diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index b699ea86a..000000000 --- a/.eslintignore +++ /dev/null @@ -1,6 +0,0 @@ -# built files -dist/ -# local developer scratch area -.ignore/ -# root dot javascript files -!.*.js diff --git a/.gitignore b/.gitignore index 131732ae8..769a5972f 100755 --- a/.gitignore +++ b/.gitignore @@ -5,14 +5,12 @@ node_modules .* !.babelrc.json !.editorconfig -!.eslintignore -!.eslintrc.json !.gitattributes !.github !.gitignore !.husky -!.ncurc.js +!.ncurc.cjs !.npmignore !.README !.releaserc -!.vscode \ No newline at end of file +!.vscode diff --git a/.husky/pre-push b/.husky/pre-push index 05340f7e4..f48cbd2e0 100755 --- a/.husky/pre-push +++ b/.husky/pre-push @@ -1,4 +1,4 @@ #!/usr/bin/env sh . "$(dirname -- "$0")/_/husky.sh" -npm test && npm run build && npm run check-docs +npm test && npm run build diff --git a/.ncurc.js b/.ncurc.cjs similarity index 100% rename from .ncurc.js rename to .ncurc.cjs diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a78596308..b0744dac2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -64,7 +64,7 @@ for more on the allowable properties (e.g., `code`, `errors` (for invalid rules) Note that besides `pnpm test` there is `pnpm test-cov`, which shows more detailed coverage information. Coverage should be maintained at 100%, and if there are a few guards in place for future use, the code block in question -can be ignored by being preceded by `/* istanbul ignore next */` (including +can be ignored by being preceded by `/* c8 ignore next */` (including for warnings where the block is never passed over (i.e., the block is always entered)). If you want to test without coverage at all, you can use `pnpm test-no-cov`. To only test rules rather than other files, you diff --git a/eslint.config.mjs b/eslint.config.js similarity index 87% rename from eslint.config.mjs rename to eslint.config.js index 722e0ce2a..0022392ea 100644 --- a/eslint.config.mjs +++ b/eslint.config.js @@ -1,5 +1,5 @@ import globals from 'globals'; -import jsdoc from './dist/index.js'; +import jsdoc from './src/index.js'; // import canonical from 'eslint-config-canonical'; // import canonicalJsdoc from 'eslint-config-canonical/jsdoc.js'; @@ -21,7 +21,35 @@ export default [ }, { ...common, - files: ['.ncurc.js'], + languageOptions: { + ecmaVersion: 'latest', + sourceType: 'module', + globals: globals.node + }, + settings: { + jsdoc: { + mode: 'typescript' + } + }, + rules: { + 'array-element-newline': 0, + 'filenames/match-regex': 0, + 'import/extensions': 0, + 'import/no-useless-path-segments': 0, + 'prefer-named-capture-group': 0, + 'unicorn/no-array-reduce': 0, + 'unicorn/no-unsafe-regex': 0, + 'unicorn/prefer-array-some': 0, + 'unicorn/prevent-abbreviations': 0, + 'unicorn/import-index': 0, + 'linebreak-style': 0, + 'no-inline-comments': 0, + 'no-extra-parens': 0 + } + }, + { + ...common, + files: ['.ncurc.cjs'], languageOptions: { parserOptions: { ecmaFeatures: { @@ -41,35 +69,13 @@ export default [ { ...common, files: ['test/**/*.js'], + languageOptions: { + ecmaVersion: 'latest', + sourceType: 'module' + }, rules: { 'no-restricted-syntax': 0, 'unicorn/prevent-abbreviations': 0 } }, - { - ...common, - languageOptions: { - globals: globals.node - }, - settings: { - jsdoc: { - mode: 'typescript' - } - }, - rules: { - 'array-element-newline': 0, - 'filenames/match-regex': 0, - 'import/extensions': 0, - 'import/no-useless-path-segments': 0, - 'prefer-named-capture-group': 0, - 'unicorn/no-array-reduce': 0, - 'unicorn/no-unsafe-regex': 0, - 'unicorn/prefer-array-some': 0, - 'unicorn/prevent-abbreviations': 0, - 'unicorn/import-index': 0, - 'linebreak-style': 0, - 'no-inline-comments': 0, - 'no-extra-parens': 0 - } - } ]; diff --git a/package.json b/package.json index 47587860f..989b2315d 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,6 @@ "@babel/plugin-syntax-class-properties": "^7.12.13", "@babel/plugin-transform-flow-strip-types": "^7.23.3", "@babel/preset-env": "^7.23.7", - "@babel/register": "^7.23.7", "@es-joy/escodegen": "^3.5.1", "@es-joy/jsdoc-eslint-parser": "^0.21.1", "@hkdobrev/run-if-changed": "^0.3.1", @@ -42,9 +41,10 @@ "@types/node": "^20.10.6", "@types/semver": "^7.5.6", "@types/spdx-expression-parse": "^3.0.5", - "@typescript-eslint/parser": "^6.16.0", + "@typescript-eslint/parser": "^6.17.0", "babel-plugin-add-module-exports": "^1.0.4", "babel-plugin-istanbul": "^6.1.1", + "c8": "^8.0.1", "camelcase": "^6.3.0", "chai": "^4.3.10", "cross-env": "^7.0.3", @@ -61,14 +61,14 @@ "lint-staged": "^15.2.0", "lodash.defaultsdeep": "^4.6.1", "mocha": "^10.2.0", - "nyc": "^15.1.0", "open-editor": "^3.0.0", + "replace": "^1.2.2", "rimraf": "^5.0.5", "semantic-release": "^22.0.12", "typescript": "5.3.3" }, "engines": { - "node": ">=16" + "node": ">=18" }, "keywords": [ "eslint", @@ -83,18 +83,21 @@ ], "*.js": "npm run lint-arg -- --fix" }, + "type": "module", "main": "./dist/index.js", "types": "./dist/index.d.ts", + "exports": { + "types": "./dist/index.d.ts", + "import": "./src/index.js", + "require": "./dist/index.cjs" + }, "name": "eslint-plugin-jsdoc", "mocha": { - "require": [ - "@babel/register" - ], "reporter": "dot", "recursive": true, "timeout": 12000 }, - "nyc": { + "c8": { "branches": 100, "check-coverage": true, "exclude": [ @@ -107,9 +110,6 @@ "instrument": false, "lines": 100, "reporter": "text-summary", - "require": [ - "@babel/register" - ], "sourceMap": false, "statements": 100 }, @@ -126,7 +126,7 @@ "scripts": { "tsc": "tsc", "tsc-build": "tsc -p tsconfig-prod.json", - "build": "rimraf ./dist && cross-env NODE_ENV=production babel ./src --out-dir ./dist --copy-files --source-maps --ignore ./src/bin/*.js --no-copy-ignored && pnpm tsc-build", + "build": "rimraf ./dist && cross-env NODE_ENV=production babel ./src --out-file-extension .cjs --out-dir ./dist --copy-files --source-maps --ignore ./src/bin/*.js --no-copy-ignored && replace 'require\\(\"\\.(.*?)\\.[^.]*?\"\\)' 'require(\".$1.cjs\")' 'dist' -r --include=\"*.cjs\" && pnpm tsc-build", "check-docs": "babel-node ./src/bin/generateDocs.js --check", "create-docs": "npm run create-options && babel-node ./src/bin/generateDocs.js", "create-rule": "babel-node ./src/bin/generateRule.js", @@ -137,8 +137,8 @@ "lint-fix": "npm run lint-arg -- --fix .", "prepare": "husky install", "test-no-cov": "cross-env BABEL_ENV=test mocha", - "test": "nyc npm run test-no-cov", - "test-cov": "cross-env TIMING=1 nyc --reporter text npm run test-no-cov", + "test": "c8 npm run test-no-cov", + "test-cov": "cross-env TIMING=1 c8 --reporter text npm run test-no-cov", "test-index": "npm run test-no-cov -- test/rules/index.js" }, "version": "1.0.0" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 329c23ee2..2b887980e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -55,9 +55,6 @@ devDependencies: '@babel/preset-env': specifier: ^7.23.7 version: 7.23.7(@babel/core@7.23.7) - '@babel/register': - specifier: ^7.23.7 - version: 7.23.7(@babel/core@7.23.7) '@es-joy/escodegen': specifier: ^3.5.1 version: 3.5.1 @@ -110,14 +107,17 @@ devDependencies: specifier: ^3.0.5 version: 3.0.5 '@typescript-eslint/parser': - specifier: ^6.16.0 - version: 6.16.0(eslint@9.0.0-alpha.0)(typescript@5.3.3) + specifier: ^6.17.0 + version: 6.17.0(eslint@9.0.0-alpha.0)(typescript@5.3.3) babel-plugin-add-module-exports: specifier: ^1.0.4 version: 1.0.4 babel-plugin-istanbul: specifier: ^6.1.1 version: 6.1.1 + c8: + specifier: ^8.0.1 + version: 8.0.1 camelcase: specifier: ^6.3.0 version: 6.3.0 @@ -166,12 +166,12 @@ devDependencies: mocha: specifier: ^10.2.0 version: 10.2.0 - nyc: - specifier: ^15.1.0 - version: 15.1.0 open-editor: specifier: ^3.0.0 version: 3.0.0 + replace: + specifier: ^1.2.2 + version: 1.2.2 rimraf: specifier: ^5.0.5 version: 5.0.5 @@ -1533,6 +1533,10 @@ packages: to-fast-properties: 2.0.0 dev: true + /@bcoe/v8-coverage@0.2.3: + resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==} + dev: true + /@colors/colors@1.5.0: resolution: {integrity: sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==} engines: {node: '>=0.1.90'} @@ -1565,7 +1569,7 @@ packages: '@babel/core': 7.23.7 '@babel/eslint-parser': 7.23.3(@babel/core@7.23.7)(eslint@8.56.0) '@es-joy/jsdoccomment': 0.41.0 - '@typescript-eslint/parser': 6.16.0(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/parser': 6.17.0(eslint@8.56.0)(typescript@5.3.3) eslint: 8.56.0 esquery: 1.5.0 typescript: 5.3.3 @@ -2378,6 +2382,10 @@ packages: resolution: {integrity: sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==} dev: true + /@types/istanbul-lib-coverage@2.0.6: + resolution: {integrity: sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==} + dev: true + /@types/json-schema@7.0.15: resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} dev: true @@ -2428,7 +2436,7 @@ packages: '@types/node': 20.10.6 dev: true - /@typescript-eslint/eslint-plugin@6.16.0(@typescript-eslint/parser@6.16.0)(eslint@9.0.0-alpha.0)(typescript@5.3.3): + /@typescript-eslint/eslint-plugin@6.16.0(@typescript-eslint/parser@6.17.0)(eslint@9.0.0-alpha.0)(typescript@5.3.3): resolution: {integrity: sha512-O5f7Kv5o4dLWQtPX4ywPPa+v9G+1q1x8mz0Kr0pXUtKsevo+gIJHLkGc8RxaZWtP8RrhwhSNIWThnW42K9/0rQ==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -2440,7 +2448,7 @@ packages: optional: true dependencies: '@eslint-community/regexpp': 4.10.0 - '@typescript-eslint/parser': 6.16.0(eslint@9.0.0-alpha.0)(typescript@5.3.3) + '@typescript-eslint/parser': 6.17.0(eslint@9.0.0-alpha.0)(typescript@5.3.3) '@typescript-eslint/scope-manager': 6.16.0 '@typescript-eslint/type-utils': 6.16.0(eslint@9.0.0-alpha.0)(typescript@5.3.3) '@typescript-eslint/utils': 6.16.0(eslint@9.0.0-alpha.0)(typescript@5.3.3) @@ -2470,8 +2478,8 @@ packages: - typescript dev: true - /@typescript-eslint/parser@6.16.0(eslint@8.56.0)(typescript@5.3.3): - resolution: {integrity: sha512-H2GM3eUo12HpKZU9njig3DF5zJ58ja6ahj1GoHEHOgQvYxzoFJJEvC1MQ7T2l9Ha+69ZSOn7RTxOdpC/y3ikMw==} + /@typescript-eslint/parser@6.17.0(eslint@8.56.0)(typescript@5.3.3): + resolution: {integrity: sha512-C4bBaX2orvhK+LlwrY8oWGmSl4WolCfYm513gEccdWZj0CwGadbIADb0FtVEcI+WzUyjyoBj2JRP8g25E6IB8A==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: eslint: ^7.0.0 || ^8.0.0 @@ -2480,10 +2488,10 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/scope-manager': 6.16.0 - '@typescript-eslint/types': 6.16.0 - '@typescript-eslint/typescript-estree': 6.16.0(typescript@5.3.3) - '@typescript-eslint/visitor-keys': 6.16.0 + '@typescript-eslint/scope-manager': 6.17.0 + '@typescript-eslint/types': 6.17.0 + '@typescript-eslint/typescript-estree': 6.17.0(typescript@5.3.3) + '@typescript-eslint/visitor-keys': 6.17.0 debug: 4.3.4(supports-color@8.1.1) eslint: 8.56.0 typescript: 5.3.3 @@ -2491,8 +2499,8 @@ packages: - supports-color dev: true - /@typescript-eslint/parser@6.16.0(eslint@9.0.0-alpha.0)(typescript@5.3.3): - resolution: {integrity: sha512-H2GM3eUo12HpKZU9njig3DF5zJ58ja6ahj1GoHEHOgQvYxzoFJJEvC1MQ7T2l9Ha+69ZSOn7RTxOdpC/y3ikMw==} + /@typescript-eslint/parser@6.17.0(eslint@9.0.0-alpha.0)(typescript@5.3.3): + resolution: {integrity: sha512-C4bBaX2orvhK+LlwrY8oWGmSl4WolCfYm513gEccdWZj0CwGadbIADb0FtVEcI+WzUyjyoBj2JRP8g25E6IB8A==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: eslint: ^7.0.0 || ^8.0.0 @@ -2501,10 +2509,10 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/scope-manager': 6.16.0 - '@typescript-eslint/types': 6.16.0 - '@typescript-eslint/typescript-estree': 6.16.0(typescript@5.3.3) - '@typescript-eslint/visitor-keys': 6.16.0 + '@typescript-eslint/scope-manager': 6.17.0 + '@typescript-eslint/types': 6.17.0 + '@typescript-eslint/typescript-estree': 6.17.0(typescript@5.3.3) + '@typescript-eslint/visitor-keys': 6.17.0 debug: 4.3.4(supports-color@8.1.1) eslint: 9.0.0-alpha.0 typescript: 5.3.3 @@ -2528,6 +2536,14 @@ packages: '@typescript-eslint/visitor-keys': 6.16.0 dev: true + /@typescript-eslint/scope-manager@6.17.0: + resolution: {integrity: sha512-RX7a8lwgOi7am0k17NUO0+ZmMOX4PpjLtLRgLmT1d3lBYdWH4ssBUbwdmc5pdRX8rXon8v9x8vaoOSpkHfcXGA==} + engines: {node: ^16.0.0 || >=18.0.0} + dependencies: + '@typescript-eslint/types': 6.17.0 + '@typescript-eslint/visitor-keys': 6.17.0 + dev: true + /@typescript-eslint/type-utils@6.16.0(eslint@9.0.0-alpha.0)(typescript@5.3.3): resolution: {integrity: sha512-ThmrEOcARmOnoyQfYkHw/DX2SEYBalVECmoldVuH6qagKROp/jMnfXpAU/pAIWub9c4YTxga+XwgAkoA0pxfmg==} engines: {node: ^16.0.0 || >=18.0.0} @@ -2558,6 +2574,11 @@ packages: engines: {node: ^16.0.0 || >=18.0.0} dev: true + /@typescript-eslint/types@6.17.0: + resolution: {integrity: sha512-qRKs9tvc3a4RBcL/9PXtKSehI/q8wuU9xYJxe97WFxnzH8NWWtcW3ffNS+EWg8uPvIerhjsEZ+rHtDqOCiH57A==} + engines: {node: ^16.0.0 || >=18.0.0} + dev: true + /@typescript-eslint/typescript-estree@5.62.0(typescript@5.3.3): resolution: {integrity: sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -2601,6 +2622,28 @@ packages: - supports-color dev: true + /@typescript-eslint/typescript-estree@6.17.0(typescript@5.3.3): + resolution: {integrity: sha512-gVQe+SLdNPfjlJn5VNGhlOhrXz4cajwFd5kAgWtZ9dCZf4XJf8xmgCTLIqec7aha3JwgLI2CK6GY1043FRxZwg==} + engines: {node: ^16.0.0 || >=18.0.0} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/types': 6.17.0 + '@typescript-eslint/visitor-keys': 6.17.0 + debug: 4.3.4(supports-color@8.1.1) + globby: 11.1.0 + is-glob: 4.0.3 + minimatch: 9.0.3 + semver: 7.5.4 + ts-api-utils: 1.0.3(typescript@5.3.3) + typescript: 5.3.3 + transitivePeerDependencies: + - supports-color + dev: true + /@typescript-eslint/utils@5.62.0(eslint@9.0.0-alpha.0)(typescript@5.3.3): resolution: {integrity: sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -2656,6 +2699,14 @@ packages: eslint-visitor-keys: 3.4.3 dev: true + /@typescript-eslint/visitor-keys@6.17.0: + resolution: {integrity: sha512-H6VwB/k3IuIeQOyYczyyKN8wH6ed8EwliaYHLxOIhyF0dYEIsN8+Bk3GE19qafeMKyZJJHP8+O1HiFhFLUNKSg==} + engines: {node: ^16.0.0 || >=18.0.0} + dependencies: + '@typescript-eslint/types': 6.17.0 + eslint-visitor-keys: 3.4.3 + dev: true + /@ungap/structured-clone@1.2.0: resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} dev: true @@ -2811,17 +2862,6 @@ packages: picomatch: 2.3.1 dev: true - /append-transform@2.0.0: - resolution: {integrity: sha512-7yeyCEurROLQJFv5Xj4lEGTy0borxepjFv1g22oAdqFu//SrAlDl1O1Nxx15SH1RoliUml6p8dwJW9jvZughhg==} - engines: {node: '>=8'} - dependencies: - default-require-extensions: 3.0.1 - dev: true - - /archy@1.0.0: - resolution: {integrity: sha512-Xg+9RwCg/0p32teKdGMPTPnVXKD0w3DfHnFTficozsAgsvq2XenPJq/MYpzzQ/v8zrOyJn6Ds39VA4JIDwFfqw==} - dev: true - /are-docs-informative@0.0.2: resolution: {integrity: sha512-ixiS0nLNNG5jNQzgZJNoUpBKdo9yTYZMGJ+QgT2jmjR7G7+QHRCc4v6LQ3NgE7EBJq+o0ams3waJwkrlBom8Ig==} engines: {node: '>=14'} @@ -3223,6 +3263,25 @@ packages: streamsearch: 1.1.0 dev: true + /c8@8.0.1: + resolution: {integrity: sha512-EINpopxZNH1mETuI0DzRA4MZpAUH+IFiRhnmFD3vFr3vdrgxqi3VfE3KL0AIL+zDq8rC9bZqwM/VDmmoe04y7w==} + engines: {node: '>=12'} + hasBin: true + dependencies: + '@bcoe/v8-coverage': 0.2.3 + '@istanbuljs/schema': 0.1.3 + find-up: 5.0.0 + foreground-child: 2.0.0 + istanbul-lib-coverage: 3.2.2 + istanbul-lib-report: 3.0.1 + istanbul-reports: 3.1.6 + rimraf: 3.0.2 + test-exclude: 6.0.0 + v8-to-istanbul: 9.2.0 + yargs: 17.7.2 + yargs-parser: 21.1.1 + dev: true + /cacache@18.0.1: resolution: {integrity: sha512-g4Uf2CFZPaxtJKre6qr4zqLDOOPU7bNVhWjlNhvzc51xaTOx2noMOLhfFkTAqwtrAZAKQUuDfyjitzilpA8WsQ==} engines: {node: ^16.14.0 || >=18.0.0} @@ -3256,16 +3315,6 @@ packages: unset-value: 1.0.0 dev: true - /caching-transform@4.0.0: - resolution: {integrity: sha512-kpqOvwXnjjN44D89K5ccQC+RUrsy7jB/XLlRrx0D7/2HNcTPqzsb6XgYoErwko6QsV184CA2YgS1fxDiiDZMWA==} - engines: {node: '>=8'} - dependencies: - hasha: 5.2.2 - make-dir: 3.1.0 - package-hash: 4.0.0 - write-file-atomic: 3.0.3 - dev: true - /call-bind@1.0.5: resolution: {integrity: sha512-C3nQxfFZxFRVoJoGKKI8y3MOEo129NQ+FgQ08iye+Mk4zNZZGdjfs06bVTr+DBSlA66Q2VEcMki/cUCP4SercQ==} dependencies: @@ -3613,10 +3662,6 @@ packages: split2: 4.2.0 dev: true - /convert-source-map@1.9.0: - resolution: {integrity: sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==} - dev: true - /convert-source-map@2.0.0: resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} dev: true @@ -3832,13 +3877,6 @@ packages: resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} dev: true - /default-require-extensions@3.0.1: - resolution: {integrity: sha512-eXTJmRbm2TIt9MgWTsOH1wEuhew6XGZcMeGKCtLedIg/NCsg1iBePXkceTdK4Fii7pzmN9tGsZhKzZ4h7O/fxw==} - engines: {node: '>=8'} - dependencies: - strip-bom: 4.0.0 - dev: true - /define-data-property@1.1.1: resolution: {integrity: sha512-E7uGkTzkk1d0ByLeSc6ZsFS79Axg+m1P/VsgYsxHgiuc3tFSj+MjMIwe90FC4lOAZzNBdY7kkO2P2wKdsQ1vgQ==} engines: {node: '>= 0.4'} @@ -4153,10 +4191,6 @@ packages: is-symbol: 1.0.4 dev: true - /es6-error@4.1.1: - resolution: {integrity: sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==} - dev: true - /escalade@3.1.1: resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==} engines: {node: '>=6'} @@ -4219,18 +4253,18 @@ packages: '@graphql-eslint/eslint-plugin': 3.20.1(@babel/core@7.23.7)(@types/node@20.10.6)(graphql@16.8.1) '@next/eslint-plugin-next': 13.5.6 '@rushstack/eslint-patch': 1.6.1 - '@typescript-eslint/eslint-plugin': 6.16.0(@typescript-eslint/parser@6.16.0)(eslint@9.0.0-alpha.0)(typescript@5.3.3) - '@typescript-eslint/parser': 6.16.0(eslint@9.0.0-alpha.0)(typescript@5.3.3) + '@typescript-eslint/eslint-plugin': 6.16.0(@typescript-eslint/parser@6.17.0)(eslint@9.0.0-alpha.0)(typescript@5.3.3) + '@typescript-eslint/parser': 6.17.0(eslint@9.0.0-alpha.0)(typescript@5.3.3) eslint: 9.0.0-alpha.0 eslint-config-prettier: 9.1.0(eslint@9.0.0-alpha.0) - eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@6.16.0)(eslint-plugin-i@2.29.1)(eslint@9.0.0-alpha.0) + eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@6.17.0)(eslint-plugin-i@2.29.1)(eslint@9.0.0-alpha.0) eslint-plugin-ava: 14.0.0(eslint@9.0.0-alpha.0) - eslint-plugin-canonical: 4.18.0(@typescript-eslint/parser@6.16.0)(eslint-plugin-i@2.29.1)(eslint@9.0.0-alpha.0)(typescript@5.3.3) + eslint-plugin-canonical: 4.18.0(@typescript-eslint/parser@6.17.0)(eslint-plugin-i@2.29.1)(eslint@9.0.0-alpha.0)(typescript@5.3.3) eslint-plugin-cypress: 2.15.1(eslint@9.0.0-alpha.0) eslint-plugin-eslint-comments: 3.2.0(eslint@9.0.0-alpha.0) eslint-plugin-flowtype: 8.0.3(@babel/plugin-syntax-flow@7.23.3)(@babel/plugin-transform-react-jsx@7.23.4)(eslint@9.0.0-alpha.0) eslint-plugin-fp: 2.3.0(eslint@9.0.0-alpha.0) - eslint-plugin-import: /eslint-plugin-i@2.29.1(@typescript-eslint/parser@6.16.0)(eslint-import-resolver-typescript@3.6.1)(eslint@9.0.0-alpha.0) + eslint-plugin-import: /eslint-plugin-i@2.29.1(@typescript-eslint/parser@6.17.0)(eslint-import-resolver-typescript@3.6.1)(eslint@9.0.0-alpha.0) eslint-plugin-jest: 27.6.0(@typescript-eslint/eslint-plugin@6.16.0)(eslint@9.0.0-alpha.0)(typescript@5.3.3) eslint-plugin-jsdoc: 46.9.1(eslint@9.0.0-alpha.0) eslint-plugin-jsonc: 2.11.2(eslint@9.0.0-alpha.0) @@ -4245,7 +4279,7 @@ packages: eslint-plugin-react-hooks: 4.6.0(eslint@9.0.0-alpha.0) eslint-plugin-regexp: 1.15.0(eslint@9.0.0-alpha.0) eslint-plugin-simple-import-sort: 10.0.0(eslint@9.0.0-alpha.0) - eslint-plugin-typescript-sort-keys: 3.1.0(@typescript-eslint/parser@6.16.0)(eslint@9.0.0-alpha.0)(typescript@5.3.3) + eslint-plugin-typescript-sort-keys: 3.1.0(@typescript-eslint/parser@6.17.0)(eslint@9.0.0-alpha.0)(typescript@5.3.3) eslint-plugin-unicorn: 48.0.1(eslint@9.0.0-alpha.0) eslint-plugin-vitest: 0.3.20(@typescript-eslint/eslint-plugin@6.16.0)(eslint@9.0.0-alpha.0)(typescript@5.3.3) eslint-plugin-yml: 1.11.0(eslint@9.0.0-alpha.0) @@ -4290,7 +4324,7 @@ packages: - supports-color dev: true - /eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.16.0)(eslint-plugin-i@2.29.1)(eslint@9.0.0-alpha.0): + /eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.17.0)(eslint-plugin-i@2.29.1)(eslint@9.0.0-alpha.0): resolution: {integrity: sha512-xgdptdoi5W3niYeuQxKmzVDTATvLYqhpwmykwsh7f6HIOStGWEIL9iqZgQDF9u9OEzrRwR8no5q2VT+bjAujTg==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: @@ -4300,8 +4334,8 @@ packages: debug: 4.3.4(supports-color@8.1.1) enhanced-resolve: 5.15.0 eslint: 9.0.0-alpha.0 - eslint-module-utils: 2.8.0(@typescript-eslint/parser@6.16.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@9.0.0-alpha.0) - eslint-plugin-import: /eslint-plugin-i@2.29.1(@typescript-eslint/parser@6.16.0)(eslint-import-resolver-typescript@3.6.1)(eslint@9.0.0-alpha.0) + eslint-module-utils: 2.8.0(@typescript-eslint/parser@6.17.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@9.0.0-alpha.0) + eslint-plugin-import: /eslint-plugin-i@2.29.1(@typescript-eslint/parser@6.17.0)(eslint-import-resolver-typescript@3.6.1)(eslint@9.0.0-alpha.0) fast-glob: 3.3.2 get-tsconfig: 4.7.2 is-core-module: 2.13.1 @@ -4313,7 +4347,7 @@ packages: - supports-color dev: true - /eslint-module-utils@2.8.0(@typescript-eslint/parser@6.16.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@9.0.0-alpha.0): + /eslint-module-utils@2.8.0(@typescript-eslint/parser@6.17.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@9.0.0-alpha.0): resolution: {integrity: sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==} engines: {node: '>=4'} peerDependencies: @@ -4334,11 +4368,11 @@ packages: eslint-import-resolver-webpack: optional: true dependencies: - '@typescript-eslint/parser': 6.16.0(eslint@9.0.0-alpha.0)(typescript@5.3.3) + '@typescript-eslint/parser': 6.17.0(eslint@9.0.0-alpha.0)(typescript@5.3.3) debug: 3.2.7 eslint: 9.0.0-alpha.0 eslint-import-resolver-node: 0.3.9 - eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@6.16.0)(eslint-plugin-i@2.29.1)(eslint@9.0.0-alpha.0) + eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@6.17.0)(eslint-plugin-i@2.29.1)(eslint@9.0.0-alpha.0) transitivePeerDependencies: - supports-color dev: true @@ -4360,15 +4394,15 @@ packages: resolve-from: 5.0.0 dev: true - /eslint-plugin-canonical@4.18.0(@typescript-eslint/parser@6.16.0)(eslint-plugin-i@2.29.1)(eslint@9.0.0-alpha.0)(typescript@5.3.3): + /eslint-plugin-canonical@4.18.0(@typescript-eslint/parser@6.17.0)(eslint-plugin-i@2.29.1)(eslint@9.0.0-alpha.0)(typescript@5.3.3): resolution: {integrity: sha512-0Egc0FKOnCRdu3bFEJhfHkdkusIgW0UxdemukkowZQnQsnf12FHSJ7K26b+tZ5pKB7cTyECSaqvEpoIJfplX4g==} engines: {node: '>=16.0.0'} dependencies: '@typescript-eslint/utils': 6.16.0(eslint@9.0.0-alpha.0)(typescript@5.3.3) chance: 1.1.11 debug: 4.3.4(supports-color@8.1.1) - eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@6.16.0)(eslint-plugin-i@2.29.1)(eslint@9.0.0-alpha.0) - eslint-module-utils: 2.8.0(@typescript-eslint/parser@6.16.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@9.0.0-alpha.0) + eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@6.17.0)(eslint-plugin-i@2.29.1)(eslint@9.0.0-alpha.0) + eslint-module-utils: 2.8.0(@typescript-eslint/parser@6.17.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@9.0.0-alpha.0) is-get-set-prop: 1.0.0 is-js-type: 2.0.0 is-obj-prop: 1.0.0 @@ -4449,7 +4483,7 @@ packages: req-all: 0.1.0 dev: true - /eslint-plugin-i@2.29.1(@typescript-eslint/parser@6.16.0)(eslint-import-resolver-typescript@3.6.1)(eslint@9.0.0-alpha.0): + /eslint-plugin-i@2.29.1(@typescript-eslint/parser@6.17.0)(eslint-import-resolver-typescript@3.6.1)(eslint@9.0.0-alpha.0): resolution: {integrity: sha512-ORizX37MelIWLbMyqI7hi8VJMf7A0CskMmYkB+lkCX3aF4pkGV7kwx5bSEb4qx7Yce2rAf9s34HqDRPjGRZPNQ==} engines: {node: '>=12'} peerDependencies: @@ -4459,7 +4493,7 @@ packages: doctrine: 3.0.0 eslint: 9.0.0-alpha.0 eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.8.0(@typescript-eslint/parser@6.16.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@9.0.0-alpha.0) + eslint-module-utils: 2.8.0(@typescript-eslint/parser@6.17.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@9.0.0-alpha.0) get-tsconfig: 4.7.2 is-glob: 4.0.3 minimatch: 3.1.2 @@ -4484,7 +4518,7 @@ packages: jest: optional: true dependencies: - '@typescript-eslint/eslint-plugin': 6.16.0(@typescript-eslint/parser@6.16.0)(eslint@9.0.0-alpha.0)(typescript@5.3.3) + '@typescript-eslint/eslint-plugin': 6.16.0(@typescript-eslint/parser@6.17.0)(eslint@9.0.0-alpha.0)(typescript@5.3.3) '@typescript-eslint/utils': 5.62.0(eslint@9.0.0-alpha.0)(typescript@5.3.3) eslint: 9.0.0-alpha.0 transitivePeerDependencies: @@ -4689,7 +4723,7 @@ packages: eslint: 9.0.0-alpha.0 dev: true - /eslint-plugin-typescript-sort-keys@3.1.0(@typescript-eslint/parser@6.16.0)(eslint@9.0.0-alpha.0)(typescript@5.3.3): + /eslint-plugin-typescript-sort-keys@3.1.0(@typescript-eslint/parser@6.17.0)(eslint@9.0.0-alpha.0)(typescript@5.3.3): resolution: {integrity: sha512-rgZeYfEguqKni/V7sbmgFu9/94UDAQd7YqNd0J7Qhw7SdLIGd0iBk2KgpjhRhe2ge4rPSLDIdFWwUiDqBOst6Q==} engines: {node: '>= 16'} peerDependencies: @@ -4698,7 +4732,7 @@ packages: typescript: ^3 || ^4 || ^5 dependencies: '@typescript-eslint/experimental-utils': 5.62.0(eslint@9.0.0-alpha.0)(typescript@5.3.3) - '@typescript-eslint/parser': 6.16.0(eslint@9.0.0-alpha.0)(typescript@5.3.3) + '@typescript-eslint/parser': 6.17.0(eslint@9.0.0-alpha.0)(typescript@5.3.3) eslint: 9.0.0-alpha.0 json-schema: 0.4.0 natural-compare-lite: 1.4.0 @@ -4744,7 +4778,7 @@ packages: vitest: optional: true dependencies: - '@typescript-eslint/eslint-plugin': 6.16.0(@typescript-eslint/parser@6.16.0)(eslint@9.0.0-alpha.0)(typescript@5.3.3) + '@typescript-eslint/eslint-plugin': 6.16.0(@typescript-eslint/parser@6.17.0)(eslint@9.0.0-alpha.0)(typescript@5.3.3) '@typescript-eslint/utils': 6.16.0(eslint@9.0.0-alpha.0)(typescript@5.3.3) eslint: 9.0.0-alpha.0 transitivePeerDependencies: @@ -5175,15 +5209,6 @@ packages: pkg-dir: 3.0.0 dev: true - /find-cache-dir@3.3.2: - resolution: {integrity: sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==} - engines: {node: '>=8'} - dependencies: - commondir: 1.0.1 - make-dir: 3.1.0 - pkg-dir: 4.2.0 - dev: true - /find-up-simple@1.0.0: resolution: {integrity: sha512-q7Us7kcjj2VMePAa02hDAF6d+MzsdsAWEwYyOpwUtlerRBkOEPBCRZrAV4XfcSN8fHAgaD0hP7miwoay6DCprw==} engines: {node: '>=18'} @@ -5298,10 +5323,6 @@ packages: readable-stream: 2.3.8 dev: true - /fromentries@1.3.2: - resolution: {integrity: sha512-cHEpEQHUg0f8XdtZCc2ZAhrHzKzT0MrFUTcvx+hfxYu7rGMDc5SKoXFh+n4YigxsHXRzc6OrCshdR1bWH6HHyg==} - dev: true - /fs-extra@11.2.0: resolution: {integrity: sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==} engines: {node: '>=14.14'} @@ -5765,14 +5786,6 @@ packages: kind-of: 4.0.0 dev: true - /hasha@5.2.2: - resolution: {integrity: sha512-Hrp5vIK/xr5SkeN2onO32H0MgNZ0f17HRNH39WfL0SYUNOTZ5Lz1TJ8Pajo/87dYGEFlLMm7mIc/k/s6Bvz9HQ==} - engines: {node: '>=8'} - dependencies: - is-stream: 2.0.1 - type-fest: 0.8.1 - dev: true - /hasown@2.0.0: resolution: {integrity: sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==} engines: {node: '>= 0.4'} @@ -6418,25 +6431,6 @@ packages: engines: {node: '>=8'} dev: true - /istanbul-lib-hook@3.0.0: - resolution: {integrity: sha512-Pt/uge1Q9s+5VAZ+pCo16TYMWPBIl+oaNIjgLQxcX0itS6ueeaA+pEfThZpH8WxhFgCiEb8sAJY6MdUKgiIWaQ==} - engines: {node: '>=8'} - dependencies: - append-transform: 2.0.0 - dev: true - - /istanbul-lib-instrument@4.0.3: - resolution: {integrity: sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ==} - engines: {node: '>=8'} - dependencies: - '@babel/core': 7.23.7 - '@istanbuljs/schema': 0.1.3 - istanbul-lib-coverage: 3.2.2 - semver: 6.3.1 - transitivePeerDependencies: - - supports-color - dev: true - /istanbul-lib-instrument@5.2.1: resolution: {integrity: sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==} engines: {node: '>=8'} @@ -6450,18 +6444,6 @@ packages: - supports-color dev: true - /istanbul-lib-processinfo@2.0.3: - resolution: {integrity: sha512-NkwHbo3E00oybX6NGJi6ar0B29vxyvNwoC7eJ4G4Yq28UfY758Hgn/heV8VRFhevPED4LXfFz0DQ8z/0kw9zMg==} - engines: {node: '>=8'} - dependencies: - archy: 1.0.0 - cross-spawn: 7.0.3 - istanbul-lib-coverage: 3.2.2 - p-map: 3.0.0 - rimraf: 3.0.2 - uuid: 8.3.2 - dev: true - /istanbul-lib-report@3.0.1: resolution: {integrity: sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==} engines: {node: '>=10'} @@ -6471,17 +6453,6 @@ packages: supports-color: 7.2.0 dev: true - /istanbul-lib-source-maps@4.0.1: - resolution: {integrity: sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==} - engines: {node: '>=10'} - dependencies: - debug: 4.3.4(supports-color@8.1.1) - istanbul-lib-coverage: 3.2.2 - source-map: 0.6.1 - transitivePeerDependencies: - - supports-color - dev: true - /istanbul-reports@3.1.6: resolution: {integrity: sha512-TLgnMkKg3iTDsQ9PbPTdpfAK2DzjF9mqUG7RMgcQl8oFjad8ob4laGxv5XV5U9MAfx8D6tSJiUyuAwzLicaxlg==} engines: {node: '>=8'} @@ -6838,10 +6809,6 @@ packages: resolution: {integrity: sha512-TM9YBvyC84ZxE3rgfefxUWiQKLilstD6k7PTGt6wfbtXF8ixIJLOL3VYyV/z+ZiPLsVxAsKAFVwWlWeb2Y8Yyw==} dev: true - /lodash.flattendeep@4.4.0: - resolution: {integrity: sha512-uHaJFihxmJcEX3kT4I23ABqKKalJ/zDrDg0lsFtc1h+3uw49SIJ5beyhx5ExVRti3AvKoOJngIj7xz3oylPdWQ==} - dev: true - /lodash.get@4.4.2: resolution: {integrity: sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ==} dev: true @@ -6936,13 +6903,6 @@ packages: semver: 5.7.2 dev: true - /make-dir@3.1.0: - resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==} - engines: {node: '>=8'} - dependencies: - semver: 6.3.1 - dev: true - /make-dir@4.0.0: resolution: {integrity: sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==} engines: {node: '>=10'} @@ -7107,6 +7067,12 @@ packages: engines: {node: '>=4'} dev: true + /minimatch@3.0.5: + resolution: {integrity: sha512-tUpxzX0VAzJHjLu0xUfFv1gwVp9ba3IOuRAVH2EGuRW8a5emA2FlACLqiT/lDVtS1W+TGNwqz3sWaNyLgDJWuw==} + dependencies: + brace-expansion: 1.1.11 + dev: true + /minimatch@3.1.2: resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} dependencies: @@ -7361,13 +7327,6 @@ packages: - supports-color dev: true - /node-preload@0.2.1: - resolution: {integrity: sha512-RM5oyBy45cLEoHqCeh+MNuFAxO0vTFBLskvQbOKnEE7YTTSN4tbN8QWDIPQ6L+WvKsB/qLEGpYe2ZZ9d4W9OIQ==} - engines: {node: '>=8'} - dependencies: - process-on-spawn: 1.0.0 - dev: true - /node-releases@2.0.14: resolution: {integrity: sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==} dev: true @@ -7543,42 +7502,6 @@ packages: resolution: {integrity: sha512-3iuY4N5dhgMpCUrOVnuAdGrgxVqV2cJpM+XNccjR2DKOB1RUP0aA+wGXEiNziG/UKboFyGBIoKOaNlJxx8bciQ==} dev: true - /nyc@15.1.0: - resolution: {integrity: sha512-jMW04n9SxKdKi1ZMGhvUTHBN0EICCRkHemEoE5jm6mTYcqcdas0ATzgUgejlQUHMvpnOZqGB5Xxsv9KxJW1j8A==} - engines: {node: '>=8.9'} - hasBin: true - dependencies: - '@istanbuljs/load-nyc-config': 1.1.0 - '@istanbuljs/schema': 0.1.3 - caching-transform: 4.0.0 - convert-source-map: 1.9.0 - decamelize: 1.2.0 - find-cache-dir: 3.3.2 - find-up: 4.1.0 - foreground-child: 2.0.0 - get-package-type: 0.1.0 - glob: 7.2.3 - istanbul-lib-coverage: 3.2.2 - istanbul-lib-hook: 3.0.0 - istanbul-lib-instrument: 4.0.3 - istanbul-lib-processinfo: 2.0.3 - istanbul-lib-report: 3.0.1 - istanbul-lib-source-maps: 4.0.1 - istanbul-reports: 3.1.6 - make-dir: 3.1.0 - node-preload: 0.2.1 - p-map: 3.0.0 - process-on-spawn: 1.0.0 - resolve-from: 5.0.0 - rimraf: 3.0.2 - signal-exit: 3.0.7 - spawn-wrap: 2.0.0 - test-exclude: 6.0.0 - yargs: 15.4.1 - transitivePeerDependencies: - - supports-color - dev: true - /oauth-sign@0.9.0: resolution: {integrity: sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==} dev: true @@ -7821,13 +7744,6 @@ packages: p-limit: 3.1.0 dev: true - /p-map@3.0.0: - resolution: {integrity: sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==} - engines: {node: '>=8'} - dependencies: - aggregate-error: 3.1.0 - dev: true - /p-map@4.0.0: resolution: {integrity: sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==} engines: {node: '>=10'} @@ -7855,16 +7771,6 @@ packages: engines: {node: '>=6'} dev: true - /package-hash@4.0.0: - resolution: {integrity: sha512-whdkPIooSu/bASggZ96BWVvZTRMOFxnyUG5PnTSGKoJE2gd5mbVNmR2Nj20QFzxYYgAXpoqC+AiXzl+UMRh7zQ==} - engines: {node: '>=8'} - dependencies: - graceful-fs: 4.2.11 - hasha: 5.2.2 - lodash.flattendeep: 4.4.0 - release-zalgo: 1.0.0 - dev: true - /parent-module@1.0.1: resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} engines: {node: '>=6'} @@ -8018,13 +7924,6 @@ packages: find-up: 3.0.0 dev: true - /pkg-dir@4.2.0: - resolution: {integrity: sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==} - engines: {node: '>=8'} - dependencies: - find-up: 4.1.0 - dev: true - /pkg-dir@5.0.0: resolution: {integrity: sha512-NPE8TDbzl/3YQYY7CSS228s3g2ollTFnc+Qi3tqmqJp9Vg2ovUpixcJEo2HJScN2Ez+kEaal6y70c0ehqJBJeA==} engines: {node: '>=10'} @@ -8074,13 +7973,6 @@ packages: resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==} dev: true - /process-on-spawn@1.0.0: - resolution: {integrity: sha512-1WsPDsUSMmZH5LeMLegqkPDrsGgsWwk1Exipy2hvB0o/F0ASzbpIctSCcZIK1ykJvtTJULEH+20WOFjMvGnCTg==} - engines: {node: '>=8'} - dependencies: - fromentries: 1.3.2 - dev: true - /promise-retry@2.0.1: resolution: {integrity: sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g==} engines: {node: '>=10'} @@ -8378,13 +8270,6 @@ packages: jsesc: 0.5.0 dev: true - /release-zalgo@1.0.0: - resolution: {integrity: sha512-gUAyHVHPPC5wdqX/LG4LWtRYtgjxyX78oanFNTMMyFEfOqdC54s3eE82imuWKbOeqYht2CrNf64Qb8vgmmtZGA==} - engines: {node: '>=4'} - dependencies: - es6-error: 4.1.1 - dev: true - /remove-trailing-separator@1.1.0: resolution: {integrity: sha512-/hS+Y0u3aOfIETiaiirUFwDBDzmXPvO+jAfKTitUngIPzdKc6Z0LoFjM/CK5PL4C+eKwHohlHAb6H0VFfmmUsw==} dev: true @@ -8399,6 +8284,16 @@ packages: engines: {node: '>=0.10'} dev: true + /replace@1.2.2: + resolution: {integrity: sha512-C4EDifm22XZM2b2JOYe6Mhn+lBsLBAvLbK8drfUQLTfD1KYl/n3VaW/CDju0Ny4w3xTtegBpg8YNSpFJPUDSjA==} + engines: {node: '>= 6'} + hasBin: true + dependencies: + chalk: 2.4.2 + minimatch: 3.0.5 + yargs: 15.4.1 + dev: true + /req-all@0.1.0: resolution: {integrity: sha512-ZdvPr8uXy9ujX3KujwE2P1HWkMYgogIhqeAeyb47MqWjSfyxERSm0TNbN/IapCCmWDufXab04AYrRgObaJCJ6Q==} engines: {node: '>=4'} @@ -8903,18 +8798,6 @@ packages: resolution: {integrity: sha512-gRjMgK5uFjbCvdibeGJuy3I5OYz6VLoVdsOJdA6wV0WlfQVLFueoqMxwwYD9RODdgb6oUIvlRlsyFSiQkMKu0g==} dev: true - /spawn-wrap@2.0.0: - resolution: {integrity: sha512-EeajNjfN9zMnULLwhZZQU3GWBoFNkbngTUPfaawT4RkMiviTxcX0qfhVbGey39mfctfDHkWtuecgQ8NJcyQWHg==} - engines: {node: '>=8'} - dependencies: - foreground-child: 2.0.0 - is-windows: 1.0.2 - make-dir: 3.1.0 - rimraf: 3.0.2 - signal-exit: 3.0.7 - which: 2.0.2 - dev: true - /spdx-correct@3.2.0: resolution: {integrity: sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==} dependencies: @@ -9125,11 +9008,6 @@ packages: engines: {node: '>=4'} dev: true - /strip-bom@4.0.0: - resolution: {integrity: sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==} - engines: {node: '>=8'} - dev: true - /strip-eof@1.0.0: resolution: {integrity: sha512-7FCwGGmx8mD5xQd3RPUvnSpUXHM3BWuzjtpD4TXsfcZ9EL4azvVVUscFYwD9nx8Kh+uCBC00XBtAykoMHwTh8Q==} engines: {node: '>=0.10.0'} @@ -9482,12 +9360,6 @@ packages: is-typed-array: 1.1.12 dev: true - /typedarray-to-buffer@3.1.5: - resolution: {integrity: sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==} - dependencies: - is-typedarray: 1.0.0 - dev: true - /typescript@5.3.3: resolution: {integrity: sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==} engines: {node: '>=14.17'} @@ -9675,9 +9547,13 @@ packages: hasBin: true dev: true - /uuid@8.3.2: - resolution: {integrity: sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==} - hasBin: true + /v8-to-istanbul@9.2.0: + resolution: {integrity: sha512-/EH/sDgxU2eGxajKdwLCDmQ4FWq+kpi3uCmBGpw1xJtnAxEjlD8j8PEiGWpCIMIs3ciNAgH0d3TTJiUkYzyZjA==} + engines: {node: '>=10.12.0'} + dependencies: + '@jridgewell/trace-mapping': 0.3.20 + '@types/istanbul-lib-coverage': 2.0.6 + convert-source-map: 2.0.0 dev: true /v8flags@3.2.0: @@ -9868,15 +9744,6 @@ packages: resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} dev: true - /write-file-atomic@3.0.3: - resolution: {integrity: sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==} - dependencies: - imurmurhash: 0.1.4 - is-typedarray: 1.0.0 - signal-exit: 3.0.7 - typedarray-to-buffer: 3.1.5 - dev: true - /ws@8.13.0: resolution: {integrity: sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==} engines: {node: '>=10.0.0'} diff --git a/src/WarnSettings.js b/src/WarnSettings.js index 9d69fc210..aee7c92bf 100644 --- a/src/WarnSettings.js +++ b/src/WarnSettings.js @@ -21,7 +21,7 @@ const WarnSettings = function () { * @returns {void} */ markSettingAsWarned (context, setting) { - // istanbul ignore else + // c8 ignore else if (!warnedSettings.has(context)) { warnedSettings.set(context, new Set()); } diff --git a/src/alignTransform.js b/src/alignTransform.js index 022761f65..c12cb7eb3 100644 --- a/src/alignTransform.js +++ b/src/alignTransform.js @@ -192,7 +192,7 @@ const alignTransform = ({ nothingAfter.tag = true; tokens.postTag = ''; - /* istanbul ignore next: Never happens because the !intoTags return. But it's here for consistency with the original align transform */ + /* c8 ignore next: Never happens because the !intoTags return. But it's here for consistency with the original align transform */ if (tokens.tag === '') { nothingAfter.delim = true; } diff --git a/src/bin/generateDocs.js b/src/bin/generateDocs.js index 2774cb4f5..1e66ba602 100644 --- a/src/bin/generateDocs.js +++ b/src/bin/generateDocs.js @@ -1,13 +1,16 @@ /** * This script is used to inline assertions into the README.md documents. */ -import decamelize from 'decamelize'; +import path, {dirname} from 'path'; +import {fileURLToPath} from 'url'; import fs from 'fs'; +import decamelize from 'decamelize'; import Gitdown from 'gitdown'; import { glob, } from 'glob'; -import path from 'path'; + +const __dirname = dirname(fileURLToPath(import.meta.url)); /** * @param {string} code @@ -77,7 +80,7 @@ const getAssertions = async () => { * valid: (import('eslint').RuleTester.ValidTestCase & {ignoreReadme?: true})[] * }} */ - const codes = await import(filePath); + const codes = (await import(filePath)).default; const ruleName = decamelize(assertionNames[idx], { separator: '-', diff --git a/src/bin/generateRule.js b/src/bin/generateRule.js index 3da323523..7216f0ebe 100644 --- a/src/bin/generateRule.js +++ b/src/bin/generateRule.js @@ -1,5 +1,14 @@ /* eslint-disable no-console -- CLI */ +import {fileURLToPath} from 'url'; +import { + existsSync, +} from 'fs'; +import fs from 'fs/promises'; +import { + resolve, dirname, +} from 'path'; + /** * @example * @@ -9,14 +18,9 @@ */ import camelCase from 'camelcase'; -import { - existsSync, -} from 'fs'; -import fs from 'fs/promises'; import open from 'open-editor'; -import { - resolve, -} from 'path'; + +const __dirname = dirname(fileURLToPath(import.meta.url)); // Todo: Would ideally have prompts, e.g., to ask for whether // type was problem/layout, etc. diff --git a/src/exportParser.js b/src/exportParser.js index 9ec8e089d..5a748b987 100644 --- a/src/exportParser.js +++ b/src/exportParser.js @@ -39,17 +39,16 @@ const createNode = function () { * @returns {string|null} */ const getSymbolValue = function (symbol) { - /* istanbul ignore if */ + /* c8 ignore next 3 */ if (!symbol) { return null; } - /* istanbul ignore else */ + /* c8 ignore else */ if (symbol.type === 'literal') { return /** @type {ValueObject} */ (symbol.value).value; } - - /* istanbul ignore next */ + /* c8 ignore next */ return null; }; @@ -73,7 +72,7 @@ const getIdentifier = function (node, globals, scope, opts) { return identifierLiteral; } - /* istanbul ignore next */ + /* c8 ignore next */ const block = scope || globals; // As scopes are not currently supported, they are not traversed upwards recursively @@ -82,7 +81,7 @@ const getIdentifier = function (node, globals, scope, opts) { } // Seems this will only be entered once scopes added and entered - /* istanbul ignore next */ + /* c8 ignore next 3 */ if (globals.props[node.name]) { return globals.props[node.name]; } @@ -122,7 +121,7 @@ let createSymbol; // eslint-disable-line prefer-const const getSymbol = function (node, globals, scope, opt) { /* eslint-enable complexity -- Temporary */ const opts = opt || {}; - /* istanbul ignore next */ + /* c8 ignore next */ switch (node.type) { case 'Identifier': { return getIdentifier(node, globals, scope, opts); @@ -147,13 +146,13 @@ const getSymbol = function (node, globals, scope, opt) { ); const propertyValue = getSymbolValue(propertySymbol); - /* istanbul ignore else */ + /* c8 ignore else */ if (obj && propertyValue && obj.props[propertyValue]) { const block = obj.props[propertyValue]; return block; } - + /* c8 ignore next 10 */ /* if (opts.createMissingProps && propertyValue) { obj.props[propertyValue] = createNode(); @@ -161,12 +160,10 @@ const getSymbol = function (node, globals, scope, opt) { return obj.props[propertyValue]; } */ - /* istanbul ignore next */ debug(`MemberExpression: Missing property ${ /** @type {import('estree').PrivateIdentifier} */ (node.property).name }`); - - /* istanbul ignore next */ + /* c8 ignore next 2 */ return null; } @@ -180,11 +177,14 @@ const getSymbol = function (node, globals, scope, opt) { ); } + /* c8 ignore next 7 -- No longer needed? */ // @ts-expect-error TS OK case 'TSTypeAliasDeclaration': // @ts-expect-error TS OK // Fallthrough - case 'TSEnumDeclaration': case 'TSInterfaceDeclaration': + case 'TSEnumDeclaration': + // @ts-expect-error TS OK + case 'TSInterfaceDeclaration': case 'ClassDeclaration': case 'FunctionExpression': case 'FunctionDeclaration': case 'ArrowFunctionExpression': { @@ -266,7 +266,7 @@ const getSymbol = function (node, globals, scope, opt) { scope, opts, ); - /* istanbul ignore if */ + /* c8 ignore next 8 */ if (propVal) { val.props[ /** @type {import('estree').PrivateIdentifier} */ @@ -288,8 +288,7 @@ const getSymbol = function (node, globals, scope, opt) { return val; } } - - /* istanbul ignore next */ + /* c8 ignore next */ return null; }; @@ -311,7 +310,7 @@ const createBlockSymbol = function (block, name, value, globals, isGlobal) { createSymbol = function (node, globals, value, scope, isGlobal) { const block = scope || globals; - /* istanbul ignore if */ + /* c8 ignore next 3 */ if (!node) { return null; } @@ -319,16 +318,16 @@ createSymbol = function (node, globals, value, scope, isGlobal) { let symbol; switch (node.type) { case 'FunctionDeclaration': - /* istanbul ignore next */ + /* c8 ignore next */ // @ts-expect-error TS OK // Fall through case 'TSEnumDeclaration': case 'TSInterfaceDeclaration': - /* istanbul ignore next */ + /* c8 ignore next */ // @ts-expect-error TS OK // Fall through case 'TSTypeAliasDeclaration': case 'ClassDeclaration': { const nde = /** @type {import('estree').ClassDeclaration} */ (node); - /* istanbul ignore else */ + /* c8 ignore else */ if (nde.id && nde.id.type === 'Identifier') { return createSymbol( /** @type {import('eslint').Rule.Node} */ (nde.id), @@ -337,8 +336,7 @@ createSymbol = function (node, globals, value, scope, isGlobal) { globals, ); } - - /* istanbul ignore next */ + /* c8 ignore next 2 */ break; } @@ -346,22 +344,20 @@ createSymbol = function (node, globals, value, scope, isGlobal) { const nde = /** @type {import('estree').Identifier} */ (node); if (value) { const valueSymbol = getSymbol(value, globals, block); - /* istanbul ignore else */ + /* c8 ignore else */ if (valueSymbol) { createBlockSymbol(block, nde.name, valueSymbol, globals, isGlobal); return block.props[nde.name]; } - - /* istanbul ignore next */ + /* c8 ignore next */ debug('Identifier: Missing value symbol for %s', nde.name); } else { createBlockSymbol(block, nde.name, createNode(), globals, isGlobal); return block.props[nde.name]; } - - /* istanbul ignore next */ + /* c8 ignore next 2 */ break; } @@ -482,9 +478,9 @@ const initVariables = function (node, globals, opts) { */ const mapVariables = function (node, globals, opt, isExport) { /* eslint-enable complexity -- Temporary */ - /* istanbul ignore next */ + /* c8 ignore next */ const opts = opt || {}; - /* istanbul ignore next */ + /* c8 ignore next */ switch (node.type) { case 'Program': { if (opts.ancestorsOnly) { @@ -545,7 +541,7 @@ const mapVariables = function (node, globals, opt, isExport) { } case 'FunctionDeclaration': { - /* istanbul ignore if */ + /* c8 ignore next 10 */ if (/** @type {import('estree').Identifier} */ (node.id).type === 'Identifier') { createSymbol( /** @type {import('eslint').Rule.Node} */ @@ -570,6 +566,7 @@ const mapVariables = function (node, globals, opt, isExport) { ); if (symbol) { symbol.exported = true; + /* c8 ignore next 6 */ } else { // if (!node.id) { globals.ANONYMOUS_DEFAULT = /** @type {import('eslint').Rule.Node} */ ( @@ -598,7 +595,7 @@ const mapVariables = function (node, globals, opt, isExport) { /** @type {import('eslint').Rule.Node} */ (node.declaration), ); - /* istanbul ignore if */ + /* c8 ignore next 3 */ if (symbol) { symbol.exported = true; } @@ -624,7 +621,7 @@ const mapVariables = function (node, globals, opt, isExport) { globals, globals, ); - /* istanbul ignore if */ + /* c8 ignore next 3 */ if (symbol) { symbol.exported = true; } @@ -643,7 +640,7 @@ const mapVariables = function (node, globals, opt, isExport) { } default: { - /* istanbul ignore next */ + /* c8 ignore next */ return false; } } @@ -685,7 +682,7 @@ const findNode = function (node, block, cache) { const props = ('props' in block && block.props) || ('body' in block && block.body); for (const propval of Object.values(props || {})) { if (Array.isArray(propval)) { - /* istanbul ignore if */ + /* c8 ignore next 5 */ if (propval.some((val) => { return findNode(node, val, blockCache); })) { @@ -784,7 +781,7 @@ const isExportByAncestor = function (nde) { * @returns {boolean} */ const findExportedNode = function (block, node, cache) { - /* istanbul ignore if */ + /* c8 ignore next 3 */ if (block === null) { return false; } @@ -857,7 +854,7 @@ const parseRecursive = function (node, globalVars, opts) { * @returns {CreatedNode} */ const parse = function (ast, node, opt) { - /* istanbul ignore next */ + /* c8 ignore next 6 */ const opts = opt || { ancestorsOnly: false, esm: true, diff --git a/src/index.js b/src/index.js index 59ff98670..cbbfc917e 100644 --- a/src/index.js +++ b/src/index.js @@ -244,7 +244,7 @@ const createRecommendedTypeScriptFlavorRuleset = (warnOrError, flat) => { }; }; -/* istanbul ignore if -- TS */ +/* c8 ignore next 3 -- TS */ if (!index.configs) { throw new Error('TypeScript guard'); } diff --git a/src/iterateJsdoc.js b/src/iterateJsdoc.js index ecb509824..0c20a3ce5 100644 --- a/src/iterateJsdoc.js +++ b/src/iterateJsdoc.js @@ -687,18 +687,18 @@ const getUtils = ( ruleConfig, indent, ) => { - /* istanbul ignore next */ const ancestors = /** @type {import('eslint').Rule.Node[]} */ (node ? (sc.getAncestors ? ( sc.getAncestors(node) + /* c8 ignore next 4 */ ) : ( context.getAncestors() )) : []); - // istanbul ignore next -- Fallback to deprecated method + /* c8 ignore next -- Fallback to deprecated method */ const { sourceCode = context.getSourceCode(), } = context; @@ -937,7 +937,7 @@ const getUtils = ( return false; }); - /* istanbul ignore else -- Won't be called if missing */ + /* c8 ignore else -- Won't be called if missing */ if (descLines.length) { jsdoc.source.splice( /** @type {Integer} */ (startIdx), @@ -968,7 +968,7 @@ const getUtils = ( end, }, }, idx) => { - // istanbul ignore if -- Already checked + /* c8 ignore next 3 -- Already checked */ if (idx && (tag || end)) { return true; } @@ -1035,7 +1035,7 @@ const getUtils = ( }) => { return number === srcNumber; }); - // istanbul ignore else + // c8 ignore else if (sourceIndex > -1) { let spliceCount = 1; tagSource.slice(tagIdx + 1).some(({ @@ -1060,7 +1060,6 @@ const getUtils = ( end, } = jsdoc.source[spliceIdx].tokens; - /* istanbul ignore if -- Currently want to clear entirely if removing tags */ if ( spliceIdx === 0 && jsdoc.tags.length >= 2 || !removeEmptyBlock && (end || delimiter === '/**') @@ -1096,8 +1095,7 @@ const getUtils = ( return true; } - - // istanbul ignore next + /* c8 ignore next */ return false; }); for (const [ @@ -1240,7 +1238,7 @@ const getUtils = ( }) => { return number === srcNumber && !end; }); - // istanbul ignore else + // c8 ignore else if (sourceIndex > -1) { const lines = makeLines(); jsdoc.source.splice(sourceIndex + tagSourceOffset, 0, ...lines); @@ -1250,8 +1248,7 @@ const getUtils = ( return true; } - - // istanbul ignore next + /* c8 ignore next */ return false; }); @@ -1295,7 +1292,7 @@ const getUtils = ( postName = ''; } else if (postType) { postType = ''; - } else /* istanbul ignore else -- `comment-parser` prevents empty blocks currently per https://github.com/syavorsky/comment-parser/issues/128 */ if (postTag) { + } else /* c8 ignore else -- `comment-parser` prevents empty blocks currently per https://github.com/syavorsky/comment-parser/issues/128 */ if (postTag) { postTag = ''; } } @@ -1902,7 +1899,6 @@ const makeReport = (context, commentNode) => { }; // Todo: Remove ignore once `check-examples` can be restored for ESLint 8+ - // istanbul ignore if if ('column' in jsdocLoc && typeof jsdocLoc.column === 'number') { const colNumber = /** @type {import('eslint').AST.SourceLocation} */ ( commentNode.loc @@ -2151,7 +2147,7 @@ const iterateAllJsdocs = (iterator, ruleConfig, contexts, additiveCommentContext * @returns {void} */ const callIterator = (context, node, jsdocNodes, state, lastCall) => { - // istanbul ignore next -- Fallback to deprecated method + /* c8 ignore next -- Fallback to deprecated method */ const { sourceCode = context.getSourceCode(), } = context; @@ -2265,7 +2261,7 @@ const iterateAllJsdocs = (iterator, ruleConfig, contexts, additiveCommentContext return { // @ts-expect-error ESLint accepts create (context) { - // istanbul ignore next -- Fallback to deprecated method + /* c8 ignore next -- Fallback to deprecated method */ const { sourceCode = context.getSourceCode(), } = context; @@ -2344,7 +2340,7 @@ const iterateAllJsdocs = (iterator, ruleConfig, contexts, additiveCommentContext const checkFile = (iterator, ruleConfig) => { return { create (context) { - // istanbul ignore next -- Fallback to deprecated method + /* c8 ignore next -- Fallback to deprecated method */ const { sourceCode = context.getSourceCode(), } = context; @@ -2463,7 +2459,7 @@ export default function iterateJsdoc (iterator, ruleConfig) { } } - // istanbul ignore next -- Fallback to deprecated method + /* c8 ignore next -- Fallback to deprecated method */ const { sourceCode = context.getSourceCode(), } = context; diff --git a/src/jsdocUtils.js b/src/jsdocUtils.js index 8e6c015d9..4b9c67280 100644 --- a/src/jsdocUtils.js +++ b/src/jsdocUtils.js @@ -389,8 +389,8 @@ const getFunctionParameterNames = ( // The key of an object could also be a string or number case 'Literal': + /* c8 ignore next 2 -- `raw` may not be present in all parsers */ return /** @type {string} */ (param.key.raw || - // istanbul ignore next -- `raw` may not be present in all parsers param.key.value); // case 'MemberExpression': @@ -849,6 +849,7 @@ const getTagStructureForMode = (mode, structuredTags) => { try { overrideTagStructure(structuredTags, tagStruct); + /* c8 ignore next 3 */ } catch { // } @@ -1022,8 +1023,8 @@ const hasNonFunctionYield = (node, checkYieldReturnValue) => { }); } + /* c8 ignore next 2 -- In Babel? */ // @ts-expect-error In Babel? - // istanbul ignore next -- In Babel? case 'OptionalCallExpression': case 'CallExpression': return node.arguments.some((element) => { @@ -1112,24 +1113,24 @@ const hasNonFunctionYield = (node, checkYieldReturnValue) => { return hasNonFunctionYield(property, checkYieldReturnValue); }); - // istanbul ignore next -- In Babel? + /* c8 ignore next -- In Babel? */ case 'PropertyDefinition': /* eslint-disable no-fallthrough */ + /* c8 ignore next 2 -- In Babel? */ // @ts-expect-error In Babel? - // istanbul ignore next -- In Babel? case 'ObjectProperty': + /* c8 ignore next 2 -- In Babel? */ // @ts-expect-error In Babel? - // istanbul ignore next -- In Babel? case 'ClassProperty': case 'Property': /* eslint-enable no-fallthrough */ return node.computed && hasNonFunctionYield(node.key, checkYieldReturnValue) || hasNonFunctionYield(node.value, checkYieldReturnValue); + /* c8 ignore next 2 -- In Babel? */ // @ts-expect-error In Babel? - // istanbul ignore next -- In Babel? case 'ObjectMethod': + /* c8 ignore next 6 -- In Babel? */ // @ts-expect-error In Babel? - // istanbul ignore next -- In Babel? return node.computed && hasNonFunctionYield(node.key, checkYieldReturnValue) || // @ts-expect-error In Babel? node.arguments.some((nde) => { @@ -1143,16 +1144,16 @@ const hasNonFunctionYield = (node, checkYieldReturnValue) => { case 'TaggedTemplateExpression': return hasNonFunctionYield(node.quasi, checkYieldReturnValue); - // @ts-expect-error In Babel? // ?. - // istanbul ignore next -- In Babel? + /* c8 ignore next 2 -- In Babel? */ + // @ts-expect-error In Babel? case 'OptionalMemberExpression': case 'MemberExpression': return hasNonFunctionYield(node.object, checkYieldReturnValue) || hasNonFunctionYield(node.property, checkYieldReturnValue); + /* c8 ignore next 2 -- In Babel? */ // @ts-expect-error In Babel? - // istanbul ignore next -- In Babel? case 'Import': case 'ImportExpression': return hasNonFunctionYield(node.source, checkYieldReturnValue); diff --git a/src/rules/importsAsDependencies.js b/src/rules/importsAsDependencies.js index 435897cf4..75167b52c 100644 --- a/src/rules/importsAsDependencies.js +++ b/src/rules/importsAsDependencies.js @@ -25,19 +25,20 @@ const setDeps = function () { ); deps = new Set([ ...(pkg.dependencies ? + /* c8 ignore next 2 */ Object.keys(pkg.dependencies) : - // istanbul ignore next []), ...(pkg.devDependencies ? + /* c8 ignore next 2 */ Object.keys(pkg.devDependencies) : - // istanbul ignore next []), ]); + /* c8 ignore next -- our package.json exists */ } catch (error) { - // istanbul ignore next -- our package.json exists + /* c8 ignore next -- our package.json exists */ deps = null; + /* c8 ignore next 4 -- our package.json exists */ /* eslint-disable no-console -- Inform user */ - // istanbul ignore next -- our package.json exists console.log(error); /* eslint-enable no-console -- Inform user */ } @@ -50,12 +51,11 @@ export default iterateJsdoc(({ settings, utils, }) => { - // istanbul ignore if if (deps === undefined) { setDeps(); } - // istanbul ignore if -- our package.json exists + /* c8 ignore next 3 -- our package.json exists */ if (deps === null) { return; } @@ -74,7 +74,7 @@ export default iterateJsdoc(({ // eslint-disable-next-line no-loop-func -- Safe traverse(typeAst, (nde) => { - // istanbul ignore if -- TS guard + /* c8 ignore next 3 -- TS guard */ if (deps === null) { return; } diff --git a/src/rules/noUndefinedTypes.js b/src/rules/noUndefinedTypes.js index 4813fdb0a..4ed51f18d 100644 --- a/src/rules/noUndefinedTypes.js +++ b/src/rules/noUndefinedTypes.js @@ -179,7 +179,6 @@ export default iterateJsdoc(({ // If the file is a module, concat the variables from the module scope. .concat( - /* istanbul ignore next */ cjsOrESMScope ? globalScope.childScopes.flatMap(({ variables, @@ -189,6 +188,7 @@ export default iterateJsdoc(({ name, }) => { return name; + /* c8 ignore next */ }) : [], ) .concat(extraTypes) @@ -286,9 +286,9 @@ export default iterateJsdoc(({ report(`The type '${value}' is undefined.`, null, tag); } } else if (markVariablesAsUsed && !extraTypes.includes(value)) { - /* istanbul ignore else */ if (sourceCode.markVariableAsUsed) { sourceCode.markVariableAsUsed(value); + /* c8 ignore next 3 */ } else { context.markVariableAsUsed(value); } diff --git a/src/rules/requireJsdoc.js b/src/rules/requireJsdoc.js index fb74c0e1c..0ebcbb0a9 100644 --- a/src/rules/requireJsdoc.js +++ b/src/rules/requireJsdoc.js @@ -284,7 +284,7 @@ const getOptions = (context, settings) => { /** @type {import('eslint').Rule.RuleModule} */ export default { create (context) { - // istanbul ignore next -- Fallback to deprecated method + /* c8 ignore next -- Fallback to deprecated method */ const { sourceCode = context.getSourceCode(), } = context; diff --git a/src/rules/requireReturns.js b/src/rules/requireReturns.js index 26d04acb5..99fa077c7 100644 --- a/src/rules/requireReturns.js +++ b/src/rules/requireReturns.js @@ -104,7 +104,7 @@ export default iterateJsdoc(({ initModuleExports: Boolean(publicOnly?.cjs ?? true), initWindow: Boolean(publicOnly?.window ?? false), }; - // istanbul ignore next -- Fallback to deprecated method + /* c8 ignore next -- Fallback to deprecated method */ const { sourceCode = context.getSourceCode(), } = context; diff --git a/src/rules/sortTags.js b/src/rules/sortTags.js index 6616e24df..3ce942b13 100644 --- a/src/rules/sortTags.js +++ b/src/rules/sortTags.js @@ -246,7 +246,7 @@ export default iterateJsdoc(({ while (true) { const nextTokens = jsdoc.source[++newIdx]?.tokens; - /* istanbul ignore if -- Guard */ + /* c8 ignore next 3 -- Guard */ if (!nextTokens) { return; } diff --git a/src/utils/hasReturnValue.js b/src/utils/hasReturnValue.js index c5f9abd73..813585476 100644 --- a/src/utils/hasReturnValue.js +++ b/src/utils/hasReturnValue.js @@ -198,12 +198,10 @@ const allBrancheshaveReturnValues = (node, promFilter) => { try { hasReturnValue(node.finalizer, true, promFilter); } catch (error) { - // istanbul ignore else if (/** @type {Error} */ (error).message === 'Null return') { return false; } - - // istanbul ignore next + /* c8 ignore next 2 */ throw error; } @@ -274,8 +272,8 @@ const hasNonEmptyResolverCall = (node, resolverName) => { // Arrow function without block switch (node.type) { + /* c8 ignore next 2 -- In Babel? */ // @ts-expect-error Babel? - // istanbul ignore next -- In Babel? case 'OptionalCallExpression': case 'CallExpression': return /** @type {import('@typescript-eslint/types').TSESTree.Identifier} */ ( @@ -375,8 +373,8 @@ const hasNonEmptyResolverCall = (node, resolverName) => { return node.properties.some((property) => { return hasNonEmptyResolverCall(property, resolverName); }); + /* c8 ignore next 2 -- In Babel? */ // @ts-expect-error Babel? - // istanbul ignore next -- In Babel? case 'ClassMethod': case 'MethodDefinition': return node.decorators && node.decorators.some((decorator) => { @@ -385,24 +383,24 @@ const hasNonEmptyResolverCall = (node, resolverName) => { node.computed && hasNonEmptyResolverCall(node.key, resolverName) || hasNonEmptyResolverCall(node.value, resolverName); + /* c8 ignore next 2 -- In Babel? */ // @ts-expect-error Babel? - // istanbul ignore next -- In Babel? case 'ObjectProperty': /* eslint-disable no-fallthrough */ - // istanbul ignore next -- In Babel? + /* c8 ignore next -- In Babel? */ case 'PropertyDefinition': + /* c8 ignore next 2 -- In Babel? */ // @ts-expect-error Babel? - // istanbul ignore next -- In Babel? case 'ClassProperty': case 'Property': /* eslint-enable no-fallthrough */ return node.computed && hasNonEmptyResolverCall(node.key, resolverName) || hasNonEmptyResolverCall(node.value, resolverName); + /* c8 ignore next 2 -- In Babel? */ // @ts-expect-error Babel? - // istanbul ignore next -- In Babel? case 'ObjectMethod': + /* c8 ignore next 6 -- In Babel? */ // @ts-expect-error - // istanbul ignore next -- In Babel? return node.computed && hasNonEmptyResolverCall(node.key, resolverName) || // @ts-expect-error node.arguments.some((nde) => { @@ -433,16 +431,16 @@ const hasNonEmptyResolverCall = (node, resolverName) => { case 'TaggedTemplateExpression': return hasNonEmptyResolverCall(node.quasi, resolverName); - // @ts-expect-error Babel? // ?. - // istanbul ignore next -- In Babel? + /* c8 ignore next 2 -- In Babel? */ + // @ts-expect-error Babel? case 'OptionalMemberExpression': case 'MemberExpression': return hasNonEmptyResolverCall(node.object, resolverName) || hasNonEmptyResolverCall(node.property, resolverName); + /* c8 ignore next 2 -- In Babel? */ // @ts-expect-error Babel? - // istanbul ignore next -- In Babel? case 'Import': case 'ImportExpression': return hasNonEmptyResolverCall(node.source, resolverName); @@ -488,12 +486,11 @@ const hasValueOrExecutorHasNonEmptyResolveValue = (node, anyPromiseAsReturn, all try { hasReturn = hasReturnValue(nde, true, promiseFilter); } catch (error) { - // istanbul ignore else + // c8 ignore else if (/** @type {Error} */ (error).message === 'Null return') { return false; } - - // istanbul ignore next + /* c8 ignore next 2 */ throw error; } diff --git a/test/rules/assertions/flatConfig.js b/test/rules/assertions/flatConfig.js deleted file mode 100644 index 986e85eba..000000000 --- a/test/rules/assertions/flatConfig.js +++ /dev/null @@ -1,31 +0,0 @@ -import * as tsParser from '@typescript-eslint/parser'; - -export default { - 'valid-types': { - invalid: [], - valid: [ - { - code: ` - /** - * Foo function. - * - * @param {[number, string]} bar - The bar array. - */ - function foo(bar) {} - `, - languageOptions: { - parser: tsParser, - sourceType: 'module', - }, - // Need manual setting here until fixing: - // https://github.com/eslint/eslint/pull/16944 - // https://github.com/typescript-eslint/typescript-eslint/issues/6541 - settings: { - jsdoc: { - mode: 'typescript', - }, - }, - }, - ], - }, -}; diff --git a/test/rules/assertions/requireJsdoc.js b/test/rules/assertions/requireJsdoc.js index b6fa0af78..c8a6ab995 100644 --- a/test/rules/assertions/requireJsdoc.js +++ b/test/rules/assertions/requireJsdoc.js @@ -2068,6 +2068,8 @@ function quux (foo) { `, languageOptions: { globals: globals.node, + ecmaVersion: 6, + sourceType: 'module', }, errors: [ { @@ -2096,10 +2098,6 @@ function quux (foo) { } `, - languageOptions: { - ecmaVersion: 6, - sourceType: 'module', - }, }, { code: ` @@ -2109,6 +2107,8 @@ function quux (foo) { `, languageOptions: { globals: globals.node, + ecmaVersion: 6, + sourceType: 'module', }, errors: [ { @@ -2137,10 +2137,6 @@ function quux (foo) { } `, - languageOptions: { - ecmaVersion: 6, - sourceType: 'module', - }, }, { code: ` @@ -5363,6 +5359,8 @@ function quux (foo) { `, languageOptions: { globals: globals.node, + ecmaVersion: 6, + sourceType: 'module', }, options: [ { @@ -5376,10 +5374,6 @@ function quux (foo) { }, }, ], - languageOptions: { - ecmaVersion: 6, - sourceType: 'module', - }, }, { code: ` export function someMethod() { @@ -5388,6 +5382,8 @@ function quux (foo) { `, languageOptions: { globals: globals.node, + ecmaVersion: 6, + sourceType: 'module', }, options: [ { @@ -5401,10 +5397,6 @@ function quux (foo) { }, }, ], - languageOptions: { - ecmaVersion: 6, - sourceType: 'module', - }, }, { code: ` exports.someMethod = function() { diff --git a/test/rules/index.js b/test/rules/index.js index 54599466b..bfb1d525f 100644 --- a/test/rules/index.js +++ b/test/rules/index.js @@ -1,29 +1,23 @@ import config from '../../src/index.js'; -// import {fileURLToPath} from 'url'; +import {fileURLToPath} from 'url'; import camelCase from 'camelcase'; import { ESLint, RuleTester, } from 'eslint'; -import pkg from 'eslint/use-at-your-own-risk'; import { readFileSync, } from 'fs'; import defaultsDeep from 'lodash.defaultsdeep'; import { - // dirname, + dirname, join, } from 'path'; import semver from 'semver'; -// const __dirname = dirname(fileURLToPath(import.meta.url)); +const __dirname = dirname(fileURLToPath(import.meta.url)); const ruleTester = new RuleTester(); -const { - // Todo: Could submit this to @types/eslint - // @ts-expect-error - FlatRuleTester, -} = pkg; // eslint-disable-next-line complexity -- Temporary const main = async () => { @@ -161,27 +155,6 @@ const main = async () => { process.chdir(cwd); } } - - if (!process.env.npm_config_rule) { - // Catch syntax errors - let flatRuleNames; - try { - flatRuleNames = (await import('./assertions/flatConfig.js')).default; - } catch (error) { - // eslint-disable-next-line no-console -- Reporting back to tester - console.error(error); - return; - } - - const fakeRuleTester = new FlatRuleTester(); - for (const [ - ruleName, - assertions, - ] of Object.entries(flatRuleNames)) { - const rule = config.rules[ruleName]; - fakeRuleTester.run(ruleName, rule, assertions); - } - } }; -main(); +await main();