@jimmy.codes/eslint-config 3.22.1 → 3.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +32 -11
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +42 -6
- package/dist/index.d.mts +42 -6
- package/dist/index.mjs +1 -1
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -59,25 +59,46 @@ import eslintConfig from "@jimmy.codes/eslint-config";
|
|
|
59
59
|
export default eslintConfig({ autoDetect: false });
|
|
60
60
|
```
|
|
61
61
|
|
|
62
|
-
#### Extending the Configuration
|
|
62
|
+
#### Extending/overriding the Configuration
|
|
63
63
|
|
|
64
|
-
You can also extend the configuration:
|
|
64
|
+
You can also extend or override the configuration:
|
|
65
|
+
|
|
66
|
+
```ts
|
|
67
|
+
import eslintConfig from "@jimmy.codes/eslint-config";
|
|
68
|
+
|
|
69
|
+
export default eslintConfig({
|
|
70
|
+
overrides: [
|
|
71
|
+
{
|
|
72
|
+
files: ["**/*.js"],
|
|
73
|
+
rules: {
|
|
74
|
+
"prefer-spread": "error",
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
files: ["**/*.ts"],
|
|
79
|
+
rules: {
|
|
80
|
+
"prefer-const": "error",
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
],
|
|
84
|
+
});
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Or pass configs as additional arguments:
|
|
65
88
|
|
|
66
89
|
```ts
|
|
67
90
|
import eslintConfig from "@jimmy.codes/eslint-config";
|
|
68
91
|
|
|
69
92
|
export default eslintConfig(
|
|
93
|
+
{},
|
|
70
94
|
{
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
"prefer-spread": "error",
|
|
76
|
-
},
|
|
77
|
-
},
|
|
78
|
-
],
|
|
95
|
+
files: ["**/*.js"],
|
|
96
|
+
rules: {
|
|
97
|
+
"prefer-spread": "error",
|
|
98
|
+
},
|
|
79
99
|
},
|
|
80
100
|
{
|
|
101
|
+
files: ["**/*.ts"],
|
|
81
102
|
rules: {
|
|
82
103
|
"prefer-const": "error",
|
|
83
104
|
},
|
|
@@ -97,7 +118,7 @@ export default eslintConfig({
|
|
|
97
118
|
});
|
|
98
119
|
```
|
|
99
120
|
|
|
100
|
-
###
|
|
121
|
+
### TypeScript Configuration Files
|
|
101
122
|
|
|
102
123
|
If you want to use [TypeScript configuration files](https://eslint.org/docs/latest/use/configure/configuration-files#typescript-configuration-files), you can do the following:
|
|
103
124
|
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var W=Object.create;var d=Object.defineProperty;var Y=Object.getOwnPropertyDescriptor;var M=Object.getOwnPropertyNames;var D=Object.getPrototypeOf,K=Object.prototype.hasOwnProperty;var t=(e,r)=>d(e,"name",{value:r,configurable:!0});var Z=(e,r,s,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of M(r))!K.call(e,a)&&a!==s&&d(e,a,{get:()=>r[a],enumerable:!(n=Y(r,a))||n.enumerable});return e};var o=(e,r,s)=>(s=e!=null?W(D(e)):{},Z(r||!e||!e.__esModule?d(s,"default",{value:e,enumerable:!0}):s,e));var g=require("globals"),p=require("typescript-eslint"),E=require("@eslint-community/eslint-plugin-eslint-comments/configs"),u=require("eslint-plugin-import-x"),O=require("eslint-plugin-n"),ee=require("@eslint/js"),C=require("eslint-plugin-perfectionist"),re=require("eslint-config-prettier"),te=require("eslint-plugin-regexp"),c=require("local-pkg"),q=require("eslint-plugin-unicorn");function se(e){var r=Object.create(null);return e&&Object.keys(e).forEach(function(s){if(s!=="default"){var n=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(r,s,n.get?n:{enumerable:!0,get:t(function(){return e[s]},"get")})}}),r.default=e,Object.freeze(r)}t(se,"_interopNamespaceDefault");var _=se(te);const l="?([cm])[jt]s?(x)",oe=["**/node_modules","**/dist","**/package-lock.json","**/yarn.lock","**/pnpm-lock.yaml","**/bun.lockb","**/output","**/coverage","**/temp","**/.temp","**/tmp","**/.tmp","**/.history","**/.vitepress/cache","**/.nuxt","**/.next","**/.vercel","**/.changeset","**/.idea","**/.cache","**/.output","**/.vite-inspect","**/.yarn","**/storybook-static","**/.eslint-config-inspector","**/playwright-report","**/.astro","**/.vinxi","**/app.config.timestamp_*.js","**/CHANGELOG*.md","**/*.min.*","**/LICENSE*","**/__snapshots__","**/auto-import?(s).d.ts","**/components.d.ts","**/vite.config.ts.*.mjs","**/*.gen.*","!.storybook"],ne="**/*.?([cm])js",y="**/*.?([cm])jsx",T="**/*.?([cm])tsx",m=[`**/__tests__/**/*.${l}`,`**/*.spec.${l}`,`**/*.test.${l}`,`**/*.bench.${l}`,`**/*.benchmark.${l}`],R=[`**/e2e/**/*.spec.${l}`,`**/e2e/**/*.test.${l}`],j=[...R,`**/cypress/**/*.spec.${l}`,`**/cypress/**/*.test.${l}`],ie="**/*.cjs",ae="**/*.astro",ce=["vi.mock","describe","expect","it"],le=["@testing-library/react"],i=t(async e=>{const r=await e;return r.default??r},"interopDefault"),pe=t(async()=>{const e=[ae],[r,s,n]=await Promise.all([import("eslint-plugin-astro"),import("astro-eslint-parser"),i(import("eslint-plugin-jsx-a11y"))]);return[{files:e,languageOptions:{globals:{...g.node,Astro:!1,Fragment:!1},parser:s,parserOptions:{extraFileExtensions:[".astro"],parser:p.parser},sourceType:"module"},name:"jimmy.codes/astro",plugins:{astro:r,"jsx-a11y":n},processor:"astro/client-side-ts",rules:{...n.configs.recommended.rules,"astro/missing-client-only-directive-value":"error","astro/no-conflict-set-directives":"error","astro/no-deprecated-astro-canonicalurl":"error","astro/no-deprecated-astro-fetchcontent":"error","astro/no-deprecated-astro-resolve":"error","astro/no-deprecated-getentrybyslug":"error","astro/no-exports-from-components":"off","astro/no-unused-define-vars-in-style":"error","astro/valid-compile":"error"}},{files:e,languageOptions:{parserOptions:p.configs.disableTypeChecked.languageOptions?.parserOptions},name:"jimmy.codes/astro/disable-type-checked",rules:p.configs.disableTypeChecked.rules},{name:"jimmy.codes/astro/imports",settings:{"import-x/core-modules":["astro:content"]}}]},"astroConfig"),fe=t(()=>[{files:[ie],languageOptions:{globals:g.commonjs},name:"jimmy.codes/commonjs"}],"commonjsConfig"),ue={...E.recommended.rules,"@eslint-community/eslint-comments/no-unused-disable":"off","@eslint-community/eslint-comments/require-description":"error"},me=t(()=>[{...E.recommended,name:"jimmy.codes/eslint-comments",rules:ue}],"eslintCommentsConfig"),de=t(e=>[{ignores:[...oe,...e],name:"jimmy.codes/ignores"}],"ignoresConfig"),ge={...u.configs.recommended.rules,"import-x/consistent-type-specifier-style":["error","prefer-top-level"],"import-x/extensions":["error","never",{checkTypedImports:!0,svg:"always"}],"import-x/first":"error","import-x/namespace":"off","import-x/newline-after-import":"error","import-x/no-absolute-path":"error","import-x/no-duplicates":"error","import-x/no-empty-named-blocks":"error","import-x/no-named-as-default":"error","import-x/no-named-as-default-member":"error","import-x/no-self-import":"error","import-x/no-unresolved":["error",{ignore:[String.raw`\.svg$`]}],"import-x/no-useless-path-segments":"error"},ye={name:"jimmy.codes/imports/typescript",rules:u.configs.typescript.rules,settings:{...u.configs.typescript.settings,"import-x/resolver":{...u.configs.typescript.settings["import-x/resolver"],typescript:!0}}},je=t(({typescript:e=!1}={})=>[{name:"jimmy.codes/imports",plugins:{"import-x":u,n:O},rules:ge},...e?[ye]:[]],"importsConfig"),xe={...ee.configs.recommended.rules,"array-callback-return":["error",{allowImplicit:!0}],"arrow-body-style":["error","always"],curly:["error","all"],"no-console":"warn","no-self-compare":"error","no-template-curly-in-string":"error","no-unmodified-loop-condition":"error","no-unreachable-loop":"error","no-use-before-define":["error",{allowNamedExports:!1,classes:!1,functions:!1,variables:!0}],"no-useless-rename":"error","object-shorthand":"error","prefer-arrow-callback":"error"},he=t(()=>[{linterOptions:{reportUnusedDisableDirectives:!0},name:"jimmy.codes/javascript",rules:xe}],"javascriptConfig"),be={"n/no-process-exit":"off","n/prefer-node-protocol":"error"},we=t(()=>[{name:"jimmy.codes/node",plugins:{n:O},rules:be}],"nodeConfig"),ve={...C.configs["recommended-natural"].rules,"perfectionist/sort-imports":["error",{customGroups:{type:{},value:{}},environment:"node",groups:["side-effect-style","builtin","type","external","internal-type","internal",["parent-type","sibling-type","index-type"],["parent","sibling","index"],"object","style","unknown"],internalPattern:["^~/.*","^@/.*"],order:"asc",type:"natural"}],"perfectionist/sort-modules":"off"},ke=t(()=>[{name:"jimmy.codes/perfectionist",plugins:{perfectionist:C},rules:ve}],"perfectionistConfig"),Pe=t(async()=>({...(await i(import("eslint-plugin-playwright"))).configs["flat/recommended"].rules,"playwright/expect-expect":"error","playwright/max-nested-describe":"error","playwright/no-conditional-expect":"error","playwright/no-conditional-in-test":"error","playwright/no-element-handle":"error","playwright/no-eval":"error","playwright/no-force-option":"error","playwright/no-nested-step":"error","playwright/no-page-pause":"error","playwright/no-skipped-test":"error","playwright/no-useless-await":"error","playwright/no-useless-not":"error","playwright/no-wait-for-selector":"error","playwright/no-wait-for-timeout":"error"}),"playwrightRules"),Ee=t(async()=>[{...(await i(import("eslint-plugin-playwright"))).configs["flat/recommended"],files:R,name:"jimmy.codes/playwright",rules:await Pe()}],"playwrightConfig"),Oe=t(()=>[{name:"jimmy.codes/prettier",...re}],"prettierConfig"),Ce=t(e=>e===2?"error":e===1?"warn":"off","toStringSeverity"),L=t((e={})=>Object.fromEntries(Object.entries(e).map(([r,s])=>[r,typeof s=="number"?Ce(s):s])),"normalizeRuleEntries"),qe=t(async()=>{const[e,r]=await Promise.all([i(import("eslint-plugin-react")),i(import("eslint-plugin-jsx-a11y"))]);return{...r.configs.recommended.rules,...L(e.configs.flat?.recommended?.rules),...L(e.configs.flat?.["jsx-runtime"]?.rules),"react-compiler/react-compiler":"error","react-hooks/exhaustive-deps":"error","react-hooks/rules-of-hooks":"error","react-refresh/only-export-components":["warn",{allowConstantExport:!0}],"react/boolean-prop-naming":"off","react/button-has-type":"error","react/checked-requires-onchange-or-readonly":"error","react/default-props-match-prop-types":"error","react/destructuring-assignment":"off","react/forbid-component-props":"off","react/forbid-dom-props":"off","react/forbid-elements":"off","react/forbid-foreign-prop-types":"off","react/forbid-prop-types":"off","react/forward-ref-uses-ref":"error","react/function-component-definition":"off","react/hook-use-state":"error","react/iframe-missing-sandbox":"error","react/jsx-boolean-value":["error","never"],"react/jsx-curly-brace-presence":"error","react/jsx-filename-extension":"off","react/jsx-fragments":["error","syntax"],"react/jsx-handler-names":"off","react/jsx-max-depth":"off","react/jsx-no-bind":"off","react/jsx-no-constructed-context-values":"error","react/jsx-no-leaked-render":"error","react/jsx-no-literals":"off","react/jsx-no-script-url":"error","react/jsx-no-useless-fragment":"error","react/jsx-one-expression-per-line":"off","react/jsx-pascal-case":["error",{allowNamespace:!0}],"react/jsx-props-no-spread-multi":"off","react/jsx-props-no-spreading":"off","react/jsx-sort-default-props":"off","react/jsx-sort-props":"off","react/no-access-state-in-setstate":"error","react/no-adjacent-inline-elements":"off","react/no-array-index-key":"off","react/no-arrow-function-lifecycle":"error","react/no-danger":"off","react/no-did-mount-set-state":"error","react/no-did-update-set-state":"error","react/no-invalid-html-attribute":"error","react/no-multi-comp":"off","react/no-namespace":"error","react/no-object-type-as-default-prop":"error","react/no-redundant-should-component-update":"error","react/no-set-state":"off","react/no-this-in-sfc":"error","react/no-typos":"error","react/no-unstable-nested-components":"error","react/no-unused-class-component-methods":"error","react/no-unused-prop-types":"error","react/no-unused-state":"error","react/no-will-update-set-state":"error","react/prefer-es6-class":"off","react/prefer-exact-props":"off","react/prefer-read-only-props":"off","react/prefer-stateless-function":"off","react/require-default-props":"off","react/require-optimization":"off","react/self-closing-comp":"error","react/sort-comp":"off","react/sort-default-props":"off","react/sort-prop-types":"off","react/state-in-constructor":"off","react/static-property-placement":"off","react/style-prop-object":"error","react/void-dom-elements-no-children":"error"}},"reactRules"),_e=t(async()=>{const[e,r,s,n,a]=await Promise.all([i(import("eslint-plugin-react")),i(import("eslint-plugin-jsx-a11y")),import("eslint-plugin-react-hooks"),import("eslint-plugin-react-refresh"),i(import("eslint-plugin-react-compiler"))]);return[{files:[y,T],languageOptions:{globals:{...g.browser},parserOptions:{ecmaFeatures:{jsx:!0},jsxPragma:null}},name:"jimmy.codes/react",plugins:{"jsx-a11y":r,react:e,"react-compiler":a,"react-hooks":s,"react-refresh":n},rules:await qe(),settings:{react:{version:"detect"}}}]},"reactConfig"),Te={..._.configs["flat/recommended"].rules,"regexp/confusing-quantifier":"error","regexp/no-empty-alternative":"error","regexp/no-lazy-ends":"error","regexp/no-potentially-useless-backreference":"error","regexp/no-useless-flag":"error","regexp/optimal-lookaround-quantifier":"error"},Re=t(()=>[{name:"jimmy.codes/regexp",plugins:{regexp:_},rules:Te}],"regexpConfig"),Le=t((e={})=>Object.fromEntries(Object.entries(e).map(([r,s])=>[r,s==="warn"?"error":s])),"warningAsErrors"),Se=t(async()=>{const{configs:e}=await i(import("eslint-plugin-storybook")),[r,s,n]=e["flat/recommended"];return[{name:"jimmy.codes/storybook/setup",plugins:r?.plugins},{files:s?.files,name:"jimmy.codes/storybook/stories-rules",rules:{...Le(s?.rules),"import-x/no-anonymous-default-export":"off","unicorn/no-anonymous-default-export":"off"}},{files:n?.files,name:"jimmy.codes/storybook/main-rules",rules:{...n?.rules}}]},"storybookConfig"),Ae=t(async()=>{const e=await i(import("@tanstack/eslint-plugin-query"));return[{files:[y,T],name:"jimmy.codes/react/query",plugins:{"@tanstack/query":e},rules:{"@tanstack/query/exhaustive-deps":"error","@tanstack/query/no-rest-destructuring":"warn","@tanstack/query/stable-query-client":"error"}}]},"tanstackQueryConfig"),S=t(async()=>{const e=await i(import("eslint-plugin-jest"));return{...e.configs["flat/recommended"].rules,...e.configs["flat/style"].rules,"jest/consistent-test-it":["error",{fn:"test",withinDescribe:"it"}],"jest/expect-expect":"error","jest/no-alias-methods":"error","jest/no-commented-out-tests":"error","jest/no-conditional-in-test":"error","jest/no-confusing-set-timeout":"error","jest/no-duplicate-hooks":"error","jest/no-hooks":"off","jest/no-large-snapshots":"off","jest/no-restricted-jest-methods":"off","jest/no-restricted-matchers":"off","jest/no-test-return-statement":"error","jest/no-untyped-mock-factory":"off","jest/prefer-called-with":"error","jest/prefer-comparison-matcher":"error","jest/prefer-each":"error","jest/prefer-equality-matcher":"error","jest/prefer-expect-assertions":"off","jest/prefer-expect-resolves":"error","jest/prefer-hooks-in-order":"error","jest/prefer-hooks-on-top":"error","jest/prefer-lowercase-title":"off","jest/prefer-mock-promise-shorthand":"error","jest/prefer-snapshot-hint":"error","jest/prefer-spy-on":"off","jest/prefer-strict-equal":"error","jest/prefer-todo":"warn","jest/require-hook":"error","jest/require-to-throw-message":"error","jest/require-top-level-describe":"off","jest/unbound-method":"off"}},"jestRules"),Ge=t(async()=>({...await S(),"jest/no-deprecated-functions":"off","jest/require-hook":["error",{allowedFunctionCalls:ce}]}),"vitestRules"),Ie=t(()=>c.isPackageExists("typescript"),"hasTypescript"),Be=t(()=>c.isPackageExists("react"),"hasReact"),A=t(()=>c.isPackageExists("vitest"),"hasVitest"),G=t(()=>c.isPackageExists("jest"),"hasJest"),Ne=t(()=>A()||G(),"hasTesting"),$e=t(()=>le.some(e=>c.isPackageExists(e)),"hasTestingLibrary"),Fe=t(()=>c.isPackageExists("@tanstack/react-query"),"hasReactQuery"),Je=t(()=>c.isPackageExists("astro"),"hasAstro"),ze=t(()=>c.isPackageExists("@playwright/test"),"hasPlaywright"),Qe=t(()=>c.isPackageExists("storybook"),"hasStorybook"),Ve=t(async({framework:e="vitest"}={},r=!0)=>{const s=r?A():e==="vitest",n=e==="jest"||r&&G(),a=[];if(s){const f=await i(import("eslint-plugin-jest"));a.push({files:m,ignores:j,...f.configs["flat/recommended"],name:"jimmy.codes/vitest",rules:await Ge()})}if(n){const f=await i(import("eslint-plugin-jest"));a.push({files:m,ignores:j,...f.configs["flat/recommended"],name:"jimmy.codes/jest",rules:await S()})}return a},"testingConfig"),Xe=t(async()=>{const[e,r]=await Promise.all([import("eslint-plugin-jest-dom"),i(import("eslint-plugin-testing-library"))]);return{...r.configs["flat/react"].rules,...e.configs["flat/recommended"].rules}},"testingLibraryRules"),He=t(async()=>{const[e,r]=await Promise.all([import("eslint-plugin-jest-dom"),i(import("eslint-plugin-testing-library"))]);return[{files:m,ignores:j,name:"jimmy.codes/testing-library",plugins:{"jest-dom":e,"testing-library":r},rules:await Xe()}]},"testingLibraryConfig"),Ue={"@typescript-eslint/consistent-type-exports":["error",{fixMixedExportsWithInlineTypeSpecifier:!1}],"@typescript-eslint/consistent-type-imports":["error",{fixStyle:"separate-type-imports"}],"@typescript-eslint/no-deprecated":"warn","@typescript-eslint/no-misused-promises":["error",{checksVoidReturn:{attributes:!1}}],"@typescript-eslint/no-unused-vars":["error",{args:"all",argsIgnorePattern:"^_",caughtErrors:"all",caughtErrorsIgnorePattern:"^_",destructuredArrayIgnorePattern:"^_",ignoreRestSiblings:!0,varsIgnorePattern:"^_"}],"@typescript-eslint/no-use-before-define":["error",{allowNamedExports:!1,classes:!1,functions:!1,variables:!0}],"@typescript-eslint/restrict-template-expressions":["error",{allowNumber:!0}],"no-use-before-define":"off"},We=t(e=>[...p.configs.strictTypeChecked,...p.configs.stylisticTypeChecked.filter(r=>r.name==="typescript-eslint/stylistic-type-checked"),{languageOptions:{parserOptions:{...e?.project?{project:e.project}:{projectService:!0},tsconfigRootDir:process.cwd()}},name:"jimmy.codes/typescript",rules:Ue},{files:[ne,y],...p.configs.disableTypeChecked},{files:m,name:"jimmy.codes/typescript/testing",rules:{"@typescript-eslint/no-unsafe-argument":"off","@typescript-eslint/no-unsafe-assignment":"off"}}],"typescriptConfig"),Ye={...q.configs["flat/recommended"].rules,"unicorn/filename-case":"off","unicorn/import-style":"off","unicorn/no-abusive-eslint-disable":"off","unicorn/no-anonymous-default-export":"off","unicorn/no-array-callback-reference":"off","unicorn/no-array-reduce":"off","unicorn/no-null":"off","unicorn/no-process-exit":"off","unicorn/no-useless-undefined":["error",{checkArguments:!1,checkArrowFunctionBody:!1}],"unicorn/prefer-node-protocol":"off","unicorn/prevent-abbreviations":"off"},Me=t(()=>[{...q.configs["flat/recommended"],name:"jimmy.codes/unicorn",rules:Ye}],"unicornConfig"),De=t(e=>typeof e=="object"?e:void 0,"getTypescriptOptions"),Ke=t((e,r)=>typeof e=="object"?e:{framework:r.vitest?"vitest":r.jest?"jest":"vitest",...r.testingLibrary&&{utilities:["testing-library"]}},"getTestingOptions"),Ze=t(e=>typeof e=="object"?e:{utilities:[]},"getReactOptions"),er=t(({utilities:e=[]},r,s)=>r||e.includes("@tanstack/query")||s&&Fe(),"shouldEnableTanstackQuery"),rr=t(({utilities:e=[]},r)=>e.includes("testing-library")||r&&$e(),"shouldEnableTestingLibrary"),tr=t(async({astro:e=!1,autoDetect:r=!0,configs:s=[],ignores:n=[],jest:a=!1,playwright:f=!1,react:x=!1,storybook:I=!1,tanstackQuery:B=!1,testing:h=!1,testingLibrary:N=!1,typescript:b=!1,vitest:w=!1}={},...$)=>{const F=Ze(x),v=Ke(h,{jest:a,testingLibrary:N,vitest:w}),k=De(b),P=b||!!k||r&&Ie(),J=x||r&&Be(),z=h||a||w||r&&Ne(),Q=e||r&&Je(),V=er(F,B,r),X=rr(v,r),H=f||r&&ze(),U=I||r&&Qe();return[he(),ke(),we(),Me(),me(),Re(),je({typescript:P}),P?We(k):[],J?await _e():[],V?await Ae():[],Q?await pe():[],z?await Ve(v,r):[],X?await He():[],H?await Ee():[],U?await Se():[],Oe(),fe(),de(n),s,$].flat()},"eslintConfig");module.exports=tr;
|
|
1
|
+
"use strict";var W=Object.create;var d=Object.defineProperty;var Y=Object.getOwnPropertyDescriptor;var D=Object.getOwnPropertyNames;var K=Object.getPrototypeOf,Z=Object.prototype.hasOwnProperty;var t=(e,r)=>d(e,"name",{value:r,configurable:!0});var ee=(e,r,s,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of D(r))!Z.call(e,a)&&a!==s&&d(e,a,{get:()=>r[a],enumerable:!(n=Y(r,a))||n.enumerable});return e};var o=(e,r,s)=>(s=e!=null?W(K(e)):{},ee(r||!e||!e.__esModule?d(s,"default",{value:e,enumerable:!0}):s,e));var g=require("globals"),p=require("typescript-eslint"),E=require("@eslint-community/eslint-plugin-eslint-comments/configs"),u=require("eslint-plugin-import-x"),O=require("eslint-plugin-n"),re=require("@eslint/js"),C=require("eslint-plugin-perfectionist"),te=require("eslint-config-prettier"),c=require("local-pkg"),se=require("eslint-plugin-regexp"),q=require("eslint-plugin-unicorn");function oe(e){var r=Object.create(null);return e&&Object.keys(e).forEach(function(s){if(s!=="default"){var n=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(r,s,n.get?n:{enumerable:!0,get:t(function(){return e[s]},"get")})}}),r.default=e,Object.freeze(r)}t(oe,"_interopNamespaceDefault");var _=oe(se);const l="?([cm])[jt]s?(x)",ne=["**/node_modules","**/dist","**/package-lock.json","**/yarn.lock","**/pnpm-lock.yaml","**/bun.lockb","**/output","**/coverage","**/temp","**/.temp","**/tmp","**/.tmp","**/.history","**/.vitepress/cache","**/.nuxt","**/.next","**/.vercel","**/.changeset","**/.idea","**/.cache","**/.output","**/.vite-inspect","**/.yarn","**/storybook-static","**/.eslint-config-inspector","**/playwright-report","**/.astro","**/.vinxi","**/app.config.timestamp_*.js","**/CHANGELOG*.md","**/*.min.*","**/LICENSE*","**/__snapshots__","**/auto-import?(s).d.ts","**/components.d.ts","**/vite.config.ts.*.mjs","**/*.gen.*","!.storybook"],ie="**/*.?([cm])js",y="**/*.?([cm])jsx",R="**/*.?([cm])tsx",m=[`**/__tests__/**/*.${l}`,`**/*.spec.${l}`,`**/*.test.${l}`,`**/*.bench.${l}`,`**/*.benchmark.${l}`],T=[`**/e2e/**/*.spec.${l}`,`**/e2e/**/*.test.${l}`],j=[...T,`**/cypress/**/*.spec.${l}`,`**/cypress/**/*.test.${l}`],ae="**/*.cjs",ce="**/*.astro",le=["vi.mock","describe","expect","it"],pe=["@testing-library/react"],i=t(async e=>{const r=await e;return r.default??r},"interopDefault"),fe=t(async()=>{const e=[ce],[r,s,n]=await Promise.all([import("eslint-plugin-astro"),import("astro-eslint-parser"),i(import("eslint-plugin-jsx-a11y"))]);return[{files:e,languageOptions:{globals:{...g.node,Astro:!1,Fragment:!1},parser:s,parserOptions:{extraFileExtensions:[".astro"],parser:p.parser},sourceType:"module"},name:"jimmy.codes/astro",plugins:{astro:r,"jsx-a11y":n},processor:"astro/client-side-ts",rules:{...n.configs.recommended.rules,"astro/missing-client-only-directive-value":"error","astro/no-conflict-set-directives":"error","astro/no-deprecated-astro-canonicalurl":"error","astro/no-deprecated-astro-fetchcontent":"error","astro/no-deprecated-astro-resolve":"error","astro/no-deprecated-getentrybyslug":"error","astro/no-exports-from-components":"off","astro/no-unused-define-vars-in-style":"error","astro/valid-compile":"error"}},{files:e,languageOptions:{parserOptions:p.configs.disableTypeChecked.languageOptions?.parserOptions},name:"jimmy.codes/astro/disable-type-checked",rules:p.configs.disableTypeChecked.rules},{name:"jimmy.codes/astro/imports",settings:{"import-x/core-modules":["astro:content"]}}]},"astroConfig"),ue=t(()=>[{files:[ae],languageOptions:{globals:g.commonjs},name:"jimmy.codes/commonjs"}],"commonjsConfig"),me={...E.recommended.rules,"@eslint-community/eslint-comments/no-unused-disable":"off","@eslint-community/eslint-comments/require-description":"error"},de=t(()=>[{...E.recommended,name:"jimmy.codes/eslint-comments",rules:me}],"eslintCommentsConfig"),ge=t(e=>[{ignores:[...ne,...e],name:"jimmy.codes/ignores"}],"ignoresConfig"),ye={...u.configs.recommended.rules,"import-x/consistent-type-specifier-style":["error","prefer-top-level"],"import-x/extensions":["error","never",{checkTypedImports:!0,svg:"always"}],"import-x/first":"error","import-x/namespace":"off","import-x/newline-after-import":"error","import-x/no-absolute-path":"error","import-x/no-duplicates":"error","import-x/no-empty-named-blocks":"error","import-x/no-named-as-default":"error","import-x/no-named-as-default-member":"error","import-x/no-self-import":"error","import-x/no-unresolved":["error",{ignore:[String.raw`\.svg$`]}],"import-x/no-useless-path-segments":"error"},je={name:"jimmy.codes/imports/typescript",rules:u.configs.typescript.rules,settings:{...u.configs.typescript.settings,"import-x/resolver":{...u.configs.typescript.settings["import-x/resolver"],typescript:!0}}},xe=t(({typescript:e=!1}={})=>[{name:"jimmy.codes/imports",plugins:{"import-x":u,n:O},rules:ye},...e?[je]:[]],"importsConfig"),he={...re.configs.recommended.rules,"array-callback-return":["error",{allowImplicit:!0}],"arrow-body-style":["error","always"],curly:["error","all"],"no-console":"warn","no-self-compare":"error","no-template-curly-in-string":"error","no-unmodified-loop-condition":"error","no-unreachable-loop":"error","no-use-before-define":["error",{allowNamedExports:!1,classes:!1,functions:!1,variables:!0}],"no-useless-rename":"error","object-shorthand":"error","prefer-arrow-callback":"error"},be=t(()=>[{linterOptions:{reportUnusedDisableDirectives:!0},name:"jimmy.codes/javascript",rules:he}],"javascriptConfig"),we={"n/no-process-exit":"off","n/prefer-node-protocol":"error"},ve=t(()=>[{name:"jimmy.codes/node",plugins:{n:O},rules:we}],"nodeConfig"),ke={...C.configs["recommended-natural"].rules,"perfectionist/sort-imports":["error",{customGroups:{type:{},value:{}},environment:"node",groups:["side-effect-style","builtin","type","external","internal-type","internal",["parent-type","sibling-type","index-type"],["parent","sibling","index"],"object","style","unknown"],internalPattern:["^~/.*","^@/.*"],order:"asc",type:"natural"}],"perfectionist/sort-modules":"off"},Pe=t(()=>[{name:"jimmy.codes/perfectionist",plugins:{perfectionist:C},rules:ke}],"perfectionistConfig"),Ee=t(async()=>({...(await i(import("eslint-plugin-playwright"))).configs["flat/recommended"].rules,"playwright/expect-expect":"error","playwright/max-nested-describe":"error","playwright/no-conditional-expect":"error","playwright/no-conditional-in-test":"error","playwright/no-element-handle":"error","playwright/no-eval":"error","playwright/no-force-option":"error","playwright/no-nested-step":"error","playwright/no-page-pause":"error","playwright/no-skipped-test":"error","playwright/no-useless-await":"error","playwright/no-useless-not":"error","playwright/no-wait-for-selector":"error","playwright/no-wait-for-timeout":"error"}),"playwrightRules"),Oe=t(async()=>[{...(await i(import("eslint-plugin-playwright"))).configs["flat/recommended"],files:T,name:"jimmy.codes/playwright",rules:await Ee()}],"playwrightConfig"),Ce=t(()=>[{name:"jimmy.codes/prettier",...te}],"prettierConfig"),qe=t(()=>c.isPackageExists("typescript"),"hasTypescript"),_e=t(()=>c.isPackageExists("react"),"hasReact"),L=t(()=>c.isPackageExists("vitest"),"hasVitest"),S=t(()=>c.isPackageExists("jest"),"hasJest"),Re=t(()=>L()||S(),"hasTesting"),Te=t(()=>pe.some(e=>c.isPackageExists(e)),"hasTestingLibrary"),Le=t(()=>c.isPackageExists("@tanstack/react-query"),"hasReactQuery"),Se=t(()=>c.isPackageExists("astro"),"hasAstro"),Ae=t(()=>c.isPackageExists("@playwright/test"),"hasPlaywright"),Ge=t(()=>c.isPackageExists("storybook"),"hasStorybook"),Ie=t(()=>c.isPackageExists("next"),"hasNext"),Ne=t(()=>c.isPackageExists("vite"),"hasVite"),Be=t(e=>e===2?"error":e===1?"warn":"off","toStringSeverity"),A=t((e={})=>Object.fromEntries(Object.entries(e).map(([r,s])=>[r,typeof s=="number"?Be(s):s])),"normalizeRuleEntries"),$e=["dynamic","dynamicParams","revalidate","fetchCache","runtime","preferredRegion","maxDuration","config","generateStaticParams","metadata","generateMetadata","viewport","generateViewport"],Fe=t(async()=>{const[e,r]=await Promise.all([i(import("eslint-plugin-react")),i(import("eslint-plugin-jsx-a11y"))]),s=Ie(),n=Ne();return{...r.configs.recommended.rules,...A(e.configs.flat?.recommended?.rules),...A(e.configs.flat?.["jsx-runtime"]?.rules),"react-compiler/react-compiler":"error","react-hooks/exhaustive-deps":"error","react-hooks/rules-of-hooks":"error","react-refresh/only-export-components":["warn",{allowConstantExport:n,allowExportNames:s?$e:[]}],"react/boolean-prop-naming":"off","react/button-has-type":"error","react/checked-requires-onchange-or-readonly":"error","react/default-props-match-prop-types":"error","react/destructuring-assignment":"off","react/forbid-component-props":"off","react/forbid-dom-props":"off","react/forbid-elements":"off","react/forbid-foreign-prop-types":"off","react/forbid-prop-types":"off","react/forward-ref-uses-ref":"error","react/function-component-definition":"off","react/hook-use-state":"error","react/iframe-missing-sandbox":"error","react/jsx-boolean-value":["error","never"],"react/jsx-curly-brace-presence":"error","react/jsx-filename-extension":"off","react/jsx-fragments":["error","syntax"],"react/jsx-handler-names":"off","react/jsx-max-depth":"off","react/jsx-no-bind":"off","react/jsx-no-constructed-context-values":"error","react/jsx-no-leaked-render":"error","react/jsx-no-literals":"off","react/jsx-no-script-url":"error","react/jsx-no-useless-fragment":"error","react/jsx-one-expression-per-line":"off","react/jsx-pascal-case":["error",{allowNamespace:!0}],"react/jsx-props-no-spread-multi":"off","react/jsx-props-no-spreading":"off","react/jsx-sort-default-props":"off","react/jsx-sort-props":"off","react/no-access-state-in-setstate":"error","react/no-adjacent-inline-elements":"off","react/no-array-index-key":"off","react/no-arrow-function-lifecycle":"error","react/no-danger":"off","react/no-did-mount-set-state":"error","react/no-did-update-set-state":"error","react/no-invalid-html-attribute":"error","react/no-multi-comp":"off","react/no-namespace":"error","react/no-object-type-as-default-prop":"error","react/no-redundant-should-component-update":"error","react/no-set-state":"off","react/no-this-in-sfc":"error","react/no-typos":"error","react/no-unstable-nested-components":"error","react/no-unused-class-component-methods":"error","react/no-unused-prop-types":"error","react/no-unused-state":"error","react/no-will-update-set-state":"error","react/prefer-es6-class":"off","react/prefer-exact-props":"off","react/prefer-read-only-props":"off","react/prefer-stateless-function":"off","react/require-default-props":"off","react/require-optimization":"off","react/self-closing-comp":"error","react/sort-comp":"off","react/sort-default-props":"off","react/sort-prop-types":"off","react/state-in-constructor":"off","react/static-property-placement":"off","react/style-prop-object":"error","react/void-dom-elements-no-children":"error"}},"reactRules"),Ve=t(async()=>{const[e,r,s,n,a]=await Promise.all([i(import("eslint-plugin-react")),i(import("eslint-plugin-jsx-a11y")),import("eslint-plugin-react-hooks"),i(import("eslint-plugin-react-refresh")),i(import("eslint-plugin-react-compiler"))]);return[{files:[y,R],languageOptions:{globals:{...g.browser},parserOptions:{ecmaFeatures:{jsx:!0},jsxPragma:null}},name:"jimmy.codes/react",plugins:{"jsx-a11y":r,react:e,"react-compiler":a,"react-hooks":s,"react-refresh":n},rules:await Fe(),settings:{react:{version:"detect"}}}]},"reactConfig"),Je={..._.configs["flat/recommended"].rules,"regexp/confusing-quantifier":"error","regexp/no-empty-alternative":"error","regexp/no-lazy-ends":"error","regexp/no-potentially-useless-backreference":"error","regexp/no-useless-flag":"error","regexp/optimal-lookaround-quantifier":"error"},Ue=t(()=>[{name:"jimmy.codes/regexp",plugins:{regexp:_},rules:Je}],"regexpConfig"),ze=t((e={})=>Object.fromEntries(Object.entries(e).map(([r,s])=>[r,s==="warn"?"error":s])),"warningAsErrors"),Qe=t(async()=>{const{configs:e}=await i(import("eslint-plugin-storybook")),[r,s,n]=e["flat/recommended"];return[{name:"jimmy.codes/storybook/setup",plugins:r?.plugins},{files:s?.files,name:"jimmy.codes/storybook/stories-rules",rules:{...ze(s?.rules),"import-x/no-anonymous-default-export":"off","unicorn/no-anonymous-default-export":"off"}},{files:n?.files,name:"jimmy.codes/storybook/main-rules",rules:{...n?.rules}}]},"storybookConfig"),Xe=t(async()=>{const e=await i(import("@tanstack/eslint-plugin-query"));return[{files:[y,R],name:"jimmy.codes/react/query",plugins:{"@tanstack/query":e},rules:{"@tanstack/query/exhaustive-deps":"error","@tanstack/query/no-rest-destructuring":"warn","@tanstack/query/stable-query-client":"error"}}]},"tanstackQueryConfig"),G=t(async()=>{const e=await i(import("eslint-plugin-jest"));return{...e.configs["flat/recommended"].rules,...e.configs["flat/style"].rules,"jest/consistent-test-it":["error",{fn:"test",withinDescribe:"it"}],"jest/expect-expect":"error","jest/no-alias-methods":"error","jest/no-commented-out-tests":"error","jest/no-conditional-in-test":"error","jest/no-confusing-set-timeout":"error","jest/no-duplicate-hooks":"error","jest/no-hooks":"off","jest/no-large-snapshots":"off","jest/no-restricted-jest-methods":"off","jest/no-restricted-matchers":"off","jest/no-test-return-statement":"error","jest/no-untyped-mock-factory":"off","jest/prefer-called-with":"error","jest/prefer-comparison-matcher":"error","jest/prefer-each":"error","jest/prefer-equality-matcher":"error","jest/prefer-expect-assertions":"off","jest/prefer-expect-resolves":"error","jest/prefer-hooks-in-order":"error","jest/prefer-hooks-on-top":"error","jest/prefer-lowercase-title":"off","jest/prefer-mock-promise-shorthand":"error","jest/prefer-snapshot-hint":"error","jest/prefer-spy-on":"off","jest/prefer-strict-equal":"error","jest/prefer-todo":"warn","jest/require-hook":"error","jest/require-to-throw-message":"error","jest/require-top-level-describe":"off","jest/unbound-method":"off"}},"jestRules"),He=t(async()=>({...await G(),"jest/no-deprecated-functions":"off","jest/require-hook":["error",{allowedFunctionCalls:le}]}),"vitestRules"),Me=t(async({framework:e="vitest"}={},r=!0)=>{const s=r?L():e==="vitest",n=e==="jest"||r&&S(),a=[];if(s){const f=await i(import("eslint-plugin-jest"));a.push({files:m,ignores:j,...f.configs["flat/recommended"],name:"jimmy.codes/vitest",rules:await He()})}if(n){const f=await i(import("eslint-plugin-jest"));a.push({files:m,ignores:j,...f.configs["flat/recommended"],name:"jimmy.codes/jest",rules:await G()})}return a},"testingConfig"),We=t(async()=>{const[e,r]=await Promise.all([import("eslint-plugin-jest-dom"),i(import("eslint-plugin-testing-library"))]);return{...r.configs["flat/react"].rules,...e.configs["flat/recommended"].rules}},"testingLibraryRules"),Ye=t(async()=>{const[e,r]=await Promise.all([import("eslint-plugin-jest-dom"),i(import("eslint-plugin-testing-library"))]);return[{files:m,ignores:j,name:"jimmy.codes/testing-library",plugins:{"jest-dom":e,"testing-library":r},rules:await We()}]},"testingLibraryConfig"),De={"@typescript-eslint/consistent-type-exports":["error",{fixMixedExportsWithInlineTypeSpecifier:!1}],"@typescript-eslint/consistent-type-imports":["error",{fixStyle:"separate-type-imports"}],"@typescript-eslint/no-deprecated":"warn","@typescript-eslint/no-misused-promises":["error",{checksVoidReturn:{attributes:!1}}],"@typescript-eslint/no-unused-vars":["error",{args:"all",argsIgnorePattern:"^_",caughtErrors:"all",caughtErrorsIgnorePattern:"^_",destructuredArrayIgnorePattern:"^_",ignoreRestSiblings:!0,varsIgnorePattern:"^_"}],"@typescript-eslint/no-use-before-define":["error",{allowNamedExports:!1,classes:!1,functions:!1,variables:!0}],"@typescript-eslint/restrict-template-expressions":["error",{allowNumber:!0}],"no-use-before-define":"off"},Ke=t(e=>[...p.configs.strictTypeChecked,...p.configs.stylisticTypeChecked.filter(r=>r.name==="typescript-eslint/stylistic-type-checked"),{languageOptions:{parserOptions:{...e?.project?{project:e.project}:{projectService:!0},tsconfigRootDir:process.cwd()}},name:"jimmy.codes/typescript",rules:De},{files:[ie,y],...p.configs.disableTypeChecked},{files:m,name:"jimmy.codes/typescript/testing",rules:{"@typescript-eslint/no-unsafe-argument":"off","@typescript-eslint/no-unsafe-assignment":"off"}}],"typescriptConfig"),Ze={...q.configs["flat/recommended"].rules,"unicorn/filename-case":"off","unicorn/import-style":"off","unicorn/no-abusive-eslint-disable":"off","unicorn/no-anonymous-default-export":"off","unicorn/no-array-callback-reference":"off","unicorn/no-array-reduce":"off","unicorn/no-null":"off","unicorn/no-process-exit":"off","unicorn/no-useless-undefined":["error",{checkArguments:!1,checkArrowFunctionBody:!1}],"unicorn/prefer-node-protocol":"off","unicorn/prevent-abbreviations":"off"},er=t(()=>[{...q.configs["flat/recommended"],name:"jimmy.codes/unicorn",rules:Ze}],"unicornConfig"),rr=t(e=>typeof e=="object"?e:void 0,"getTypescriptOptions"),tr=t((e,r)=>typeof e=="object"?e:{framework:r.vitest?"vitest":r.jest?"jest":"vitest",...r.testingLibrary&&{utilities:["testing-library"]}},"getTestingOptions"),sr=t(e=>typeof e=="object"?e:{utilities:[]},"getReactOptions"),or=t(({utilities:e=[]},r,s)=>r||e.includes("@tanstack/query")||s&&Le(),"shouldEnableTanstackQuery"),nr=t(({utilities:e=[]},r)=>e.includes("testing-library")||r&&Te(),"shouldEnableTestingLibrary"),ir=t(async({astro:e=!1,autoDetect:r=!0,configs:s=[],ignores:n=[],jest:a=!1,overrides:f=[],playwright:I=!1,react:x=!1,storybook:N=!1,tanstackQuery:B=!1,testing:h=!1,testingLibrary:$=!1,typescript:b=!1,vitest:w=!1}={},...F)=>{const V=sr(x),v=tr(h,{jest:a,testingLibrary:$,vitest:w}),k=rr(b),P=b||!!k||r&&qe(),J=x||r&&_e(),U=h||a||w||r&&Re(),z=e||r&&Se(),Q=or(V,B,r),X=nr(v,r),H=I||r&&Ae(),M=N||r&&Ge();return[be(),Pe(),ve(),er(),de(),Ue(),xe({typescript:P}),P?Ke(k):[],J?await Ve():[],Q?await Xe():[],z?await fe():[],U?await Me(v,r):[],X?await Ye():[],H?await Oe():[],M?await Qe():[],Ce(),ue(),ge(n),s,f,F].flat()},"eslintConfig");module.exports=ir;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as eslint_plugin_regexp from 'eslint-plugin-regexp';
|
|
2
|
-
import * as eslint_plugin_react_refresh from 'eslint-plugin-react-refresh';
|
|
3
2
|
import * as eslint_plugin_react from 'eslint-plugin-react';
|
|
4
3
|
import * as eslint_plugin_n from 'eslint-plugin-n';
|
|
5
4
|
import * as eslint_plugin_import_x_utils_module_visitor_js from 'eslint-plugin-import-x/utils/module-visitor.js';
|
|
@@ -2475,7 +2474,7 @@ interface RuleOptions {
|
|
|
2475
2474
|
*/
|
|
2476
2475
|
'no-class-assign'?: Linter.RuleEntry<[]>
|
|
2477
2476
|
/**
|
|
2478
|
-
* Disallow comparing against
|
|
2477
|
+
* Disallow comparing against `-0`
|
|
2479
2478
|
* @see https://eslint.org/docs/latest/rules/no-compare-neg-zero
|
|
2480
2479
|
*/
|
|
2481
2480
|
'no-compare-neg-zero'?: Linter.RuleEntry<[]>
|
|
@@ -6686,6 +6685,10 @@ type TypescriptEslintPreferOptionalChain = []|[{
|
|
|
6686
6685
|
type TypescriptEslintPreferPromiseRejectErrors = []|[{
|
|
6687
6686
|
|
|
6688
6687
|
allowEmptyReject?: boolean
|
|
6688
|
+
|
|
6689
|
+
allowThrowingAny?: boolean
|
|
6690
|
+
|
|
6691
|
+
allowThrowingUnknown?: boolean
|
|
6689
6692
|
}]
|
|
6690
6693
|
// ----- @typescript-eslint/prefer-readonly -----
|
|
6691
6694
|
type TypescriptEslintPreferReadonly = []|[{
|
|
@@ -9814,9 +9817,10 @@ type ReactHooksExhaustiveDeps = []|[{
|
|
|
9814
9817
|
}]
|
|
9815
9818
|
// ----- react-refresh/only-export-components -----
|
|
9816
9819
|
type ReactRefreshOnlyExportComponents = []|[{
|
|
9820
|
+
allowExportNames?: string[]
|
|
9817
9821
|
allowConstantExport?: boolean
|
|
9822
|
+
customHOCs?: string[]
|
|
9818
9823
|
checkJS?: boolean
|
|
9819
|
-
allowExportNames?: string[]
|
|
9820
9824
|
}]
|
|
9821
9825
|
// ----- react/boolean-prop-naming -----
|
|
9822
9826
|
type ReactBooleanPropNaming = []|[{
|
|
@@ -10439,6 +10443,7 @@ type SortKeys = []|[("asc" | "desc")]|[("asc" | "desc"), {
|
|
|
10439
10443
|
natural?: boolean
|
|
10440
10444
|
minKeys?: number
|
|
10441
10445
|
allowLineSeparatedGroups?: boolean
|
|
10446
|
+
ignoreComputedKeys?: boolean
|
|
10442
10447
|
}]
|
|
10443
10448
|
// ----- sort-vars -----
|
|
10444
10449
|
type SortVars = []|[{
|
|
@@ -10857,6 +10862,7 @@ interface Options {
|
|
|
10857
10862
|
autoDetect?: boolean;
|
|
10858
10863
|
/**
|
|
10859
10864
|
* Additional configs to either extend or overrides configurations
|
|
10865
|
+
* @deprecated please use {@link Options.configs} instead.
|
|
10860
10866
|
* @default []
|
|
10861
10867
|
*/
|
|
10862
10868
|
configs?: Linter.Config[] | TypedConfigItem[];
|
|
@@ -10870,6 +10876,11 @@ interface Options {
|
|
|
10870
10876
|
* @default false
|
|
10871
10877
|
*/
|
|
10872
10878
|
jest?: boolean;
|
|
10879
|
+
/**
|
|
10880
|
+
* Additional configs to either extend or overrides configurations
|
|
10881
|
+
* @default []
|
|
10882
|
+
*/
|
|
10883
|
+
overrides?: Linter.Config[] | TypedConfigItem[];
|
|
10873
10884
|
/**
|
|
10874
10885
|
* Are playwright rules enabled?
|
|
10875
10886
|
* @default false
|
|
@@ -10913,7 +10924,7 @@ interface Options {
|
|
|
10913
10924
|
vitest?: boolean;
|
|
10914
10925
|
}
|
|
10915
10926
|
|
|
10916
|
-
declare const eslintConfig: ({ astro, autoDetect, configs, ignores, jest, playwright, react, storybook, tanstackQuery, testing, testingLibrary, typescript, vitest, }?: Options, ...
|
|
10927
|
+
declare const eslintConfig: ({ astro, autoDetect, configs, ignores, jest, overrides, playwright, react, storybook, tanstackQuery, testing, testingLibrary, typescript, vitest, }?: Options, ...moreOverrides: Linter.Config[] | TypedConfigItem[]) => Promise<(TypedConfigItem | Linter.Config<Linter.RulesRecord> | _typescript_eslint_utils_ts_eslint.FlatConfig.Config | {
|
|
10917
10928
|
files: string[];
|
|
10918
10929
|
languageOptions: {
|
|
10919
10930
|
globals: {
|
|
@@ -11756,6 +11767,7 @@ declare const eslintConfig: ({ astro, autoDetect, configs, ignores, jest, playwr
|
|
|
11756
11767
|
CSSKeywordValue: false;
|
|
11757
11768
|
CSSLayerBlockRule: false;
|
|
11758
11769
|
CSSLayerStatementRule: false;
|
|
11770
|
+
CSSMarginRule: false;
|
|
11759
11771
|
CSSMathClamp: false;
|
|
11760
11772
|
CSSMathInvert: false;
|
|
11761
11773
|
CSSMathMax: false;
|
|
@@ -12721,12 +12733,15 @@ declare const eslintConfig: ({ astro, autoDetect, configs, ignores, jest, playwr
|
|
|
12721
12733
|
XRDepthInformation: false;
|
|
12722
12734
|
XRDOMOverlayState: false;
|
|
12723
12735
|
XRFrame: false;
|
|
12736
|
+
XRHand: false;
|
|
12724
12737
|
XRHitTestResult: false;
|
|
12725
12738
|
XRHitTestSource: false;
|
|
12726
12739
|
XRInputSource: false;
|
|
12727
12740
|
XRInputSourceArray: false;
|
|
12728
12741
|
XRInputSourceEvent: false;
|
|
12729
12742
|
XRInputSourcesChangeEvent: false;
|
|
12743
|
+
XRJointPose: false;
|
|
12744
|
+
XRJointSpace: false;
|
|
12730
12745
|
XRLayer: false;
|
|
12731
12746
|
XRLightEstimate: false;
|
|
12732
12747
|
XRLightProbe: false;
|
|
@@ -13163,14 +13178,35 @@ declare const eslintConfig: ({ astro, autoDetect, configs, ignores, jest, playwr
|
|
|
13163
13178
|
};
|
|
13164
13179
|
};
|
|
13165
13180
|
};
|
|
13166
|
-
"react-refresh":
|
|
13181
|
+
"react-refresh": {
|
|
13182
|
+
rules: Record<string, any>;
|
|
13183
|
+
configs: {
|
|
13184
|
+
recommended: {
|
|
13185
|
+
plugins: {
|
|
13186
|
+
"react-refresh": {
|
|
13187
|
+
rules: Record<string, any>;
|
|
13188
|
+
};
|
|
13189
|
+
};
|
|
13190
|
+
rules: Record<string, any>;
|
|
13191
|
+
};
|
|
13192
|
+
vite: {
|
|
13193
|
+
plugins: {
|
|
13194
|
+
"react-refresh": {
|
|
13195
|
+
rules: Record<string, any>;
|
|
13196
|
+
};
|
|
13197
|
+
};
|
|
13198
|
+
rules: Record<string, any>;
|
|
13199
|
+
};
|
|
13200
|
+
};
|
|
13201
|
+
};
|
|
13167
13202
|
};
|
|
13168
13203
|
rules: {
|
|
13169
13204
|
"react-compiler/react-compiler": "error";
|
|
13170
13205
|
"react-hooks/exhaustive-deps": "error";
|
|
13171
13206
|
"react-hooks/rules-of-hooks": "error";
|
|
13172
13207
|
"react-refresh/only-export-components": ["warn", {
|
|
13173
|
-
allowConstantExport:
|
|
13208
|
+
allowConstantExport: boolean;
|
|
13209
|
+
allowExportNames: string[];
|
|
13174
13210
|
}];
|
|
13175
13211
|
"react/boolean-prop-naming": "off";
|
|
13176
13212
|
"react/button-has-type": "error";
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as eslint_plugin_regexp from 'eslint-plugin-regexp';
|
|
2
|
-
import * as eslint_plugin_react_refresh from 'eslint-plugin-react-refresh';
|
|
3
2
|
import * as eslint_plugin_react from 'eslint-plugin-react';
|
|
4
3
|
import * as eslint_plugin_n from 'eslint-plugin-n';
|
|
5
4
|
import * as eslint_plugin_import_x_utils_module_visitor_js from 'eslint-plugin-import-x/utils/module-visitor.js';
|
|
@@ -2475,7 +2474,7 @@ interface RuleOptions {
|
|
|
2475
2474
|
*/
|
|
2476
2475
|
'no-class-assign'?: Linter.RuleEntry<[]>
|
|
2477
2476
|
/**
|
|
2478
|
-
* Disallow comparing against
|
|
2477
|
+
* Disallow comparing against `-0`
|
|
2479
2478
|
* @see https://eslint.org/docs/latest/rules/no-compare-neg-zero
|
|
2480
2479
|
*/
|
|
2481
2480
|
'no-compare-neg-zero'?: Linter.RuleEntry<[]>
|
|
@@ -6686,6 +6685,10 @@ type TypescriptEslintPreferOptionalChain = []|[{
|
|
|
6686
6685
|
type TypescriptEslintPreferPromiseRejectErrors = []|[{
|
|
6687
6686
|
|
|
6688
6687
|
allowEmptyReject?: boolean
|
|
6688
|
+
|
|
6689
|
+
allowThrowingAny?: boolean
|
|
6690
|
+
|
|
6691
|
+
allowThrowingUnknown?: boolean
|
|
6689
6692
|
}]
|
|
6690
6693
|
// ----- @typescript-eslint/prefer-readonly -----
|
|
6691
6694
|
type TypescriptEslintPreferReadonly = []|[{
|
|
@@ -9814,9 +9817,10 @@ type ReactHooksExhaustiveDeps = []|[{
|
|
|
9814
9817
|
}]
|
|
9815
9818
|
// ----- react-refresh/only-export-components -----
|
|
9816
9819
|
type ReactRefreshOnlyExportComponents = []|[{
|
|
9820
|
+
allowExportNames?: string[]
|
|
9817
9821
|
allowConstantExport?: boolean
|
|
9822
|
+
customHOCs?: string[]
|
|
9818
9823
|
checkJS?: boolean
|
|
9819
|
-
allowExportNames?: string[]
|
|
9820
9824
|
}]
|
|
9821
9825
|
// ----- react/boolean-prop-naming -----
|
|
9822
9826
|
type ReactBooleanPropNaming = []|[{
|
|
@@ -10439,6 +10443,7 @@ type SortKeys = []|[("asc" | "desc")]|[("asc" | "desc"), {
|
|
|
10439
10443
|
natural?: boolean
|
|
10440
10444
|
minKeys?: number
|
|
10441
10445
|
allowLineSeparatedGroups?: boolean
|
|
10446
|
+
ignoreComputedKeys?: boolean
|
|
10442
10447
|
}]
|
|
10443
10448
|
// ----- sort-vars -----
|
|
10444
10449
|
type SortVars = []|[{
|
|
@@ -10857,6 +10862,7 @@ interface Options {
|
|
|
10857
10862
|
autoDetect?: boolean;
|
|
10858
10863
|
/**
|
|
10859
10864
|
* Additional configs to either extend or overrides configurations
|
|
10865
|
+
* @deprecated please use {@link Options.configs} instead.
|
|
10860
10866
|
* @default []
|
|
10861
10867
|
*/
|
|
10862
10868
|
configs?: Linter.Config[] | TypedConfigItem[];
|
|
@@ -10870,6 +10876,11 @@ interface Options {
|
|
|
10870
10876
|
* @default false
|
|
10871
10877
|
*/
|
|
10872
10878
|
jest?: boolean;
|
|
10879
|
+
/**
|
|
10880
|
+
* Additional configs to either extend or overrides configurations
|
|
10881
|
+
* @default []
|
|
10882
|
+
*/
|
|
10883
|
+
overrides?: Linter.Config[] | TypedConfigItem[];
|
|
10873
10884
|
/**
|
|
10874
10885
|
* Are playwright rules enabled?
|
|
10875
10886
|
* @default false
|
|
@@ -10913,7 +10924,7 @@ interface Options {
|
|
|
10913
10924
|
vitest?: boolean;
|
|
10914
10925
|
}
|
|
10915
10926
|
|
|
10916
|
-
declare const eslintConfig: ({ astro, autoDetect, configs, ignores, jest, playwright, react, storybook, tanstackQuery, testing, testingLibrary, typescript, vitest, }?: Options, ...
|
|
10927
|
+
declare const eslintConfig: ({ astro, autoDetect, configs, ignores, jest, overrides, playwright, react, storybook, tanstackQuery, testing, testingLibrary, typescript, vitest, }?: Options, ...moreOverrides: Linter.Config[] | TypedConfigItem[]) => Promise<(TypedConfigItem | Linter.Config<Linter.RulesRecord> | _typescript_eslint_utils_ts_eslint.FlatConfig.Config | {
|
|
10917
10928
|
files: string[];
|
|
10918
10929
|
languageOptions: {
|
|
10919
10930
|
globals: {
|
|
@@ -11756,6 +11767,7 @@ declare const eslintConfig: ({ astro, autoDetect, configs, ignores, jest, playwr
|
|
|
11756
11767
|
CSSKeywordValue: false;
|
|
11757
11768
|
CSSLayerBlockRule: false;
|
|
11758
11769
|
CSSLayerStatementRule: false;
|
|
11770
|
+
CSSMarginRule: false;
|
|
11759
11771
|
CSSMathClamp: false;
|
|
11760
11772
|
CSSMathInvert: false;
|
|
11761
11773
|
CSSMathMax: false;
|
|
@@ -12721,12 +12733,15 @@ declare const eslintConfig: ({ astro, autoDetect, configs, ignores, jest, playwr
|
|
|
12721
12733
|
XRDepthInformation: false;
|
|
12722
12734
|
XRDOMOverlayState: false;
|
|
12723
12735
|
XRFrame: false;
|
|
12736
|
+
XRHand: false;
|
|
12724
12737
|
XRHitTestResult: false;
|
|
12725
12738
|
XRHitTestSource: false;
|
|
12726
12739
|
XRInputSource: false;
|
|
12727
12740
|
XRInputSourceArray: false;
|
|
12728
12741
|
XRInputSourceEvent: false;
|
|
12729
12742
|
XRInputSourcesChangeEvent: false;
|
|
12743
|
+
XRJointPose: false;
|
|
12744
|
+
XRJointSpace: false;
|
|
12730
12745
|
XRLayer: false;
|
|
12731
12746
|
XRLightEstimate: false;
|
|
12732
12747
|
XRLightProbe: false;
|
|
@@ -13163,14 +13178,35 @@ declare const eslintConfig: ({ astro, autoDetect, configs, ignores, jest, playwr
|
|
|
13163
13178
|
};
|
|
13164
13179
|
};
|
|
13165
13180
|
};
|
|
13166
|
-
"react-refresh":
|
|
13181
|
+
"react-refresh": {
|
|
13182
|
+
rules: Record<string, any>;
|
|
13183
|
+
configs: {
|
|
13184
|
+
recommended: {
|
|
13185
|
+
plugins: {
|
|
13186
|
+
"react-refresh": {
|
|
13187
|
+
rules: Record<string, any>;
|
|
13188
|
+
};
|
|
13189
|
+
};
|
|
13190
|
+
rules: Record<string, any>;
|
|
13191
|
+
};
|
|
13192
|
+
vite: {
|
|
13193
|
+
plugins: {
|
|
13194
|
+
"react-refresh": {
|
|
13195
|
+
rules: Record<string, any>;
|
|
13196
|
+
};
|
|
13197
|
+
};
|
|
13198
|
+
rules: Record<string, any>;
|
|
13199
|
+
};
|
|
13200
|
+
};
|
|
13201
|
+
};
|
|
13167
13202
|
};
|
|
13168
13203
|
rules: {
|
|
13169
13204
|
"react-compiler/react-compiler": "error";
|
|
13170
13205
|
"react-hooks/exhaustive-deps": "error";
|
|
13171
13206
|
"react-hooks/rules-of-hooks": "error";
|
|
13172
13207
|
"react-refresh/only-export-components": ["warn", {
|
|
13173
|
-
allowConstantExport:
|
|
13208
|
+
allowConstantExport: boolean;
|
|
13209
|
+
allowExportNames: string[];
|
|
13174
13210
|
}];
|
|
13175
13211
|
"react/boolean-prop-naming": "off";
|
|
13176
13212
|
"react/button-has-type": "error";
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var H=Object.defineProperty;var r=(e,t)=>H(e,"name",{value:t,configurable:!0});import u from"globals";import{parser as U,configs as p}from"typescript-eslint";import v from"@eslint-community/eslint-plugin-eslint-comments/configs";import f from"eslint-plugin-import-x";import C from"eslint-plugin-n";import W from"@eslint/js";import P from"eslint-plugin-perfectionist";import Y from"eslint-config-prettier";import*as O from"eslint-plugin-regexp";import{isPackageExists as i}from"local-pkg";import E from"eslint-plugin-unicorn";const a="?([cm])[jt]s?(x)",M=["**/node_modules","**/dist","**/package-lock.json","**/yarn.lock","**/pnpm-lock.yaml","**/bun.lockb","**/output","**/coverage","**/temp","**/.temp","**/tmp","**/.tmp","**/.history","**/.vitepress/cache","**/.nuxt","**/.next","**/.vercel","**/.changeset","**/.idea","**/.cache","**/.output","**/.vite-inspect","**/.yarn","**/storybook-static","**/.eslint-config-inspector","**/playwright-report","**/.astro","**/.vinxi","**/app.config.timestamp_*.js","**/CHANGELOG*.md","**/*.min.*","**/LICENSE*","**/__snapshots__","**/auto-import?(s).d.ts","**/components.d.ts","**/vite.config.ts.*.mjs","**/*.gen.*","!.storybook"],K="**/*.?([cm])js",d="**/*.?([cm])jsx",T="**/*.?([cm])tsx",m=[`**/__tests__/**/*.${a}`,`**/*.spec.${a}`,`**/*.test.${a}`,`**/*.bench.${a}`,`**/*.benchmark.${a}`],_=[`**/e2e/**/*.spec.${a}`,`**/e2e/**/*.test.${a}`],y=[..._,`**/cypress/**/*.spec.${a}`,`**/cypress/**/*.test.${a}`],Z="**/*.cjs",D="**/*.astro",ee=["vi.mock","describe","expect","it"],re=["@testing-library/react"],s=r(async e=>{const t=await e;return t.default??t},"interopDefault"),te=r(async()=>{const e=[D],[t,o,n]=await Promise.all([import("eslint-plugin-astro"),import("astro-eslint-parser"),s(import("eslint-plugin-jsx-a11y"))]);return[{files:e,languageOptions:{globals:{...u.node,Astro:!1,Fragment:!1},parser:o,parserOptions:{extraFileExtensions:[".astro"],parser:U},sourceType:"module"},name:"jimmy.codes/astro",plugins:{astro:t,"jsx-a11y":n},processor:"astro/client-side-ts",rules:{...n.configs.recommended.rules,"astro/missing-client-only-directive-value":"error","astro/no-conflict-set-directives":"error","astro/no-deprecated-astro-canonicalurl":"error","astro/no-deprecated-astro-fetchcontent":"error","astro/no-deprecated-astro-resolve":"error","astro/no-deprecated-getentrybyslug":"error","astro/no-exports-from-components":"off","astro/no-unused-define-vars-in-style":"error","astro/valid-compile":"error"}},{files:e,languageOptions:{parserOptions:p.disableTypeChecked.languageOptions?.parserOptions},name:"jimmy.codes/astro/disable-type-checked",rules:p.disableTypeChecked.rules},{name:"jimmy.codes/astro/imports",settings:{"import-x/core-modules":["astro:content"]}}]},"astroConfig"),oe=r(()=>[{files:[Z],languageOptions:{globals:u.commonjs},name:"jimmy.codes/commonjs"}],"commonjsConfig"),se={...v.recommended.rules,"@eslint-community/eslint-comments/no-unused-disable":"off","@eslint-community/eslint-comments/require-description":"error"},ne=r(()=>[{...v.recommended,name:"jimmy.codes/eslint-comments",rules:se}],"eslintCommentsConfig"),ie=r(e=>[{ignores:[...M,...e],name:"jimmy.codes/ignores"}],"ignoresConfig"),ae={...f.configs.recommended.rules,"import-x/consistent-type-specifier-style":["error","prefer-top-level"],"import-x/extensions":["error","never",{checkTypedImports:!0,svg:"always"}],"import-x/first":"error","import-x/namespace":"off","import-x/newline-after-import":"error","import-x/no-absolute-path":"error","import-x/no-duplicates":"error","import-x/no-empty-named-blocks":"error","import-x/no-named-as-default":"error","import-x/no-named-as-default-member":"error","import-x/no-self-import":"error","import-x/no-unresolved":["error",{ignore:[String.raw`\.svg$`]}],"import-x/no-useless-path-segments":"error"},ce={name:"jimmy.codes/imports/typescript",rules:f.configs.typescript.rules,settings:{...f.configs.typescript.settings,"import-x/resolver":{...f.configs.typescript.settings["import-x/resolver"],typescript:!0}}},le=r(({typescript:e=!1}={})=>[{name:"jimmy.codes/imports",plugins:{"import-x":f,n:C},rules:ae},...e?[ce]:[]],"importsConfig"),pe={...W.configs.recommended.rules,"array-callback-return":["error",{allowImplicit:!0}],"arrow-body-style":["error","always"],curly:["error","all"],"no-console":"warn","no-self-compare":"error","no-template-curly-in-string":"error","no-unmodified-loop-condition":"error","no-unreachable-loop":"error","no-use-before-define":["error",{allowNamedExports:!1,classes:!1,functions:!1,variables:!0}],"no-useless-rename":"error","object-shorthand":"error","prefer-arrow-callback":"error"},fe=r(()=>[{linterOptions:{reportUnusedDisableDirectives:!0},name:"jimmy.codes/javascript",rules:pe}],"javascriptConfig"),me={"n/no-process-exit":"off","n/prefer-node-protocol":"error"},ue=r(()=>[{name:"jimmy.codes/node",plugins:{n:C},rules:me}],"nodeConfig"),de={...P.configs["recommended-natural"].rules,"perfectionist/sort-imports":["error",{customGroups:{type:{},value:{}},environment:"node",groups:["side-effect-style","builtin","type","external","internal-type","internal",["parent-type","sibling-type","index-type"],["parent","sibling","index"],"object","style","unknown"],internalPattern:["^~/.*","^@/.*"],order:"asc",type:"natural"}],"perfectionist/sort-modules":"off"},ye=r(()=>[{name:"jimmy.codes/perfectionist",plugins:{perfectionist:P},rules:de}],"perfectionistConfig"),ge=r(async()=>({...(await s(import("eslint-plugin-playwright"))).configs["flat/recommended"].rules,"playwright/expect-expect":"error","playwright/max-nested-describe":"error","playwright/no-conditional-expect":"error","playwright/no-conditional-in-test":"error","playwright/no-element-handle":"error","playwright/no-eval":"error","playwright/no-force-option":"error","playwright/no-nested-step":"error","playwright/no-page-pause":"error","playwright/no-skipped-test":"error","playwright/no-useless-await":"error","playwright/no-useless-not":"error","playwright/no-wait-for-selector":"error","playwright/no-wait-for-timeout":"error"}),"playwrightRules"),je=r(async()=>[{...(await s(import("eslint-plugin-playwright"))).configs["flat/recommended"],files:_,name:"jimmy.codes/playwright",rules:await ge()}],"playwrightConfig"),he=r(()=>[{name:"jimmy.codes/prettier",...Y}],"prettierConfig"),xe=r(e=>e===2?"error":e===1?"warn":"off","toStringSeverity"),R=r((e={})=>Object.fromEntries(Object.entries(e).map(([t,o])=>[t,typeof o=="number"?xe(o):o])),"normalizeRuleEntries"),be=r(async()=>{const[e,t]=await Promise.all([s(import("eslint-plugin-react")),s(import("eslint-plugin-jsx-a11y"))]);return{...t.configs.recommended.rules,...R(e.configs.flat?.recommended?.rules),...R(e.configs.flat?.["jsx-runtime"]?.rules),"react-compiler/react-compiler":"error","react-hooks/exhaustive-deps":"error","react-hooks/rules-of-hooks":"error","react-refresh/only-export-components":["warn",{allowConstantExport:!0}],"react/boolean-prop-naming":"off","react/button-has-type":"error","react/checked-requires-onchange-or-readonly":"error","react/default-props-match-prop-types":"error","react/destructuring-assignment":"off","react/forbid-component-props":"off","react/forbid-dom-props":"off","react/forbid-elements":"off","react/forbid-foreign-prop-types":"off","react/forbid-prop-types":"off","react/forward-ref-uses-ref":"error","react/function-component-definition":"off","react/hook-use-state":"error","react/iframe-missing-sandbox":"error","react/jsx-boolean-value":["error","never"],"react/jsx-curly-brace-presence":"error","react/jsx-filename-extension":"off","react/jsx-fragments":["error","syntax"],"react/jsx-handler-names":"off","react/jsx-max-depth":"off","react/jsx-no-bind":"off","react/jsx-no-constructed-context-values":"error","react/jsx-no-leaked-render":"error","react/jsx-no-literals":"off","react/jsx-no-script-url":"error","react/jsx-no-useless-fragment":"error","react/jsx-one-expression-per-line":"off","react/jsx-pascal-case":["error",{allowNamespace:!0}],"react/jsx-props-no-spread-multi":"off","react/jsx-props-no-spreading":"off","react/jsx-sort-default-props":"off","react/jsx-sort-props":"off","react/no-access-state-in-setstate":"error","react/no-adjacent-inline-elements":"off","react/no-array-index-key":"off","react/no-arrow-function-lifecycle":"error","react/no-danger":"off","react/no-did-mount-set-state":"error","react/no-did-update-set-state":"error","react/no-invalid-html-attribute":"error","react/no-multi-comp":"off","react/no-namespace":"error","react/no-object-type-as-default-prop":"error","react/no-redundant-should-component-update":"error","react/no-set-state":"off","react/no-this-in-sfc":"error","react/no-typos":"error","react/no-unstable-nested-components":"error","react/no-unused-class-component-methods":"error","react/no-unused-prop-types":"error","react/no-unused-state":"error","react/no-will-update-set-state":"error","react/prefer-es6-class":"off","react/prefer-exact-props":"off","react/prefer-read-only-props":"off","react/prefer-stateless-function":"off","react/require-default-props":"off","react/require-optimization":"off","react/self-closing-comp":"error","react/sort-comp":"off","react/sort-default-props":"off","react/sort-prop-types":"off","react/state-in-constructor":"off","react/static-property-placement":"off","react/style-prop-object":"error","react/void-dom-elements-no-children":"error"}},"reactRules"),we=r(async()=>{const[e,t,o,n,c]=await Promise.all([s(import("eslint-plugin-react")),s(import("eslint-plugin-jsx-a11y")),import("eslint-plugin-react-hooks"),import("eslint-plugin-react-refresh"),s(import("eslint-plugin-react-compiler"))]);return[{files:[d,T],languageOptions:{globals:{...u.browser},parserOptions:{ecmaFeatures:{jsx:!0},jsxPragma:null}},name:"jimmy.codes/react",plugins:{"jsx-a11y":t,react:e,"react-compiler":c,"react-hooks":o,"react-refresh":n},rules:await be(),settings:{react:{version:"detect"}}}]},"reactConfig"),ke={...O.configs["flat/recommended"].rules,"regexp/confusing-quantifier":"error","regexp/no-empty-alternative":"error","regexp/no-lazy-ends":"error","regexp/no-potentially-useless-backreference":"error","regexp/no-useless-flag":"error","regexp/optimal-lookaround-quantifier":"error"},ve=r(()=>[{name:"jimmy.codes/regexp",plugins:{regexp:O},rules:ke}],"regexpConfig"),Ce=r((e={})=>Object.fromEntries(Object.entries(e).map(([t,o])=>[t,o==="warn"?"error":o])),"warningAsErrors"),Pe=r(async()=>{const{configs:e}=await s(import("eslint-plugin-storybook")),[t,o,n]=e["flat/recommended"];return[{name:"jimmy.codes/storybook/setup",plugins:t?.plugins},{files:o?.files,name:"jimmy.codes/storybook/stories-rules",rules:{...Ce(o?.rules),"import-x/no-anonymous-default-export":"off","unicorn/no-anonymous-default-export":"off"}},{files:n?.files,name:"jimmy.codes/storybook/main-rules",rules:{...n?.rules}}]},"storybookConfig"),Oe=r(async()=>{const e=await s(import("@tanstack/eslint-plugin-query"));return[{files:[d,T],name:"jimmy.codes/react/query",plugins:{"@tanstack/query":e},rules:{"@tanstack/query/exhaustive-deps":"error","@tanstack/query/no-rest-destructuring":"warn","@tanstack/query/stable-query-client":"error"}}]},"tanstackQueryConfig"),L=r(async()=>{const e=await s(import("eslint-plugin-jest"));return{...e.configs["flat/recommended"].rules,...e.configs["flat/style"].rules,"jest/consistent-test-it":["error",{fn:"test",withinDescribe:"it"}],"jest/expect-expect":"error","jest/no-alias-methods":"error","jest/no-commented-out-tests":"error","jest/no-conditional-in-test":"error","jest/no-confusing-set-timeout":"error","jest/no-duplicate-hooks":"error","jest/no-hooks":"off","jest/no-large-snapshots":"off","jest/no-restricted-jest-methods":"off","jest/no-restricted-matchers":"off","jest/no-test-return-statement":"error","jest/no-untyped-mock-factory":"off","jest/prefer-called-with":"error","jest/prefer-comparison-matcher":"error","jest/prefer-each":"error","jest/prefer-equality-matcher":"error","jest/prefer-expect-assertions":"off","jest/prefer-expect-resolves":"error","jest/prefer-hooks-in-order":"error","jest/prefer-hooks-on-top":"error","jest/prefer-lowercase-title":"off","jest/prefer-mock-promise-shorthand":"error","jest/prefer-snapshot-hint":"error","jest/prefer-spy-on":"off","jest/prefer-strict-equal":"error","jest/prefer-todo":"warn","jest/require-hook":"error","jest/require-to-throw-message":"error","jest/require-top-level-describe":"off","jest/unbound-method":"off"}},"jestRules"),Ee=r(async()=>({...await L(),"jest/no-deprecated-functions":"off","jest/require-hook":["error",{allowedFunctionCalls:ee}]}),"vitestRules"),Te=r(()=>i("typescript"),"hasTypescript"),_e=r(()=>i("react"),"hasReact"),S=r(()=>i("vitest"),"hasVitest"),q=r(()=>i("jest"),"hasJest"),Re=r(()=>S()||q(),"hasTesting"),Le=r(()=>re.some(e=>i(e)),"hasTestingLibrary"),Se=r(()=>i("@tanstack/react-query"),"hasReactQuery"),qe=r(()=>i("astro"),"hasAstro"),Ae=r(()=>i("@playwright/test"),"hasPlaywright"),Ge=r(()=>i("storybook"),"hasStorybook"),Ie=r(async({framework:e="vitest"}={},t=!0)=>{const o=t?S():e==="vitest",n=e==="jest"||t&&q(),c=[];if(o){const l=await s(import("eslint-plugin-jest"));c.push({files:m,ignores:y,...l.configs["flat/recommended"],name:"jimmy.codes/vitest",rules:await Ee()})}if(n){const l=await s(import("eslint-plugin-jest"));c.push({files:m,ignores:y,...l.configs["flat/recommended"],name:"jimmy.codes/jest",rules:await L()})}return c},"testingConfig"),Be=r(async()=>{const[e,t]=await Promise.all([import("eslint-plugin-jest-dom"),s(import("eslint-plugin-testing-library"))]);return{...t.configs["flat/react"].rules,...e.configs["flat/recommended"].rules}},"testingLibraryRules"),$e=r(async()=>{const[e,t]=await Promise.all([import("eslint-plugin-jest-dom"),s(import("eslint-plugin-testing-library"))]);return[{files:m,ignores:y,name:"jimmy.codes/testing-library",plugins:{"jest-dom":e,"testing-library":t},rules:await Be()}]},"testingLibraryConfig"),Ne={"@typescript-eslint/consistent-type-exports":["error",{fixMixedExportsWithInlineTypeSpecifier:!1}],"@typescript-eslint/consistent-type-imports":["error",{fixStyle:"separate-type-imports"}],"@typescript-eslint/no-deprecated":"warn","@typescript-eslint/no-misused-promises":["error",{checksVoidReturn:{attributes:!1}}],"@typescript-eslint/no-unused-vars":["error",{args:"all",argsIgnorePattern:"^_",caughtErrors:"all",caughtErrorsIgnorePattern:"^_",destructuredArrayIgnorePattern:"^_",ignoreRestSiblings:!0,varsIgnorePattern:"^_"}],"@typescript-eslint/no-use-before-define":["error",{allowNamedExports:!1,classes:!1,functions:!1,variables:!0}],"@typescript-eslint/restrict-template-expressions":["error",{allowNumber:!0}],"no-use-before-define":"off"},Fe=r(e=>[...p.strictTypeChecked,...p.stylisticTypeChecked.filter(t=>t.name==="typescript-eslint/stylistic-type-checked"),{languageOptions:{parserOptions:{...e?.project?{project:e.project}:{projectService:!0},tsconfigRootDir:process.cwd()}},name:"jimmy.codes/typescript",rules:Ne},{files:[K,d],...p.disableTypeChecked},{files:m,name:"jimmy.codes/typescript/testing",rules:{"@typescript-eslint/no-unsafe-argument":"off","@typescript-eslint/no-unsafe-assignment":"off"}}],"typescriptConfig"),Je={...E.configs["flat/recommended"].rules,"unicorn/filename-case":"off","unicorn/import-style":"off","unicorn/no-abusive-eslint-disable":"off","unicorn/no-anonymous-default-export":"off","unicorn/no-array-callback-reference":"off","unicorn/no-array-reduce":"off","unicorn/no-null":"off","unicorn/no-process-exit":"off","unicorn/no-useless-undefined":["error",{checkArguments:!1,checkArrowFunctionBody:!1}],"unicorn/prefer-node-protocol":"off","unicorn/prevent-abbreviations":"off"},Qe=r(()=>[{...E.configs["flat/recommended"],name:"jimmy.codes/unicorn",rules:Je}],"unicornConfig"),Ve=r(e=>typeof e=="object"?e:void 0,"getTypescriptOptions"),Xe=r((e,t)=>typeof e=="object"?e:{framework:t.vitest?"vitest":t.jest?"jest":"vitest",...t.testingLibrary&&{utilities:["testing-library"]}},"getTestingOptions"),ze=r(e=>typeof e=="object"?e:{utilities:[]},"getReactOptions"),He=r(({utilities:e=[]},t,o)=>t||e.includes("@tanstack/query")||o&&Se(),"shouldEnableTanstackQuery"),Ue=r(({utilities:e=[]},t)=>e.includes("testing-library")||t&&Le(),"shouldEnableTestingLibrary"),We=r(async({astro:e=!1,autoDetect:t=!0,configs:o=[],ignores:n=[],jest:c=!1,playwright:l=!1,react:g=!1,storybook:A=!1,tanstackQuery:G=!1,testing:j=!1,testingLibrary:I=!1,typescript:h=!1,vitest:x=!1}={},...B)=>{const $=ze(g),b=Xe(j,{jest:c,testingLibrary:I,vitest:x}),w=Ve(h),k=h||!!w||t&&Te(),N=g||t&&_e(),F=j||c||x||t&&Re(),J=e||t&&qe(),Q=He($,G,t),V=Ue(b,t),X=l||t&&Ae(),z=A||t&&Ge();return[fe(),ye(),ue(),Qe(),ne(),ve(),le({typescript:k}),k?Fe(w):[],N?await we():[],Q?await Oe():[],J?await te():[],F?await Ie(b,t):[],V?await $e():[],X?await je():[],z?await Pe():[],he(),oe(),ie(n),o,B].flat()},"eslintConfig");export{We as default};
|
|
1
|
+
var H=Object.defineProperty;var r=(e,t)=>H(e,"name",{value:t,configurable:!0});import u from"globals";import{parser as M,configs as p}from"typescript-eslint";import v from"@eslint-community/eslint-plugin-eslint-comments/configs";import f from"eslint-plugin-import-x";import P from"eslint-plugin-n";import W from"@eslint/js";import C from"eslint-plugin-perfectionist";import Y from"eslint-config-prettier";import{isPackageExists as i}from"local-pkg";import*as O from"eslint-plugin-regexp";import E from"eslint-plugin-unicorn";const a="?([cm])[jt]s?(x)",D=["**/node_modules","**/dist","**/package-lock.json","**/yarn.lock","**/pnpm-lock.yaml","**/bun.lockb","**/output","**/coverage","**/temp","**/.temp","**/tmp","**/.tmp","**/.history","**/.vitepress/cache","**/.nuxt","**/.next","**/.vercel","**/.changeset","**/.idea","**/.cache","**/.output","**/.vite-inspect","**/.yarn","**/storybook-static","**/.eslint-config-inspector","**/playwright-report","**/.astro","**/.vinxi","**/app.config.timestamp_*.js","**/CHANGELOG*.md","**/*.min.*","**/LICENSE*","**/__snapshots__","**/auto-import?(s).d.ts","**/components.d.ts","**/vite.config.ts.*.mjs","**/*.gen.*","!.storybook"],K="**/*.?([cm])js",d="**/*.?([cm])jsx",R="**/*.?([cm])tsx",m=[`**/__tests__/**/*.${a}`,`**/*.spec.${a}`,`**/*.test.${a}`,`**/*.bench.${a}`,`**/*.benchmark.${a}`],T=[`**/e2e/**/*.spec.${a}`,`**/e2e/**/*.test.${a}`],g=[...T,`**/cypress/**/*.spec.${a}`,`**/cypress/**/*.test.${a}`],Z="**/*.cjs",ee="**/*.astro",re=["vi.mock","describe","expect","it"],te=["@testing-library/react"],s=r(async e=>{const t=await e;return t.default??t},"interopDefault"),oe=r(async()=>{const e=[ee],[t,o,n]=await Promise.all([import("eslint-plugin-astro"),import("astro-eslint-parser"),s(import("eslint-plugin-jsx-a11y"))]);return[{files:e,languageOptions:{globals:{...u.node,Astro:!1,Fragment:!1},parser:o,parserOptions:{extraFileExtensions:[".astro"],parser:M},sourceType:"module"},name:"jimmy.codes/astro",plugins:{astro:t,"jsx-a11y":n},processor:"astro/client-side-ts",rules:{...n.configs.recommended.rules,"astro/missing-client-only-directive-value":"error","astro/no-conflict-set-directives":"error","astro/no-deprecated-astro-canonicalurl":"error","astro/no-deprecated-astro-fetchcontent":"error","astro/no-deprecated-astro-resolve":"error","astro/no-deprecated-getentrybyslug":"error","astro/no-exports-from-components":"off","astro/no-unused-define-vars-in-style":"error","astro/valid-compile":"error"}},{files:e,languageOptions:{parserOptions:p.disableTypeChecked.languageOptions?.parserOptions},name:"jimmy.codes/astro/disable-type-checked",rules:p.disableTypeChecked.rules},{name:"jimmy.codes/astro/imports",settings:{"import-x/core-modules":["astro:content"]}}]},"astroConfig"),se=r(()=>[{files:[Z],languageOptions:{globals:u.commonjs},name:"jimmy.codes/commonjs"}],"commonjsConfig"),ne={...v.recommended.rules,"@eslint-community/eslint-comments/no-unused-disable":"off","@eslint-community/eslint-comments/require-description":"error"},ie=r(()=>[{...v.recommended,name:"jimmy.codes/eslint-comments",rules:ne}],"eslintCommentsConfig"),ae=r(e=>[{ignores:[...D,...e],name:"jimmy.codes/ignores"}],"ignoresConfig"),ce={...f.configs.recommended.rules,"import-x/consistent-type-specifier-style":["error","prefer-top-level"],"import-x/extensions":["error","never",{checkTypedImports:!0,svg:"always"}],"import-x/first":"error","import-x/namespace":"off","import-x/newline-after-import":"error","import-x/no-absolute-path":"error","import-x/no-duplicates":"error","import-x/no-empty-named-blocks":"error","import-x/no-named-as-default":"error","import-x/no-named-as-default-member":"error","import-x/no-self-import":"error","import-x/no-unresolved":["error",{ignore:[String.raw`\.svg$`]}],"import-x/no-useless-path-segments":"error"},le={name:"jimmy.codes/imports/typescript",rules:f.configs.typescript.rules,settings:{...f.configs.typescript.settings,"import-x/resolver":{...f.configs.typescript.settings["import-x/resolver"],typescript:!0}}},pe=r(({typescript:e=!1}={})=>[{name:"jimmy.codes/imports",plugins:{"import-x":f,n:P},rules:ce},...e?[le]:[]],"importsConfig"),fe={...W.configs.recommended.rules,"array-callback-return":["error",{allowImplicit:!0}],"arrow-body-style":["error","always"],curly:["error","all"],"no-console":"warn","no-self-compare":"error","no-template-curly-in-string":"error","no-unmodified-loop-condition":"error","no-unreachable-loop":"error","no-use-before-define":["error",{allowNamedExports:!1,classes:!1,functions:!1,variables:!0}],"no-useless-rename":"error","object-shorthand":"error","prefer-arrow-callback":"error"},me=r(()=>[{linterOptions:{reportUnusedDisableDirectives:!0},name:"jimmy.codes/javascript",rules:fe}],"javascriptConfig"),ue={"n/no-process-exit":"off","n/prefer-node-protocol":"error"},de=r(()=>[{name:"jimmy.codes/node",plugins:{n:P},rules:ue}],"nodeConfig"),ge={...C.configs["recommended-natural"].rules,"perfectionist/sort-imports":["error",{customGroups:{type:{},value:{}},environment:"node",groups:["side-effect-style","builtin","type","external","internal-type","internal",["parent-type","sibling-type","index-type"],["parent","sibling","index"],"object","style","unknown"],internalPattern:["^~/.*","^@/.*"],order:"asc",type:"natural"}],"perfectionist/sort-modules":"off"},ye=r(()=>[{name:"jimmy.codes/perfectionist",plugins:{perfectionist:C},rules:ge}],"perfectionistConfig"),je=r(async()=>({...(await s(import("eslint-plugin-playwright"))).configs["flat/recommended"].rules,"playwright/expect-expect":"error","playwright/max-nested-describe":"error","playwright/no-conditional-expect":"error","playwright/no-conditional-in-test":"error","playwright/no-element-handle":"error","playwright/no-eval":"error","playwright/no-force-option":"error","playwright/no-nested-step":"error","playwright/no-page-pause":"error","playwright/no-skipped-test":"error","playwright/no-useless-await":"error","playwright/no-useless-not":"error","playwright/no-wait-for-selector":"error","playwright/no-wait-for-timeout":"error"}),"playwrightRules"),he=r(async()=>[{...(await s(import("eslint-plugin-playwright"))).configs["flat/recommended"],files:T,name:"jimmy.codes/playwright",rules:await je()}],"playwrightConfig"),xe=r(()=>[{name:"jimmy.codes/prettier",...Y}],"prettierConfig"),be=r(()=>i("typescript"),"hasTypescript"),we=r(()=>i("react"),"hasReact"),_=r(()=>i("vitest"),"hasVitest"),L=r(()=>i("jest"),"hasJest"),ke=r(()=>_()||L(),"hasTesting"),ve=r(()=>te.some(e=>i(e)),"hasTestingLibrary"),Pe=r(()=>i("@tanstack/react-query"),"hasReactQuery"),Ce=r(()=>i("astro"),"hasAstro"),Oe=r(()=>i("@playwright/test"),"hasPlaywright"),Ee=r(()=>i("storybook"),"hasStorybook"),Re=r(()=>i("next"),"hasNext"),Te=r(()=>i("vite"),"hasVite"),_e=r(e=>e===2?"error":e===1?"warn":"off","toStringSeverity"),S=r((e={})=>Object.fromEntries(Object.entries(e).map(([t,o])=>[t,typeof o=="number"?_e(o):o])),"normalizeRuleEntries"),Le=["dynamic","dynamicParams","revalidate","fetchCache","runtime","preferredRegion","maxDuration","config","generateStaticParams","metadata","generateMetadata","viewport","generateViewport"],Se=r(async()=>{const[e,t]=await Promise.all([s(import("eslint-plugin-react")),s(import("eslint-plugin-jsx-a11y"))]),o=Re(),n=Te();return{...t.configs.recommended.rules,...S(e.configs.flat?.recommended?.rules),...S(e.configs.flat?.["jsx-runtime"]?.rules),"react-compiler/react-compiler":"error","react-hooks/exhaustive-deps":"error","react-hooks/rules-of-hooks":"error","react-refresh/only-export-components":["warn",{allowConstantExport:n,allowExportNames:o?Le:[]}],"react/boolean-prop-naming":"off","react/button-has-type":"error","react/checked-requires-onchange-or-readonly":"error","react/default-props-match-prop-types":"error","react/destructuring-assignment":"off","react/forbid-component-props":"off","react/forbid-dom-props":"off","react/forbid-elements":"off","react/forbid-foreign-prop-types":"off","react/forbid-prop-types":"off","react/forward-ref-uses-ref":"error","react/function-component-definition":"off","react/hook-use-state":"error","react/iframe-missing-sandbox":"error","react/jsx-boolean-value":["error","never"],"react/jsx-curly-brace-presence":"error","react/jsx-filename-extension":"off","react/jsx-fragments":["error","syntax"],"react/jsx-handler-names":"off","react/jsx-max-depth":"off","react/jsx-no-bind":"off","react/jsx-no-constructed-context-values":"error","react/jsx-no-leaked-render":"error","react/jsx-no-literals":"off","react/jsx-no-script-url":"error","react/jsx-no-useless-fragment":"error","react/jsx-one-expression-per-line":"off","react/jsx-pascal-case":["error",{allowNamespace:!0}],"react/jsx-props-no-spread-multi":"off","react/jsx-props-no-spreading":"off","react/jsx-sort-default-props":"off","react/jsx-sort-props":"off","react/no-access-state-in-setstate":"error","react/no-adjacent-inline-elements":"off","react/no-array-index-key":"off","react/no-arrow-function-lifecycle":"error","react/no-danger":"off","react/no-did-mount-set-state":"error","react/no-did-update-set-state":"error","react/no-invalid-html-attribute":"error","react/no-multi-comp":"off","react/no-namespace":"error","react/no-object-type-as-default-prop":"error","react/no-redundant-should-component-update":"error","react/no-set-state":"off","react/no-this-in-sfc":"error","react/no-typos":"error","react/no-unstable-nested-components":"error","react/no-unused-class-component-methods":"error","react/no-unused-prop-types":"error","react/no-unused-state":"error","react/no-will-update-set-state":"error","react/prefer-es6-class":"off","react/prefer-exact-props":"off","react/prefer-read-only-props":"off","react/prefer-stateless-function":"off","react/require-default-props":"off","react/require-optimization":"off","react/self-closing-comp":"error","react/sort-comp":"off","react/sort-default-props":"off","react/sort-prop-types":"off","react/state-in-constructor":"off","react/static-property-placement":"off","react/style-prop-object":"error","react/void-dom-elements-no-children":"error"}},"reactRules"),qe=r(async()=>{const[e,t,o,n,c]=await Promise.all([s(import("eslint-plugin-react")),s(import("eslint-plugin-jsx-a11y")),import("eslint-plugin-react-hooks"),s(import("eslint-plugin-react-refresh")),s(import("eslint-plugin-react-compiler"))]);return[{files:[d,R],languageOptions:{globals:{...u.browser},parserOptions:{ecmaFeatures:{jsx:!0},jsxPragma:null}},name:"jimmy.codes/react",plugins:{"jsx-a11y":t,react:e,"react-compiler":c,"react-hooks":o,"react-refresh":n},rules:await Se(),settings:{react:{version:"detect"}}}]},"reactConfig"),Ae={...O.configs["flat/recommended"].rules,"regexp/confusing-quantifier":"error","regexp/no-empty-alternative":"error","regexp/no-lazy-ends":"error","regexp/no-potentially-useless-backreference":"error","regexp/no-useless-flag":"error","regexp/optimal-lookaround-quantifier":"error"},Ge=r(()=>[{name:"jimmy.codes/regexp",plugins:{regexp:O},rules:Ae}],"regexpConfig"),Ie=r((e={})=>Object.fromEntries(Object.entries(e).map(([t,o])=>[t,o==="warn"?"error":o])),"warningAsErrors"),Ne=r(async()=>{const{configs:e}=await s(import("eslint-plugin-storybook")),[t,o,n]=e["flat/recommended"];return[{name:"jimmy.codes/storybook/setup",plugins:t?.plugins},{files:o?.files,name:"jimmy.codes/storybook/stories-rules",rules:{...Ie(o?.rules),"import-x/no-anonymous-default-export":"off","unicorn/no-anonymous-default-export":"off"}},{files:n?.files,name:"jimmy.codes/storybook/main-rules",rules:{...n?.rules}}]},"storybookConfig"),Be=r(async()=>{const e=await s(import("@tanstack/eslint-plugin-query"));return[{files:[d,R],name:"jimmy.codes/react/query",plugins:{"@tanstack/query":e},rules:{"@tanstack/query/exhaustive-deps":"error","@tanstack/query/no-rest-destructuring":"warn","@tanstack/query/stable-query-client":"error"}}]},"tanstackQueryConfig"),q=r(async()=>{const e=await s(import("eslint-plugin-jest"));return{...e.configs["flat/recommended"].rules,...e.configs["flat/style"].rules,"jest/consistent-test-it":["error",{fn:"test",withinDescribe:"it"}],"jest/expect-expect":"error","jest/no-alias-methods":"error","jest/no-commented-out-tests":"error","jest/no-conditional-in-test":"error","jest/no-confusing-set-timeout":"error","jest/no-duplicate-hooks":"error","jest/no-hooks":"off","jest/no-large-snapshots":"off","jest/no-restricted-jest-methods":"off","jest/no-restricted-matchers":"off","jest/no-test-return-statement":"error","jest/no-untyped-mock-factory":"off","jest/prefer-called-with":"error","jest/prefer-comparison-matcher":"error","jest/prefer-each":"error","jest/prefer-equality-matcher":"error","jest/prefer-expect-assertions":"off","jest/prefer-expect-resolves":"error","jest/prefer-hooks-in-order":"error","jest/prefer-hooks-on-top":"error","jest/prefer-lowercase-title":"off","jest/prefer-mock-promise-shorthand":"error","jest/prefer-snapshot-hint":"error","jest/prefer-spy-on":"off","jest/prefer-strict-equal":"error","jest/prefer-todo":"warn","jest/require-hook":"error","jest/require-to-throw-message":"error","jest/require-top-level-describe":"off","jest/unbound-method":"off"}},"jestRules"),$e=r(async()=>({...await q(),"jest/no-deprecated-functions":"off","jest/require-hook":["error",{allowedFunctionCalls:re}]}),"vitestRules"),Fe=r(async({framework:e="vitest"}={},t=!0)=>{const o=t?_():e==="vitest",n=e==="jest"||t&&L(),c=[];if(o){const l=await s(import("eslint-plugin-jest"));c.push({files:m,ignores:g,...l.configs["flat/recommended"],name:"jimmy.codes/vitest",rules:await $e()})}if(n){const l=await s(import("eslint-plugin-jest"));c.push({files:m,ignores:g,...l.configs["flat/recommended"],name:"jimmy.codes/jest",rules:await q()})}return c},"testingConfig"),Ve=r(async()=>{const[e,t]=await Promise.all([import("eslint-plugin-jest-dom"),s(import("eslint-plugin-testing-library"))]);return{...t.configs["flat/react"].rules,...e.configs["flat/recommended"].rules}},"testingLibraryRules"),Je=r(async()=>{const[e,t]=await Promise.all([import("eslint-plugin-jest-dom"),s(import("eslint-plugin-testing-library"))]);return[{files:m,ignores:g,name:"jimmy.codes/testing-library",plugins:{"jest-dom":e,"testing-library":t},rules:await Ve()}]},"testingLibraryConfig"),Ue={"@typescript-eslint/consistent-type-exports":["error",{fixMixedExportsWithInlineTypeSpecifier:!1}],"@typescript-eslint/consistent-type-imports":["error",{fixStyle:"separate-type-imports"}],"@typescript-eslint/no-deprecated":"warn","@typescript-eslint/no-misused-promises":["error",{checksVoidReturn:{attributes:!1}}],"@typescript-eslint/no-unused-vars":["error",{args:"all",argsIgnorePattern:"^_",caughtErrors:"all",caughtErrorsIgnorePattern:"^_",destructuredArrayIgnorePattern:"^_",ignoreRestSiblings:!0,varsIgnorePattern:"^_"}],"@typescript-eslint/no-use-before-define":["error",{allowNamedExports:!1,classes:!1,functions:!1,variables:!0}],"@typescript-eslint/restrict-template-expressions":["error",{allowNumber:!0}],"no-use-before-define":"off"},Qe=r(e=>[...p.strictTypeChecked,...p.stylisticTypeChecked.filter(t=>t.name==="typescript-eslint/stylistic-type-checked"),{languageOptions:{parserOptions:{...e?.project?{project:e.project}:{projectService:!0},tsconfigRootDir:process.cwd()}},name:"jimmy.codes/typescript",rules:Ue},{files:[K,d],...p.disableTypeChecked},{files:m,name:"jimmy.codes/typescript/testing",rules:{"@typescript-eslint/no-unsafe-argument":"off","@typescript-eslint/no-unsafe-assignment":"off"}}],"typescriptConfig"),Xe={...E.configs["flat/recommended"].rules,"unicorn/filename-case":"off","unicorn/import-style":"off","unicorn/no-abusive-eslint-disable":"off","unicorn/no-anonymous-default-export":"off","unicorn/no-array-callback-reference":"off","unicorn/no-array-reduce":"off","unicorn/no-null":"off","unicorn/no-process-exit":"off","unicorn/no-useless-undefined":["error",{checkArguments:!1,checkArrowFunctionBody:!1}],"unicorn/prefer-node-protocol":"off","unicorn/prevent-abbreviations":"off"},ze=r(()=>[{...E.configs["flat/recommended"],name:"jimmy.codes/unicorn",rules:Xe}],"unicornConfig"),He=r(e=>typeof e=="object"?e:void 0,"getTypescriptOptions"),Me=r((e,t)=>typeof e=="object"?e:{framework:t.vitest?"vitest":t.jest?"jest":"vitest",...t.testingLibrary&&{utilities:["testing-library"]}},"getTestingOptions"),We=r(e=>typeof e=="object"?e:{utilities:[]},"getReactOptions"),Ye=r(({utilities:e=[]},t,o)=>t||e.includes("@tanstack/query")||o&&Pe(),"shouldEnableTanstackQuery"),De=r(({utilities:e=[]},t)=>e.includes("testing-library")||t&&ve(),"shouldEnableTestingLibrary"),Ke=r(async({astro:e=!1,autoDetect:t=!0,configs:o=[],ignores:n=[],jest:c=!1,overrides:l=[],playwright:A=!1,react:y=!1,storybook:G=!1,tanstackQuery:I=!1,testing:j=!1,testingLibrary:N=!1,typescript:h=!1,vitest:x=!1}={},...B)=>{const $=We(y),b=Me(j,{jest:c,testingLibrary:N,vitest:x}),w=He(h),k=h||!!w||t&&be(),F=y||t&&we(),V=j||c||x||t&&ke(),J=e||t&&Ce(),U=Ye($,I,t),Q=De(b,t),X=A||t&&Oe(),z=G||t&&Ee();return[me(),ye(),de(),ze(),ie(),Ge(),pe({typescript:k}),k?Qe(w):[],F?await qe():[],U?await Be():[],J?await oe():[],V?await Fe(b,t):[],Q?await Je():[],X?await he():[],z?await Ne():[],xe(),se(),ae(n),o,l,B].flat()},"eslintConfig");export{Ke as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jimmy.codes/eslint-config",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.23.0",
|
|
4
4
|
"description": "another opinionated eslint config",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -32,11 +32,11 @@
|
|
|
32
32
|
],
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.4.1",
|
|
35
|
-
"@eslint/js": "^9.
|
|
36
|
-
"@tanstack/eslint-plugin-query": "^5.
|
|
35
|
+
"@eslint/js": "^9.16.0",
|
|
36
|
+
"@tanstack/eslint-plugin-query": "^5.62.1",
|
|
37
37
|
"@types/eslint": "9.6.1",
|
|
38
|
-
"@typescript-eslint/parser": "^8.
|
|
39
|
-
"@typescript-eslint/utils": "^8.
|
|
38
|
+
"@typescript-eslint/parser": "^8.17.0",
|
|
39
|
+
"@typescript-eslint/utils": "^8.17.0",
|
|
40
40
|
"astro-eslint-parser": "^1.1.0",
|
|
41
41
|
"eslint-config-prettier": "^9.1.0",
|
|
42
42
|
"eslint-import-resolver-typescript": "^3.6.3",
|
|
@@ -51,14 +51,14 @@
|
|
|
51
51
|
"eslint-plugin-react": "^7.37.2",
|
|
52
52
|
"eslint-plugin-react-compiler": "19.0.0-beta-df7b47d-20241124",
|
|
53
53
|
"eslint-plugin-react-hooks": "^5.0.0",
|
|
54
|
-
"eslint-plugin-react-refresh": "0.4.
|
|
54
|
+
"eslint-plugin-react-refresh": "0.4.16",
|
|
55
55
|
"eslint-plugin-regexp": "^2.7.0",
|
|
56
56
|
"eslint-plugin-storybook": "0.11.1",
|
|
57
57
|
"eslint-plugin-testing-library": "^7.0.0",
|
|
58
58
|
"eslint-plugin-unicorn": "^56.0.1",
|
|
59
|
-
"globals": "^15.
|
|
59
|
+
"globals": "^15.13.0",
|
|
60
60
|
"local-pkg": "0.5.1",
|
|
61
|
-
"typescript-eslint": "^8.
|
|
61
|
+
"typescript-eslint": "^8.17.0"
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|
|
64
64
|
"eslint": "^9.10.0"
|