diff --git a/.eslintrc.yaml b/.eslintrc.yaml deleted file mode 100644 index 5ef6b469..00000000 --- a/.eslintrc.yaml +++ /dev/null @@ -1,261 +0,0 @@ -env: - node: true - -parserOptions: - ecmaVersion: 6 - -rules: - # http://eslint.org/docs/rules/#possible-errors - comma-dangle: - - 2 - - never - no-cond-assign: 2 - no-console: 1 - no-constant-condition: 2 - no-control-regex: 2 - no-debugger: 1 - no-dupe-args: 2 - no-dupe-keys: 2 - no-duplicate-case: 2 - no-empty-character-class: 2 - no-empty: 2 - no-ex-assign: 2 - no-extra-boolean-cast: 2 - no-extra-parens: - - 0 - no-extra-semi: 2 - no-func-assign: 2 - no-inner-declarations: 2 - no-invalid-regexp: 2 - no-irregular-whitespace: 2 - no-negated-in-lhs: 2 - no-obj-calls: 2 - no-regex-spaces: 2 - no-reserved-keys: 0 - no-sparse-arrays: 2 - no-unreachable: 1 - use-isnan: 2 - - valid-jsdoc: 0 - valid-typeof: 2 - - # http://eslint.org/docs/rules/#best-practices - accessor-pairs: - - 2 - - getWithoutSet: false - setWithoutGet: true - block-scoped-var: 2 - complexity: 0 - consistent-return: 0 - curly: - - 2 - - all - default-case: 0 - dot-notation: 2 - dot-location: - - 2 - - property - eqeqeq: 2 - guard-for-in: 0 - no-alert: 1 - no-caller: 2 - no-div-regex: 0 - no-else-return: 2 - labeled: 0 - no-eq-null: 2 - no-eval: 2 - no-extend-native: 2 - no-extra-bind: 2 - no-fallthrough: 2 - no-floating-decimal: 2 - no-implied-eval: 2 - no-iterator: 2 - no-labels: 2 - no-lone-blocks: 2 - no-loop-func: 2 - no-multi-spaces: 2 - no-native-reassign: 2 - no-new-func: 2 - no-new-wrappers: 2 - no-new: 0 - no-octal-escape: 2 - no-octal: 2 - no-param-reassign: 0 - no-process-env: 0 - no-proto: 0 - no-redeclare: 2 - no-return-assign: 2 - no-script-url: 2 - no-self-compare: 2 - no-sequences: 2 - no-throw-literal: 2 - no-unused-expressions: 2 - no-void: 2 - no-warning-comments: 0 - no-with: 2 - radix: 0 - vars-on-top: 0 - wrap-iife: - - 2 - - outside - yoda: 2 - - strict: - - 2 - - global - - # http://eslint.org/docs/rules/#variables - no-catch-shadow: 2 - no-delete-var: 2 - # Can't occur, because 'no-labels' is enabled. - no-label-var: 0 - no-shadow-restricted-names: 2 - no-shadow: 2 - no-undef-init: 2 - no-undef: 2 - no-undefined: 0 - no-unused-vars: - - 2 - - vars: all - args: after-used - no-use-before-define: 0 - - # http://eslint.org/docs/rules/#nodejs - callback-return: 2 - global-require: 2 - handle-callback-err: - - 2 - - ^(e|err|error)$ - no-mixed-requires: - - 2 - - true - no-new-require: 2 - no-path-concat: 2 - no-process-exit: 2 - no-restricted-modules: 0 - no-sync: 0 - - # http://eslint.org/docs/rules/#stylistic-issues - brace-style: - - 2 - - 1tbs - - allowSingleLine: false - camelcase: - - 2 - - properties: always - comma-spacing: - - 2 - - before: false - after: true - comma-style: - - 2 - - last - computed-property-spacing: - - 2 - - never - consistent-this: - - 0 - eol-last: 2 - func-names: 0 - func-style: - - 2 - - declaration - indent: - - 2 - - 4 - - SwitchCase: 1 - - # http://eslint.org/docs/rules/keyword-spacing.html - keyword-spacing: - - 2 - - before: true - after: true - overrides: {} - key-spacing: - - 2 - - beforeColon: false - afterColon: true - lines-around-comment: 0 - linebreak-style: - - 2 - - unix - max-nested-callbacks: 0 - new-cap: 2 - new-parens: 2 - newline-after-var: 0 - no-array-constructor: 2 - no-continue: 0 - no-lonely-if: 2 - # Implied by 'indent' - no-mixed-spaces-and-tabs: 0 - no-multiple-empty-lines: - - 2 - - max: 2 - no-nested-ternary: 2 - no-new-object: 2 - no-spaced-func: 2 - no-ternary: 0 - no-trailing-spaces: 2 - no-underscore-dangle: 0 - no-unneeded-ternary: 2 - object-curly-spacing: - - 2 - - never - one-var: - - 2 - - never - operator-assignment: - - 2 - - always - operator-linebreak: - - 2 - - after - padded-blocks: - - 2 - - never - quote-props: - - 2 - - as-needed - quotes: - - 2 - - single - - avoid-escape - semi-spacing: - - 2 - - before: false - after: true - semi: 2 - sort-vars: - - 2 - - ignoreCase: true - space-before-blocks: - - 2 - - always - space-before-function-paren: - - 2 - - never - space-in-parens: - - 2 - - never - space-infix-ops: 2 - space-unary-ops: - - 2 - - words: true - nonwords: false - spaced-comment: - - 1 - - always - wrap-regex: 0 - - # http://eslint.org/docs/rules/#legacy - max-depth: 0 - max-len: - - 0 - - 120 - - 4 - - ignoreComments: false - ignoreUrls: true - max-params: 0 - max-statements: 0 - no-bitwise: 0 - no-plusplus: 0 diff --git a/README.md b/README.md index 8fc8b929..b362ea3c 100644 --- a/README.md +++ b/README.md @@ -41,10 +41,19 @@ Since the 0.0.4 release, some rules defined in [John Papa's Guideline](https://g npm install --save-dev eslint-plugin-angular ``` -3. Use the shareable config by adding it to your `.eslintrc`: - - ```yaml - extends: plugin:angular/johnpapa +3. Use the shareable config by adding it to your `eslintrc.config.mjs`: + + ```javascript + import angular from "eslint-plugin-angular"; + + export default defineConfig([{ + plugins: { + angular + }, + rules: { + ...angular.configs.johnpapa.rules + } + }]); ``` @@ -63,19 +72,30 @@ Since the 0.0.4 release, some rules defined in [John Papa's Guideline](https://g npm install --save-dev eslint-plugin-angular ``` -3. Enable the plugin by adding it to your `.eslintrc`: +3. Enable the plugin by adding it to your `eslint.config.mjs`: - ```yaml - plugins: - - angular - ``` -4. You can also configure these rules in your `.eslintrc`. All rules defined in this plugin have to be prefixed by 'angular/' + ```javascript + import angular from "eslint-plugin-angular"; - ```yaml - plugins: - - angular - rules: - - angular/controller_name: 0 + export default defineConfig([{ + plugins: { + angular + } + }]); + ``` +4. You can also configure these rules in your `eslint.config.mjs`. All rules defined in this plugin have to be prefixed by 'angular/' + + ```javascript + import angular from "eslint-plugin-angular"; + + export default defineConfig([{ + plugins: { + angular + }, + rules: { + "angular/controller-name": "error" + } + }]); ``` ---- @@ -248,20 +268,28 @@ There are some useful references for creating new rules. Specificly useful are: We can use a property, defined in the ESLint configuration file, in order to know which version is used : Angular 1 or Angular 2. based on this property, you can create rules for each version. -```yaml -plugins: - - angular - -rules: - angular/controller-name: - - 2 - - '/[A-Z].*Controller$/' - -globals: - angular: true - -settings: - angular: 2 +```javascript +import angular from "eslint-plugin-angular"; + +export default defineConfig([ + { + files: ["**/*.js"], + plugins: { + angular + }, + languageOptions: { + globals: { + angular: true + } + }, + settings: { + angular: 2 + }, + rules: { + "angular/controller-name": ["error", "/[A-Z].*Controller$/"] + } + } +]); ``` And in your rule, you can access to this property thanks to the `context` object : @@ -285,10 +313,10 @@ return { Here is the basic configuration for the rules defined in the ESLint plugin, in order to be compatible with the guideline provided by @johnpapa : -```yaml -rules: - no-use-before-define: - - 0 +```javascript +rules: { + "no-use-before-define": "off" +} ``` diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 00000000..358c09c1 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,231 @@ +import { defineConfig } from "eslint/config"; +import globals from "globals"; + +export default defineConfig([{ + languageOptions: { + globals: { + ...globals.node, + }, + + ecmaVersion: 6, + sourceType: "commonjs", + }, + + rules: { + "comma-dangle": [2, "never"], + "no-cond-assign": 2, + "no-console": 1, + "no-constant-condition": 2, + "no-control-regex": 2, + "no-debugger": 1, + "no-dupe-args": 2, + "no-dupe-keys": 2, + "no-duplicate-case": 2, + "no-empty-character-class": 2, + "no-empty": 2, + "no-ex-assign": 2, + "no-extra-boolean-cast": 2, + "no-extra-parens": [0], + "no-extra-semi": 2, + "no-func-assign": 2, + "no-inner-declarations": 2, + "no-invalid-regexp": 2, + "no-irregular-whitespace": 2, + "no-negated-in-lhs": 2, + "no-obj-calls": 2, + "no-regex-spaces": 2, + "no-reserved-keys": 0, + "no-sparse-arrays": 2, + "no-unreachable": 1, + "use-isnan": 2, + "valid-jsdoc": 0, + "valid-typeof": 2, + + "accessor-pairs": [2, { + getWithoutSet: false, + setWithoutGet: true, + }], + + "block-scoped-var": 2, + complexity: 0, + "consistent-return": 0, + curly: [2, "all"], + "default-case": 0, + "dot-notation": 2, + "dot-location": [2, "property"], + eqeqeq: 2, + "guard-for-in": 0, + "no-alert": 1, + "no-caller": 2, + "no-div-regex": 0, + "no-else-return": 2, + labeled: 0, + "no-eq-null": 2, + "no-eval": 2, + "no-extend-native": 2, + "no-extra-bind": 2, + "no-fallthrough": 2, + "no-floating-decimal": 2, + "no-implied-eval": 2, + "no-iterator": 2, + "no-labels": 2, + "no-lone-blocks": 2, + "no-loop-func": 2, + "no-multi-spaces": 2, + "no-native-reassign": 2, + "no-new-func": 2, + "no-new-wrappers": 2, + "no-new": 0, + "no-octal-escape": 2, + "no-octal": 2, + "no-param-reassign": 0, + "no-process-env": 0, + "no-proto": 0, + "no-redeclare": 2, + "no-return-assign": 2, + "no-script-url": 2, + "no-self-compare": 2, + "no-sequences": 2, + "no-throw-literal": 2, + "no-unused-expressions": 2, + "no-void": 2, + "no-warning-comments": 0, + "no-with": 2, + radix: 0, + "vars-on-top": 0, + "wrap-iife": [2, "outside"], + yoda: 2, + strict: [2, "global"], + "no-catch-shadow": 2, + "no-delete-var": 2, + "no-label-var": 0, + "no-shadow-restricted-names": 2, + "no-shadow": 2, + "no-undef-init": 2, + "no-undef": 2, + "no-undefined": 0, + + "no-unused-vars": [2, { + vars: "all", + args: "after-used", + }], + + "no-use-before-define": 0, + "callback-return": 2, + "global-require": 2, + "handle-callback-err": [2, "^(e|err|error)$"], + "no-mixed-requires": [2, true], + "no-new-require": 2, + "no-path-concat": 2, + "no-process-exit": 2, + "no-restricted-modules": 0, + "no-sync": 0, + + "brace-style": [2, "1tbs", { + allowSingleLine: false, + }], + + camelcase: [2, { + properties: "always", + }], + + "comma-spacing": [2, { + before: false, + after: true, + }], + + "comma-style": [2, "last"], + "computed-property-spacing": [2, "never"], + "consistent-this": [0], + "eol-last": 2, + "func-names": 0, + "func-style": [2, "declaration"], + + indent: [2, 4, { + SwitchCase: 1, + }], + + "keyword-spacing": [2, { + before: true, + after: true, + overrides: {}, + }], + + "key-spacing": [2, { + beforeColon: false, + afterColon: true, + }], + + "lines-around-comment": 0, + "linebreak-style": [2, "unix"], + "max-nested-callbacks": 0, + "new-cap": 2, + "new-parens": 2, + "newline-after-var": 0, + "no-array-constructor": 2, + "no-continue": 0, + "no-lonely-if": 2, + "no-mixed-spaces-and-tabs": 0, + + "no-multiple-empty-lines": [2, { + max: 2, + }], + + "no-nested-ternary": 2, + "no-new-object": 2, + "no-spaced-func": 2, + "no-ternary": 0, + "no-trailing-spaces": 2, + "no-underscore-dangle": 0, + "no-unneeded-ternary": 2, + "object-curly-spacing": [2, "never"], + "one-var": [2, "never"], + "operator-assignment": [2, "always"], + "operator-linebreak": [2, "after"], + "padded-blocks": [2, "never"], + "quote-props": [2, "as-needed"], + quotes: [2, "single", "avoid-escape"], + + "semi-spacing": [2, { + before: false, + after: true, + }], + + semi: 2, + + "sort-vars": [2, { + ignoreCase: true, + }], + + "space-before-blocks": [2, "always"], + "space-before-function-paren": [2, "never"], + "space-in-parens": [2, "never"], + "space-infix-ops": 2, + + "space-unary-ops": [2, { + words: true, + nonwords: false, + }], + + "spaced-comment": [1, "always"], + "wrap-regex": 0, + "max-depth": 0, + + "max-len": [0, 120, 4, { + ignoreComments: false, + ignoreUrls: true, + }], + + "max-params": 0, + "max-statements": 0, + "no-bitwise": 0, + "no-plusplus": 0, + }, +}, { + files: ["test/**"], + languageOptions: { + globals: { + ...globals.mocha, + }, + }, +},]); diff --git a/package-lock.json b/package-lock.json index 84943342..2c60afaa 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,13 +11,16 @@ "devDependencies": { "chai": "5.2.1", "chai-spies": "1.1.0", - "eslint": "8.57.1", + "eslint": "^9.32.0", "espree": "10.4.0", "gulp": "5.0.1", "lodash": "4.17.21", "mocha": "11.7.1", "nyc": "17.1.0", "parse-comments": "0.4.3" + }, + "peerDependencies": { + "eslint": "^9.32.0" } }, "node_modules/@ampproject/remapping": { @@ -320,6 +323,19 @@ "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" } }, + "node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, "node_modules/@eslint-community/regexpp": { "version": "4.12.1", "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.1.tgz", @@ -330,17 +346,55 @@ "node": "^12.0.0 || ^14.0.0 || >=16.0.0" } }, + "node_modules/@eslint/config-array": { + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.21.0.tgz", + "integrity": "sha512-ENIdc4iLu0d93HeYirvKmrzshzofPw6VkZRKQGe9Nv46ZnWUzcF1xV01dcvEg/1wXUR61OmmlSfyeyO7EvjLxQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/object-schema": "^2.1.6", + "debug": "^4.3.1", + "minimatch": "^3.1.2" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/config-helpers": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.3.0.tgz", + "integrity": "sha512-ViuymvFmcJi04qdZeDc2whTHryouGcDlaxPqarTD0ZE10ISpxGUVZGZDx4w01upyIynL3iu6IXH2bS1NhclQMw==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/core": { + "version": "0.15.1", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.15.1.tgz", + "integrity": "sha512-bkOp+iumZCCbt1K1CmWf0R9pM5yKpDv+ZXtvSyQpudrI9kuFLp+bM2WOPXImuD/ceQuaa8f5pj93Y7zyECIGNA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@types/json-schema": "^7.0.15" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, "node_modules/@eslint/eslintrc": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", - "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.1.tgz", + "integrity": "sha512-gtF186CXhIl1p4pJNGZw8Yc6RlshoePRvE0X91oPGb3vZ8pM3qOS9W9NGPat9LziaBV7XrJWGylNQXkGcnM3IQ==", "dev": true, "license": "MIT", "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", - "espree": "^9.6.0", - "globals": "^13.19.0", + "espree": "^10.0.1", + "globals": "^14.0.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", "js-yaml": "^4.1.0", @@ -348,38 +402,47 @@ "strip-json-comments": "^3.1.1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "url": "https://opencollective.com/eslint" } }, - "node_modules/@eslint/eslintrc/node_modules/espree": { - "version": "9.6.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", - "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", + "node_modules/@eslint/js": { + "version": "9.32.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.32.0.tgz", + "integrity": "sha512-BBpRFZK3eX6uMLKz8WxFOBIFFcGFJ/g8XuwjTHCqHROSIsopI+ddn/d5Cfh36+7+e5edVS8dbSHnBNhrLEX0zg==", "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "acorn": "^8.9.0", - "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^3.4.1" - }, + "license": "MIT", "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { - "url": "https://opencollective.com/eslint" + "url": "https://eslint.org/donate" } }, - "node_modules/@eslint/js": { - "version": "8.57.1", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.1.tgz", - "integrity": "sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q==", + "node_modules/@eslint/object-schema": { + "version": "2.1.6", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.6.tgz", + "integrity": "sha512-RBMg5FRL0I0gs51M/guSAj5/e14VQ4tpZnQNWwuDT66P14I43ItmPfIZRhO9fUVIPOAQXU47atlywZ/czoqFPA==", "dev": true, - "license": "MIT", + "license": "Apache-2.0", "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/plugin-kit": { + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.3.4.tgz", + "integrity": "sha512-Ul5l+lHEcw3L5+k8POx6r74mxEYKG5kOb6Xpy2gCRW6zweT6TEhAf8vhxGgjhqrd/VO/Dirhsb+1hNpD1ue9hw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^0.15.1", + "levn": "^0.4.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, "node_modules/@gulpjs/messages": { @@ -405,20 +468,42 @@ "node": ">=10.13.0" } }, - "node_modules/@humanwhocodes/config-array": { - "version": "0.13.0", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.13.0.tgz", - "integrity": "sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw==", - "deprecated": "Use @eslint/config-array instead", + "node_modules/@humanfs/core": { + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", + "integrity": "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanfs/node": { + "version": "0.16.6", + "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.6.tgz", + "integrity": "sha512-YuI2ZHQL78Q5HbhDiBA1X4LmYdXCKCMQIfw0pw7piHJwyREFebJUvrQN4cMssyES6x+vfUbx1CIpaQUKYdQZOw==", "dev": true, "license": "Apache-2.0", "dependencies": { - "@humanwhocodes/object-schema": "^2.0.3", - "debug": "^4.3.1", - "minimatch": "^3.0.5" + "@humanfs/core": "^0.19.1", + "@humanwhocodes/retry": "^0.3.0" }, "engines": { - "node": ">=10.10.0" + "node": ">=18.18.0" + } + }, + "node_modules/@humanfs/node/node_modules/@humanwhocodes/retry": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.3.1.tgz", + "integrity": "sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" } }, "node_modules/@humanwhocodes/module-importer": { @@ -435,13 +520,19 @@ "url": "https://github.com/sponsors/nzakas" } }, - "node_modules/@humanwhocodes/object-schema": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz", - "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==", - "deprecated": "Use @eslint/object-schema instead", + "node_modules/@humanwhocodes/retry": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.3.tgz", + "integrity": "sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==", "dev": true, - "license": "BSD-3-Clause" + "license": "Apache-2.0", + "engines": { + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } }, "node_modules/@isaacs/cliui": { "version": "8.0.2", @@ -461,19 +552,6 @@ "node": ">=12" } }, - "node_modules/@isaacs/cliui/node_modules/ansi-regex": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", - "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" - } - }, "node_modules/@isaacs/cliui/node_modules/emoji-regex": { "version": "9.2.2", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", @@ -499,22 +577,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@isaacs/cliui/node_modules/strip-ansi": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", - "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^6.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" - } - }, "node_modules/@istanbuljs/load-nyc-config": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", @@ -671,44 +733,6 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, - "node_modules/@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "dev": true, - "license": "MIT", - "dependencies": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - }, - "engines": { - "node": ">= 8" - } - }, "node_modules/@pkgjs/parseargs": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", @@ -720,12 +744,19 @@ "node": ">=14" } }, - "node_modules/@ungap/structured-clone": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.3.0.tgz", - "integrity": "sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==", + "node_modules/@types/estree": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", + "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", "dev": true, - "license": "ISC" + "license": "MIT" + }, + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true, + "license": "MIT" }, "node_modules/acorn": { "version": "8.15.0", @@ -782,13 +813,16 @@ } }, "node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", + "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", "dev": true, "license": "MIT", "engines": { - "node": ">=8" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" } }, "node_modules/ansi-styles": { @@ -1134,9 +1168,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001727", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001727.tgz", - "integrity": "sha512-pB68nIHmbN6L/4C6MH1DokyR3bYqFwjaSs/sWDHGj4CTcFtQUQMuJftVwWkXq7mNWOybD3KhUv3oWHoGxgP14Q==", + "version": "1.0.30001731", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001731.tgz", + "integrity": "sha512-lDdp2/wrOmTRWuoB5DpfNkC0rJDU8DqRa6nYL6HK6sytw70QMopt/NIc/9SM7ylItlBWfACXk0tEn37UWM/+mg==", "dev": true, "funding": [ { @@ -1271,6 +1305,29 @@ "wrap-ansi": "^7.0.0" } }, + "node_modules/cliui/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/cliui/node_modules/wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", @@ -1450,19 +1507,6 @@ "node": ">=0.3.1" } }, - "node_modules/doctrine": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "esutils": "^2.0.2" - }, - "engines": { - "node": ">=6.0.0" - } - }, "node_modules/each-props": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/each-props/-/each-props-3.0.0.tgz", @@ -1539,66 +1583,70 @@ } }, "node_modules/eslint": { - "version": "8.57.1", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.1.tgz", - "integrity": "sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==", - "deprecated": "This version is no longer supported. Please see https://eslint.org/version-support for other options.", + "version": "9.32.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.32.0.tgz", + "integrity": "sha512-LSehfdpgMeWcTZkWZVIJl+tkZ2nuSkyyB9C27MZqFWXuph7DvaowgcTvKqxvpLW1JZIk8PN7hFY3Rj9LQ7m7lg==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", - "@eslint-community/regexpp": "^4.6.1", - "@eslint/eslintrc": "^2.1.4", - "@eslint/js": "8.57.1", - "@humanwhocodes/config-array": "^0.13.0", + "@eslint-community/regexpp": "^4.12.1", + "@eslint/config-array": "^0.21.0", + "@eslint/config-helpers": "^0.3.0", + "@eslint/core": "^0.15.0", + "@eslint/eslintrc": "^3.3.1", + "@eslint/js": "9.32.0", + "@eslint/plugin-kit": "^0.3.4", + "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", - "@nodelib/fs.walk": "^1.2.8", - "@ungap/structured-clone": "^1.2.0", + "@humanwhocodes/retry": "^0.4.2", + "@types/estree": "^1.0.6", + "@types/json-schema": "^7.0.15", "ajv": "^6.12.4", "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", + "cross-spawn": "^7.0.6", "debug": "^4.3.2", - "doctrine": "^3.0.0", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.2.2", - "eslint-visitor-keys": "^3.4.3", - "espree": "^9.6.1", - "esquery": "^1.4.2", + "eslint-scope": "^8.4.0", + "eslint-visitor-keys": "^4.2.1", + "espree": "^10.4.0", + "esquery": "^1.5.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^6.0.1", + "file-entry-cache": "^8.0.0", "find-up": "^5.0.0", "glob-parent": "^6.0.2", - "globals": "^13.19.0", - "graphemer": "^1.4.0", "ignore": "^5.2.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", - "is-path-inside": "^3.0.3", - "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", "lodash.merge": "^4.6.2", "minimatch": "^3.1.2", "natural-compare": "^1.4.0", - "optionator": "^0.9.3", - "strip-ansi": "^6.0.1", - "text-table": "^0.2.0" + "optionator": "^0.9.3" }, "bin": { "eslint": "bin/eslint.js" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { - "url": "https://opencollective.com/eslint" + "url": "https://eslint.org/donate" + }, + "peerDependencies": { + "jiti": "*" + }, + "peerDependenciesMeta": { + "jiti": { + "optional": true + } } }, "node_modules/eslint-scope": { - "version": "7.2.2", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", - "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.4.0.tgz", + "integrity": "sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg==", "dev": true, "license": "BSD-2-Clause", "dependencies": { @@ -1606,38 +1654,20 @@ "estraverse": "^5.2.0" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "url": "https://opencollective.com/eslint" } }, "node_modules/eslint-visitor-keys": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", - "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", + "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", "dev": true, "license": "Apache-2.0", "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/eslint/node_modules/espree": { - "version": "9.6.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", - "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "acorn": "^8.9.0", - "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^3.4.1" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "url": "https://opencollective.com/eslint" @@ -1661,19 +1691,6 @@ "url": "https://opencollective.com/eslint" } }, - "node_modules/espree/node_modules/eslint-visitor-keys": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", - "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, "node_modules/esprima": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", @@ -1816,16 +1833,16 @@ } }, "node_modules/file-entry-cache": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", - "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", + "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", "dev": true, "license": "MIT", "dependencies": { - "flat-cache": "^3.0.4" + "flat-cache": "^4.0.0" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": ">=16.0.0" } }, "node_modules/fill-range": { @@ -1930,18 +1947,17 @@ } }, "node_modules/flat-cache": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", - "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", + "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", "dev": true, "license": "MIT", "dependencies": { "flatted": "^3.2.9", - "keyv": "^4.5.3", - "rimraf": "^3.0.2" + "keyv": "^4.5.4" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": ">=16" } }, "node_modules/flatted": { @@ -2251,16 +2267,13 @@ } }, "node_modules/globals": { - "version": "13.24.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", - "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", + "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", "dev": true, "license": "MIT", - "dependencies": { - "type-fest": "^0.20.2" - }, "engines": { - "node": ">=8" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -2286,13 +2299,6 @@ "dev": true, "license": "ISC" }, - "node_modules/graphemer": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", - "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", - "dev": true, - "license": "MIT" - }, "node_modules/gulp": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/gulp/-/gulp-5.0.1.tgz", @@ -2379,16 +2385,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/hasha/node_modules/type-fest": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", - "dev": true, - "license": "(MIT OR CC0-1.0)", - "engines": { - "node": ">=8" - } - }, "node_modules/hasown": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", @@ -2655,16 +2651,6 @@ "node": ">=0.12.0" } }, - "node_modules/is-path-inside": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", - "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/is-plain-obj": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", @@ -3235,6 +3221,16 @@ "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, + "node_modules/mocha/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/mocha/node_modules/brace-expansion": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", @@ -3306,6 +3302,19 @@ "url": "https://paulmillr.com/funding/" } }, + "node_modules/mocha/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/mocha/node_modules/supports-color": { "version": "8.1.1", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", @@ -3468,6 +3477,16 @@ "node": ">=18" } }, + "node_modules/nyc/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/nyc/node_modules/cliui": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", @@ -3575,6 +3594,19 @@ "dev": true, "license": "ISC" }, + "node_modules/nyc/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/nyc/node_modules/wrap-ansi": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", @@ -4058,27 +4090,6 @@ "node": ">=6" } }, - "node_modules/queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT" - }, "node_modules/randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", @@ -4295,30 +4306,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT", - "dependencies": { - "queue-microtask": "^1.2.2" - } - }, "node_modules/safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -4564,7 +4551,40 @@ "node": ">=8" } }, - "node_modules/strip-ansi": { + "node_modules/string-width-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width/node_modules/strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", @@ -4577,6 +4597,22 @@ "node": ">=8" } }, + "node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, "node_modules/strip-ansi-cjs": { "name": "strip-ansi", "version": "6.0.1", @@ -4591,6 +4627,16 @@ "node": ">=8" } }, + "node_modules/strip-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/strip-bom": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", @@ -4718,13 +4764,6 @@ "b4a": "^1.6.4" } }, - "node_modules/text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", - "dev": true, - "license": "MIT" - }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -4765,16 +4804,13 @@ } }, "node_modules/type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", "dev": true, "license": "(MIT OR CC0-1.0)", "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=8" } }, "node_modules/typedarray-to-buffer": { @@ -5069,17 +5105,27 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, - "node_modules/wrap-ansi/node_modules/ansi-regex": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", - "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", + "node_modules/wrap-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, "license": "MIT", "engines": { - "node": ">=12" + "node": ">=8" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" + "engines": { + "node": ">=8" } }, "node_modules/wrap-ansi/node_modules/ansi-styles": { @@ -5120,22 +5166,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/wrap-ansi/node_modules/strip-ansi": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", - "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^6.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" - } - }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", diff --git a/package.json b/package.json index eb0c6b82..4402f045 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "devDependencies": { "chai": "5.2.1", "chai-spies": "1.1.0", - "eslint": "8.57.1", + "eslint": "^9.32.0", "espree": "10.4.0", "gulp": "5.0.1", "lodash": "4.17.21", @@ -31,6 +31,9 @@ "nyc": "17.1.0", "parse-comments": "0.4.3" }, + "peerDependencies": { + "eslint": "^9.32.0" + }, "keywords": [ "eslint", "eslintplugin", diff --git a/rules/controller-as-vm.js b/rules/controller-as-vm.js index 7406c167..8d2d8748 100644 --- a/rules/controller-as-vm.js +++ b/rules/controller-as-vm.js @@ -88,7 +88,7 @@ module.exports = { }, // statements are checked here for bad uses of $scope ThisExpression: function(stmt) { - var parents = context.getAncestors(); + var parents = context.sourceCode.getAncestors(stmt); if (!isClassDeclaration(parents)) { if (stmt.parent.type === 'VariableDeclarator') { if (!stmt.parent.id || stmt.parent.id.name !== viewModelName) { diff --git a/rules/controller-as.js b/rules/controller-as.js index 5a27cafd..f778322c 100644 --- a/rules/controller-as.js +++ b/rules/controller-as.js @@ -67,12 +67,12 @@ module.exports = { stmt.expression.left.object && stmt.expression.left.object.name === '$scope' && utils.scopeProperties.indexOf(stmt.expression.left.property.name) < 0) { - badStatements.push({parents: context.getAncestors(), stmt: stmt}); + badStatements.push({parents: context.sourceCode.getAncestors(stmt), stmt: stmt}); } else if (stmt.expression.type === 'CallExpression' && stmt.expression.callee.object && stmt.expression.callee.object.name === '$scope' && utils.scopeProperties.indexOf(stmt.expression.callee.property.name) < 0) { - badStatements.push({parents: context.getAncestors(), stmt: stmt}); + badStatements.push({parents: context.sourceCode.getAncestors(stmt), stmt: stmt}); } }, 'Program:exit': function() { diff --git a/rules/di-unused.js b/rules/di-unused.js index 5176c48c..b8ea7490 100644 --- a/rules/di-unused.js +++ b/rules/di-unused.js @@ -76,8 +76,8 @@ module.exports = { reportUnusedVariables(null, $get); }, - 'Program:exit': function() { - var globalScope = context.getScope(); + 'Program:exit': function(node) { + var globalScope = context.sourceCode.getScope(node); collectAngularScopes(globalScope); } }; diff --git a/rules/directive-restrict.js b/rules/directive-restrict.js index 66908e6c..609a5b72 100644 --- a/rules/directive-restrict.js +++ b/rules/directive-restrict.js @@ -50,7 +50,7 @@ module.exports = { return; } var directiveNode; - context.getAncestors().some(function(ancestor) { + context.sourceCode.getAncestors(node).some(function(ancestor) { if (utils.isAngularDirectiveDeclaration(ancestor)) { directiveNode = ancestor; return true; @@ -59,7 +59,7 @@ module.exports = { if (!directiveNode) { // Try to find an ancestor function used as definition for one of the found directives - context.getAncestors().some(function(ancestor) { + context.sourceCode.getAncestors(node).some(function(ancestor) { if (isFunctionDeclaration(ancestor)) { if (!ancestor.id) { return false; diff --git a/rules/file-name.js b/rules/file-name.js index 58ee275d..f6076c7d 100644 --- a/rules/file-name.js +++ b/rules/file-name.js @@ -33,13 +33,13 @@ var utils = require('./utils/utils'); * @returns */ function handleModuleCase(node, context, defaultFilename) { - if (context.parserOptions.sourceType !== 'module') { + if (context.languageOptions.sourceType !== 'module') { return defaultFilename; } // Handle the module case. var name = node.arguments[1].name; - var globalScope = context.getScope(); + var globalScope = context.sourceCode.getScope(node); // Retrieve the import instruction. var variable = globalScope.variables.find(function(v) { diff --git a/rules/no-directive-replace.js b/rules/no-directive-replace.js index 16ed550a..c7df0e3f 100644 --- a/rules/no-directive-replace.js +++ b/rules/no-directive-replace.js @@ -40,7 +40,7 @@ module.exports = { nodeList.push({ name: variableName, node: node, - block: context.getScope().block.body + block: context.sourceCode.getScope(node).block.body }); potentialReplaceNodes[variableName] = nodeList; diff --git a/rules/prefer-component.js b/rules/prefer-component.js index 1e399f30..f9a2cbbe 100644 --- a/rules/prefer-component.js +++ b/rules/prefer-component.js @@ -27,7 +27,7 @@ module.exports = { nodeList.push({ name: variableName, node: node, - block: context.getScope().block.body + block: context.sourceCode.getScope(node).block.body }); potentialReplaceNodes[variableName] = nodeList; diff --git a/rules/utils/angular-rule.js b/rules/utils/angular-rule.js index 5e731cb0..83aa2b2a 100644 --- a/rules/utils/angular-rule.js +++ b/rules/utils/angular-rule.js @@ -131,7 +131,7 @@ function angularRule(ruleDefinition) { // ^^^^^^ injectCalls.push({ callExpression: callExpressionNode, - fn: findFunctionByNode(callExpressionNode, context.getScope()) + fn: findFunctionByNode(callExpressionNode, context.sourceCode.getScope(callExpressionNode)) }); } return; @@ -147,12 +147,12 @@ function angularRule(ruleDefinition) { angularChainables.push(callExpressionNode); angularComponents.push({ callExpression: callExpressionNode, - fn: findFunctionByNode(callExpressionNode, context.getScope()) + fn: findFunctionByNode(callExpressionNode, context.sourceCode.getScope(callExpressionNode)) }); } else if (callee.object.type === 'Identifier') { // var app = angular.module(); app.factory() // ^^^^^^^ - var scope = context.getScope(); + var scope = context.sourceCode.getScope(callExpressionNode); var isAngularModule = scope.variables.some(function(variable) { if (callee.object.name !== variable.name) { return false; @@ -165,7 +165,7 @@ function angularRule(ruleDefinition) { angularChainables.push(callExpressionNode); angularComponents.push({ callExpression: callExpressionNode, - fn: findFunctionByNode(callExpressionNode, context.getScope()) + fn: findFunctionByNode(callExpressionNode, context.sourceCode.getScope(callExpressionNode)) }); } else { return; diff --git a/rules/utils/utils.js b/rules/utils/utils.js index 90c28559..afe69e4a 100644 --- a/rules/utils/utils.js +++ b/rules/utils/utils.js @@ -543,9 +543,9 @@ function isUIRouterStateDefinition(node) { * * @returns {Object} The node declaring the identifier. */ -function findIdentiferInScope(context, identifier) { +function findIdentiferInScope(context, identifier, node) { var identifierNode = null; - context.getScope().variables.forEach(function(variable) { + context.sourceCode.getScope(node).variables.forEach(function(variable) { if (variable.name === identifier.name) { identifierNode = variable.defs[0].node; if (identifierNode.type === 'VariableDeclarator') { @@ -577,12 +577,12 @@ function getControllerDefinition(context, node) { controllerArg = controllerArg.elements[controllerArg.elements.length - 1]; if (isIdentifierType(controllerArg)) { - return findIdentiferInScope(context, controllerArg); + return findIdentiferInScope(context, controllerArg, node); } return controllerArg; } if (isIdentifierType(controllerArg)) { - return findIdentiferInScope(context, controllerArg); + return findIdentiferInScope(context, controllerArg, node); } } diff --git a/test/avoid-scope-typos.js b/test/avoid-scope-typos.js index fb66fee4..1a7216a0 100644 --- a/test/avoid-scope-typos.js +++ b/test/avoid-scope-typos.js @@ -12,7 +12,11 @@ const commonFalsePositives = require('./utils/commonFalsePositives'); // Tests // ------------------------------------------------------------------------------ -const eslintTester = new RuleTester(); +const eslintTester = new RuleTester({ + languageOptions: { + sourceType: 'script' // Allow binding eval() + } +}); const variables = ['$scope', '$rootScope']; const bad = ['new', 'watch', 'watchGroup', 'watchCollection', diff --git a/test/controller-as-vm.js b/test/controller-as-vm.js index 750b0094..5a76c6a5 100644 --- a/test/controller-as-vm.js +++ b/test/controller-as-vm.js @@ -22,11 +22,11 @@ eslintTester.run('controller-as-vm', rule, { {code: 'angular.module("test").controller("Test", function() {var vm = this; vm.test();} )', options: ['vm']}, {code: 'angular.module("test").controller("Test", class {constructor(){this.x = 0;}} )', - options: ['vm'], parserOptions: {ecmaVersion: 6}}, + options: ['vm'], languageOptions: {ecmaVersion: 6}}, {code: 'angular.module("test").service("Test", function() {this.doSomething();} )', options: ['vm']}, {code: 'angular.module("test").service("Test", class {constructor(){this.x = 0;}} )', - options: ['vm'], parserOptions: {ecmaVersion: 6}} + options: ['vm'], languageOptions: {ecmaVersion: 6}} ].concat(commonFalsePositives), invalid: [ {code: 'function controllerFunc() {this.test = "test";} angular.module("test").controller("Test", controllerFunc )', diff --git a/test/controller-name.js b/test/controller-name.js index f33cf13c..0032d592 100644 --- a/test/controller-name.js +++ b/test/controller-name.js @@ -26,9 +26,6 @@ eslintTester.run('controller-name', rule, { }, { code: 'app.controller("EslintController", function() {});', options: ['/[A-Z].*Controller$/'] - }, { - code: 'app.controller("EslintController", function() {});', - options: ['/[A-Z].*Controller$/'] }, { code: 'controller = el.controller();', options: ['/[A-Z].*Controller$/'] diff --git a/test/di-unused.js b/test/di-unused.js index b540ea98..1c5160ee 100644 --- a/test/di-unused.js +++ b/test/di-unused.js @@ -96,12 +96,12 @@ eslintTester.run('di-unused', rule, { }, { code: 'angular.module("").controller("", ["$q", ($q) => {}]);', - parserOptions: {ecmaVersion: 6}, + languageOptions: {ecmaVersion: 6}, errors: [{message: 'Unused injected value $q'}] }, { code: 'angular.module("").controller("", ($q) => {});', - parserOptions: {ecmaVersion: 6}, + languageOptions: {ecmaVersion: 6}, errors: [{message: 'Unused injected value $q'}] }, // directive @@ -133,14 +133,14 @@ eslintTester.run('di-unused', rule, { { code: 'angular.module("").factory("", $q => {});', errors: [{message: 'Unused injected value $q'}], - parserOptions: {ecmaVersion: 6} + languageOptions: {ecmaVersion: 6} }, { code: 'angular.module("").factory("", ["q", function($q) {}]);', errors: [{message: 'Unused injected value $q'}] }, { code: 'angular.module("").factory("", ["q", $q => {}]);', errors: [{message: 'Unused injected value $q'}], - parserOptions: {ecmaVersion: 6} + languageOptions: {ecmaVersion: 6} }, { code: 'var app = angular.module(""); app.factory("", function($q) {});', errors: [{message: 'Unused injected value $q'}] diff --git a/test/di.js b/test/di.js index 3f893504..f6bd39b9 100644 --- a/test/di.js +++ b/test/di.js @@ -229,9 +229,6 @@ valid.push({ }, { code: 'mocha.run();', options: ['array'] -}, { - code: 'mocha.run();', - options: ['array'] }, { // value false positive with function code: 'angular.module("") .value("", function () {});', diff --git a/test/factory-name.js b/test/factory-name.js index 7b764792..dec7dd41 100644 --- a/test/factory-name.js +++ b/test/factory-name.js @@ -27,7 +27,7 @@ valid.push({ }, { code: 'app.factory("eslintFactory", EslintFactory); class EslintFactory {}', options: ['eslint'], - parserOptions: {ecmaVersion: 6} + languageOptions: {ecmaVersion: 6} }, { code: 'app.factory("eslintFactory", function() {});', options: [/^eslint/] diff --git a/test/file-name.js b/test/file-name.js index 11360d92..25af8e1a 100644 --- a/test/file-name.js +++ b/test/file-name.js @@ -271,7 +271,7 @@ angular.module(mod, [mod + '.core.angular', mod + '.thirdparty']); app.directive("SomeDirective", MyCtrl2); app.service("SomeService", MyCtrl3); app.controller("SomeOtherController", MyCtrl4);`, - parserOptions: { + languageOptions: { ecmaVersion: 6, sourceType: 'module' } @@ -472,7 +472,7 @@ angular.module(mod, [mod + '.core.angular', mod + '.thirdparty']); code: ` import {MyCtrl} from 'src/app/main.js' app.controller("SomeController", MyCtrl);`, - parserOptions: { + languageOptions: { ecmaVersion: 6, sourceType: 'module' }, diff --git a/test/function-type.js b/test/function-type.js index c189ea08..83fdd350 100644 --- a/test/function-type.js +++ b/test/function-type.js @@ -55,15 +55,15 @@ valid.push({ }, { code: 'angular.module("foo", []).constant("foo", () => {})', options: ['anonymous'], - parserOptions: {ecmaVersion: 6} + languageOptions: {ecmaVersion: 6} }, { code: 'angular.module("foo", []).constant("foo", (() => {})())', options: ['named'], - parserOptions: {ecmaVersion: 6} + languageOptions: {ecmaVersion: 6} }, { code: 'angular.module("foo", []).constant("foo", (() => {})())', options: ['anonymous'], - parserOptions: {ecmaVersion: 6} + languageOptions: {ecmaVersion: 6} }, { code: 'var foo = "foo";angular.module("foo", []).constant("foo", foo)', options: ['named'] diff --git a/test/module-getter.js b/test/module-getter.js index e75d8943..172d4f4b 100644 --- a/test/module-getter.js +++ b/test/module-getter.js @@ -47,7 +47,6 @@ eslintTester.run('module-getter', rule, { 'describe("suite test", function() {})', 'it("test", function() {})', '$provide.value("accountsService", accountsService)', - 'mocha.run();', 'var MODULE_NAME = \'mymodule\'; angular.module(MODULE_NAME).service(\'TestService\', function () {});' ].concat(commonFalsePositives), invalid: [ diff --git a/test/no-directive-replace.js b/test/no-directive-replace.js index 39bceca4..1ab272d8 100644 --- a/test/no-directive-replace.js +++ b/test/no-directive-replace.js @@ -13,7 +13,7 @@ var commonFalsePositives = require('./utils/commonFalsePositives'); // ------------------------------------------------------------------------------ var eslintTester = new RuleTester({ - parserOptions: { + languageOptions: { ecmaVersion: 6 } }); diff --git a/test/no-run-logic.js b/test/no-run-logic.js index f9a341a0..272874ca 100644 --- a/test/no-run-logic.js +++ b/test/no-run-logic.js @@ -34,7 +34,6 @@ eslintTester.run('no-run-logic', rule, { 'angular.module("").factory();', 'angular.module("").filter();', 'angular.module("").provider();', - 'angular.module("").run();', 'angular.module("").service();' ], invalid: [ diff --git a/test/no-service-method.js b/test/no-service-method.js index 1807e783..8a43b175 100644 --- a/test/no-service-method.js +++ b/test/no-service-method.js @@ -19,10 +19,6 @@ var valid = []; ['factory', 'provider', 'constant', 'value'].forEach(function(syntax) { valid.push({ code: 'app.' + syntax + '("eslintService", function() {});' - }, { - code: 'app.' + syntax + '("eslintService", function() {});' - }, { - code: 'app.' + syntax + '("eslintService", function() {});' }); }); diff --git a/test/on-destroy.js b/test/on-destroy.js index 25dc2ac7..193b94a6 100644 --- a/test/on-destroy.js +++ b/test/on-destroy.js @@ -33,7 +33,6 @@ eslintTester.run('on-destroy', rule, { '$scope.$on()', '$scope.$watch()', 'scope.$on("$destroy")', - '$rootScope.$on("$destroy")', // false positive check '$on()', diff --git a/test/rest-service.js b/test/rest-service.js index 63fe0f8f..908ec827 100644 --- a/test/rest-service.js +++ b/test/rest-service.js @@ -24,12 +24,13 @@ valid.push({ options: ['cmnHttpSvc'] }); angularObjectList.forEach(function(object) { + valid.push({ + code: 'app.' + object + '("name", function(Service1) {});' + }); possibleValues.forEach(function(value) { valid.push({ code: 'app.' + object + '("name", function(Service1) {});', options: [value] - }, { - code: 'app.' + object + '("name", function(Service1) {});' }, { code: 'app.' + object + '("name", ["Service1", function(Service1) {}]);', options: [value] diff --git a/test/service-name.js b/test/service-name.js index 0a30fec3..e8ccb31c 100644 --- a/test/service-name.js +++ b/test/service-name.js @@ -27,8 +27,6 @@ valid.push({ }, { code: 'app.service("eslintService", function() {});', options: [/^eslint/, {oldBehavior: false}] -}, { - code: 'app.service("eslintService", function() {});' }, { code: 'app.service("eslintService", function() {});', options: ['/^eslint/', {oldBehavior: false}]