@jimmy.codes/eslint-config 3.22.2 → 3.24.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 CHANGED
@@ -41,6 +41,7 @@ import eslintConfig from "@jimmy.codes/eslint-config";
41
41
  export default eslintConfig({
42
42
  astro: false,
43
43
  jest: false,
44
+ nextjs: false,
44
45
  playwright: false,
45
46
  react: false,
46
47
  storybook: false,
@@ -59,25 +60,46 @@ import eslintConfig from "@jimmy.codes/eslint-config";
59
60
  export default eslintConfig({ autoDetect: false });
60
61
  ```
61
62
 
62
- #### Extending the Configuration
63
+ #### Extending/overriding the Configuration
63
64
 
64
- You can also extend the configuration:
65
+ You can also extend or override the configuration:
66
+
67
+ ```ts
68
+ import eslintConfig from "@jimmy.codes/eslint-config";
69
+
70
+ export default eslintConfig({
71
+ overrides: [
72
+ {
73
+ files: ["**/*.js"],
74
+ rules: {
75
+ "prefer-spread": "error",
76
+ },
77
+ },
78
+ {
79
+ files: ["**/*.ts"],
80
+ rules: {
81
+ "prefer-const": "error",
82
+ },
83
+ },
84
+ ],
85
+ });
86
+ ```
87
+
88
+ Or pass configs as additional arguments:
65
89
 
66
90
  ```ts
67
91
  import eslintConfig from "@jimmy.codes/eslint-config";
68
92
 
69
93
  export default eslintConfig(
94
+ {},
70
95
  {
71
- configs: [
72
- {
73
- files: ["**/*.js"],
74
- rules: {
75
- "prefer-spread": "error",
76
- },
77
- },
78
- ],
96
+ files: ["**/*.js"],
97
+ rules: {
98
+ "prefer-spread": "error",
99
+ },
79
100
  },
80
101
  {
102
+ files: ["**/*.ts"],
81
103
  rules: {
82
104
  "prefer-const": "error",
83
105
  },
@@ -97,7 +119,7 @@ export default eslintConfig({
97
119
  });
98
120
  ```
99
121
 
100
- ### Typescript Configuration Files
122
+ ### TypeScript Configuration Files
101
123
 
102
124
  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
125
 
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";var M=Object.create;var d=Object.defineProperty;var W=Object.getOwnPropertyDescriptor;var Y=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 Y(r))!K.call(e,a)&&a!==s&&d(e,a,{get:()=>r[a],enumerable:!(n=W(r,a))||n.enumerable});return e};var o=(e,r,s)=>(s=e!=null?M(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"),c=require("local-pkg"),te=require("eslint-plugin-regexp"),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",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}`],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:T,name:"jimmy.codes/playwright",rules:await Pe()}],"playwrightConfig"),Oe=t(()=>[{name:"jimmy.codes/prettier",...re}],"prettierConfig"),Ce=t(()=>c.isPackageExists("typescript"),"hasTypescript"),qe=t(()=>c.isPackageExists("react"),"hasReact"),L=t(()=>c.isPackageExists("vitest"),"hasVitest"),S=t(()=>c.isPackageExists("jest"),"hasJest"),_e=t(()=>L()||S(),"hasTesting"),Re=t(()=>le.some(e=>c.isPackageExists(e)),"hasTestingLibrary"),Te=t(()=>c.isPackageExists("@tanstack/react-query"),"hasReactQuery"),Le=t(()=>c.isPackageExists("astro"),"hasAstro"),Se=t(()=>c.isPackageExists("@playwright/test"),"hasPlaywright"),Ae=t(()=>c.isPackageExists("storybook"),"hasStorybook"),Ge=t(()=>c.isPackageExists("next"),"hasNext"),Ie=t(()=>c.isPackageExists("vite"),"hasVite"),Ne=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"?Ne(s):s])),"normalizeRuleEntries"),Be=["dynamic","dynamicParams","revalidate","fetchCache","runtime","preferredRegion","maxDuration","config","generateStaticParams","metadata","generateMetadata","viewport","generateViewport"],$e=t(async()=>{const[e,r]=await Promise.all([i(import("eslint-plugin-react")),i(import("eslint-plugin-jsx-a11y"))]),s=Ge(),n=Ie();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?Be:[]}],"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"),Fe=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 $e(),settings:{react:{version:"detect"}}}]},"reactConfig"),Ve={..._.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"},Je=t(()=>[{name:"jimmy.codes/regexp",plugins:{regexp:_},rules:Ve}],"regexpConfig"),Ue=t((e={})=>Object.fromEntries(Object.entries(e).map(([r,s])=>[r,s==="warn"?"error":s])),"warningAsErrors"),ze=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:{...Ue(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"),Qe=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"),Xe=t(async()=>({...await G(),"jest/no-deprecated-functions":"off","jest/require-hook":["error",{allowedFunctionCalls:ce}]}),"vitestRules"),He=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 Xe()})}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"),Me=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"),We=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 Me()}]},"testingLibraryConfig"),Ye={"@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"},De=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:Ye},{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"),Ke={...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"},Ze=t(()=>[{...q.configs["flat/recommended"],name:"jimmy.codes/unicorn",rules:Ke}],"unicornConfig"),er=t(e=>typeof e=="object"?e:void 0,"getTypescriptOptions"),rr=t((e,r)=>typeof e=="object"?e:{framework:r.vitest?"vitest":r.jest?"jest":"vitest",...r.testingLibrary&&{utilities:["testing-library"]}},"getTestingOptions"),tr=t(e=>typeof e=="object"?e:{utilities:[]},"getReactOptions"),sr=t(({utilities:e=[]},r,s)=>r||e.includes("@tanstack/query")||s&&Te(),"shouldEnableTanstackQuery"),or=t(({utilities:e=[]},r)=>e.includes("testing-library")||r&&Re(),"shouldEnableTestingLibrary"),nr=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:N=!1,testing:h=!1,testingLibrary:B=!1,typescript:b=!1,vitest:w=!1}={},...$)=>{const F=tr(x),v=rr(h,{jest:a,testingLibrary:B,vitest:w}),k=er(b),P=b||!!k||r&&Ce(),V=x||r&&qe(),J=h||a||w||r&&_e(),U=e||r&&Le(),z=sr(F,N,r),Q=or(v,r),X=f||r&&Se(),H=I||r&&Ae();return[he(),ke(),we(),Ze(),me(),Je(),je({typescript:P}),P?De(k):[],V?await Fe():[],z?await Qe():[],U?await pe():[],J?await He(v,r):[],Q?await We():[],X?await Ee():[],H?await ze():[],Oe(),fe(),de(n),s,$].flat()},"eslintConfig");module.exports=nr;
1
+ "use strict";var Z=Object.create;var g=Object.defineProperty;var ee=Object.getOwnPropertyDescriptor;var re=Object.getOwnPropertyNames;var te=Object.getPrototypeOf,se=Object.prototype.hasOwnProperty;var t=(e,r)=>g(e,"name",{value:r,configurable:!0});var oe=(e,r,s,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of re(r))!se.call(e,a)&&a!==s&&g(e,a,{get:()=>r[a],enumerable:!(n=ee(r,a))||n.enumerable});return e};var o=(e,r,s)=>(s=e!=null?Z(te(e)):{},oe(r||!e||!e.__esModule?g(s,"default",{value:e,enumerable:!0}):s,e));var y=require("globals"),p=require("typescript-eslint"),O=require("@eslint-community/eslint-plugin-eslint-comments/configs"),u=require("eslint-plugin-import-x"),C=require("eslint-plugin-n"),ne=require("@eslint/js"),_=require("eslint-plugin-perfectionist"),ie=require("eslint-config-prettier"),c=require("local-pkg"),ae=require("eslint-plugin-regexp"),q=require("eslint-plugin-unicorn");function ce(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(ce,"_interopNamespaceDefault");var T=ce(ae);const l="?([cm])[jt]s?(x)",le=["**/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"],R="**/*.?([cm])js",m="**/*.?([cm])jsx",pe="**/*.?([cm])ts",j="**/*.?([cm])tsx",d=[`**/__tests__/**/*.${l}`,`**/*.spec.${l}`,`**/*.test.${l}`,`**/*.bench.${l}`,`**/*.benchmark.${l}`],L=[`**/e2e/**/*.spec.${l}`,`**/e2e/**/*.test.${l}`],x=[...L,`**/cypress/**/*.spec.${l}`,`**/cypress/**/*.test.${l}`],fe=[R,m,pe,j],ue="**/*.cjs",me="**/*.astro",de=["vi.mock","describe","expect","it"],ge=["@testing-library/react"],i=t(async e=>{const r=await e;return r.default??r},"interopDefault"),ye=t(async()=>{const e=[me],[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:{...y.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"),je=t(()=>[{files:[ue],languageOptions:{globals:y.commonjs},name:"jimmy.codes/commonjs"}],"commonjsConfig"),xe={...O.recommended.rules,"@eslint-community/eslint-comments/no-unused-disable":"off","@eslint-community/eslint-comments/require-description":"error"},he=t(()=>[{...O.recommended,name:"jimmy.codes/eslint-comments",rules:xe}],"eslintCommentsConfig"),be=t(e=>[{ignores:[...le,...e],name:"jimmy.codes/ignores"}],"ignoresConfig"),we={...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"},ve={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}}},ke=t(({typescript:e=!1}={})=>[{name:"jimmy.codes/imports",plugins:{"import-x":u,n:C},rules:we},...e?[ve]:[]],"importsConfig"),Pe={...ne.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"},Ee=t(()=>[{linterOptions:{reportUnusedDisableDirectives:!0},name:"jimmy.codes/javascript",rules:Pe}],"javascriptConfig"),Oe=t(async()=>({...(await i(import("@next/eslint-plugin-next"))).configs["core-web-vitals"].rules}),"nextjsRules"),Ce=t(async()=>{const e=await i(import("@next/eslint-plugin-next"));return[{files:fe,name:"jimmy.codes/nextjs",plugins:{"@next/next":e},rules:await Oe()}]},"nextjsConfig"),_e={"n/no-process-exit":"off","n/prefer-node-protocol":"error"},qe=t(()=>[{name:"jimmy.codes/node",plugins:{n:C},rules:_e}],"nodeConfig"),Te={..._.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"},Re=t(()=>[{name:"jimmy.codes/perfectionist",plugins:{perfectionist:_},rules:Te}],"perfectionistConfig"),Le=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"),Se=t(async()=>[{...(await i(import("eslint-plugin-playwright"))).configs["flat/recommended"],files:L,name:"jimmy.codes/playwright",rules:await Le()}],"playwrightConfig"),Ge=t(()=>[{name:"jimmy.codes/prettier",...ie}],"prettierConfig"),Ae=t(()=>c.isPackageExists("typescript"),"hasTypescript"),Ne=t(()=>c.isPackageExists("react"),"hasReact"),S=t(()=>c.isPackageExists("vitest"),"hasVitest"),G=t(()=>c.isPackageExists("jest"),"hasJest"),Ie=t(()=>S()||G(),"hasTesting"),Be=t(()=>ge.some(e=>c.isPackageExists(e)),"hasTestingLibrary"),$e=t(()=>c.isPackageExists("@tanstack/react-query"),"hasReactQuery"),Fe=t(()=>c.isPackageExists("astro"),"hasAstro"),Ve=t(()=>c.isPackageExists("@playwright/test"),"hasPlaywright"),Je=t(()=>c.isPackageExists("storybook"),"hasStorybook"),A=t(()=>c.isPackageExists("next"),"hasNext"),Ue=t(()=>c.isPackageExists("vite"),"hasVite"),Xe=t(e=>e===2?"error":e===1?"warn":"off","toStringSeverity"),N=t((e={})=>Object.fromEntries(Object.entries(e).map(([r,s])=>[r,typeof s=="number"?Xe(s):s])),"normalizeRuleEntries"),ze=["dynamic","dynamicParams","revalidate","fetchCache","runtime","preferredRegion","maxDuration","config","generateStaticParams","metadata","generateMetadata","viewport","generateViewport"],Qe=t(async()=>{const[e,r]=await Promise.all([i(import("eslint-plugin-react")),i(import("eslint-plugin-jsx-a11y"))]),s=A(),n=Ue();return{...r.configs.recommended.rules,...N(e.configs.flat?.recommended?.rules),...N(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?ze:[]}],"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"),He=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:[m,j],languageOptions:{globals:{...y.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"),Me={...T.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"},We=t(()=>[{name:"jimmy.codes/regexp",plugins:{regexp:T},rules:Me}],"regexpConfig"),Ye=t((e={})=>Object.fromEntries(Object.entries(e).map(([r,s])=>[r,s==="warn"?"error":s])),"warningAsErrors"),De=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:{...Ye(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"),Ke=t(async()=>{const e=await i(import("@tanstack/eslint-plugin-query"));return[{files:[m,j],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"),I=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"),Ze=t(async()=>({...await I(),"jest/no-deprecated-functions":"off","jest/require-hook":["error",{allowedFunctionCalls:de}]}),"vitestRules"),er=t(async({framework:e="vitest"}={},r=!0)=>{const s=r?S():e==="vitest",n=e==="jest"||r&&G(),a=[];if(s){const f=await i(import("eslint-plugin-jest"));a.push({files:d,ignores:x,...f.configs["flat/recommended"],name:"jimmy.codes/vitest",rules:await Ze()})}if(n){const f=await i(import("eslint-plugin-jest"));a.push({files:d,ignores:x,...f.configs["flat/recommended"],name:"jimmy.codes/jest",rules:await I()})}return a},"testingConfig"),rr=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"),tr=t(async()=>{const[e,r]=await Promise.all([import("eslint-plugin-jest-dom"),i(import("eslint-plugin-testing-library"))]);return[{files:d,ignores:x,name:"jimmy.codes/testing-library",plugins:{"jest-dom":e,"testing-library":r},rules:await rr()}]},"testingLibraryConfig"),sr={"@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"},or=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:sr},{files:[R,m],...p.configs.disableTypeChecked},{files:d,name:"jimmy.codes/typescript/testing",rules:{"@typescript-eslint/no-unsafe-argument":"off","@typescript-eslint/no-unsafe-assignment":"off"}}],"typescriptConfig"),nr={...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"},ir=t(()=>[{...q.configs["flat/recommended"],name:"jimmy.codes/unicorn",rules:nr}],"unicornConfig"),ar=t(e=>typeof e=="object"?e:void 0,"getTypescriptOptions"),cr=t((e,r)=>typeof e=="object"?e:{framework:r.vitest?"vitest":r.jest?"jest":"vitest",...r.testingLibrary&&{utilities:["testing-library"]}},"getTestingOptions"),lr=t(e=>typeof e=="object"?e:{utilities:[]},"getReactOptions"),pr=t(({utilities:e=[]},r,s)=>r||e.includes("@tanstack/query")||s&&$e(),"shouldEnableTanstackQuery"),fr=t(({utilities:e=[]},r)=>e.includes("testing-library")||r&&Be(),"shouldEnableTestingLibrary"),ur=t(async({astro:e=!1,autoDetect:r=!0,configs:s=[],ignores:n=[],jest:a=!1,nextjs:f=!1,overrides:B=[],playwright:$=!1,react:h=!1,storybook:F=!1,tanstackQuery:V=!1,testing:b=!1,testingLibrary:J=!1,typescript:w=!1,vitest:v=!1}={},...U)=>{const X=lr(h),k=cr(b,{jest:a,testingLibrary:J,vitest:v}),P=ar(w),E=w||!!P||r&&Ae(),z=h||r&&Ne(),Q=b||a||v||r&&Ie(),H=e||r&&Fe(),M=pr(X,V,r),W=fr(k,r),Y=$||r&&Ve(),D=F||r&&Je(),K=f||r&&A();return[Ee(),Re(),qe(),ir(),he(),We(),ke({typescript:E}),E?or(P):[],z?await He():[],M?await Ke():[],H?await ye():[],Q?await er(k,r):[],W?await tr():[],Y?await Se():[],D?await De():[],K?await Ce():[],Ge(),je(),be(n),s,B,U].flat()},"eslintConfig");module.exports=ur;
package/dist/index.d.cts CHANGED
@@ -59,6 +59,110 @@ interface RuleOptions {
59
59
  * @see https://eslint-community.github.io/eslint-plugin-eslint-comments/rules/require-description.html
60
60
  */
61
61
  '@eslint-community/eslint-comments/require-description'?: Linter.RuleEntry<EslintCommunityEslintCommentsRequireDescription>
62
+ /**
63
+ * Enforce font-display behavior with Google Fonts.
64
+ * @see https://nextjs.org/docs/messages/google-font-display
65
+ */
66
+ '@next/next/google-font-display'?: Linter.RuleEntry<[]>
67
+ /**
68
+ * Ensure `preconnect` is used with Google Fonts.
69
+ * @see https://nextjs.org/docs/messages/google-font-preconnect
70
+ */
71
+ '@next/next/google-font-preconnect'?: Linter.RuleEntry<[]>
72
+ /**
73
+ * Enforce `id` attribute on `next/script` components with inline content.
74
+ * @see https://nextjs.org/docs/messages/inline-script-id
75
+ */
76
+ '@next/next/inline-script-id'?: Linter.RuleEntry<[]>
77
+ /**
78
+ * Prefer `next/script` component when using the inline script for Google Analytics.
79
+ * @see https://nextjs.org/docs/messages/next-script-for-ga
80
+ */
81
+ '@next/next/next-script-for-ga'?: Linter.RuleEntry<[]>
82
+ /**
83
+ * Prevent assignment to the `module` variable.
84
+ * @see https://nextjs.org/docs/messages/no-assign-module-variable
85
+ */
86
+ '@next/next/no-assign-module-variable'?: Linter.RuleEntry<[]>
87
+ /**
88
+ * Prevent client components from being async functions.
89
+ * @see https://nextjs.org/docs/messages/no-async-client-component
90
+ */
91
+ '@next/next/no-async-client-component'?: Linter.RuleEntry<[]>
92
+ /**
93
+ * Prevent usage of `next/script`'s `beforeInteractive` strategy outside of `pages/_document.js`.
94
+ * @see https://nextjs.org/docs/messages/no-before-interactive-script-outside-document
95
+ */
96
+ '@next/next/no-before-interactive-script-outside-document'?: Linter.RuleEntry<[]>
97
+ /**
98
+ * Prevent manual stylesheet tags.
99
+ * @see https://nextjs.org/docs/messages/no-css-tags
100
+ */
101
+ '@next/next/no-css-tags'?: Linter.RuleEntry<[]>
102
+ /**
103
+ * Prevent importing `next/document` outside of `pages/_document.js`.
104
+ * @see https://nextjs.org/docs/messages/no-document-import-in-page
105
+ */
106
+ '@next/next/no-document-import-in-page'?: Linter.RuleEntry<[]>
107
+ /**
108
+ * Prevent duplicate usage of `<Head>` in `pages/_document.js`.
109
+ * @see https://nextjs.org/docs/messages/no-duplicate-head
110
+ */
111
+ '@next/next/no-duplicate-head'?: Linter.RuleEntry<[]>
112
+ /**
113
+ * Prevent usage of `<head>` element.
114
+ * @see https://nextjs.org/docs/messages/no-head-element
115
+ */
116
+ '@next/next/no-head-element'?: Linter.RuleEntry<[]>
117
+ /**
118
+ * Prevent usage of `next/head` in `pages/_document.js`.
119
+ * @see https://nextjs.org/docs/messages/no-head-import-in-document
120
+ */
121
+ '@next/next/no-head-import-in-document'?: Linter.RuleEntry<[]>
122
+ /**
123
+ * Prevent usage of `<a>` elements to navigate to internal Next.js pages.
124
+ * @see https://nextjs.org/docs/messages/no-html-link-for-pages
125
+ */
126
+ '@next/next/no-html-link-for-pages'?: Linter.RuleEntry<NextNextNoHtmlLinkForPages>
127
+ /**
128
+ * Prevent usage of `<img>` element due to slower LCP and higher bandwidth.
129
+ * @see https://nextjs.org/docs/messages/no-img-element
130
+ */
131
+ '@next/next/no-img-element'?: Linter.RuleEntry<[]>
132
+ /**
133
+ * Prevent page-only custom fonts.
134
+ * @see https://nextjs.org/docs/messages/no-page-custom-font
135
+ */
136
+ '@next/next/no-page-custom-font'?: Linter.RuleEntry<[]>
137
+ /**
138
+ * Prevent usage of `next/script` in `next/head` component.
139
+ * @see https://nextjs.org/docs/messages/no-script-component-in-head
140
+ */
141
+ '@next/next/no-script-component-in-head'?: Linter.RuleEntry<[]>
142
+ /**
143
+ * Prevent usage of `styled-jsx` in `pages/_document.js`.
144
+ * @see https://nextjs.org/docs/messages/no-styled-jsx-in-document
145
+ */
146
+ '@next/next/no-styled-jsx-in-document'?: Linter.RuleEntry<[]>
147
+ /**
148
+ * Prevent synchronous scripts.
149
+ * @see https://nextjs.org/docs/messages/no-sync-scripts
150
+ */
151
+ '@next/next/no-sync-scripts'?: Linter.RuleEntry<[]>
152
+ /**
153
+ * Prevent usage of `<title>` with `Head` component from `next/document`.
154
+ * @see https://nextjs.org/docs/messages/no-title-in-document-head
155
+ */
156
+ '@next/next/no-title-in-document-head'?: Linter.RuleEntry<[]>
157
+ /**
158
+ * Prevent common typos in Next.js data fetching functions.
159
+ */
160
+ '@next/next/no-typos'?: Linter.RuleEntry<[]>
161
+ /**
162
+ * Prevent duplicate polyfills from Polyfill.io.
163
+ * @see https://nextjs.org/docs/messages/no-unwanted-polyfillio
164
+ */
165
+ '@next/next/no-unwanted-polyfillio'?: Linter.RuleEntry<[]>
62
166
  /**
63
167
  * Exhaustive deps rule for useQuery
64
168
  * @see https://tanstack.com/query/latest/docs/eslint/exhaustive-deps
@@ -2474,7 +2578,7 @@ interface RuleOptions {
2474
2578
  */
2475
2579
  'no-class-assign'?: Linter.RuleEntry<[]>
2476
2580
  /**
2477
- * Disallow comparing against -0
2581
+ * Disallow comparing against `-0`
2478
2582
  * @see https://eslint.org/docs/latest/rules/no-compare-neg-zero
2479
2583
  */
2480
2584
  'no-compare-neg-zero'?: Linter.RuleEntry<[]>
@@ -5743,6 +5847,8 @@ type EslintCommunityEslintCommentsNoUse = []|[{
5743
5847
  type EslintCommunityEslintCommentsRequireDescription = []|[{
5744
5848
  ignore?: ("eslint" | "eslint-disable" | "eslint-disable-line" | "eslint-disable-next-line" | "eslint-enable" | "eslint-env" | "exported" | "global" | "globals")[]
5745
5849
  }]
5850
+ // ----- @next/next/no-html-link-for-pages -----
5851
+ type NextNextNoHtmlLinkForPages = []|[(string | string[])]
5746
5852
  // ----- @typescript-eslint/array-type -----
5747
5853
  type TypescriptEslintArrayType = []|[{
5748
5854
 
@@ -6685,6 +6791,10 @@ type TypescriptEslintPreferOptionalChain = []|[{
6685
6791
  type TypescriptEslintPreferPromiseRejectErrors = []|[{
6686
6792
 
6687
6793
  allowEmptyReject?: boolean
6794
+
6795
+ allowThrowingAny?: boolean
6796
+
6797
+ allowThrowingUnknown?: boolean
6688
6798
  }]
6689
6799
  // ----- @typescript-eslint/prefer-readonly -----
6690
6800
  type TypescriptEslintPreferReadonly = []|[{
@@ -10439,6 +10549,7 @@ type SortKeys = []|[("asc" | "desc")]|[("asc" | "desc"), {
10439
10549
  natural?: boolean
10440
10550
  minKeys?: number
10441
10551
  allowLineSeparatedGroups?: boolean
10552
+ ignoreComputedKeys?: boolean
10442
10553
  }]
10443
10554
  // ----- sort-vars -----
10444
10555
  type SortVars = []|[{
@@ -10857,6 +10968,7 @@ interface Options {
10857
10968
  autoDetect?: boolean;
10858
10969
  /**
10859
10970
  * Additional configs to either extend or overrides configurations
10971
+ * @deprecated please use {@link Options.configs} instead.
10860
10972
  * @default []
10861
10973
  */
10862
10974
  configs?: Linter.Config[] | TypedConfigItem[];
@@ -10870,6 +10982,16 @@ interface Options {
10870
10982
  * @default false
10871
10983
  */
10872
10984
  jest?: boolean;
10985
+ /**
10986
+ * Are Next.js rules enabled?
10987
+ * @default false
10988
+ */
10989
+ nextjs?: boolean;
10990
+ /**
10991
+ * Additional configs to either extend or overrides configurations
10992
+ * @default []
10993
+ */
10994
+ overrides?: Linter.Config[] | TypedConfigItem[];
10873
10995
  /**
10874
10996
  * Are playwright rules enabled?
10875
10997
  * @default false
@@ -10913,7 +11035,7 @@ interface Options {
10913
11035
  vitest?: boolean;
10914
11036
  }
10915
11037
 
10916
- declare const eslintConfig: ({ astro, autoDetect, configs, ignores, jest, playwright, react, storybook, tanstackQuery, testing, testingLibrary, typescript, vitest, }?: Options, ...moreConfigs: Linter.Config[] | TypedConfigItem[]) => Promise<(TypedConfigItem | Linter.Config<Linter.RulesRecord> | _typescript_eslint_utils_ts_eslint.FlatConfig.Config | {
11038
+ declare const eslintConfig: ({ astro, autoDetect, configs, ignores, jest, nextjs, 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
11039
  files: string[];
10918
11040
  languageOptions: {
10919
11041
  globals: {
@@ -11562,6 +11684,20 @@ declare const eslintConfig: ({ astro, autoDetect, configs, ignores, jest, playwr
11562
11684
  "object-shorthand": "error";
11563
11685
  "prefer-arrow-callback": "error";
11564
11686
  };
11687
+ } | {
11688
+ files: string[];
11689
+ name: string;
11690
+ plugins: {
11691
+ "@next/next": {
11692
+ configs: {
11693
+ "core-web-vitals": Linter.Config<Linter.RulesRecord>;
11694
+ recommended: Linter.Config<Linter.RulesRecord>;
11695
+ };
11696
+ };
11697
+ };
11698
+ rules: {
11699
+ [x: string]: Linter.RuleEntry<any[]> | undefined;
11700
+ };
11565
11701
  } | {
11566
11702
  name: string;
11567
11703
  plugins: {
@@ -11756,6 +11892,7 @@ declare const eslintConfig: ({ astro, autoDetect, configs, ignores, jest, playwr
11756
11892
  CSSKeywordValue: false;
11757
11893
  CSSLayerBlockRule: false;
11758
11894
  CSSLayerStatementRule: false;
11895
+ CSSMarginRule: false;
11759
11896
  CSSMathClamp: false;
11760
11897
  CSSMathInvert: false;
11761
11898
  CSSMathMax: false;
@@ -12721,12 +12858,15 @@ declare const eslintConfig: ({ astro, autoDetect, configs, ignores, jest, playwr
12721
12858
  XRDepthInformation: false;
12722
12859
  XRDOMOverlayState: false;
12723
12860
  XRFrame: false;
12861
+ XRHand: false;
12724
12862
  XRHitTestResult: false;
12725
12863
  XRHitTestSource: false;
12726
12864
  XRInputSource: false;
12727
12865
  XRInputSourceArray: false;
12728
12866
  XRInputSourceEvent: false;
12729
12867
  XRInputSourcesChangeEvent: false;
12868
+ XRJointPose: false;
12869
+ XRJointSpace: false;
12730
12870
  XRLayer: false;
12731
12871
  XRLightEstimate: false;
12732
12872
  XRLightProbe: false;
package/dist/index.d.mts CHANGED
@@ -59,6 +59,110 @@ interface RuleOptions {
59
59
  * @see https://eslint-community.github.io/eslint-plugin-eslint-comments/rules/require-description.html
60
60
  */
61
61
  '@eslint-community/eslint-comments/require-description'?: Linter.RuleEntry<EslintCommunityEslintCommentsRequireDescription>
62
+ /**
63
+ * Enforce font-display behavior with Google Fonts.
64
+ * @see https://nextjs.org/docs/messages/google-font-display
65
+ */
66
+ '@next/next/google-font-display'?: Linter.RuleEntry<[]>
67
+ /**
68
+ * Ensure `preconnect` is used with Google Fonts.
69
+ * @see https://nextjs.org/docs/messages/google-font-preconnect
70
+ */
71
+ '@next/next/google-font-preconnect'?: Linter.RuleEntry<[]>
72
+ /**
73
+ * Enforce `id` attribute on `next/script` components with inline content.
74
+ * @see https://nextjs.org/docs/messages/inline-script-id
75
+ */
76
+ '@next/next/inline-script-id'?: Linter.RuleEntry<[]>
77
+ /**
78
+ * Prefer `next/script` component when using the inline script for Google Analytics.
79
+ * @see https://nextjs.org/docs/messages/next-script-for-ga
80
+ */
81
+ '@next/next/next-script-for-ga'?: Linter.RuleEntry<[]>
82
+ /**
83
+ * Prevent assignment to the `module` variable.
84
+ * @see https://nextjs.org/docs/messages/no-assign-module-variable
85
+ */
86
+ '@next/next/no-assign-module-variable'?: Linter.RuleEntry<[]>
87
+ /**
88
+ * Prevent client components from being async functions.
89
+ * @see https://nextjs.org/docs/messages/no-async-client-component
90
+ */
91
+ '@next/next/no-async-client-component'?: Linter.RuleEntry<[]>
92
+ /**
93
+ * Prevent usage of `next/script`'s `beforeInteractive` strategy outside of `pages/_document.js`.
94
+ * @see https://nextjs.org/docs/messages/no-before-interactive-script-outside-document
95
+ */
96
+ '@next/next/no-before-interactive-script-outside-document'?: Linter.RuleEntry<[]>
97
+ /**
98
+ * Prevent manual stylesheet tags.
99
+ * @see https://nextjs.org/docs/messages/no-css-tags
100
+ */
101
+ '@next/next/no-css-tags'?: Linter.RuleEntry<[]>
102
+ /**
103
+ * Prevent importing `next/document` outside of `pages/_document.js`.
104
+ * @see https://nextjs.org/docs/messages/no-document-import-in-page
105
+ */
106
+ '@next/next/no-document-import-in-page'?: Linter.RuleEntry<[]>
107
+ /**
108
+ * Prevent duplicate usage of `<Head>` in `pages/_document.js`.
109
+ * @see https://nextjs.org/docs/messages/no-duplicate-head
110
+ */
111
+ '@next/next/no-duplicate-head'?: Linter.RuleEntry<[]>
112
+ /**
113
+ * Prevent usage of `<head>` element.
114
+ * @see https://nextjs.org/docs/messages/no-head-element
115
+ */
116
+ '@next/next/no-head-element'?: Linter.RuleEntry<[]>
117
+ /**
118
+ * Prevent usage of `next/head` in `pages/_document.js`.
119
+ * @see https://nextjs.org/docs/messages/no-head-import-in-document
120
+ */
121
+ '@next/next/no-head-import-in-document'?: Linter.RuleEntry<[]>
122
+ /**
123
+ * Prevent usage of `<a>` elements to navigate to internal Next.js pages.
124
+ * @see https://nextjs.org/docs/messages/no-html-link-for-pages
125
+ */
126
+ '@next/next/no-html-link-for-pages'?: Linter.RuleEntry<NextNextNoHtmlLinkForPages>
127
+ /**
128
+ * Prevent usage of `<img>` element due to slower LCP and higher bandwidth.
129
+ * @see https://nextjs.org/docs/messages/no-img-element
130
+ */
131
+ '@next/next/no-img-element'?: Linter.RuleEntry<[]>
132
+ /**
133
+ * Prevent page-only custom fonts.
134
+ * @see https://nextjs.org/docs/messages/no-page-custom-font
135
+ */
136
+ '@next/next/no-page-custom-font'?: Linter.RuleEntry<[]>
137
+ /**
138
+ * Prevent usage of `next/script` in `next/head` component.
139
+ * @see https://nextjs.org/docs/messages/no-script-component-in-head
140
+ */
141
+ '@next/next/no-script-component-in-head'?: Linter.RuleEntry<[]>
142
+ /**
143
+ * Prevent usage of `styled-jsx` in `pages/_document.js`.
144
+ * @see https://nextjs.org/docs/messages/no-styled-jsx-in-document
145
+ */
146
+ '@next/next/no-styled-jsx-in-document'?: Linter.RuleEntry<[]>
147
+ /**
148
+ * Prevent synchronous scripts.
149
+ * @see https://nextjs.org/docs/messages/no-sync-scripts
150
+ */
151
+ '@next/next/no-sync-scripts'?: Linter.RuleEntry<[]>
152
+ /**
153
+ * Prevent usage of `<title>` with `Head` component from `next/document`.
154
+ * @see https://nextjs.org/docs/messages/no-title-in-document-head
155
+ */
156
+ '@next/next/no-title-in-document-head'?: Linter.RuleEntry<[]>
157
+ /**
158
+ * Prevent common typos in Next.js data fetching functions.
159
+ */
160
+ '@next/next/no-typos'?: Linter.RuleEntry<[]>
161
+ /**
162
+ * Prevent duplicate polyfills from Polyfill.io.
163
+ * @see https://nextjs.org/docs/messages/no-unwanted-polyfillio
164
+ */
165
+ '@next/next/no-unwanted-polyfillio'?: Linter.RuleEntry<[]>
62
166
  /**
63
167
  * Exhaustive deps rule for useQuery
64
168
  * @see https://tanstack.com/query/latest/docs/eslint/exhaustive-deps
@@ -2474,7 +2578,7 @@ interface RuleOptions {
2474
2578
  */
2475
2579
  'no-class-assign'?: Linter.RuleEntry<[]>
2476
2580
  /**
2477
- * Disallow comparing against -0
2581
+ * Disallow comparing against `-0`
2478
2582
  * @see https://eslint.org/docs/latest/rules/no-compare-neg-zero
2479
2583
  */
2480
2584
  'no-compare-neg-zero'?: Linter.RuleEntry<[]>
@@ -5743,6 +5847,8 @@ type EslintCommunityEslintCommentsNoUse = []|[{
5743
5847
  type EslintCommunityEslintCommentsRequireDescription = []|[{
5744
5848
  ignore?: ("eslint" | "eslint-disable" | "eslint-disable-line" | "eslint-disable-next-line" | "eslint-enable" | "eslint-env" | "exported" | "global" | "globals")[]
5745
5849
  }]
5850
+ // ----- @next/next/no-html-link-for-pages -----
5851
+ type NextNextNoHtmlLinkForPages = []|[(string | string[])]
5746
5852
  // ----- @typescript-eslint/array-type -----
5747
5853
  type TypescriptEslintArrayType = []|[{
5748
5854
 
@@ -6685,6 +6791,10 @@ type TypescriptEslintPreferOptionalChain = []|[{
6685
6791
  type TypescriptEslintPreferPromiseRejectErrors = []|[{
6686
6792
 
6687
6793
  allowEmptyReject?: boolean
6794
+
6795
+ allowThrowingAny?: boolean
6796
+
6797
+ allowThrowingUnknown?: boolean
6688
6798
  }]
6689
6799
  // ----- @typescript-eslint/prefer-readonly -----
6690
6800
  type TypescriptEslintPreferReadonly = []|[{
@@ -10439,6 +10549,7 @@ type SortKeys = []|[("asc" | "desc")]|[("asc" | "desc"), {
10439
10549
  natural?: boolean
10440
10550
  minKeys?: number
10441
10551
  allowLineSeparatedGroups?: boolean
10552
+ ignoreComputedKeys?: boolean
10442
10553
  }]
10443
10554
  // ----- sort-vars -----
10444
10555
  type SortVars = []|[{
@@ -10857,6 +10968,7 @@ interface Options {
10857
10968
  autoDetect?: boolean;
10858
10969
  /**
10859
10970
  * Additional configs to either extend or overrides configurations
10971
+ * @deprecated please use {@link Options.configs} instead.
10860
10972
  * @default []
10861
10973
  */
10862
10974
  configs?: Linter.Config[] | TypedConfigItem[];
@@ -10870,6 +10982,16 @@ interface Options {
10870
10982
  * @default false
10871
10983
  */
10872
10984
  jest?: boolean;
10985
+ /**
10986
+ * Are Next.js rules enabled?
10987
+ * @default false
10988
+ */
10989
+ nextjs?: boolean;
10990
+ /**
10991
+ * Additional configs to either extend or overrides configurations
10992
+ * @default []
10993
+ */
10994
+ overrides?: Linter.Config[] | TypedConfigItem[];
10873
10995
  /**
10874
10996
  * Are playwright rules enabled?
10875
10997
  * @default false
@@ -10913,7 +11035,7 @@ interface Options {
10913
11035
  vitest?: boolean;
10914
11036
  }
10915
11037
 
10916
- declare const eslintConfig: ({ astro, autoDetect, configs, ignores, jest, playwright, react, storybook, tanstackQuery, testing, testingLibrary, typescript, vitest, }?: Options, ...moreConfigs: Linter.Config[] | TypedConfigItem[]) => Promise<(TypedConfigItem | Linter.Config<Linter.RulesRecord> | _typescript_eslint_utils_ts_eslint.FlatConfig.Config | {
11038
+ declare const eslintConfig: ({ astro, autoDetect, configs, ignores, jest, nextjs, 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
11039
  files: string[];
10918
11040
  languageOptions: {
10919
11041
  globals: {
@@ -11562,6 +11684,20 @@ declare const eslintConfig: ({ astro, autoDetect, configs, ignores, jest, playwr
11562
11684
  "object-shorthand": "error";
11563
11685
  "prefer-arrow-callback": "error";
11564
11686
  };
11687
+ } | {
11688
+ files: string[];
11689
+ name: string;
11690
+ plugins: {
11691
+ "@next/next": {
11692
+ configs: {
11693
+ "core-web-vitals": Linter.Config<Linter.RulesRecord>;
11694
+ recommended: Linter.Config<Linter.RulesRecord>;
11695
+ };
11696
+ };
11697
+ };
11698
+ rules: {
11699
+ [x: string]: Linter.RuleEntry<any[]> | undefined;
11700
+ };
11565
11701
  } | {
11566
11702
  name: string;
11567
11703
  plugins: {
@@ -11756,6 +11892,7 @@ declare const eslintConfig: ({ astro, autoDetect, configs, ignores, jest, playwr
11756
11892
  CSSKeywordValue: false;
11757
11893
  CSSLayerBlockRule: false;
11758
11894
  CSSLayerStatementRule: false;
11895
+ CSSMarginRule: false;
11759
11896
  CSSMathClamp: false;
11760
11897
  CSSMathInvert: false;
11761
11898
  CSSMathMax: false;
@@ -12721,12 +12858,15 @@ declare const eslintConfig: ({ astro, autoDetect, configs, ignores, jest, playwr
12721
12858
  XRDepthInformation: false;
12722
12859
  XRDOMOverlayState: false;
12723
12860
  XRFrame: false;
12861
+ XRHand: false;
12724
12862
  XRHitTestResult: false;
12725
12863
  XRHitTestSource: false;
12726
12864
  XRInputSource: false;
12727
12865
  XRInputSourceArray: false;
12728
12866
  XRInputSourceEvent: false;
12729
12867
  XRInputSourcesChangeEvent: false;
12868
+ XRJointPose: false;
12869
+ XRJointSpace: false;
12730
12870
  XRLayer: false;
12731
12871
  XRLightEstimate: false;
12732
12872
  XRLightProbe: false;
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- var z=Object.defineProperty;var r=(e,t)=>z(e,"name",{value:t,configurable:!0});import u from"globals";import{parser as H,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 M from"@eslint/js";import C from"eslint-plugin-perfectionist";import W 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)",Y=["**/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"],D="**/*.?([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}`],K="**/*.cjs",Z="**/*.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=[Z],[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:H},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:[K],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:[...Y,...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:P},rules:ae},...e?[ce]:[]],"importsConfig"),pe={...M.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:P},rules:me}],"nodeConfig"),de={...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"},ge=r(()=>[{name:"jimmy.codes/perfectionist",plugins:{perfectionist:C},rules:de}],"perfectionistConfig"),ye=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:T,name:"jimmy.codes/playwright",rules:await ye()}],"playwrightConfig"),he=r(()=>[{name:"jimmy.codes/prettier",...W}],"prettierConfig"),xe=r(()=>i("typescript"),"hasTypescript"),be=r(()=>i("react"),"hasReact"),_=r(()=>i("vitest"),"hasVitest"),L=r(()=>i("jest"),"hasJest"),we=r(()=>_()||L(),"hasTesting"),ke=r(()=>re.some(e=>i(e)),"hasTestingLibrary"),ve=r(()=>i("@tanstack/react-query"),"hasReactQuery"),Pe=r(()=>i("astro"),"hasAstro"),Ce=r(()=>i("@playwright/test"),"hasPlaywright"),Oe=r(()=>i("storybook"),"hasStorybook"),Ee=r(()=>i("next"),"hasNext"),Re=r(()=>i("vite"),"hasVite"),Te=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"?Te(o):o])),"normalizeRuleEntries"),_e=["dynamic","dynamicParams","revalidate","fetchCache","runtime","preferredRegion","maxDuration","config","generateStaticParams","metadata","generateMetadata","viewport","generateViewport"],Le=r(async()=>{const[e,t]=await Promise.all([s(import("eslint-plugin-react")),s(import("eslint-plugin-jsx-a11y"))]),o=Ee(),n=Re();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?_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"),Se=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 Le(),settings:{react:{version:"detect"}}}]},"reactConfig"),qe={...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"},Ae=r(()=>[{name:"jimmy.codes/regexp",plugins:{regexp:O},rules:qe}],"regexpConfig"),Ge=r((e={})=>Object.fromEntries(Object.entries(e).map(([t,o])=>[t,o==="warn"?"error":o])),"warningAsErrors"),Ie=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:{...Ge(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"),Ne=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"),Be=r(async()=>({...await q(),"jest/no-deprecated-functions":"off","jest/require-hook":["error",{allowedFunctionCalls:ee}]}),"vitestRules"),$e=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 Be()})}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"),Fe=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"),Ve=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 Fe()}]},"testingLibraryConfig"),Je={"@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"},Ue=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:Je},{files:[D,d],...p.disableTypeChecked},{files:m,name:"jimmy.codes/typescript/testing",rules:{"@typescript-eslint/no-unsafe-argument":"off","@typescript-eslint/no-unsafe-assignment":"off"}}],"typescriptConfig"),Qe={...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"},Xe=r(()=>[{...E.configs["flat/recommended"],name:"jimmy.codes/unicorn",rules:Qe}],"unicornConfig"),ze=r(e=>typeof e=="object"?e:void 0,"getTypescriptOptions"),He=r((e,t)=>typeof e=="object"?e:{framework:t.vitest?"vitest":t.jest?"jest":"vitest",...t.testingLibrary&&{utilities:["testing-library"]}},"getTestingOptions"),Me=r(e=>typeof e=="object"?e:{utilities:[]},"getReactOptions"),We=r(({utilities:e=[]},t,o)=>t||e.includes("@tanstack/query")||o&&ve(),"shouldEnableTanstackQuery"),Ye=r(({utilities:e=[]},t)=>e.includes("testing-library")||t&&ke(),"shouldEnableTestingLibrary"),De=r(async({astro:e=!1,autoDetect:t=!0,configs:o=[],ignores:n=[],jest:c=!1,playwright:l=!1,react:y=!1,storybook:A=!1,tanstackQuery:G=!1,testing:j=!1,testingLibrary:I=!1,typescript:h=!1,vitest:x=!1}={},...N)=>{const B=Me(y),b=He(j,{jest:c,testingLibrary:I,vitest:x}),w=ze(h),k=h||!!w||t&&xe(),$=y||t&&be(),F=j||c||x||t&&we(),V=e||t&&Pe(),J=We(B,G,t),U=Ye(b,t),Q=l||t&&Ce(),X=A||t&&Oe();return[fe(),ge(),ue(),Xe(),ne(),Ae(),le({typescript:k}),k?Ue(w):[],$?await Se():[],J?await Ne():[],V?await te():[],F?await $e(b,t):[],U?await Ve():[],Q?await je():[],X?await Ie():[],he(),oe(),ie(n),o,N].flat()},"eslintConfig");export{De as default};
1
+ var K=Object.defineProperty;var r=(e,t)=>K(e,"name",{value:t,configurable:!0});import d from"globals";import{parser as Z,configs as p}from"typescript-eslint";import P from"@eslint-community/eslint-plugin-eslint-comments/configs";import f from"eslint-plugin-import-x";import C from"eslint-plugin-n";import D from"@eslint/js";import O from"eslint-plugin-perfectionist";import ee from"eslint-config-prettier";import{isPackageExists as i}from"local-pkg";import*as E from"eslint-plugin-regexp";import T from"eslint-plugin-unicorn";const a="?([cm])[jt]s?(x)",re=["**/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"],_="**/*.?([cm])js",m="**/*.?([cm])jsx",te="**/*.?([cm])ts",g="**/*.?([cm])tsx",u=[`**/__tests__/**/*.${a}`,`**/*.spec.${a}`,`**/*.test.${a}`,`**/*.bench.${a}`,`**/*.benchmark.${a}`],R=[`**/e2e/**/*.spec.${a}`,`**/e2e/**/*.test.${a}`],y=[...R,`**/cypress/**/*.spec.${a}`,`**/cypress/**/*.test.${a}`],oe=[_,m,te,g],se="**/*.cjs",ne="**/*.astro",ie=["vi.mock","describe","expect","it"],ae=["@testing-library/react"],s=r(async e=>{const t=await e;return t.default??t},"interopDefault"),ce=r(async()=>{const e=[ne],[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:{...d.node,Astro:!1,Fragment:!1},parser:o,parserOptions:{extraFileExtensions:[".astro"],parser:Z},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"),le=r(()=>[{files:[se],languageOptions:{globals:d.commonjs},name:"jimmy.codes/commonjs"}],"commonjsConfig"),pe={...P.recommended.rules,"@eslint-community/eslint-comments/no-unused-disable":"off","@eslint-community/eslint-comments/require-description":"error"},fe=r(()=>[{...P.recommended,name:"jimmy.codes/eslint-comments",rules:pe}],"eslintCommentsConfig"),me=r(e=>[{ignores:[...re,...e],name:"jimmy.codes/ignores"}],"ignoresConfig"),ue={...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"},de={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}}},ge=r(({typescript:e=!1}={})=>[{name:"jimmy.codes/imports",plugins:{"import-x":f,n:C},rules:ue},...e?[de]:[]],"importsConfig"),ye={...D.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"},je=r(()=>[{linterOptions:{reportUnusedDisableDirectives:!0},name:"jimmy.codes/javascript",rules:ye}],"javascriptConfig"),xe=r(async()=>({...(await s(import("@next/eslint-plugin-next"))).configs["core-web-vitals"].rules}),"nextjsRules"),he=r(async()=>{const e=await s(import("@next/eslint-plugin-next"));return[{files:oe,name:"jimmy.codes/nextjs",plugins:{"@next/next":e},rules:await xe()}]},"nextjsConfig"),be={"n/no-process-exit":"off","n/prefer-node-protocol":"error"},we=r(()=>[{name:"jimmy.codes/node",plugins:{n:C},rules:be}],"nodeConfig"),ke={...O.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"},ve=r(()=>[{name:"jimmy.codes/perfectionist",plugins:{perfectionist:O},rules:ke}],"perfectionistConfig"),Pe=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"),Ce=r(async()=>[{...(await s(import("eslint-plugin-playwright"))).configs["flat/recommended"],files:R,name:"jimmy.codes/playwright",rules:await Pe()}],"playwrightConfig"),Oe=r(()=>[{name:"jimmy.codes/prettier",...ee}],"prettierConfig"),Ee=r(()=>i("typescript"),"hasTypescript"),Te=r(()=>i("react"),"hasReact"),L=r(()=>i("vitest"),"hasVitest"),S=r(()=>i("jest"),"hasJest"),_e=r(()=>L()||S(),"hasTesting"),Re=r(()=>ae.some(e=>i(e)),"hasTestingLibrary"),Le=r(()=>i("@tanstack/react-query"),"hasReactQuery"),Se=r(()=>i("astro"),"hasAstro"),qe=r(()=>i("@playwright/test"),"hasPlaywright"),Ge=r(()=>i("storybook"),"hasStorybook"),q=r(()=>i("next"),"hasNext"),Ae=r(()=>i("vite"),"hasVite"),Ie=r(e=>e===2?"error":e===1?"warn":"off","toStringSeverity"),G=r((e={})=>Object.fromEntries(Object.entries(e).map(([t,o])=>[t,typeof o=="number"?Ie(o):o])),"normalizeRuleEntries"),Ne=["dynamic","dynamicParams","revalidate","fetchCache","runtime","preferredRegion","maxDuration","config","generateStaticParams","metadata","generateMetadata","viewport","generateViewport"],Be=r(async()=>{const[e,t]=await Promise.all([s(import("eslint-plugin-react")),s(import("eslint-plugin-jsx-a11y"))]),o=q(),n=Ae();return{...t.configs.recommended.rules,...G(e.configs.flat?.recommended?.rules),...G(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?Ne:[]}],"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=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:[m,g],languageOptions:{globals:{...d.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"),Fe={...E.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:E},rules:Fe}],"regexpConfig"),Je=r((e={})=>Object.fromEntries(Object.entries(e).map(([t,o])=>[t,o==="warn"?"error":o])),"warningAsErrors"),Ue=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:{...Je(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"),Xe=r(async()=>{const e=await s(import("@tanstack/eslint-plugin-query"));return[{files:[m,g],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"),A=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"),Qe=r(async()=>({...await A(),"jest/no-deprecated-functions":"off","jest/require-hook":["error",{allowedFunctionCalls:ie}]}),"vitestRules"),ze=r(async({framework:e="vitest"}={},t=!0)=>{const o=t?L():e==="vitest",n=e==="jest"||t&&S(),c=[];if(o){const l=await s(import("eslint-plugin-jest"));c.push({files:u,ignores:y,...l.configs["flat/recommended"],name:"jimmy.codes/vitest",rules:await Qe()})}if(n){const l=await s(import("eslint-plugin-jest"));c.push({files:u,ignores:y,...l.configs["flat/recommended"],name:"jimmy.codes/jest",rules:await A()})}return c},"testingConfig"),He=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"),Me=r(async()=>{const[e,t]=await Promise.all([import("eslint-plugin-jest-dom"),s(import("eslint-plugin-testing-library"))]);return[{files:u,ignores:y,name:"jimmy.codes/testing-library",plugins:{"jest-dom":e,"testing-library":t},rules:await He()}]},"testingLibraryConfig"),We={"@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"},Ye=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:We},{files:[_,m],...p.disableTypeChecked},{files:u,name:"jimmy.codes/typescript/testing",rules:{"@typescript-eslint/no-unsafe-argument":"off","@typescript-eslint/no-unsafe-assignment":"off"}}],"typescriptConfig"),Ke={...T.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(()=>[{...T.configs["flat/recommended"],name:"jimmy.codes/unicorn",rules:Ke}],"unicornConfig"),De=r(e=>typeof e=="object"?e:void 0,"getTypescriptOptions"),er=r((e,t)=>typeof e=="object"?e:{framework:t.vitest?"vitest":t.jest?"jest":"vitest",...t.testingLibrary&&{utilities:["testing-library"]}},"getTestingOptions"),rr=r(e=>typeof e=="object"?e:{utilities:[]},"getReactOptions"),tr=r(({utilities:e=[]},t,o)=>t||e.includes("@tanstack/query")||o&&Le(),"shouldEnableTanstackQuery"),or=r(({utilities:e=[]},t)=>e.includes("testing-library")||t&&Re(),"shouldEnableTestingLibrary"),sr=r(async({astro:e=!1,autoDetect:t=!0,configs:o=[],ignores:n=[],jest:c=!1,nextjs:l=!1,overrides:I=[],playwright:N=!1,react:j=!1,storybook:B=!1,tanstackQuery:$=!1,testing:x=!1,testingLibrary:F=!1,typescript:h=!1,vitest:b=!1}={},...V)=>{const J=rr(j),w=er(x,{jest:c,testingLibrary:F,vitest:b}),k=De(h),v=h||!!k||t&&Ee(),U=j||t&&Te(),X=x||c||b||t&&_e(),Q=e||t&&Se(),z=tr(J,$,t),H=or(w,t),M=N||t&&qe(),W=B||t&&Ge(),Y=l||t&&q();return[je(),ve(),we(),Ze(),fe(),Ve(),ge({typescript:v}),v?Ye(k):[],U?await $e():[],z?await Xe():[],Q?await ce():[],X?await ze(w,t):[],H?await Me():[],M?await Ce():[],W?await Ue():[],Y?await he():[],Oe(),le(),me(n),o,I,V].flat()},"eslintConfig");export{sr as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jimmy.codes/eslint-config",
3
- "version": "3.22.2",
3
+ "version": "3.24.0",
4
4
  "description": "another opinionated eslint config",
5
5
  "keywords": [
6
6
  "eslint",
@@ -32,11 +32,12 @@
32
32
  ],
33
33
  "dependencies": {
34
34
  "@eslint-community/eslint-plugin-eslint-comments": "^4.4.1",
35
- "@eslint/js": "^9.15.0",
36
- "@tanstack/eslint-plugin-query": "^5.61.6",
35
+ "@eslint/js": "^9.16.0",
36
+ "@next/eslint-plugin-next": "^15.0.3",
37
+ "@tanstack/eslint-plugin-query": "^5.62.1",
37
38
  "@types/eslint": "9.6.1",
38
- "@typescript-eslint/parser": "^8.16.0",
39
- "@typescript-eslint/utils": "^8.16.0",
39
+ "@typescript-eslint/parser": "^8.17.0",
40
+ "@typescript-eslint/utils": "^8.17.0",
40
41
  "astro-eslint-parser": "^1.1.0",
41
42
  "eslint-config-prettier": "^9.1.0",
42
43
  "eslint-import-resolver-typescript": "^3.6.3",
@@ -56,9 +57,9 @@
56
57
  "eslint-plugin-storybook": "0.11.1",
57
58
  "eslint-plugin-testing-library": "^7.0.0",
58
59
  "eslint-plugin-unicorn": "^56.0.1",
59
- "globals": "^15.12.0",
60
+ "globals": "^15.13.0",
60
61
  "local-pkg": "0.5.1",
61
- "typescript-eslint": "^8.16.0"
62
+ "typescript-eslint": "^8.17.0"
62
63
  },
63
64
  "peerDependencies": {
64
65
  "eslint": "^9.10.0"