This commit is contained in:
Alex
2024-08-11 17:32:54 -04:00
parent afb93c4971
commit 191848fdca
15 changed files with 151 additions and 84 deletions

9
dist/index.d.ts vendored
View File

@ -16,15 +16,15 @@ export interface MiddlewareFunctions {
addSettings(settings: Partial<Settings>): void; addSettings(settings: Partial<Settings>): void;
} }
export type Middleware = (config: MiddlewareConfig, helpers: MiddlewareFunctions) => void; export type Middleware = (config: MiddlewareConfig, helpers: MiddlewareFunctions) => void;
export declare const error = "error";
export declare const warn = "warn";
export declare const off = "off";
export declare const graphql: Middleware; export declare const graphql: Middleware;
export declare const jsdoc: Middleware; export declare const jsdoc: Middleware;
export declare const storybook: Middleware; export declare const storybook: Middleware;
export declare const react: Middleware; export declare const react: Middleware;
export declare const reactRefresh: Middleware; export declare const reactRefresh: Middleware;
export declare const tailwind: Middleware; export declare const tailwind: Middleware;
export declare const error = "error";
export declare const warn = "warn";
export declare const off = "off";
export type RuleLevel = "error" | "warn" | "off" | 0 | 1 | 2; export type RuleLevel = "error" | "warn" | "off" | 0 | 1 | 2;
export type RuleEntry<Options> = RuleLevel | [ export type RuleEntry<Options> = RuleLevel | [
RuleLevel, RuleLevel,
@ -90,6 +90,9 @@ export type InputConfig = Omit<ESLintConfig, "rules"> & {
* *
* Non bundled: * Non bundled:
* 1. [`graphql`](https://the-guild.dev/graphql/eslint/rules) * 1. [`graphql`](https://the-guild.dev/graphql/eslint/rules)
*
* @param of Configuration options.
* @returns ESLint configuration object.
*/ */
export declare function extendConfig(of?: InputConfig & { export declare function extendConfig(of?: InputConfig & {
middlewares?: Middleware[]; middlewares?: Middleware[];

17
dist/package.json vendored
View File

@ -1,6 +1,6 @@
{ {
"name": "@aet/eslint-rules", "name": "@aet/eslint-rules",
"version": "1.0.1-beta.22", "version": "1.0.1-beta.25",
"license": "UNLICENSED", "license": "UNLICENSED",
"bin": { "bin": {
"eslint-install": "install.js", "eslint-install": "install.js",
@ -13,15 +13,16 @@
"dependencies": { "dependencies": {
"@antfu/install-pkg": "^0.3.3", "@antfu/install-pkg": "^0.3.3",
"@nolyfill/is-core-module": "^1.0.39", "@nolyfill/is-core-module": "^1.0.39",
"@aet/eslint-define-config": "^0.1.0-beta.17", "@aet/eslint-define-config": "^0.1.0-beta.21",
"@eslint-community/eslint-utils": "^4.4.0", "@eslint-community/eslint-utils": "^4.4.0",
"@tanstack/eslint-plugin-query": "^5.51.15", "@tanstack/eslint-plugin-query": "^5.51.15",
"@types/eslint": "^9.6.0", "@types/eslint": "^9.6.0",
"@typescript-eslint/eslint-plugin": "^8.0.1", "@typescript-eslint/eslint-plugin": "^7.18.0",
"@typescript-eslint/parser": "^8.0.1", "@typescript-eslint/parser": "^7.18.0",
"@typescript-eslint/type-utils": "^8.0.1", "@typescript-eslint/type-utils": "^7.18.0",
"@typescript-eslint/utils": "^8.0.1", "@typescript-eslint/utils": "^7.18.0",
"@eslint-react/eslint-plugin": "1.7.1", "@eslint-react/eslint-plugin": "1.10.0",
"@stylistic/eslint-plugin": "^2.6.2",
"aria-query": "^5.3.0", "aria-query": "^5.3.0",
"axe-core": "^4.10.0", "axe-core": "^4.10.0",
"axobject-query": "4.1.0", "axobject-query": "4.1.0",
@ -35,7 +36,7 @@
"eslint-module-utils": "^2.8.1", "eslint-module-utils": "^2.8.1",
"eslint-plugin-es-x": "^8.0.0", "eslint-plugin-es-x": "^8.0.0",
"eslint-plugin-import-x": "^3.1.0", "eslint-plugin-import-x": "^3.1.0",
"eslint-plugin-jsdoc": "^50.0.0", "eslint-plugin-jsdoc": "^50.0.1",
"eslint-plugin-react-refresh": "^0.4.9", "eslint-plugin-react-refresh": "^0.4.9",
"eslint-plugin-unicorn": "^55.0.0", "eslint-plugin-unicorn": "^55.0.0",
"esprima": "^4.0.1", "esprima": "^4.0.1",

View File

@ -8,7 +8,7 @@
}, },
"private": true, "private": true,
"devDependencies": { "devDependencies": {
"@aet/eslint-define-config": "^0.1.0-beta.17", "@aet/eslint-define-config": "^0.1.0-beta.21",
"@antfu/install-pkg": "^0.3.3", "@antfu/install-pkg": "^0.3.3",
"@babel/core": "^7.25.2", "@babel/core": "^7.25.2",
"@babel/plugin-transform-flow-strip-types": "^7.25.2", "@babel/plugin-transform-flow-strip-types": "^7.25.2",
@ -21,12 +21,12 @@
"@types/estree": "^1.0.5", "@types/estree": "^1.0.5",
"@types/estree-jsx": "^1.0.5", "@types/estree-jsx": "^1.0.5",
"@types/lodash": "^4.17.7", "@types/lodash": "^4.17.7",
"@types/node": "^22.1.0", "@types/node": "^22.2.0",
"@typescript-eslint/eslint-plugin": "^8.0.0", "@typescript-eslint/eslint-plugin": "^8.0.1",
"@typescript-eslint/type-utils": "^8.0.0", "@typescript-eslint/type-utils": "^8.0.1",
"@typescript-eslint/types": "^8.0.0", "@typescript-eslint/types": "^8.0.1",
"@typescript-eslint/typescript-estree": "^8.0.0", "@typescript-eslint/typescript-estree": "^8.0.1",
"@typescript-eslint/utils": "^8.0.0", "@typescript-eslint/utils": "^8.0.1",
"babel-plugin-macros": "^3.1.0", "babel-plugin-macros": "^3.1.0",
"dts-bundle-generator": "9.4.0", "dts-bundle-generator": "9.4.0",
"esbuild": "0.23.0", "esbuild": "0.23.0",
@ -34,7 +34,7 @@
"eslint": "8.57.0", "eslint": "8.57.0",
"eslint-config-prettier": "^9.1.0", "eslint-config-prettier": "^9.1.0",
"eslint-plugin-import-x": "^3.1.0", "eslint-plugin-import-x": "^3.1.0",
"eslint-plugin-jsdoc": "^48.11.0", "eslint-plugin-jsdoc": "^50.0.1",
"eslint-plugin-unicorn": "^55.0.0", "eslint-plugin-unicorn": "^55.0.0",
"esprima": "^4.0.1", "esprima": "^4.0.1",
"esquery": "^1.6.0", "esquery": "^1.6.0",
@ -47,8 +47,8 @@
"picocolors": "^1.0.1", "picocolors": "^1.0.1",
"prettier": "^3.3.3", "prettier": "^3.3.3",
"prop-types": "^15.8.1", "prop-types": "^15.8.1",
"terser": "^5.31.3", "terser": "^5.31.5",
"type-fest": "^4.23.0", "type-fest": "^4.24.0",
"typescript": "^5.5.4" "typescript": "^5.5.4"
}, },
"prettier": { "prettier": {

134
pnpm-lock.yaml generated
View File

@ -28,8 +28,8 @@ importers:
.: .:
devDependencies: devDependencies:
'@aet/eslint-define-config': '@aet/eslint-define-config':
specifier: ^0.1.0-beta.17 specifier: ^0.1.0-beta.18
version: 0.1.0-beta.17 version: 0.1.0-beta.18
'@antfu/install-pkg': '@antfu/install-pkg':
specifier: ^0.3.3 specifier: ^0.3.3
version: 0.3.3 version: 0.3.3
@ -67,20 +67,20 @@ importers:
specifier: ^4.17.7 specifier: ^4.17.7
version: 4.17.7 version: 4.17.7
'@types/node': '@types/node':
specifier: ^22.1.0 specifier: ^22.2.0
version: 22.1.0 version: 22.2.0
'@typescript-eslint/eslint-plugin': '@typescript-eslint/eslint-plugin':
specifier: ^8.0.0 specifier: ^8.0.1
version: 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) version: 8.0.1(@typescript-eslint/parser@8.0.0(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(typescript@5.5.4)
'@typescript-eslint/type-utils': '@typescript-eslint/type-utils':
specifier: ^8.0.0 specifier: ^8.0.1
version: 8.0.0(eslint@8.57.0)(typescript@5.5.4) version: 8.0.1(eslint@8.57.0)(typescript@5.5.4)
'@typescript-eslint/types': '@typescript-eslint/types':
specifier: ^8.0.0 specifier: ^8.0.1
version: 8.0.0 version: 8.0.1
'@typescript-eslint/typescript-estree': '@typescript-eslint/typescript-estree':
specifier: ^8.0.0 specifier: ^8.0.1
version: 8.0.0(patch_hash=zlal42evfhopemboiioznx3k3i)(typescript@5.5.4) version: 8.0.1(typescript@5.5.4)
'@typescript-eslint/utils': '@typescript-eslint/utils':
specifier: 8.0.0 specifier: 8.0.0
version: 8.0.0(eslint@8.57.0)(typescript@5.5.4) version: 8.0.0(eslint@8.57.0)(typescript@5.5.4)
@ -106,8 +106,8 @@ importers:
specifier: ^3.1.0 specifier: ^3.1.0
version: 3.1.0(eslint@8.57.0)(typescript@5.5.4) version: 3.1.0(eslint@8.57.0)(typescript@5.5.4)
eslint-plugin-jsdoc: eslint-plugin-jsdoc:
specifier: ^48.11.0 specifier: ^50.0.1
version: 48.11.0(eslint@8.57.0) version: 50.0.1(eslint@8.57.0)
eslint-plugin-unicorn: eslint-plugin-unicorn:
specifier: ^55.0.0 specifier: ^55.0.0
version: 55.0.0(eslint@8.57.0) version: 55.0.0(eslint@8.57.0)
@ -145,19 +145,19 @@ importers:
specifier: ^15.8.1 specifier: ^15.8.1
version: 15.8.1 version: 15.8.1
terser: terser:
specifier: ^5.31.3 specifier: ^5.31.5
version: 5.31.3 version: 5.31.5
type-fest: type-fest:
specifier: ^4.23.0 specifier: ^4.24.0
version: 4.23.0 version: 4.24.0
typescript: typescript:
specifier: ^5.5.4 specifier: ^5.5.4
version: 5.5.4 version: 5.5.4
packages: packages:
'@aet/eslint-define-config@0.1.0-beta.17': '@aet/eslint-define-config@0.1.0-beta.18':
resolution: {integrity: sha512-gwQUwwmneD+dqbZpEcR9sws0Xbd1zpTSbGUswsFtJS4B7iVqUhE7ovf3NlSw8igo6aKrncMKe9o5969C1p2u5A==} resolution: {integrity: sha512-s5BWjeE78j8cNvIfjztTGsvRM03Asx9wG62Ibf1lkUt/ZMGcw2GBTMgzOoURb9HXdxnTbaz7MmGK0ZxzVXTYDQ==}
engines: {node: '>=18.0.0', npm: '>=9.0.0'} engines: {node: '>=18.0.0', npm: '>=9.0.0'}
'@ampproject/remapping@2.3.0': '@ampproject/remapping@2.3.0':
@ -1015,8 +1015,8 @@ packages:
'@types/lodash@4.17.7': '@types/lodash@4.17.7':
resolution: {integrity: sha512-8wTvZawATi/lsmNu10/j2hk1KEP0IvjubqPE3cu1Xz7xfXXt5oCq3SNUz4fMIP4XGF9Ky+Ue2tBA3hcS7LSBlA==} resolution: {integrity: sha512-8wTvZawATi/lsmNu10/j2hk1KEP0IvjubqPE3cu1Xz7xfXXt5oCq3SNUz4fMIP4XGF9Ky+Ue2tBA3hcS7LSBlA==}
'@types/node@22.1.0': '@types/node@22.2.0':
resolution: {integrity: sha512-AOmuRF0R2/5j1knA3c6G3HOk523Ga+l+ZXltX8SF1+5oqcXijjfTd8fY3XRZqSihEu9XhtQnKYLmkFaoxgsJHw==} resolution: {integrity: sha512-bm6EG6/pCpkxDf/0gDNDdtDILMOHgaQBVOJGdwsqClnxA3xL6jtMv76rLBc006RVMWbmaf0xbmom4Z/5o2nRkQ==}
'@types/normalize-package-data@2.4.4': '@types/normalize-package-data@2.4.4':
resolution: {integrity: sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==} resolution: {integrity: sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==}
@ -1024,8 +1024,8 @@ packages:
'@types/parse-json@4.0.2': '@types/parse-json@4.0.2':
resolution: {integrity: sha512-dISoDXWWQwUquiKsyZ4Ng+HX2KsPL7LyHKHQwgGFEA3IaKac4Obd+h2a/a6waisAoepJlBcx9paWqjA8/HVjCw==} resolution: {integrity: sha512-dISoDXWWQwUquiKsyZ4Ng+HX2KsPL7LyHKHQwgGFEA3IaKac4Obd+h2a/a6waisAoepJlBcx9paWqjA8/HVjCw==}
'@typescript-eslint/eslint-plugin@8.0.0': '@typescript-eslint/eslint-plugin@8.0.1':
resolution: {integrity: sha512-STIZdwEQRXAHvNUS6ILDf5z3u95Gc8jzywunxSNqX00OooIemaaNIA0vEgynJlycL5AjabYLLrIyHd4iazyvtg==} resolution: {integrity: sha512-5g3Y7GDFsJAnY4Yhvk8sZtFfV6YNF2caLzjrRPUBzewjPCaj0yokePB4LJSobyCzGMzjZZYFbwuzbfDHlimXbQ==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
peerDependencies: peerDependencies:
'@typescript-eslint/parser': ^8.0.0 || ^8.0.0-alpha.0 '@typescript-eslint/parser': ^8.0.0 || ^8.0.0-alpha.0
@ -1049,8 +1049,12 @@ packages:
resolution: {integrity: sha512-V0aa9Csx/ZWWv2IPgTfY7T4agYwJyILESu/PVqFtTFz9RIS823mAze+NbnBI8xiwdX3iqeQbcTYlvB04G9wyQw==} resolution: {integrity: sha512-V0aa9Csx/ZWWv2IPgTfY7T4agYwJyILESu/PVqFtTFz9RIS823mAze+NbnBI8xiwdX3iqeQbcTYlvB04G9wyQw==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
'@typescript-eslint/type-utils@8.0.0': '@typescript-eslint/scope-manager@8.0.1':
resolution: {integrity: sha512-mJAFP2mZLTBwAn5WI4PMakpywfWFH5nQZezUQdSKV23Pqo6o9iShQg1hP2+0hJJXP2LnZkWPphdIq4juYYwCeg==} resolution: {integrity: sha512-NpixInP5dm7uukMiRyiHjRKkom5RIFA4dfiHvalanD2cF0CLUuQqxfg8PtEUo9yqJI2bBhF+pcSafqnG3UBnRQ==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
'@typescript-eslint/type-utils@8.0.1':
resolution: {integrity: sha512-+/UT25MWvXeDX9YaHv1IS6KI1fiuTto43WprE7pgSMswHbn1Jm9GEM4Txp+X74ifOWV8emu2AWcbLhpJAvD5Ng==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
peerDependencies: peerDependencies:
typescript: '*' typescript: '*'
@ -1062,6 +1066,10 @@ packages:
resolution: {integrity: sha512-wgdSGs9BTMWQ7ooeHtu5quddKKs5Z5dS+fHLbrQI+ID0XWJLODGMHRfhwImiHoeO2S5Wir2yXuadJN6/l4JRxw==} resolution: {integrity: sha512-wgdSGs9BTMWQ7ooeHtu5quddKKs5Z5dS+fHLbrQI+ID0XWJLODGMHRfhwImiHoeO2S5Wir2yXuadJN6/l4JRxw==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
'@typescript-eslint/types@8.0.1':
resolution: {integrity: sha512-PpqTVT3yCA/bIgJ12czBuE3iBlM3g4inRSC5J0QOdQFAn07TYrYEQBBKgXH1lQpglup+Zy6c1fxuwTk4MTNKIw==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
'@typescript-eslint/typescript-estree@8.0.0': '@typescript-eslint/typescript-estree@8.0.0':
resolution: {integrity: sha512-5b97WpKMX+Y43YKi4zVcCVLtK5F98dFls3Oxui8LbnmRsseKenbbDinmvxrWegKDMmlkIq/XHuyy0UGLtpCDKg==} resolution: {integrity: sha512-5b97WpKMX+Y43YKi4zVcCVLtK5F98dFls3Oxui8LbnmRsseKenbbDinmvxrWegKDMmlkIq/XHuyy0UGLtpCDKg==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
@ -1071,6 +1079,15 @@ packages:
typescript: typescript:
optional: true optional: true
'@typescript-eslint/typescript-estree@8.0.1':
resolution: {integrity: sha512-8V9hriRvZQXPWU3bbiUV4Epo7EvgM6RTs+sUmxp5G//dBGy402S7Fx0W0QkB2fb4obCF8SInoUzvTYtc3bkb5w==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
peerDependencies:
typescript: '*'
peerDependenciesMeta:
typescript:
optional: true
'@typescript-eslint/utils@8.0.0': '@typescript-eslint/utils@8.0.0':
resolution: {integrity: sha512-k/oS/A/3QeGLRvOWCg6/9rATJL5rec7/5s1YmdS0ZU6LHveJyGFwBvLhSRBv6i9xaj7etmosp+l+ViN1I9Aj/Q==} resolution: {integrity: sha512-k/oS/A/3QeGLRvOWCg6/9rATJL5rec7/5s1YmdS0ZU6LHveJyGFwBvLhSRBv6i9xaj7etmosp+l+ViN1I9Aj/Q==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
@ -1081,6 +1098,10 @@ packages:
resolution: {integrity: sha512-oN0K4nkHuOyF3PVMyETbpP5zp6wfyOvm7tWhTMfoqxSSsPmJIh6JNASuZDlODE8eE+0EB9uar+6+vxr9DBTYOA==} resolution: {integrity: sha512-oN0K4nkHuOyF3PVMyETbpP5zp6wfyOvm7tWhTMfoqxSSsPmJIh6JNASuZDlODE8eE+0EB9uar+6+vxr9DBTYOA==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
'@typescript-eslint/visitor-keys@8.0.1':
resolution: {integrity: sha512-W5E+o0UfUcK5EgchLZsyVWqARmsM7v54/qEq6PY3YI5arkgmCzHiuk0zKSJJbm71V0xdRna4BGomkCTXz2/LkQ==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
'@ungap/structured-clone@1.2.0': '@ungap/structured-clone@1.2.0':
resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==}
@ -1325,8 +1346,8 @@ packages:
peerDependencies: peerDependencies:
eslint: ^8.56.0 || ^9.0.0-0 eslint: ^8.56.0 || ^9.0.0-0
eslint-plugin-jsdoc@48.11.0: eslint-plugin-jsdoc@50.0.1:
resolution: {integrity: sha512-d12JHJDPNo7IFwTOAItCeJY1hcqoIxE0lHA8infQByLilQ9xkqrRa6laWCnsuCrf+8rUnvxXY1XuTbibRBNylA==} resolution: {integrity: sha512-UayhAysIk1Du8InV27WMbV4AMSJSu60+bekmeuGK2OUy4QJSFPr1srYT6AInykGkmMdRuHfDX6Q0tJEr8BtDtg==}
engines: {node: '>=18'} engines: {node: '>=18'}
peerDependencies: peerDependencies:
eslint: ^7.0.0 || ^8.0.0 || ^9.0.0 eslint: ^7.0.0 || ^8.0.0 || ^9.0.0
@ -1976,8 +1997,8 @@ packages:
resolution: {integrity: sha512-7gr8p9TQP6RAHusBOSLs46F4564ZrjV8xFmw5zCmgmhGUcw2hxsShhJ6CEiHQMgPDwAQ1fWHPM0ypc4RMAig4A==} resolution: {integrity: sha512-7gr8p9TQP6RAHusBOSLs46F4564ZrjV8xFmw5zCmgmhGUcw2hxsShhJ6CEiHQMgPDwAQ1fWHPM0ypc4RMAig4A==}
engines: {node: ^14.18.0 || >=16.0.0} engines: {node: ^14.18.0 || >=16.0.0}
terser@5.31.3: terser@5.31.5:
resolution: {integrity: sha512-pAfYn3NIZLyZpa83ZKigvj6Rn9c/vd5KfYGX7cN1mnzqgDcxWvrU5ZtAfIKhEXz9nRecw4z3LXkjaq96/qZqAA==} resolution: {integrity: sha512-YPmas0L0rE1UyLL/llTWA0SiDOqIcAQYLeUj7cJYzXHlRTAnMSg9pPe4VJ5PlKvTrPQsdVFuiRiwyeNlYgwh2Q==}
engines: {node: '>=10'} engines: {node: '>=10'}
hasBin: true hasBin: true
@ -2028,8 +2049,8 @@ packages:
resolution: {integrity: sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==} resolution: {integrity: sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==}
engines: {node: '>=8'} engines: {node: '>=8'}
type-fest@4.23.0: type-fest@4.24.0:
resolution: {integrity: sha512-ZiBujro2ohr5+Z/hZWHESLz3g08BBdrdLMieYFULJO+tWc437sn8kQsWLJoZErY8alNhxre9K4p3GURAG11n+w==} resolution: {integrity: sha512-spAaHzc6qre0TlZQQ2aA/nGMe+2Z/wyGk5Z+Ru2VUfdNwT6kWO6TjevOlpebsATEG1EIQ2sOiDszud3lO5mt/Q==}
engines: {node: '>=16'} engines: {node: '>=16'}
typescript@5.5.4: typescript@5.5.4:
@ -2122,7 +2143,7 @@ packages:
snapshots: snapshots:
'@aet/eslint-define-config@0.1.0-beta.17': {} '@aet/eslint-define-config@0.1.0-beta.18': {}
'@ampproject/remapping@2.3.0': '@ampproject/remapping@2.3.0':
dependencies: dependencies:
@ -3113,7 +3134,7 @@ snapshots:
'@types/lodash@4.17.7': {} '@types/lodash@4.17.7': {}
'@types/node@22.1.0': '@types/node@22.2.0':
dependencies: dependencies:
undici-types: 6.13.0 undici-types: 6.13.0
@ -3121,14 +3142,14 @@ snapshots:
'@types/parse-json@4.0.2': {} '@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)': '@typescript-eslint/eslint-plugin@8.0.1(@typescript-eslint/parser@8.0.0(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(typescript@5.5.4)':
dependencies: dependencies:
'@eslint-community/regexpp': 4.11.0 '@eslint-community/regexpp': 4.11.0
'@typescript-eslint/parser': 8.0.0(eslint@8.57.0)(typescript@5.5.4) '@typescript-eslint/parser': 8.0.0(eslint@8.57.0)(typescript@5.5.4)
'@typescript-eslint/scope-manager': 8.0.0 '@typescript-eslint/scope-manager': 8.0.1
'@typescript-eslint/type-utils': 8.0.0(eslint@8.57.0)(typescript@5.5.4) '@typescript-eslint/type-utils': 8.0.1(eslint@8.57.0)(typescript@5.5.4)
'@typescript-eslint/utils': 8.0.0(eslint@8.57.0)(typescript@5.5.4) '@typescript-eslint/utils': 8.0.0(eslint@8.57.0)(typescript@5.5.4)
'@typescript-eslint/visitor-keys': 8.0.0 '@typescript-eslint/visitor-keys': 8.0.1
eslint: 8.57.0 eslint: 8.57.0
graphemer: 1.4.0 graphemer: 1.4.0
ignore: 5.3.1 ignore: 5.3.1
@ -3157,9 +3178,14 @@ snapshots:
'@typescript-eslint/types': 8.0.0 '@typescript-eslint/types': 8.0.0
'@typescript-eslint/visitor-keys': 8.0.0 '@typescript-eslint/visitor-keys': 8.0.0
'@typescript-eslint/type-utils@8.0.0(eslint@8.57.0)(typescript@5.5.4)': '@typescript-eslint/scope-manager@8.0.1':
dependencies: dependencies:
'@typescript-eslint/typescript-estree': 8.0.0(patch_hash=zlal42evfhopemboiioznx3k3i)(typescript@5.5.4) '@typescript-eslint/types': 8.0.1
'@typescript-eslint/visitor-keys': 8.0.1
'@typescript-eslint/type-utils@8.0.1(eslint@8.57.0)(typescript@5.5.4)':
dependencies:
'@typescript-eslint/typescript-estree': 8.0.1(typescript@5.5.4)
'@typescript-eslint/utils': 8.0.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 debug: 4.3.6
ts-api-utils: 1.3.0(typescript@5.5.4) ts-api-utils: 1.3.0(typescript@5.5.4)
@ -3171,6 +3197,8 @@ snapshots:
'@typescript-eslint/types@8.0.0': {} '@typescript-eslint/types@8.0.0': {}
'@typescript-eslint/types@8.0.1': {}
'@typescript-eslint/typescript-estree@8.0.0(patch_hash=zlal42evfhopemboiioznx3k3i)(typescript@5.5.4)': '@typescript-eslint/typescript-estree@8.0.0(patch_hash=zlal42evfhopemboiioznx3k3i)(typescript@5.5.4)':
dependencies: dependencies:
'@typescript-eslint/types': 8.0.0 '@typescript-eslint/types': 8.0.0
@ -3186,6 +3214,21 @@ snapshots:
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color
'@typescript-eslint/typescript-estree@8.0.1(typescript@5.5.4)':
dependencies:
'@typescript-eslint/types': 8.0.1
'@typescript-eslint/visitor-keys': 8.0.1
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/utils@8.0.0(eslint@8.57.0)(typescript@5.5.4)': '@typescript-eslint/utils@8.0.0(eslint@8.57.0)(typescript@5.5.4)':
dependencies: dependencies:
'@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0)
@ -3202,6 +3245,11 @@ snapshots:
'@typescript-eslint/types': 8.0.0 '@typescript-eslint/types': 8.0.0
eslint-visitor-keys: 3.4.3 eslint-visitor-keys: 3.4.3
'@typescript-eslint/visitor-keys@8.0.1':
dependencies:
'@typescript-eslint/types': 8.0.1
eslint-visitor-keys: 3.4.3
'@ungap/structured-clone@1.2.0': {} '@ungap/structured-clone@1.2.0': {}
'@yarnpkg/lockfile@1.1.0': {} '@yarnpkg/lockfile@1.1.0': {}
@ -3461,7 +3509,7 @@ snapshots:
- supports-color - supports-color
- typescript - typescript
eslint-plugin-jsdoc@48.11.0(eslint@8.57.0): eslint-plugin-jsdoc@50.0.1(eslint@8.57.0):
dependencies: dependencies:
'@es-joy/jsdoccomment': 0.46.0 '@es-joy/jsdoccomment': 0.46.0
are-docs-informative: 0.0.2 are-docs-informative: 0.0.2
@ -4120,7 +4168,7 @@ snapshots:
'@pkgr/core': 0.1.1 '@pkgr/core': 0.1.1
tslib: 2.6.3 tslib: 2.6.3
terser@5.31.3: terser@5.31.5:
dependencies: dependencies:
'@jridgewell/source-map': 0.3.6 '@jridgewell/source-map': 0.3.6
acorn: 8.12.1 acorn: 8.12.1
@ -4159,7 +4207,7 @@ snapshots:
type-fest@0.8.1: {} type-fest@0.8.1: {}
type-fest@4.23.0: {} type-fest@4.24.0: {}
typescript@5.5.4: {} typescript@5.5.4: {}

View File

@ -3,7 +3,7 @@ import { promises as fs } from 'node:fs';
import { camelCase } from 'lodash'; import { camelCase } from 'lodash';
export async function buildLocalRules() { export async function buildLocalRules() {
const files = (await fs.readdir('./src/rules')) const files = (await fs.readdir('./src/custom'))
.filter(file => file.endsWith('.ts')) .filter(file => file.endsWith('.ts'))
.filter(file => file !== 'index.ts') .filter(file => file !== 'index.ts')
.map(file => file.slice(0, -3)); .map(file => file.slice(0, -3));
@ -22,7 +22,7 @@ export const rules: Record<
}; };
`.trim(); `.trim();
await fs.writeFile('./src/rules/index.ts', entryFile + '\n'); await fs.writeFile('./src/custom/index.ts', entryFile + '\n');
} }
if (require.main === module) { if (require.main === module) {

View File

@ -168,7 +168,7 @@ async function main() {
bundle('./packages/eslint-plugin-react-hooks/index.ts'), bundle('./packages/eslint-plugin-react-hooks/index.ts'),
bundle('./packages/eslint-plugin-n/lib/index.js', './dist/eslint-plugin-n/index.js'), bundle('./packages/eslint-plugin-n/lib/index.js', './dist/eslint-plugin-n/index.js'),
bundle('./packages/eslint-import-resolver-typescript/src/index.ts'), bundle('./packages/eslint-import-resolver-typescript/src/index.ts'),
bundle('./src/rules/index.ts', './dist/eslint-plugin-rules/index.js'), bundle('./src/custom/index.ts', './dist/eslint-plugin-custom/index.js'),
bundle('./src/local/index.ts', './dist/eslint-plugin-local/index.js'), bundle('./src/local/index.ts', './dist/eslint-plugin-local/index.js'),
bundle('./src/index.ts', './dist/index.js', unminify), bundle('./src/index.ts', './dist/index.js', unminify),
bundle('./src/types.ts', './dist/types.js', unminify), bundle('./src/types.ts', './dist/types.js', unminify),

View File

@ -18,10 +18,10 @@
"subject": "[readme] fix typo in shareable config section in readme" "subject": "[readme] fix typo in shareable config section in readme"
}, },
"eslint-plugin-n": { "eslint-plugin-n": {
"hash": "6744257b43560181412a76eadeb7de564b886ad4", "hash": "e5e758ea0cd238220127ae7bcbd967f1d8920f28",
"date": "2024-07-26T11:46:54+01:00", "date": "2024-08-06T04:22:42+12:00",
"committer": "GitHub", "committer": "GitHub",
"subject": "chore(master): release 17.10.1 (#319)" "subject": "docs(process-exit-as-throw): update wording (#323)"
}, },
"eslint-plugin-react": { "eslint-plugin-react": {
"hash": "983b88dd3cb5e07919517d3fde4085f60883ded7", "hash": "983b88dd3cb5e07919517d3fde4085f60883ded7",

View File

@ -10,8 +10,9 @@ import { importTypeScript } from './presets/typescript';
import { unicorn } from './presets/unicorn'; import { unicorn } from './presets/unicorn';
import { eslintRules } from './presets/eslint'; import { eslintRules } from './presets/eslint';
import { custom } from './presets/custom'; import { custom } from './presets/custom';
import { error, warn, off } from './constants'; import { off } from './constants';
import { checkEnv } from './env'; import { checkEnv } from './env';
import { stylistic } from './presets/stylistic';
export { graphql } from './presets/graphql'; export { graphql } from './presets/graphql';
export { jsdoc } from './presets/jsdoc'; export { jsdoc } from './presets/jsdoc';
@ -19,7 +20,7 @@ export { storybook } from './presets/misc';
export { react, reactRefresh } from './presets/react'; export { react, reactRefresh } from './presets/react';
export { tailwind } from './presets/tailwind'; export { tailwind } from './presets/tailwind';
export { error, warn, off }; export { error, warn, off } from './constants';
declare global { declare global {
interface Array<T> { interface Array<T> {
@ -103,6 +104,9 @@ export type InputConfig = Omit<ESLintConfig, 'rules'> & {
* *
* Non bundled: * Non bundled:
* 1. [`graphql`](https://the-guild.dev/graphql/eslint/rules) * 1. [`graphql`](https://the-guild.dev/graphql/eslint/rules)
*
* @param of Configuration options.
* @returns ESLint configuration object.
*/ */
export function extendConfig( export function extendConfig(
of: InputConfig & { of: InputConfig & {
@ -124,8 +128,8 @@ export function extendConfig(
...rest ...rest
} = of; } = of;
let plugins: Plugin[] = [..._plugins]; const plugins: Plugin[] = [..._plugins];
let extend: Extends[] = ensureArray(_extends); const extend: Extends[] = ensureArray(_extends);
if (customRuleFiles != null) { if (customRuleFiles != null) {
plugins.push('local'); plugins.push('local');
@ -135,6 +139,7 @@ export function extendConfig(
importTypeScript, importTypeScript,
unicorn, unicorn,
custom, custom,
stylistic,
...(auto ? checkEnv() : []), ...(auto ? checkEnv() : []),
..._middlewares, ..._middlewares,
]); ]);

View File

@ -43,15 +43,6 @@ export const eslintRules: Partial<EslintRulesObject> = {
'prefer-spread': warn, 'prefer-spread': warn,
'quote-props': [error, 'as-needed'], 'quote-props': [error, 'as-needed'],
'sort-imports': [warn, { ignoreDeclarationSort: true }], 'sort-imports': [warn, { ignoreDeclarationSort: true }],
'spaced-comment': [
error,
'always',
{
markers: ['/', '#', '@'],
// allow /*@__PURE__*/
block: { exceptions: ['@'] },
},
],
complexity: [warn, { max: 100 }], complexity: [warn, { max: 100 }],
curly: [error, 'multi-line', 'consistent'], curly: [error, 'multi-line', 'consistent'],
eqeqeq: [error, 'smart'], eqeqeq: [error, 'smart'],

19
src/presets/stylistic.ts Normal file
View File

@ -0,0 +1,19 @@
import { error } from '../constants';
import { defineMiddleware } from '../middleware';
import type { StylisticRulesObject } from '@aet/eslint-define-config/src/rules/stylistic';
const stylisticRules: Partial<StylisticRulesObject> = {
'stylistic/spaced-comment': [
error,
'always',
{
markers: ['/', '#', '@'],
// allow /*@__PURE__*/
block: { exceptions: ['@'] },
},
],
};
export const stylistic = defineMiddleware((_, { addRules }) => {
addRules(stylisticRules);
});

View File

@ -8,7 +8,7 @@ const alias = new Set([
'eslint-plugin-local', 'eslint-plugin-local',
'eslint-plugin-n', 'eslint-plugin-n',
'eslint-plugin-react-hooks', 'eslint-plugin-react-hooks',
'eslint-plugin-rules', 'eslint-plugin-custom',
]); ]);
type CDR<T> = T extends [any, ...infer R] ? R : []; type CDR<T> = T extends [any, ...infer R] ? R : [];