diff --git a/.eslintrc b/.eslintrc deleted file mode 100644 index 1e867ea..0000000 --- a/.eslintrc +++ /dev/null @@ -1,62 +0,0 @@ -{ - "root": true, - "env": { - "node": true, - "browser": true, - "es6": true, - }, - "extends": ["eslint:recommended", "prettier"], - "parserOptions": { - "sourceType": "module", - "ecmaVersion": "latest", - }, - "rules": { - "no-restricted-imports": [ - "warn", - { - "paths": [ - "array-includes", - "array.prototype.flat", - "array.prototype.flatmap", - "array.prototype.tosorted", - "object.entries", - "object.fromentries", - "object.hasown", - "object.values", - "string.prototype.matchall", - "has", - ], - }, - ], - "arrow-body-style": ["error", "as-needed"], - "class-methods-use-this": [ - "warn", - { "exceptMethods": ["toString", "shouldComponentUpdate"] }, - ], - "complexity": ["warn", { "max": 100 }], - "curly": ["error", "multi-line", "consistent"], - "eqeqeq": ["error", "smart"], - "no-async-promise-executor": "off", - "no-case-declarations": "off", - "no-constant-condition": ["error", { "checkLoops": false }], - "no-debugger": "off", - "no-empty": ["error", { "allowEmptyCatch": true }], - "no-inner-declarations": "off", - "no-lonely-if": "error", - "no-template-curly-in-string": "error", - "no-var": "error", - "object-shorthand": ["error", "always", { "ignoreConstructors": true }], - "one-var": ["error", { "var": "never", "let": "never" }], - "prefer-const": ["error", { "destructuring": "all" }], - "prefer-destructuring": [ - "warn", - { "AssignmentExpression": { "array": false, "object": false } }, - ], - "prefer-rest-params": "warn", - "prefer-spread": "warn", - "quote-props": ["error", "as-needed"], - "spaced-comment": ["error", "always", { "markers": ["/"] }], - "sort-imports": ["warn", { "ignoreDeclarationSort": true }], - "yoda": ["error", "never", { "exceptRange": true }], - }, -} diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..4a22b6e --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,180 @@ +module.exports = { + root: true, + plugins: ['unicorn', 'jsdoc'], + env: { node: true, browser: true, es2023: true }, + reportUnusedDisableDirectives: true, + parserOptions: { + project: true, + }, + ignorePatterns: [], + globals: {}, + extends: [ + 'eslint:recommended', + 'prettier', + 'plugin:@typescript-eslint/recommended-type-checked', + 'plugin:jsdoc/recommended-typescript', + ], + + overrides: [ + { + files: ['repl.ts', 'scripts/**/*.ts'], + rules: { 'no-console': 'off' }, + }, + { + files: ['.eslintrc.js', '.eslintrc.cjs', '*.config.js', 'index.js'], + extends: ['plugin:@typescript-eslint/disable-type-checked'], + rules: { 'rules/restrict-template-expressions': 'off' }, + }, + { + files: ['*.d.ts'], + rules: { '@typescript-eslint/consistent-type-imports': 'off' }, + }, + ], + rules: { + 'arrow-body-style': ['error', 'as-needed'], + 'class-methods-use-this': 'warn', + 'func-style': ['error', 'declaration', { allowArrowFunctions: true }], + 'no-async-promise-executor': 'off', + 'no-case-declarations': 'off', + 'no-console': 'warn', + 'no-constant-condition': ['error', { checkLoops: false }], + 'no-debugger': 'warn', + 'no-duplicate-imports': 'off', + 'no-empty': ['error', { allowEmptyCatch: true }], + 'no-inner-declarations': 'off', + 'no-lonely-if': 'error', + 'no-restricted-imports': [ + 'error', + { + paths: [ + { + name: 'crypto', + importNames: ['webcrypto'], + message: 'Use global `crypto` instead', + }, + ], + }, + ], + 'no-template-curly-in-string': 'error', + 'no-var': 'error', + 'object-shorthand': ['error', 'always', { ignoreConstructors: true }], + 'one-var': ['error', { var: 'never', let: 'never', const: 'never' }], + 'prefer-arrow-callback': 'off', + 'prefer-const': ['error', { destructuring: 'all' }], + 'prefer-destructuring': [ + 'warn', + { AssignmentExpression: { array: false, object: false } }, + ], + 'prefer-object-spread': 'error', + 'prefer-rest-params': 'warn', + 'prefer-spread': 'warn', + 'quote-props': ['error', 'as-needed'], + 'sort-imports': ['warn', { ignoreDeclarationSort: true }], + 'spaced-comment': [ + 'error', + 'always', + { markers: ['/', '#', '@'], block: { exceptions: ['@'] } }, + ], + complexity: ['warn', { max: 100 }], + curly: ['error', 'multi-line', 'consistent'], + eqeqeq: ['error', 'smart'], + yoda: ['error', 'never', { exceptRange: true }], + 'jsdoc/require-jsdoc': 'off', + '@typescript-eslint/ban-ts-comment': [ + 'error', + { + 'ts-expect-error': 'allow-with-description', + 'ts-check': false, + 'ts-ignore': 'allow-with-description', + 'ts-nocheck': 'allow-with-description', + }, + ], + '@typescript-eslint/consistent-type-imports': [ + 'error', + { + disallowTypeAnnotations: false, + fixStyle: 'inline-type-imports', + }, + ], + '@typescript-eslint/explicit-member-accessibility': [ + 'warn', + { accessibility: 'no-public' }, + ], + '@typescript-eslint/no-empty-interface': ['error', { allowSingleExtends: true }], + '@typescript-eslint/no-explicit-any': 'off', + '@typescript-eslint/no-misused-promises': ['error', { checksVoidReturn: false }], + '@typescript-eslint/no-namespace': 'off', + '@typescript-eslint/no-unnecessary-type-assertion': 'error', + '@typescript-eslint/no-unsafe-argument': 'off', + '@typescript-eslint/no-unsafe-assignment': 'off', + '@typescript-eslint/no-unsafe-call': 'off', + '@typescript-eslint/no-unsafe-member-access': 'off', + '@typescript-eslint/no-unsafe-return': 'off', + '@typescript-eslint/no-unused-vars': 'off', + '@typescript-eslint/no-use-before-define': 'off', + '@typescript-eslint/no-var-requires': 'off', + '@typescript-eslint/restrict-template-expressions': 'off', + '@typescript-eslint/triple-slash-reference': 'off', + '@typescript-eslint/unbound-method': 'off', + 'unicorn/better-regex': 'error', + 'unicorn/consistent-function-scoping': 'warn', + 'unicorn/escape-case': 'error', + 'unicorn/no-array-for-each': 'warn', + 'unicorn/no-array-method-this-argument': 'error', + 'unicorn/no-array-push-push': 'warn', + 'unicorn/no-console-spaces': 'warn', + 'unicorn/no-for-loop': 'warn', + 'unicorn/no-instanceof-array': 'error', + 'unicorn/no-lonely-if': 'warn', + 'unicorn/no-static-only-class': 'error', + 'unicorn/no-typeof-undefined': 'error', + 'unicorn/no-useless-fallback-in-spread': 'error', + 'unicorn/no-useless-promise-resolve-reject': 'error', + 'unicorn/no-useless-spread': 'error', + 'unicorn/no-useless-switch-case': 'error', + 'unicorn/prefer-array-find': 'error', + 'unicorn/prefer-array-flat-map': 'error', + 'unicorn/prefer-array-some': 'error', + 'unicorn/prefer-at': 'error', + 'unicorn/prefer-blob-reading-methods': 'error', + 'unicorn/prefer-date-now': 'error', + 'unicorn/prefer-default-parameters': 'warn', + 'unicorn/prefer-dom-node-dataset': 'error', + 'unicorn/prefer-dom-node-remove': 'error', + 'unicorn/prefer-export-from': ['error', { ignoreUsedVariables: false }], + 'unicorn/prefer-includes': 'error', + 'unicorn/prefer-keyboard-event-key': 'warn', + 'unicorn/prefer-logical-operator-over-ternary': 'warn', + 'unicorn/prefer-math-trunc': 'error', + 'unicorn/prefer-modern-math-apis': 'error', + 'unicorn/prefer-negative-index': 'error', + 'unicorn/prefer-node-protocol': 'error', + 'unicorn/prefer-object-from-entries': 'error', + 'unicorn/prefer-optional-catch-binding': 'error', + 'unicorn/prefer-reflect-apply': 'error', + 'unicorn/prefer-regexp-test': 'error', + 'unicorn/prefer-set-has': 'warn', + 'unicorn/prefer-string-slice': 'error', + 'unicorn/prefer-string-starts-ends-with': 'warn', + 'unicorn/prefer-string-trim-start-end': 'error', + 'unicorn/prefer-ternary': 'warn', + 'unicorn/string-content': [ + 'warn', + { + patterns: { + '->': { suggest: '→', fix: false }, + '=>': { suggest: '⇒', fix: false }, + '<-': { suggest: '←', fix: false }, + '<=': { suggest: '≤', fix: false }, + '>=': { suggest: '≥', fix: false }, + '!=': { suggest: '≠', fix: false }, + '<=>': { suggest: '⇔', fix: false }, + '\\.\\.\\.': { suggest: '…', fix: false }, + "'s ": { suggest: '’s ', fix: false }, + }, + }, + ], + 'unicorn/template-indent': 'warn', + }, + parser: '@typescript-eslint/parser', +}; diff --git a/dist/index.d.ts b/dist/index.d.ts index ab15849..21cf707 100644 --- a/dist/index.d.ts +++ b/dist/index.d.ts @@ -5,6 +5,17 @@ import { ESLintUtils } from '@typescript-eslint/utils'; import { Rule } from 'eslint'; import { Merge, SetRequired } from 'type-fest'; +export type OptionalObjectKey = Exclude<{ + [Key in keyof T]: undefined | any[] extends T[Key] ? Key : undefined | Record extends T[Key] ? Key : never; +}[keyof T], undefined>; +export type MiddlewareConfig = Merge>, { + extends: KnownExtends[]; +}>; +export interface MiddlewareFunctions { + addRules(rules: Partial): void; + addSettings(settings: Partial): void; +} +export type Middleware = (config: MiddlewareConfig, helpers: MiddlewareFunctions) => void; export declare const error = "error"; export declare const warn = "warn"; export declare const off = "off"; @@ -39,7 +50,6 @@ export interface CustomRule { }>; options?: RuleLevel; } -export type Middleware = (config: MiddlewareConfig, helpers: MiddlewareFunctions) => void; /** * ESLint Configuration. * @see [ESLint Configuration](https://eslint.org/docs/latest/user-guide/configuring/) @@ -62,16 +72,6 @@ export type InputConfig = Omit & { */ auto?: boolean; }; -export type OptionalObjectKey = Exclude<{ - [Key in keyof T]: undefined | any[] extends T[Key] ? Key : undefined | Record extends T[Key] ? Key : never; -}[keyof T], undefined>; -export type MiddlewareConfig = Merge>, { - extends: KnownExtends[]; -}>; -export interface MiddlewareFunctions { - addRules(rules: Partial): void; - addSettings(settings: Partial): void; -} /** * Returns a ESLint config object. * diff --git a/dist/package.json b/dist/package.json index 2d321ce..8acce6b 100644 --- a/dist/package.json +++ b/dist/package.json @@ -1,6 +1,6 @@ { "name": "@aet/eslint-rules", - "version": "1.0.1-beta.16", + "version": "1.0.1-beta.18", "license": "UNLICENSED", "bin": { "eslint-install": "install.js", diff --git a/package.json b/package.json index ceb8b8c..05907a3 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "build": "./scripts/build.ts", "check-import": "./scripts/check-imports.ts", "define": "/usr/local/bin/codium ./packages/eslint-define-config", - "do": "yarn build; (cd dist && ver bump && npm publish)" + "do": "yarn build; (cd dist && ver bump && npm publish && ver unpub)" }, "private": true, "devDependencies": { @@ -34,6 +34,8 @@ "eslint": "8.57.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-import-x": "^3.1.0", + "eslint-plugin-jsdoc": "^48.11.0", + "eslint-plugin-unicorn": "^55.0.0", "esprima": "^4.0.1", "esquery": "^1.6.0", "fast-glob": "^3.3.2", @@ -59,6 +61,7 @@ }, "pnpm": { "overrides": { + "@typescript-eslint/utils": "8.0.0", "function-bind": "npm:@nolyfill/function-bind@^1", "has-proto": "npm:@nolyfill/has-proto@^1", "has-symbols": "npm:@nolyfill/has-symbols@^1", @@ -70,6 +73,9 @@ "@babel/types": "7.25.2", "is-core-module": "npm:@nolyfill/is-core-module@^1", "json-stable-stringify": "npm:@nolyfill/json-stable-stringify@^1" + }, + "patchedDependencies": { + "@typescript-eslint/typescript-estree@8.0.0": "patches/@typescript-eslint__typescript-estree@8.0.0.patch" } } -} \ No newline at end of file +} diff --git a/patches/@typescript-eslint__typescript-estree@8.0.0.patch b/patches/@typescript-eslint__typescript-estree@8.0.0.patch new file mode 100644 index 0000000..d0aeba0 --- /dev/null +++ b/patches/@typescript-eslint__typescript-estree@8.0.0.patch @@ -0,0 +1,25 @@ +diff --git a/dist/parseSettings/createParseSettings.js b/dist/parseSettings/createParseSettings.js +index 4c8b40ae895d45bd7dfcf64c8e49e29ce48dd663..0a62880ff50b7341fa909155293cbdb77fa99c97 100644 +--- a/dist/parseSettings/createParseSettings.js ++++ b/dist/parseSettings/createParseSettings.js +@@ -1,4 +1,5 @@ + "use strict"; ++var fs = require("node:fs"); + var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); +@@ -89,10 +90,12 @@ function createParseSettings(code, tsestreeOptions = {}) { + tsestreeOptions.extraFileExtensions.every(ext => typeof ext === 'string') + ? tsestreeOptions.extraFileExtensions + : [], +- filePath: (0, shared_1.ensureAbsolutePath)(typeof tsestreeOptions.filePath === 'string' && ++ filePath: fs.realpathSync( ++ (0, shared_1.ensureAbsolutePath)(typeof tsestreeOptions.filePath === 'string' && + tsestreeOptions.filePath !== '' + ? tsestreeOptions.filePath +- : getFileName(tsestreeOptions.jsx), tsconfigRootDir), ++ : getFileName(tsestreeOptions.jsx), tsconfigRootDir) ++ ), + jsDocParsingMode, + jsx: tsestreeOptions.jsx === true, + loc: tsestreeOptions.loc === true, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index aca65e3..49e56b9 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -5,6 +5,7 @@ settings: excludeLinksFromLockfile: false overrides: + '@typescript-eslint/utils': 8.0.0 function-bind: npm:@nolyfill/function-bind@^1 has-proto: npm:@nolyfill/has-proto@^1 has-symbols: npm:@nolyfill/has-symbols@^1 @@ -17,6 +18,11 @@ overrides: is-core-module: npm:@nolyfill/is-core-module@^1 json-stable-stringify: npm:@nolyfill/json-stable-stringify@^1 +patchedDependencies: + '@typescript-eslint/typescript-estree@8.0.0': + hash: zlal42evfhopemboiioznx3k3i + path: patches/@typescript-eslint__typescript-estree@8.0.0.patch + importers: .: @@ -74,9 +80,9 @@ importers: version: 8.0.0 '@typescript-eslint/typescript-estree': specifier: ^8.0.0 - version: 8.0.0(typescript@5.5.4) + version: 8.0.0(patch_hash=zlal42evfhopemboiioznx3k3i)(typescript@5.5.4) '@typescript-eslint/utils': - specifier: ^8.0.0 + specifier: 8.0.0 version: 8.0.0(eslint@8.57.0)(typescript@5.5.4) babel-plugin-macros: specifier: ^3.1.0 @@ -99,6 +105,12 @@ importers: eslint-plugin-import-x: specifier: ^3.1.0 version: 3.1.0(eslint@8.57.0)(typescript@5.5.4) + eslint-plugin-jsdoc: + specifier: ^48.11.0 + version: 48.11.0(eslint@8.57.0) + eslint-plugin-unicorn: + specifier: ^55.0.0 + version: 55.0.0(eslint@8.57.0) esprima: specifier: ^4.0.1 version: 4.0.1 @@ -739,6 +751,10 @@ packages: resolution: {integrity: sha512-YTnYtra7W9e6/oAZEHj0bJehPRUlLH9/fbpT5LfB0NhQXyALCRkRs3zH9v07IYhkgpqX6Z78FnuccZr/l4Fs4Q==} engines: {node: '>=6.9.0'} + '@es-joy/jsdoccomment@0.46.0': + resolution: {integrity: sha512-C3Axuq1xd/9VqFZpW4YAzOx5O9q/LP46uIQy/iNDpHG3fmPa6TBtvfglMCs3RBiBxAIi0Go97r8+jvTt55XMyQ==} + engines: {node: '>=16'} + '@esbuild/aix-ppc64@0.23.0': resolution: {integrity: sha512-3sG8Zwa5fMcA9bgqB8AfWPQ+HFke6uD3h1s3RIwUNK8EG7a4buxvuFTs3j1IMs2NXAk9F30C/FF4vxRgQCcmoQ==} engines: {node: '>=18'} @@ -959,6 +975,10 @@ packages: resolution: {integrity: sha512-o1iEMo6ad7T2cKxZTzAb3u+Q3/H21SSsKFf5oAVn7PjmT7MJ0Ek2SeVcEdgVUmLmj31/jKo7U5zJWcTaC10Qow==} engines: {node: '>=12.4.0'} + '@pkgr/core@0.1.1': + resolution: {integrity: sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA==} + engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0} + '@types/babel-plugin-macros@3.1.3': resolution: {integrity: sha512-JU+MgpsHK3taY18mBETy5XlwY6LVngte7QXYzUuXEaaX0CN8dBqbjXtADe+gJmkSQE1FJHufzPj++OWZlhRmGw==} @@ -998,6 +1018,9 @@ packages: '@types/node@22.1.0': resolution: {integrity: sha512-AOmuRF0R2/5j1knA3c6G3HOk523Ga+l+ZXltX8SF1+5oqcXijjfTd8fY3XRZqSihEu9XhtQnKYLmkFaoxgsJHw==} + '@types/normalize-package-data@2.4.4': + resolution: {integrity: sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==} + '@types/parse-json@4.0.2': resolution: {integrity: sha512-dISoDXWWQwUquiKsyZ4Ng+HX2KsPL7LyHKHQwgGFEA3IaKac4Obd+h2a/a6waisAoepJlBcx9paWqjA8/HVjCw==} @@ -1022,10 +1045,6 @@ packages: typescript: optional: true - '@typescript-eslint/scope-manager@7.18.0': - resolution: {integrity: sha512-jjhdIE/FPF2B7Z1uzc6i3oWKbGcHb87Qw7AWj6jmEqNOfDFbJWtjt/XfwCpvNkpGWlcJaog5vTR+VV8+w9JflA==} - engines: {node: ^18.18.0 || >=20.0.0} - '@typescript-eslint/scope-manager@8.0.0': resolution: {integrity: sha512-V0aa9Csx/ZWWv2IPgTfY7T4agYwJyILESu/PVqFtTFz9RIS823mAze+NbnBI8xiwdX3iqeQbcTYlvB04G9wyQw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -1039,23 +1058,10 @@ packages: typescript: optional: true - '@typescript-eslint/types@7.18.0': - resolution: {integrity: sha512-iZqi+Ds1y4EDYUtlOOC+aUmxnE9xS/yCigkjA7XpTKV6nCBd3Hp/PRGGmdwnfkV2ThMyYldP1wRpm/id99spTQ==} - engines: {node: ^18.18.0 || >=20.0.0} - '@typescript-eslint/types@8.0.0': resolution: {integrity: sha512-wgdSGs9BTMWQ7ooeHtu5quddKKs5Z5dS+fHLbrQI+ID0XWJLODGMHRfhwImiHoeO2S5Wir2yXuadJN6/l4JRxw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript-eslint/typescript-estree@7.18.0': - resolution: {integrity: sha512-aP1v/BSPnnyhMHts8cf1qQ6Q1IFwwRvAQGRvBFkWlo3/lH29OXA3Pts+c10nxRxIBrDnoMqzhgdwVe5f2D6OzA==} - engines: {node: ^18.18.0 || >=20.0.0} - peerDependencies: - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - '@typescript-eslint/typescript-estree@8.0.0': resolution: {integrity: sha512-5b97WpKMX+Y43YKi4zVcCVLtK5F98dFls3Oxui8LbnmRsseKenbbDinmvxrWegKDMmlkIq/XHuyy0UGLtpCDKg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -1065,22 +1071,12 @@ packages: typescript: optional: true - '@typescript-eslint/utils@7.18.0': - resolution: {integrity: sha512-kK0/rNa2j74XuHVcoCZxdFBMF+aq/vH83CXAOHieC+2Gis4mF8jJXT5eAfyD3K0sAxtPuwxaIOIOvhwzVDt/kw==} - engines: {node: ^18.18.0 || >=20.0.0} - peerDependencies: - eslint: ^8.56.0 - '@typescript-eslint/utils@8.0.0': resolution: {integrity: sha512-k/oS/A/3QeGLRvOWCg6/9rATJL5rec7/5s1YmdS0ZU6LHveJyGFwBvLhSRBv6i9xaj7etmosp+l+ViN1I9Aj/Q==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 - '@typescript-eslint/visitor-keys@7.18.0': - resolution: {integrity: sha512-cDF0/Gf81QpY3xYyJKDV14Zwdmid5+uuENhjH2EqFaF0ni+yAyq/LzMaIJdhNJXZI7uLzwIlA+V7oWoyn6Curg==} - engines: {node: ^18.18.0 || >=20.0.0} - '@typescript-eslint/visitor-keys@8.0.0': resolution: {integrity: sha512-oN0K4nkHuOyF3PVMyETbpP5zp6wfyOvm7tWhTMfoqxSSsPmJIh6JNASuZDlODE8eE+0EB9uar+6+vxr9DBTYOA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -1116,6 +1112,10 @@ packages: resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} engines: {node: '>=8'} + are-docs-informative@0.0.2: + resolution: {integrity: sha512-ixiS0nLNNG5jNQzgZJNoUpBKdo9yTYZMGJ+QgT2jmjR7G7+QHRCc4v6LQ3NgE7EBJq+o0ams3waJwkrlBom8Ig==} + engines: {node: '>=14'} + argparse@2.0.1: resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} @@ -1167,6 +1167,10 @@ packages: buffer-from@1.1.2: resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==} + builtin-modules@3.3.0: + resolution: {integrity: sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==} + engines: {node: '>=6'} + call-me-maybe@1.0.2: resolution: {integrity: sha512-HpX65o1Hnr9HH25ojC1YGs7HCQLq0GCOibSaWER0eNpgJ/Z1MZv2mTc7+xh6WOPxbRVcmgbv4hGU+uSQ/2xFZQ==} @@ -1189,6 +1193,14 @@ packages: resolution: {integrity: sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==} engines: {node: '>=8'} + ci-info@4.0.0: + resolution: {integrity: sha512-TdHqgGf9odd8SXNuxtUBVx8Nv+qZOejE6qyqiy5NtbYYQOeFa6zmHkxlPzmaLxWWHsU6nJmB7AETdVPi+2NBUg==} + engines: {node: '>=8'} + + clean-regexp@1.0.0: + resolution: {integrity: sha512-GfisEZEJvzKrmGWkvfhgzcz/BllN1USeqD2V6tg14OAOgaCD2Z/PUEuxnAZ/nPvmaHRG7a8y77p1T/IRQ4D1Hw==} + engines: {node: '>=4'} + cliui@8.0.1: resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} engines: {node: '>=12'} @@ -1209,6 +1221,10 @@ packages: commander@2.20.3: resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==} + comment-parser@1.4.1: + resolution: {integrity: sha512-buhp5kePrmda3vhc5B9t7pUQXAb2Tnd0qgpkIhPhkHXxJpiPJ11H0ZEU0oBpJ2QztSbzG/ZxMj/CHsYJqRHmyg==} + engines: {node: '>= 12.0.0'} + common-path-prefix@3.0.0: resolution: {integrity: sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==} @@ -1271,6 +1287,9 @@ packages: error-ex@1.3.2: resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==} + es-module-lexer@1.5.4: + resolution: {integrity: sha512-MVNK56NiMrOwitFB7cqDwq0CQutbw+0BvLshJSse0MUNU+y1FC3bUS/AQg7oUng+/wKrrki7JfmwtVHkVfPLlw==} + esbuild-plugin-alias@0.2.1: resolution: {integrity: sha512-jyfL/pwPqaFXyKnj8lP8iLk6Z0m099uXR45aSN8Av1XD4vhvQutxxPzgA2bTcAwQpa1zCXDcWOlhFgyP3GKqhQ==} @@ -1306,6 +1325,18 @@ packages: peerDependencies: eslint: ^8.56.0 || ^9.0.0-0 + eslint-plugin-jsdoc@48.11.0: + resolution: {integrity: sha512-d12JHJDPNo7IFwTOAItCeJY1hcqoIxE0lHA8infQByLilQ9xkqrRa6laWCnsuCrf+8rUnvxXY1XuTbibRBNylA==} + engines: {node: '>=18'} + peerDependencies: + eslint: ^7.0.0 || ^8.0.0 || ^9.0.0 + + eslint-plugin-unicorn@55.0.0: + resolution: {integrity: sha512-n3AKiVpY2/uDcGrS3+QsYDkjPfaOrNrsfQxU9nt5nitd9KuvVXrfAvgCO9DYPSfap+Gqjw9EOrXIsBp5tlHZjA==} + engines: {node: '>=18.18'} + peerDependencies: + eslint: '>=8.56.0' + eslint-scope@7.2.2: resolution: {integrity: sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -1314,11 +1345,19 @@ packages: resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + eslint-visitor-keys@4.0.0: + resolution: {integrity: sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + eslint@8.57.0: resolution: {integrity: sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} hasBin: true + espree@10.1.0: + resolution: {integrity: sha512-M1M6CpiE6ffoigIOWYO9UDP8TMUw9kqb21tf+08IgDYjCsOvCuDt4jQcZmoYxx+w7zlKw9/N0KXfto+I8/FrXA==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + espree@9.6.1: resolution: {integrity: sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -1372,6 +1411,10 @@ packages: resolution: {integrity: sha512-OuWNfjfP05JcpAP3JPgAKUhWefjMRfI5iAoSsvE24ANYWJaepAtlSgWECSVEuRgSXpyNEc9DJwG/TZpgcOqyig==} engines: {node: '>=16'} + find-up@4.1.0: + resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==} + engines: {node: '>=8'} + find-up@5.0.0: resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==} engines: {node: '>=10'} @@ -1428,6 +1471,10 @@ packages: resolution: {integrity: sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==} engines: {node: '>=8'} + globals@15.9.0: + resolution: {integrity: sha512-SmSKyLLKFbSr6rptvP8izbyxJL4ILwqO9Jg23UA0sDlGlu58V59D1//I3vlc0KJphVdUR7vMjHIplYnzBxorQA==} + engines: {node: '>=18'} + globby@11.1.0: resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==} engines: {node: '>=10'} @@ -1446,6 +1493,9 @@ packages: resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} engines: {node: '>=8'} + hosted-git-info@2.8.9: + resolution: {integrity: sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==} + ignore@5.3.1: resolution: {integrity: sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==} engines: {node: '>= 4'} @@ -1458,6 +1508,10 @@ packages: resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} engines: {node: '>=0.8.19'} + indent-string@4.0.0: + resolution: {integrity: sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==} + engines: {node: '>=8'} + inflight@1.0.6: resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} deprecated: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. @@ -1468,6 +1522,10 @@ packages: is-arrayish@0.2.1: resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==} + is-builtin-module@3.2.1: + resolution: {integrity: sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A==} + engines: {node: '>=6'} + is-docker@2.2.1: resolution: {integrity: sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==} engines: {node: '>=8'} @@ -1507,6 +1565,10 @@ packages: resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} hasBin: true + jsdoc-type-pratt-parser@4.0.0: + resolution: {integrity: sha512-YtOli5Cmzy3q4dP26GraSOeAhqecewG04hoO8DY56CH4KJ9Fvv5qKWUCCo3HZob7esJQHCv6/+bnTy72xZZaVQ==} + engines: {node: '>=12.0.0'} + jsesc@0.5.0: resolution: {integrity: sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA==} hasBin: true @@ -1516,6 +1578,11 @@ packages: engines: {node: '>=4'} hasBin: true + jsesc@3.0.2: + resolution: {integrity: sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g==} + engines: {node: '>=6'} + hasBin: true + json-buffer@3.0.1: resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==} @@ -1553,6 +1620,10 @@ packages: lines-and-columns@1.2.4: resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} + locate-path@5.0.0: + resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==} + engines: {node: '>=8'} + locate-path@6.0.0: resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} engines: {node: '>=10'} @@ -1585,6 +1656,10 @@ packages: resolution: {integrity: sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==} engines: {node: '>=8.6'} + min-indent@1.0.1: + resolution: {integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==} + engines: {node: '>=4'} + minimatch@3.1.2: resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} @@ -1612,6 +1687,9 @@ packages: engines: {node: '>=12.4.0'} hasBin: true + normalize-package-data@2.5.0: + resolution: {integrity: sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==} + object-assign@4.1.1: resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} engines: {node: '>=0.10.0'} @@ -1631,6 +1709,10 @@ packages: resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==} engines: {node: '>=0.10.0'} + p-limit@2.3.0: + resolution: {integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==} + engines: {node: '>=6'} + p-limit@3.1.0: resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==} engines: {node: '>=10'} @@ -1639,6 +1721,10 @@ packages: resolution: {integrity: sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + p-locate@4.1.0: + resolution: {integrity: sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==} + engines: {node: '>=8'} + p-locate@5.0.0: resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==} engines: {node: '>=10'} @@ -1647,10 +1733,18 @@ packages: resolution: {integrity: sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + p-try@2.2.0: + resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==} + engines: {node: '>=6'} + parent-module@1.0.1: resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} engines: {node: '>=6'} + parse-imports@2.1.1: + resolution: {integrity: sha512-TDT4HqzUiTMO1wJRwg/t/hYk8Wdp3iF/ToMIlAoVQfL1Xs/sTxq1dKWSMjMbQmIarfWKymOyly40+zmPHXMqCA==} + engines: {node: '>= 18'} + parse-json@5.2.0: resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} engines: {node: '>=8'} @@ -1694,6 +1788,10 @@ packages: resolution: {integrity: sha512-Ie9z/WINcxxLp27BKOCHGde4ITq9UklYKDzVo1nhk5sqGEXU3FpkwP5GM2voTGJkGd9B3Otl+Q4uwSOeSUtOBA==} engines: {node: '>=14.16'} + pluralize@8.0.0: + resolution: {integrity: sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==} + engines: {node: '>=4'} + prelude-ls@1.2.1: resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} engines: {node: '>= 0.8.0'} @@ -1716,6 +1814,14 @@ packages: react-is@16.13.1: resolution: {integrity: sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==} + read-pkg-up@7.0.1: + resolution: {integrity: sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==} + engines: {node: '>=8'} + + read-pkg@5.2.0: + resolution: {integrity: sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==} + engines: {node: '>=8'} + regenerate-unicode-properties@10.1.1: resolution: {integrity: sha512-X007RyZLsCJVVrjgEFVpLUTZwyOZk3oiL75ZcuYjlIWd6rNJtOjkBwQc5AsRrpbKVkxN6sklw/k/9m2jJYOf8Q==} engines: {node: '>=4'} @@ -1729,10 +1835,18 @@ packages: regenerator-transform@0.15.2: resolution: {integrity: sha512-hfMp2BoF0qOk3uc5V20ALGDS2ddjQaLrdl7xrGXvAIow7qeWRM2VA2HuCHkUKk9slq3VwEwLNK3DFBqDfPGYtg==} + regexp-tree@0.1.27: + resolution: {integrity: sha512-iETxpjK6YoRWJG5o6hXLwvjYAoW+FEZn9os0PD/b6AP6xQwsa/Y7lCVgIixBbUPMfhu+i2LtdeAqVTgGlQarfA==} + hasBin: true + regexpu-core@5.3.2: resolution: {integrity: sha512-RAM5FlZz+Lhmo7db9L298p2vHP5ZywrVXmVXpmAD9GuL5MPH6t9ROw1iA/wfHkQ76Qe7AaPF0nGuim96/IrQMQ==} engines: {node: '>=4'} + regjsparser@0.10.0: + resolution: {integrity: sha512-qx+xQGZVsy55CH0a1hiVwHmqjLryfh7wQyF5HO07XJ9f7dQMY/gPQHhlyDkIzJKC+x2fUCpCcUODUUUFrm7SHA==} + hasBin: true + regjsparser@0.9.1: resolution: {integrity: sha512-dQUtn90WanSNl+7mQKcXAgZxvUe7Z0SqXlgzv0za4LwiUhyzBC58yQO3liFoUgu8GiJVInAhJjkj1N0EtQ5nkQ==} hasBin: true @@ -1769,6 +1883,10 @@ packages: run-parallel@1.2.0: resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} + semver@5.7.2: + resolution: {integrity: sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==} + hasBin: true + semver@6.3.1: resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} hasBin: true @@ -1794,6 +1912,9 @@ packages: resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} engines: {node: '>=8'} + slashes@3.0.12: + resolution: {integrity: sha512-Q9VME8WyGkc7pJf6QEkj3wE+2CnvZMI+XJhwdTPR8Z/kWQRXi7boAWLDibRPyHRTUTPx5FaU7MsyrjI3yLB4HA==} + source-map-support@0.5.21: resolution: {integrity: sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==} @@ -1801,6 +1922,21 @@ packages: resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} engines: {node: '>=0.10.0'} + spdx-correct@3.2.0: + resolution: {integrity: sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==} + + spdx-exceptions@2.5.0: + resolution: {integrity: sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==} + + spdx-expression-parse@3.0.1: + resolution: {integrity: sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==} + + spdx-expression-parse@4.0.0: + resolution: {integrity: sha512-Clya5JIij/7C6bRR22+tnGXbc4VKlibKSVj2iHvVeX5iMW7s1SIQlqu699JkODJJIhh/pUu8L0/VLh8xflD+LQ==} + + spdx-license-ids@3.0.18: + resolution: {integrity: sha512-xxRs31BqRYHwiMzudOrpSiHtZ8i/GeionCBDSilhYRj+9gIcI8wCZTlXZKu9vZIVqViP3dcp9qE5G6AlIaD+TQ==} + stable-hash@0.0.4: resolution: {integrity: sha512-LjdcbuBeLcdETCrPn9i8AYAZ1eCtu4ECAWtP7UleOiZ9LzVxRzzUZEoZ8zB24nhkQnDWyET0I+3sWokSDS3E7g==} @@ -1816,6 +1952,10 @@ packages: resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} engines: {node: '>=8'} + strip-indent@3.0.0: + resolution: {integrity: sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==} + engines: {node: '>=8'} + strip-json-comments@3.1.1: resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} engines: {node: '>=8'} @@ -1832,6 +1972,10 @@ packages: resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} engines: {node: '>= 0.4'} + synckit@0.9.1: + resolution: {integrity: sha512-7gr8p9TQP6RAHusBOSLs46F4564ZrjV8xFmw5zCmgmhGUcw2hxsShhJ6CEiHQMgPDwAQ1fWHPM0ypc4RMAig4A==} + engines: {node: ^14.18.0 || >=16.0.0} + terser@5.31.3: resolution: {integrity: sha512-pAfYn3NIZLyZpa83ZKigvj6Rn9c/vd5KfYGX7cN1mnzqgDcxWvrU5ZtAfIKhEXz9nRecw4z3LXkjaq96/qZqAA==} engines: {node: '>=10'} @@ -1876,6 +2020,14 @@ packages: resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==} engines: {node: '>=10'} + type-fest@0.6.0: + resolution: {integrity: sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==} + engines: {node: '>=8'} + + type-fest@0.8.1: + resolution: {integrity: sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==} + engines: {node: '>=8'} + type-fest@4.23.0: resolution: {integrity: sha512-ZiBujro2ohr5+Z/hZWHESLz3g08BBdrdLMieYFULJO+tWc437sn8kQsWLJoZErY8alNhxre9K4p3GURAG11n+w==} engines: {node: '>=16'} @@ -1917,6 +2069,9 @@ packages: uri-js@4.4.1: resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} + validate-npm-package-license@3.0.4: + resolution: {integrity: sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==} + which@2.0.2: resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} engines: {node: '>= 8'} @@ -2750,6 +2905,12 @@ snapshots: '@babel/helper-validator-identifier': 7.24.7 to-fast-properties: 2.0.0 + '@es-joy/jsdoccomment@0.46.0': + dependencies: + comment-parser: 1.4.1 + esquery: 1.6.0 + jsdoc-type-pratt-parser: 4.0.0 + '@esbuild/aix-ppc64@0.23.0': optional: true @@ -2902,6 +3063,8 @@ snapshots: '@nolyfill/json-stable-stringify@1.0.30': {} + '@pkgr/core@0.1.1': {} + '@types/babel-plugin-macros@3.1.3': dependencies: '@types/babel__core': 7.20.5 @@ -2954,6 +3117,8 @@ snapshots: dependencies: undici-types: 6.13.0 + '@types/normalize-package-data@2.4.4': {} + '@types/parse-json@4.0.2': {} '@typescript-eslint/eslint-plugin@8.0.0(@typescript-eslint/parser@8.0.0(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(typescript@5.5.4)': @@ -2978,7 +3143,7 @@ snapshots: dependencies: '@typescript-eslint/scope-manager': 8.0.0 '@typescript-eslint/types': 8.0.0 - '@typescript-eslint/typescript-estree': 8.0.0(typescript@5.5.4) + '@typescript-eslint/typescript-estree': 8.0.0(patch_hash=zlal42evfhopemboiioznx3k3i)(typescript@5.5.4) '@typescript-eslint/visitor-keys': 8.0.0 debug: 4.3.6 eslint: 8.57.0 @@ -2987,11 +3152,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/scope-manager@7.18.0': - dependencies: - '@typescript-eslint/types': 7.18.0 - '@typescript-eslint/visitor-keys': 7.18.0 - '@typescript-eslint/scope-manager@8.0.0': dependencies: '@typescript-eslint/types': 8.0.0 @@ -2999,7 +3159,7 @@ snapshots: '@typescript-eslint/type-utils@8.0.0(eslint@8.57.0)(typescript@5.5.4)': dependencies: - '@typescript-eslint/typescript-estree': 8.0.0(typescript@5.5.4) + '@typescript-eslint/typescript-estree': 8.0.0(patch_hash=zlal42evfhopemboiioznx3k3i)(typescript@5.5.4) '@typescript-eslint/utils': 8.0.0(eslint@8.57.0)(typescript@5.5.4) debug: 4.3.6 ts-api-utils: 1.3.0(typescript@5.5.4) @@ -3009,26 +3169,9 @@ snapshots: - eslint - supports-color - '@typescript-eslint/types@7.18.0': {} - '@typescript-eslint/types@8.0.0': {} - '@typescript-eslint/typescript-estree@7.18.0(typescript@5.5.4)': - dependencies: - '@typescript-eslint/types': 7.18.0 - '@typescript-eslint/visitor-keys': 7.18.0 - debug: 4.3.6 - globby: 11.1.0 - is-glob: 4.0.3 - minimatch: 9.0.5 - semver: 7.6.3 - ts-api-utils: 1.3.0(typescript@5.5.4) - optionalDependencies: - typescript: 5.5.4 - transitivePeerDependencies: - - supports-color - - '@typescript-eslint/typescript-estree@8.0.0(typescript@5.5.4)': + '@typescript-eslint/typescript-estree@8.0.0(patch_hash=zlal42evfhopemboiioznx3k3i)(typescript@5.5.4)': dependencies: '@typescript-eslint/types': 8.0.0 '@typescript-eslint/visitor-keys': 8.0.0 @@ -3043,33 +3186,17 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@7.18.0(eslint@8.57.0)(typescript@5.5.4)': - dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) - '@typescript-eslint/scope-manager': 7.18.0 - '@typescript-eslint/types': 7.18.0 - '@typescript-eslint/typescript-estree': 7.18.0(typescript@5.5.4) - eslint: 8.57.0 - transitivePeerDependencies: - - supports-color - - typescript - '@typescript-eslint/utils@8.0.0(eslint@8.57.0)(typescript@5.5.4)': dependencies: '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) '@typescript-eslint/scope-manager': 8.0.0 '@typescript-eslint/types': 8.0.0 - '@typescript-eslint/typescript-estree': 8.0.0(typescript@5.5.4) + '@typescript-eslint/typescript-estree': 8.0.0(patch_hash=zlal42evfhopemboiioznx3k3i)(typescript@5.5.4) eslint: 8.57.0 transitivePeerDependencies: - supports-color - typescript - '@typescript-eslint/visitor-keys@7.18.0': - dependencies: - '@typescript-eslint/types': 7.18.0 - eslint-visitor-keys: 3.4.3 - '@typescript-eslint/visitor-keys@8.0.0': dependencies: '@typescript-eslint/types': 8.0.0 @@ -3102,6 +3229,8 @@ snapshots: dependencies: color-convert: 2.0.1 + are-docs-informative@0.0.2: {} + argparse@2.0.1: {} array-union@2.1.0: {} @@ -3162,6 +3291,8 @@ snapshots: buffer-from@1.1.2: {} + builtin-modules@3.3.0: {} + call-me-maybe@1.0.2: {} callsites@3.1.0: {} @@ -3181,6 +3312,12 @@ snapshots: ci-info@3.9.0: {} + ci-info@4.0.0: {} + + clean-regexp@1.0.0: + dependencies: + escape-string-regexp: 1.0.5 + cliui@8.0.1: dependencies: string-width: 4.2.3 @@ -3201,6 +3338,8 @@ snapshots: commander@2.20.3: {} + comment-parser@1.4.1: {} + common-path-prefix@3.0.0: {} concat-map@0.0.1: {} @@ -3256,6 +3395,8 @@ snapshots: dependencies: is-arrayish: 0.2.1 + es-module-lexer@1.5.4: {} + esbuild-plugin-alias@0.2.1: {} esbuild@0.23.0: @@ -3305,7 +3446,7 @@ snapshots: eslint-plugin-import-x@3.1.0(eslint@8.57.0)(typescript@5.5.4): dependencies: - '@typescript-eslint/utils': 7.18.0(eslint@8.57.0)(typescript@5.5.4) + '@typescript-eslint/utils': 8.0.0(eslint@8.57.0)(typescript@5.5.4) debug: 4.3.6 doctrine: 3.0.0 eslint: 8.57.0 @@ -3320,6 +3461,43 @@ snapshots: - supports-color - typescript + eslint-plugin-jsdoc@48.11.0(eslint@8.57.0): + dependencies: + '@es-joy/jsdoccomment': 0.46.0 + are-docs-informative: 0.0.2 + comment-parser: 1.4.1 + debug: 4.3.6 + escape-string-regexp: 4.0.0 + eslint: 8.57.0 + espree: 10.1.0 + esquery: 1.6.0 + parse-imports: 2.1.1 + semver: 7.6.3 + spdx-expression-parse: 4.0.0 + synckit: 0.9.1 + transitivePeerDependencies: + - supports-color + + eslint-plugin-unicorn@55.0.0(eslint@8.57.0): + dependencies: + '@babel/helper-validator-identifier': 7.24.7 + '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) + ci-info: 4.0.0 + clean-regexp: 1.0.0 + core-js-compat: 3.37.1 + eslint: 8.57.0 + esquery: 1.6.0 + globals: 15.9.0 + indent-string: 4.0.0 + is-builtin-module: 3.2.1 + jsesc: 3.0.2 + pluralize: 8.0.0 + read-pkg-up: 7.0.1 + regexp-tree: 0.1.27 + regjsparser: 0.10.0 + semver: 7.6.3 + strip-indent: 3.0.0 + eslint-scope@7.2.2: dependencies: esrecurse: 4.3.0 @@ -3327,6 +3505,8 @@ snapshots: eslint-visitor-keys@3.4.3: {} + eslint-visitor-keys@4.0.0: {} + eslint@8.57.0: dependencies: '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) @@ -3370,6 +3550,12 @@ snapshots: transitivePeerDependencies: - supports-color + espree@10.1.0: + dependencies: + acorn: 8.12.1 + acorn-jsx: 5.3.2(acorn@8.12.1) + eslint-visitor-keys: 4.0.0 + espree@9.6.1: dependencies: acorn: 8.12.1 @@ -3421,6 +3607,11 @@ snapshots: common-path-prefix: 3.0.0 pkg-dir: 7.0.0 + find-up@4.1.0: + dependencies: + locate-path: 5.0.0 + path-exists: 4.0.0 + find-up@5.0.0: dependencies: locate-path: 6.0.0 @@ -3483,6 +3674,8 @@ snapshots: dependencies: type-fest: 0.20.2 + globals@15.9.0: {} + globby@11.1.0: dependencies: array-union: 2.1.0 @@ -3500,6 +3693,8 @@ snapshots: has-flag@4.0.0: {} + hosted-git-info@2.8.9: {} + ignore@5.3.1: {} import-fresh@3.3.0: @@ -3509,6 +3704,8 @@ snapshots: imurmurhash@0.1.4: {} + indent-string@4.0.0: {} + inflight@1.0.6: dependencies: once: 1.4.0 @@ -3518,6 +3715,10 @@ snapshots: is-arrayish@0.2.1: {} + is-builtin-module@3.2.1: + dependencies: + builtin-modules: 3.3.0 + is-docker@2.2.1: {} is-extglob@2.1.1: {} @@ -3544,10 +3745,14 @@ snapshots: dependencies: argparse: 2.0.1 + jsdoc-type-pratt-parser@4.0.0: {} + jsesc@0.5.0: {} jsesc@2.5.2: {} + jsesc@3.0.2: {} + json-buffer@3.0.1: {} json-parse-even-better-errors@2.3.1: {} @@ -3584,6 +3789,10 @@ snapshots: lines-and-columns@1.2.4: {} + locate-path@5.0.0: + dependencies: + p-locate: 4.1.0 + locate-path@6.0.0: dependencies: p-locate: 5.0.0 @@ -3613,6 +3822,8 @@ snapshots: braces: 3.0.3 picomatch: 2.3.1 + min-indent@1.0.1: {} + minimatch@3.1.2: dependencies: brace-expansion: 1.1.11 @@ -3633,6 +3844,13 @@ snapshots: nolyfill@1.0.39: {} + normalize-package-data@2.5.0: + dependencies: + hosted-git-info: 2.8.9 + resolve: 1.22.8 + semver: 5.7.2 + validate-npm-package-license: 3.0.4 + object-assign@4.1.1: {} once@1.4.0: @@ -3655,6 +3873,10 @@ snapshots: os-tmpdir@1.0.2: {} + p-limit@2.3.0: + dependencies: + p-try: 2.2.0 + p-limit@3.1.0: dependencies: yocto-queue: 0.1.0 @@ -3663,6 +3885,10 @@ snapshots: dependencies: yocto-queue: 1.1.1 + p-locate@4.1.0: + dependencies: + p-limit: 2.3.0 + p-locate@5.0.0: dependencies: p-limit: 3.1.0 @@ -3671,10 +3897,17 @@ snapshots: dependencies: p-limit: 4.0.0 + p-try@2.2.0: {} + parent-module@1.0.1: dependencies: callsites: 3.1.0 + parse-imports@2.1.1: + dependencies: + es-module-lexer: 1.5.4 + slashes: 3.0.12 + parse-json@5.2.0: dependencies: '@babel/code-frame': 7.24.7 @@ -3720,6 +3953,8 @@ snapshots: dependencies: find-up: 6.3.0 + pluralize@8.0.0: {} + prelude-ls@1.2.1: {} prettier@3.3.3: {} @@ -3736,6 +3971,19 @@ snapshots: react-is@16.13.1: {} + read-pkg-up@7.0.1: + dependencies: + find-up: 4.1.0 + read-pkg: 5.2.0 + type-fest: 0.8.1 + + read-pkg@5.2.0: + dependencies: + '@types/normalize-package-data': 2.4.4 + normalize-package-data: 2.5.0 + parse-json: 5.2.0 + type-fest: 0.6.0 + regenerate-unicode-properties@10.1.1: dependencies: regenerate: 1.4.2 @@ -3748,6 +3996,8 @@ snapshots: dependencies: '@babel/runtime': 7.25.0 + regexp-tree@0.1.27: {} + regexpu-core@5.3.2: dependencies: '@babel/regjsgen': 0.8.0 @@ -3757,6 +4007,10 @@ snapshots: unicode-match-property-ecmascript: 2.0.0 unicode-match-property-value-ecmascript: 2.1.0 + regjsparser@0.10.0: + dependencies: + jsesc: 0.5.0 + regjsparser@0.9.1: dependencies: jsesc: 0.5.0 @@ -3787,6 +4041,8 @@ snapshots: dependencies: queue-microtask: 1.2.3 + semver@5.7.2: {} + semver@6.3.1: {} semver@7.6.3: {} @@ -3801,6 +4057,8 @@ snapshots: slash@3.0.0: {} + slashes@3.0.12: {} + source-map-support@0.5.21: dependencies: buffer-from: 1.1.2 @@ -3808,6 +4066,25 @@ snapshots: source-map@0.6.1: {} + spdx-correct@3.2.0: + dependencies: + spdx-expression-parse: 3.0.1 + spdx-license-ids: 3.0.18 + + spdx-exceptions@2.5.0: {} + + spdx-expression-parse@3.0.1: + dependencies: + spdx-exceptions: 2.5.0 + spdx-license-ids: 3.0.18 + + spdx-expression-parse@4.0.0: + dependencies: + spdx-exceptions: 2.5.0 + spdx-license-ids: 3.0.18 + + spdx-license-ids@3.0.18: {} + stable-hash@0.0.4: {} string-argv@0.3.2: {} @@ -3822,6 +4099,10 @@ snapshots: dependencies: ansi-regex: 5.0.1 + strip-indent@3.0.0: + dependencies: + min-indent: 1.0.1 + strip-json-comments@3.1.1: {} supports-color@5.5.0: @@ -3834,6 +4115,11 @@ snapshots: supports-preserve-symlinks-flag@1.0.0: {} + synckit@0.9.1: + dependencies: + '@pkgr/core': 0.1.1 + tslib: 2.6.3 + terser@5.31.3: dependencies: '@jridgewell/source-map': 0.3.6 @@ -3869,6 +4155,10 @@ snapshots: type-fest@0.20.2: {} + type-fest@0.6.0: {} + + type-fest@0.8.1: {} + type-fest@4.23.0: {} typescript@5.5.4: {} @@ -3898,6 +4188,11 @@ snapshots: dependencies: punycode: 2.3.1 + validate-npm-package-license@3.0.4: + dependencies: + spdx-correct: 3.2.0 + spdx-expression-parse: 3.0.1 + which@2.0.2: dependencies: isexe: 2.0.0 diff --git a/src/env.ts b/src/env.ts index 3c39b16..5af29f3 100644 --- a/src/env.ts +++ b/src/env.ts @@ -1,10 +1,12 @@ import * as fs from 'node:fs'; import { resolve } from 'node:path'; -import { Middleware, storybook } from './index'; +import { storybook } from './index'; import { react, reactRefresh } from './presets/react'; import { tailwind } from './presets/tailwind'; +import { jsdoc } from './presets/jsdoc'; import { reactQuery } from './presets/misc'; import { testingLibrary } from './presets/testing-library'; +import type { Middleware } from './middleware'; const middlewares = { react, @@ -13,6 +15,7 @@ const middlewares = { storybook, reactQuery, testingLibrary, + jsdoc, }; export const envs: { diff --git a/src/index.ts b/src/index.ts index c70436a..548bf4a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,18 +1,11 @@ /// import './redirect'; import { uniq } from 'lodash'; -import type { Merge, SetRequired } from 'type-fest'; import type { Rule } from 'eslint'; import type { ESLintUtils } from '@typescript-eslint/utils'; -import type { - ESLintConfig, - Extends, - KnownExtends, - Plugin, - Rules, - Settings, -} from '@aet/eslint-define-config'; +import type { ESLintConfig, Extends, Plugin, Rules } from '@aet/eslint-define-config'; +import type { Middleware, MiddlewareConfig, MiddlewareFunctions } from './middleware'; import { importTypeScript } from './presets/typescript'; import { unicorn } from './presets/unicorn'; import { eslintRules } from './presets/eslint'; @@ -67,8 +60,6 @@ export interface CustomRule { options?: RuleLevel; } -export type Middleware = (config: MiddlewareConfig, helpers: MiddlewareFunctions) => void; - /** * ESLint Configuration. * @see [ESLint Configuration](https://eslint.org/docs/latest/user-guide/configuring/) @@ -94,27 +85,6 @@ export type InputConfig = Omit & { auto?: boolean; }; -type OptionalObjectKey = Exclude< - { - [Key in keyof T]: undefined | any[] extends T[Key] - ? Key - : undefined | Record extends T[Key] - ? Key - : never; - }[keyof T], - undefined ->; - -type MiddlewareConfig = Merge< - SetRequired>, - { extends: KnownExtends[] } ->; - -interface MiddlewareFunctions { - addRules(rules: Partial): void; - addSettings(settings: Partial): void; -} - /** * Returns a ESLint config object. * diff --git a/src/local/index.ts b/src/local/index.ts index 26ce37a..1d3739e 100644 --- a/src/local/index.ts +++ b/src/local/index.ts @@ -1,6 +1,6 @@ import type { ESLint } from 'eslint'; import * as fs from 'node:fs'; -import { resolve, basename, extname } from 'node:path'; +import { basename, extname, resolve } from 'node:path'; import { glob } from 'fast-glob'; import { parseModule } from 'esprima'; import query from 'esquery'; diff --git a/src/middleware.ts b/src/middleware.ts new file mode 100644 index 0000000..d0c3319 --- /dev/null +++ b/src/middleware.ts @@ -0,0 +1,30 @@ +import type { Merge, SetRequired } from 'type-fest'; +import type { ESLintConfig, KnownExtends, Settings } from '@aet/eslint-define-config'; +import type { RuleOptions } from './index'; + +type OptionalObjectKey = Exclude< + { + [Key in keyof T]: undefined | any[] extends T[Key] + ? Key + : undefined | Record extends T[Key] + ? Key + : never; + }[keyof T], + undefined +>; + +export type MiddlewareConfig = Merge< + SetRequired>, + { extends: KnownExtends[] } +>; + +export interface MiddlewareFunctions { + addRules(rules: Partial): void; + addSettings(settings: Partial): void; +} + +export type Middleware = (config: MiddlewareConfig, helpers: MiddlewareFunctions) => void; + +export function defineMiddleware(middleware: Middleware): Middleware { + return middleware; +} diff --git a/src/presets/eslint.ts b/src/presets/eslint.ts index a6808a0..d24f976 100644 --- a/src/presets/eslint.ts +++ b/src/presets/eslint.ts @@ -1,5 +1,5 @@ -import { error, warn, off } from '../constants'; -import { EslintRulesObject } from '@aet/eslint-define-config/src/rules/eslint'; +import { type EslintRulesObject } from '@aet/eslint-define-config/src/rules/eslint'; +import { error, off, warn } from '../constants'; import restrictedGlobals from './_restrictedGlobals.json'; export const eslintRules: Partial = { diff --git a/src/presets/graphql.ts b/src/presets/graphql.ts index 6b499f2..d233073 100644 --- a/src/presets/graphql.ts +++ b/src/presets/graphql.ts @@ -1,11 +1,11 @@ -import { GraphQLRulesObject } from '@aet/eslint-define-config/src/rules/graphql-eslint'; -import type { Middleware } from '../index'; +import type { GraphQLRulesObject } from '@aet/eslint-define-config/src/rules/graphql-eslint'; +import { defineMiddleware } from '../middleware'; // https://the-guild.dev/graphql/eslint/rules const graphqlRules: Partial = {}; -export const graphql: Middleware = (config, { addRules }) => { +export const graphql = defineMiddleware((config, { addRules }) => { config.plugins.push('@graphql-eslint'); config.extends.push('plugin:@graphql-eslint/recommended'); addRules(graphqlRules); -}; +}); diff --git a/src/presets/jsdoc.ts b/src/presets/jsdoc.ts index 95a0549..18e1705 100644 --- a/src/presets/jsdoc.ts +++ b/src/presets/jsdoc.ts @@ -1,10 +1,13 @@ -import { JSDocRulesObject } from '@aet/eslint-define-config/src/rules/jsdoc'; -import type { Middleware } from '../index'; +import type { JSDocRulesObject } from '@aet/eslint-define-config/src/rules/jsdoc'; +import { defineMiddleware } from '../middleware'; +import { off } from '../constants'; -const jsdocRules: Partial = {}; +const jsdocRules: Partial = { + 'jsdoc/require-jsdoc': off, +}; -export const jsdoc: Middleware = (config, { addRules }) => { +export const jsdoc = defineMiddleware((config, { addRules }) => { config.plugins.push('jsdoc'); config.extends.push('plugin:jsdoc/recommended-typescript'); addRules(jsdocRules); -}; +}); diff --git a/src/presets/local.ts b/src/presets/local.ts index a27ec36..2728d24 100644 --- a/src/presets/local.ts +++ b/src/presets/local.ts @@ -1,11 +1,12 @@ -import type { LocalRuleOptions, Middleware } from '../index'; +import type { LocalRuleOptions } from '../index'; import { error } from '../constants'; +import { defineMiddleware } from '../middleware'; const localRules: Partial = { 'rules/no-import-dot': error, 'rules/restrict-template-expressions': error, }; -export const local: Middleware = (_, { addRules }) => { +export const local = defineMiddleware((_, { addRules }) => { addRules(localRules); -}; +}); diff --git a/src/presets/misc.ts b/src/presets/misc.ts index dc659a3..c15c265 100644 --- a/src/presets/misc.ts +++ b/src/presets/misc.ts @@ -1,9 +1,9 @@ -import type { Middleware } from '../index'; +import { defineMiddleware } from '../middleware'; -export const storybook: Middleware = config => { +export const storybook = defineMiddleware(config => { config.extends.push('plugin:storybook/recommended'); -}; +}); -export const reactQuery: Middleware = config => { +export const reactQuery = defineMiddleware(config => { config.extends.push('plugin:@tanstack/eslint-plugin-query/recommended'); -}; +}); diff --git a/src/presets/react.ts b/src/presets/react.ts index 5e55c8b..8baefd2 100644 --- a/src/presets/react.ts +++ b/src/presets/react.ts @@ -1,14 +1,14 @@ -import type { Middleware } from '../index'; +import type { ReactRulesObject } from '@aet/eslint-define-config/src/rules/react'; +import type { ReactRefreshRulesObject } from '@aet/eslint-define-config/src/rules/react-refresh'; import { error, off, warn } from '../constants'; -import { ReactRulesObject } from '@aet/eslint-define-config/src/rules/react'; -import { ReactRefreshRulesObject } from '@aet/eslint-define-config/src/rules/react-refresh'; +import { defineMiddleware } from '../middleware'; const reactRules: Partial = { '@eslint-react/no-missing-component-display-name': off, '@eslint-react/no-children-prop': error, }; -export const react: Middleware = (config, { addRules }) => { +export const react = defineMiddleware((config, { addRules }) => { config.plugins.push('@eslint-react/eslint-plugin', 'react-hooks'); config.extends.push( 'plugin:@eslint-react/recommended-legacy', @@ -23,13 +23,13 @@ export const react: Middleware = (config, { addRules }) => { }, }); addRules(reactRules); -}; +}); const refreshRules: Partial = { 'react-refresh/only-export-components': [warn, { allowConstantExport: true }], }; -export const reactRefresh: Middleware = (config, { addRules }) => { +export const reactRefresh = defineMiddleware((config, { addRules }) => { config.plugins.push('react-refresh'); addRules(refreshRules); -}; +}); diff --git a/src/presets/tailwind.ts b/src/presets/tailwind.ts index 08ceb42..9618a69 100644 --- a/src/presets/tailwind.ts +++ b/src/presets/tailwind.ts @@ -1,12 +1,12 @@ -import type { Middleware } from '../index'; -import { off } from '../constants'; import type { TailwindRulesObject } from '@aet/eslint-define-config/src/rules/tailwind'; +import { defineMiddleware } from '../middleware'; +import { off } from '../constants'; const tailwindRules: Partial = { 'tailwindcss/no-custom-classname': off, } as const; -export const tailwind: Middleware = (config, { addRules }) => { +export const tailwind = defineMiddleware((config, { addRules }) => { config.extends.push('plugin:tailwindcss/recommended'); addRules(tailwindRules); -}; +}); diff --git a/src/presets/testing-library.ts b/src/presets/testing-library.ts index 2032a66..c43d00a 100644 --- a/src/presets/testing-library.ts +++ b/src/presets/testing-library.ts @@ -1,12 +1,12 @@ -import type { Middleware } from '../index'; -import { TestingLibraryRulesObject } from '@aet/eslint-define-config/src/rules/testing-library'; +import type { TestingLibraryRulesObject } from '@aet/eslint-define-config/src/rules/testing-library'; +import { defineMiddleware } from '../middleware'; const testingLibraryRules: Partial = {}; -export const testingLibrary: Middleware = (config, { addRules }) => { +export const testingLibrary = defineMiddleware((config, { addRules }) => { config.overrides.push({ files: ['**/*.(spec|test).{ts,tsx}'], plugins: ['plugin:testing-library/react'], }); addRules(testingLibraryRules); -}; +}); diff --git a/src/presets/typescript.ts b/src/presets/typescript.ts index 2918907..cdfa776 100644 --- a/src/presets/typescript.ts +++ b/src/presets/typescript.ts @@ -1,7 +1,7 @@ import { error, off, warn } from '../constants'; import type { TypeScriptRulesObject } from '@aet/eslint-define-config/src/rules/typescript-eslint'; import type { ImportXRulesObject } from '@aet/eslint-define-config/src/rules/import-x'; -import type { Middleware } from '../index'; +import { defineMiddleware } from '../middleware'; const importRules: Partial = { 'import-x/export': off, @@ -45,7 +45,7 @@ const typescriptRules: Partial = { '@typescript-eslint/unbound-method': off, }; -export const importTypeScript: Middleware = (config, { addRules, addSettings }) => { +export const importTypeScript = defineMiddleware((config, { addRules, addSettings }) => { config.parser = '@typescript-eslint/parser'; config.plugins.push('@typescript-eslint', 'import-x'); config.extends.push( @@ -66,6 +66,7 @@ export const importTypeScript: Middleware = (config, { addRules, addSettings }) files: ['.eslintrc.js', '.eslintrc.cjs', '*.config.js', 'index.js'], extends: ['plugin:@typescript-eslint/disable-type-checked'], rules: { + '@typescript-eslint/no-require-imports': off, 'rules/restrict-template-expressions': off, }, }, @@ -79,4 +80,4 @@ export const importTypeScript: Middleware = (config, { addRules, addSettings }) addRules(importRules); addRules(typescriptRules); -}; +}); diff --git a/src/presets/unicorn.ts b/src/presets/unicorn.ts index 3e23e13..d59ca25 100644 --- a/src/presets/unicorn.ts +++ b/src/presets/unicorn.ts @@ -1,32 +1,43 @@ -import type { Middleware } from '../index'; +/* eslint-disable unicorn/string-content */ +import type { UnicornRulesObject } from '@aet/eslint-define-config/src/rules/unicorn'; +import { defineMiddleware } from '../middleware'; import { error, warn } from '../constants'; -import { UnicornRulesObject } from '@aet/eslint-define-config/src/rules/unicorn'; const suggest = (suggest: string) => ({ suggest, fix: false }); // https://github.com/sindresorhus/eslint-plugin-unicorn/tree/28e7498ad06679bb92343db53bb40a7b5ba2990a const unicornRules: Partial = { 'unicorn/better-regex': error, + 'unicorn/consistent-destructuring': warn, 'unicorn/consistent-function-scoping': warn, 'unicorn/escape-case': error, 'unicorn/no-array-for-each': warn, 'unicorn/no-array-method-this-argument': error, 'unicorn/no-array-push-push': warn, + 'unicorn/no-await-in-promise-methods': error, 'unicorn/no-console-spaces': warn, 'unicorn/no-for-loop': warn, 'unicorn/no-instanceof-array': error, + 'unicorn/no-invalid-fetch-options': error, + 'unicorn/no-invalid-remove-event-listener': error, 'unicorn/no-lonely-if': warn, + 'unicorn/no-negation-in-equality-check': error, + 'unicorn/no-new-buffer': error, + 'unicorn/no-single-promise-in-promise-methods': error, 'unicorn/no-static-only-class': error, 'unicorn/no-typeof-undefined': error, - // 'unicorn/no-unused-properties': warn, + 'unicorn/no-unnecessary-await': error, + 'unicorn/no-unnecessary-polyfills': error, + 'unicorn/no-unreadable-array-destructuring': warn, 'unicorn/no-useless-fallback-in-spread': error, 'unicorn/no-useless-promise-resolve-reject': error, 'unicorn/no-useless-spread': error, 'unicorn/no-useless-switch-case': error, - - // https://github.com/prettier/eslint-config-prettier/issues/51 - // 'unicorn/number-literal-case': error, + 'unicorn/no-useless-undefined': error, + 'unicorn/no-zero-fractions': error, + 'unicorn/number-literal-case': error, 'unicorn/prefer-array-find': error, + 'unicorn/prefer-array-flat': error, 'unicorn/prefer-array-flat-map': error, 'unicorn/prefer-array-some': error, 'unicorn/prefer-at': error, @@ -35,23 +46,32 @@ const unicornRules: Partial = { 'unicorn/prefer-default-parameters': warn, 'unicorn/prefer-dom-node-dataset': error, 'unicorn/prefer-dom-node-remove': error, + 'unicorn/prefer-dom-node-text-content': warn, 'unicorn/prefer-export-from': [error, { ignoreUsedVariables: false }], 'unicorn/prefer-includes': error, + 'unicorn/prefer-json-parse-buffer': warn, 'unicorn/prefer-keyboard-event-key': warn, 'unicorn/prefer-logical-operator-over-ternary': warn, - 'unicorn/prefer-math-trunc': error, + 'unicorn/prefer-math-trunc': warn, + 'unicorn/prefer-modern-dom-apis': error, 'unicorn/prefer-modern-math-apis': error, 'unicorn/prefer-negative-index': error, 'unicorn/prefer-node-protocol': error, 'unicorn/prefer-object-from-entries': error, 'unicorn/prefer-optional-catch-binding': error, + 'unicorn/prefer-prototype-methods': error, 'unicorn/prefer-reflect-apply': error, 'unicorn/prefer-regexp-test': error, 'unicorn/prefer-set-has': warn, + 'unicorn/prefer-set-size': error, + 'unicorn/prefer-string-raw': error, 'unicorn/prefer-string-slice': error, 'unicorn/prefer-string-starts-ends-with': warn, 'unicorn/prefer-string-trim-start-end': error, + 'unicorn/prefer-switch': warn, 'unicorn/prefer-ternary': warn, + 'unicorn/relative-url-style': warn, + 'unicorn/require-number-to-fixed-digits-argument': error, 'unicorn/string-content': [ warn, { @@ -71,7 +91,7 @@ const unicornRules: Partial = { 'unicorn/template-indent': warn, }; -export const unicorn: Middleware = (config, { addRules }) => { - config.plugins.push('unicorn'); +export const unicorn = defineMiddleware((config, { addRules }) => { + config.extends.push('plugin:unicorn/recommended'); addRules(unicornRules); -}; +}); diff --git a/src/rules/restrict-template-expressions.ts b/src/rules/restrict-template-expressions.ts index 7f1bace..a24eeb0 100644 --- a/src/rules/restrict-template-expressions.ts +++ b/src/rules/restrict-template-expressions.ts @@ -1,12 +1,12 @@ // https://github.com/typescript-eslint/typescript-eslint/blob/75c128856b1ce05a4fec799bfa6de03b3dab03d0/packages/eslint-plugin/src/rules/restrict-template-expressions.ts import * as ts from 'typescript'; -import { ESLintUtils, type TSESTree, AST_NODE_TYPES } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES, ESLintUtils, type TSESTree } from '@typescript-eslint/utils'; import { + getConstrainedTypeAtLocation, getTypeName, isTypeAnyType, isTypeFlagSet, isTypeNeverType, - getConstrainedTypeAtLocation, } from '@typescript-eslint/type-utils'; import { getParserServices } from '@typescript-eslint/utils/eslint-utils'; @@ -55,7 +55,7 @@ export default createRule({ defaultOptions: [defaultOption], create(context, [options]) { const services = getParserServices(context); - const checker = services.program!.getTypeChecker(); + const checker = services.program.getTypeChecker(); const allowed = new Set(options.allow); const { StringLike, NumberLike, BigIntLike, BooleanLike, Null, Undefined } =