@jimmy.codes/eslint-config 3.23.0 → 3.25.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 +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +126 -1
- package/dist/index.d.mts +126 -1
- package/dist/index.mjs +1 -1
- package/package.json +2 -1
package/README.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var W=Object.create;var d=Object.defineProperty;var Y=Object.getOwnPropertyDescriptor;var D=Object.getOwnPropertyNames;var K=Object.getPrototypeOf,Z=Object.prototype.hasOwnProperty;var t=(e,r)=>d(e,"name",{value:r,configurable:!0});var ee=(e,r,s,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of D(r))!Z.call(e,a)&&a!==s&&d(e,a,{get:()=>r[a],enumerable:!(n=Y(r,a))||n.enumerable});return e};var o=(e,r,s)=>(s=e!=null?W(K(e)):{},ee(r||!e||!e.__esModule?d(s,"default",{value:e,enumerable:!0}):s,e));var g=require("globals"),p=require("typescript-eslint"),E=require("@eslint-community/eslint-plugin-eslint-comments/configs"),u=require("eslint-plugin-import-x"),O=require("eslint-plugin-n"),re=require("@eslint/js"),C=require("eslint-plugin-perfectionist"),te=require("eslint-config-prettier"),c=require("local-pkg"),se=require("eslint-plugin-regexp"),q=require("eslint-plugin-unicorn");function oe(e){var r=Object.create(null);return e&&Object.keys(e).forEach(function(s){if(s!=="default"){var n=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(r,s,n.get?n:{enumerable:!0,get:t(function(){return e[s]},"get")})}}),r.default=e,Object.freeze(r)}t(oe,"_interopNamespaceDefault");var _=oe(se);const l="?([cm])[jt]s?(x)",ne=["**/node_modules","**/dist","**/package-lock.json","**/yarn.lock","**/pnpm-lock.yaml","**/bun.lockb","**/output","**/coverage","**/temp","**/.temp","**/tmp","**/.tmp","**/.history","**/.vitepress/cache","**/.nuxt","**/.next","**/.vercel","**/.changeset","**/.idea","**/.cache","**/.output","**/.vite-inspect","**/.yarn","**/storybook-static","**/.eslint-config-inspector","**/playwright-report","**/.astro","**/.vinxi","**/app.config.timestamp_*.js","**/CHANGELOG*.md","**/*.min.*","**/LICENSE*","**/__snapshots__","**/auto-import?(s).d.ts","**/components.d.ts","**/vite.config.ts.*.mjs","**/*.gen.*","!.storybook"],ie="**/*.?([cm])js",y="**/*.?([cm])jsx",R="**/*.?([cm])tsx",m=[`**/__tests__/**/*.${l}`,`**/*.spec.${l}`,`**/*.test.${l}`,`**/*.bench.${l}`,`**/*.benchmark.${l}`],T=[`**/e2e/**/*.spec.${l}`,`**/e2e/**/*.test.${l}`],j=[...T,`**/cypress/**/*.spec.${l}`,`**/cypress/**/*.test.${l}`],ae="**/*.cjs",ce="**/*.astro",le=["vi.mock","describe","expect","it"],pe=["@testing-library/react"],i=t(async e=>{const r=await e;return r.default??r},"interopDefault"),fe=t(async()=>{const e=[ce],[r,s,n]=await Promise.all([import("eslint-plugin-astro"),import("astro-eslint-parser"),i(import("eslint-plugin-jsx-a11y"))]);return[{files:e,languageOptions:{globals:{...g.node,Astro:!1,Fragment:!1},parser:s,parserOptions:{extraFileExtensions:[".astro"],parser:p.parser},sourceType:"module"},name:"jimmy.codes/astro",plugins:{astro:r,"jsx-a11y":n},processor:"astro/client-side-ts",rules:{...n.configs.recommended.rules,"astro/missing-client-only-directive-value":"error","astro/no-conflict-set-directives":"error","astro/no-deprecated-astro-canonicalurl":"error","astro/no-deprecated-astro-fetchcontent":"error","astro/no-deprecated-astro-resolve":"error","astro/no-deprecated-getentrybyslug":"error","astro/no-exports-from-components":"off","astro/no-unused-define-vars-in-style":"error","astro/valid-compile":"error"}},{files:e,languageOptions:{parserOptions:p.configs.disableTypeChecked.languageOptions?.parserOptions},name:"jimmy.codes/astro/disable-type-checked",rules:p.configs.disableTypeChecked.rules},{name:"jimmy.codes/astro/imports",settings:{"import-x/core-modules":["astro:content"]}}]},"astroConfig"),ue=t(()=>[{files:[ae],languageOptions:{globals:g.commonjs},name:"jimmy.codes/commonjs"}],"commonjsConfig"),me={...E.recommended.rules,"@eslint-community/eslint-comments/no-unused-disable":"off","@eslint-community/eslint-comments/require-description":"error"},de=t(()=>[{...E.recommended,name:"jimmy.codes/eslint-comments",rules:me}],"eslintCommentsConfig"),ge=t(e=>[{ignores:[...ne,...e],name:"jimmy.codes/ignores"}],"ignoresConfig"),ye={...u.configs.recommended.rules,"import-x/consistent-type-specifier-style":["error","prefer-top-level"],"import-x/extensions":["error","never",{checkTypedImports:!0,svg:"always"}],"import-x/first":"error","import-x/namespace":"off","import-x/newline-after-import":"error","import-x/no-absolute-path":"error","import-x/no-duplicates":"error","import-x/no-empty-named-blocks":"error","import-x/no-named-as-default":"error","import-x/no-named-as-default-member":"error","import-x/no-self-import":"error","import-x/no-unresolved":["error",{ignore:[String.raw`\.svg$`]}],"import-x/no-useless-path-segments":"error"},je={name:"jimmy.codes/imports/typescript",rules:u.configs.typescript.rules,settings:{...u.configs.typescript.settings,"import-x/resolver":{...u.configs.typescript.settings["import-x/resolver"],typescript:!0}}},xe=t(({typescript:e=!1}={})=>[{name:"jimmy.codes/imports",plugins:{"import-x":u,n:O},rules:ye},...e?[je]:[]],"importsConfig"),he={...re.configs.recommended.rules,"array-callback-return":["error",{allowImplicit:!0}],"arrow-body-style":["error","always"],curly:["error","all"],"no-console":"warn","no-self-compare":"error","no-template-curly-in-string":"error","no-unmodified-loop-condition":"error","no-unreachable-loop":"error","no-use-before-define":["error",{allowNamedExports:!1,classes:!1,functions:!1,variables:!0}],"no-useless-rename":"error","object-shorthand":"error","prefer-arrow-callback":"error"},be=t(()=>[{linterOptions:{reportUnusedDisableDirectives:!0},name:"jimmy.codes/javascript",rules:he}],"javascriptConfig"),we={"n/no-process-exit":"off","n/prefer-node-protocol":"error"},ve=t(()=>[{name:"jimmy.codes/node",plugins:{n:O},rules:we}],"nodeConfig"),ke={...C.configs["recommended-natural"].rules,"perfectionist/sort-imports":["error",{customGroups:{type:{},value:{}},environment:"node",groups:["side-effect-style","builtin","type","external","internal-type","internal",["parent-type","sibling-type","index-type"],["parent","sibling","index"],"object","style","unknown"],internalPattern:["^~/.*","^@/.*"],order:"asc",type:"natural"}],"perfectionist/sort-modules":"off"},Pe=t(()=>[{name:"jimmy.codes/perfectionist",plugins:{perfectionist:C},rules:ke}],"perfectionistConfig"),Ee=t(async()=>({...(await i(import("eslint-plugin-playwright"))).configs["flat/recommended"].rules,"playwright/expect-expect":"error","playwright/max-nested-describe":"error","playwright/no-conditional-expect":"error","playwright/no-conditional-in-test":"error","playwright/no-element-handle":"error","playwright/no-eval":"error","playwright/no-force-option":"error","playwright/no-nested-step":"error","playwright/no-page-pause":"error","playwright/no-skipped-test":"error","playwright/no-useless-await":"error","playwright/no-useless-not":"error","playwright/no-wait-for-selector":"error","playwright/no-wait-for-timeout":"error"}),"playwrightRules"),Oe=t(async()=>[{...(await i(import("eslint-plugin-playwright"))).configs["flat/recommended"],files:T,name:"jimmy.codes/playwright",rules:await Ee()}],"playwrightConfig"),Ce=t(()=>[{name:"jimmy.codes/prettier",...te}],"prettierConfig"),qe=t(()=>c.isPackageExists("typescript"),"hasTypescript"),_e=t(()=>c.isPackageExists("react"),"hasReact"),L=t(()=>c.isPackageExists("vitest"),"hasVitest"),S=t(()=>c.isPackageExists("jest"),"hasJest"),Re=t(()=>L()||S(),"hasTesting"),Te=t(()=>pe.some(e=>c.isPackageExists(e)),"hasTestingLibrary"),Le=t(()=>c.isPackageExists("@tanstack/react-query"),"hasReactQuery"),Se=t(()=>c.isPackageExists("astro"),"hasAstro"),Ae=t(()=>c.isPackageExists("@playwright/test"),"hasPlaywright"),Ge=t(()=>c.isPackageExists("storybook"),"hasStorybook"),Ie=t(()=>c.isPackageExists("next"),"hasNext"),Ne=t(()=>c.isPackageExists("vite"),"hasVite"),Be=t(e=>e===2?"error":e===1?"warn":"off","toStringSeverity"),A=t((e={})=>Object.fromEntries(Object.entries(e).map(([r,s])=>[r,typeof s=="number"?Be(s):s])),"normalizeRuleEntries"),$e=["dynamic","dynamicParams","revalidate","fetchCache","runtime","preferredRegion","maxDuration","config","generateStaticParams","metadata","generateMetadata","viewport","generateViewport"],Fe=t(async()=>{const[e,r]=await Promise.all([i(import("eslint-plugin-react")),i(import("eslint-plugin-jsx-a11y"))]),s=Ie(),n=Ne();return{...r.configs.recommended.rules,...A(e.configs.flat?.recommended?.rules),...A(e.configs.flat?.["jsx-runtime"]?.rules),"react-compiler/react-compiler":"error","react-hooks/exhaustive-deps":"error","react-hooks/rules-of-hooks":"error","react-refresh/only-export-components":["warn",{allowConstantExport:n,allowExportNames:s?$e:[]}],"react/boolean-prop-naming":"off","react/button-has-type":"error","react/checked-requires-onchange-or-readonly":"error","react/default-props-match-prop-types":"error","react/destructuring-assignment":"off","react/forbid-component-props":"off","react/forbid-dom-props":"off","react/forbid-elements":"off","react/forbid-foreign-prop-types":"off","react/forbid-prop-types":"off","react/forward-ref-uses-ref":"error","react/function-component-definition":"off","react/hook-use-state":"error","react/iframe-missing-sandbox":"error","react/jsx-boolean-value":["error","never"],"react/jsx-curly-brace-presence":"error","react/jsx-filename-extension":"off","react/jsx-fragments":["error","syntax"],"react/jsx-handler-names":"off","react/jsx-max-depth":"off","react/jsx-no-bind":"off","react/jsx-no-constructed-context-values":"error","react/jsx-no-leaked-render":"error","react/jsx-no-literals":"off","react/jsx-no-script-url":"error","react/jsx-no-useless-fragment":"error","react/jsx-one-expression-per-line":"off","react/jsx-pascal-case":["error",{allowNamespace:!0}],"react/jsx-props-no-spread-multi":"off","react/jsx-props-no-spreading":"off","react/jsx-sort-default-props":"off","react/jsx-sort-props":"off","react/no-access-state-in-setstate":"error","react/no-adjacent-inline-elements":"off","react/no-array-index-key":"off","react/no-arrow-function-lifecycle":"error","react/no-danger":"off","react/no-did-mount-set-state":"error","react/no-did-update-set-state":"error","react/no-invalid-html-attribute":"error","react/no-multi-comp":"off","react/no-namespace":"error","react/no-object-type-as-default-prop":"error","react/no-redundant-should-component-update":"error","react/no-set-state":"off","react/no-this-in-sfc":"error","react/no-typos":"error","react/no-unstable-nested-components":"error","react/no-unused-class-component-methods":"error","react/no-unused-prop-types":"error","react/no-unused-state":"error","react/no-will-update-set-state":"error","react/prefer-es6-class":"off","react/prefer-exact-props":"off","react/prefer-read-only-props":"off","react/prefer-stateless-function":"off","react/require-default-props":"off","react/require-optimization":"off","react/self-closing-comp":"error","react/sort-comp":"off","react/sort-default-props":"off","react/sort-prop-types":"off","react/state-in-constructor":"off","react/static-property-placement":"off","react/style-prop-object":"error","react/void-dom-elements-no-children":"error"}},"reactRules"),Ve=t(async()=>{const[e,r,s,n,a]=await Promise.all([i(import("eslint-plugin-react")),i(import("eslint-plugin-jsx-a11y")),import("eslint-plugin-react-hooks"),i(import("eslint-plugin-react-refresh")),i(import("eslint-plugin-react-compiler"))]);return[{files:[y,R],languageOptions:{globals:{...g.browser},parserOptions:{ecmaFeatures:{jsx:!0},jsxPragma:null}},name:"jimmy.codes/react",plugins:{"jsx-a11y":r,react:e,"react-compiler":a,"react-hooks":s,"react-refresh":n},rules:await Fe(),settings:{react:{version:"detect"}}}]},"reactConfig"),Je={..._.configs["flat/recommended"].rules,"regexp/confusing-quantifier":"error","regexp/no-empty-alternative":"error","regexp/no-lazy-ends":"error","regexp/no-potentially-useless-backreference":"error","regexp/no-useless-flag":"error","regexp/optimal-lookaround-quantifier":"error"},Ue=t(()=>[{name:"jimmy.codes/regexp",plugins:{regexp:_},rules:Je}],"regexpConfig"),ze=t((e={})=>Object.fromEntries(Object.entries(e).map(([r,s])=>[r,s==="warn"?"error":s])),"warningAsErrors"),Qe=t(async()=>{const{configs:e}=await i(import("eslint-plugin-storybook")),[r,s,n]=e["flat/recommended"];return[{name:"jimmy.codes/storybook/setup",plugins:r?.plugins},{files:s?.files,name:"jimmy.codes/storybook/stories-rules",rules:{...ze(s?.rules),"import-x/no-anonymous-default-export":"off","unicorn/no-anonymous-default-export":"off"}},{files:n?.files,name:"jimmy.codes/storybook/main-rules",rules:{...n?.rules}}]},"storybookConfig"),Xe=t(async()=>{const e=await i(import("@tanstack/eslint-plugin-query"));return[{files:[y,R],name:"jimmy.codes/react/query",plugins:{"@tanstack/query":e},rules:{"@tanstack/query/exhaustive-deps":"error","@tanstack/query/no-rest-destructuring":"warn","@tanstack/query/stable-query-client":"error"}}]},"tanstackQueryConfig"),G=t(async()=>{const e=await i(import("eslint-plugin-jest"));return{...e.configs["flat/recommended"].rules,...e.configs["flat/style"].rules,"jest/consistent-test-it":["error",{fn:"test",withinDescribe:"it"}],"jest/expect-expect":"error","jest/no-alias-methods":"error","jest/no-commented-out-tests":"error","jest/no-conditional-in-test":"error","jest/no-confusing-set-timeout":"error","jest/no-duplicate-hooks":"error","jest/no-hooks":"off","jest/no-large-snapshots":"off","jest/no-restricted-jest-methods":"off","jest/no-restricted-matchers":"off","jest/no-test-return-statement":"error","jest/no-untyped-mock-factory":"off","jest/prefer-called-with":"error","jest/prefer-comparison-matcher":"error","jest/prefer-each":"error","jest/prefer-equality-matcher":"error","jest/prefer-expect-assertions":"off","jest/prefer-expect-resolves":"error","jest/prefer-hooks-in-order":"error","jest/prefer-hooks-on-top":"error","jest/prefer-lowercase-title":"off","jest/prefer-mock-promise-shorthand":"error","jest/prefer-snapshot-hint":"error","jest/prefer-spy-on":"off","jest/prefer-strict-equal":"error","jest/prefer-todo":"warn","jest/require-hook":"error","jest/require-to-throw-message":"error","jest/require-top-level-describe":"off","jest/unbound-method":"off"}},"jestRules"),He=t(async()=>({...await G(),"jest/no-deprecated-functions":"off","jest/require-hook":["error",{allowedFunctionCalls:le}]}),"vitestRules"),Me=t(async({framework:e="vitest"}={},r=!0)=>{const s=r?L():e==="vitest",n=e==="jest"||r&&S(),a=[];if(s){const f=await i(import("eslint-plugin-jest"));a.push({files:m,ignores:j,...f.configs["flat/recommended"],name:"jimmy.codes/vitest",rules:await He()})}if(n){const f=await i(import("eslint-plugin-jest"));a.push({files:m,ignores:j,...f.configs["flat/recommended"],name:"jimmy.codes/jest",rules:await G()})}return a},"testingConfig"),We=t(async()=>{const[e,r]=await Promise.all([import("eslint-plugin-jest-dom"),i(import("eslint-plugin-testing-library"))]);return{...r.configs["flat/react"].rules,...e.configs["flat/recommended"].rules}},"testingLibraryRules"),Ye=t(async()=>{const[e,r]=await Promise.all([import("eslint-plugin-jest-dom"),i(import("eslint-plugin-testing-library"))]);return[{files:m,ignores:j,name:"jimmy.codes/testing-library",plugins:{"jest-dom":e,"testing-library":r},rules:await We()}]},"testingLibraryConfig"),De={"@typescript-eslint/consistent-type-exports":["error",{fixMixedExportsWithInlineTypeSpecifier:!1}],"@typescript-eslint/consistent-type-imports":["error",{fixStyle:"separate-type-imports"}],"@typescript-eslint/no-deprecated":"warn","@typescript-eslint/no-misused-promises":["error",{checksVoidReturn:{attributes:!1}}],"@typescript-eslint/no-unused-vars":["error",{args:"all",argsIgnorePattern:"^_",caughtErrors:"all",caughtErrorsIgnorePattern:"^_",destructuredArrayIgnorePattern:"^_",ignoreRestSiblings:!0,varsIgnorePattern:"^_"}],"@typescript-eslint/no-use-before-define":["error",{allowNamedExports:!1,classes:!1,functions:!1,variables:!0}],"@typescript-eslint/restrict-template-expressions":["error",{allowNumber:!0}],"no-use-before-define":"off"},Ke=t(e=>[...p.configs.strictTypeChecked,...p.configs.stylisticTypeChecked.filter(r=>r.name==="typescript-eslint/stylistic-type-checked"),{languageOptions:{parserOptions:{...e?.project?{project:e.project}:{projectService:!0},tsconfigRootDir:process.cwd()}},name:"jimmy.codes/typescript",rules:De},{files:[ie,y],...p.configs.disableTypeChecked},{files:m,name:"jimmy.codes/typescript/testing",rules:{"@typescript-eslint/no-unsafe-argument":"off","@typescript-eslint/no-unsafe-assignment":"off"}}],"typescriptConfig"),Ze={...q.configs["flat/recommended"].rules,"unicorn/filename-case":"off","unicorn/import-style":"off","unicorn/no-abusive-eslint-disable":"off","unicorn/no-anonymous-default-export":"off","unicorn/no-array-callback-reference":"off","unicorn/no-array-reduce":"off","unicorn/no-null":"off","unicorn/no-process-exit":"off","unicorn/no-useless-undefined":["error",{checkArguments:!1,checkArrowFunctionBody:!1}],"unicorn/prefer-node-protocol":"off","unicorn/prevent-abbreviations":"off"},er=t(()=>[{...q.configs["flat/recommended"],name:"jimmy.codes/unicorn",rules:Ze}],"unicornConfig"),rr=t(e=>typeof e=="object"?e:void 0,"getTypescriptOptions"),tr=t((e,r)=>typeof e=="object"?e:{framework:r.vitest?"vitest":r.jest?"jest":"vitest",...r.testingLibrary&&{utilities:["testing-library"]}},"getTestingOptions"),sr=t(e=>typeof e=="object"?e:{utilities:[]},"getReactOptions"),or=t(({utilities:e=[]},r,s)=>r||e.includes("@tanstack/query")||s&&Le(),"shouldEnableTanstackQuery"),nr=t(({utilities:e=[]},r)=>e.includes("testing-library")||r&&Te(),"shouldEnableTestingLibrary"),ir=t(async({astro:e=!1,autoDetect:r=!0,configs:s=[],ignores:n=[],jest:a=!1,overrides:f=[],playwright:I=!1,react:x=!1,storybook:N=!1,tanstackQuery:B=!1,testing:h=!1,testingLibrary:$=!1,typescript:b=!1,vitest:w=!1}={},...F)=>{const V=sr(x),v=tr(h,{jest:a,testingLibrary:$,vitest:w}),k=rr(b),P=b||!!k||r&&qe(),J=x||r&&_e(),U=h||a||w||r&&Re(),z=e||r&&Se(),Q=or(V,B,r),X=nr(v,r),H=I||r&&Ae(),M=N||r&&Ge();return[be(),Pe(),ve(),er(),de(),Ue(),xe({typescript:P}),P?Ke(k):[],J?await Ve():[],Q?await Xe():[],z?await fe():[],U?await Me(v,r):[],X?await Ye():[],H?await Oe():[],M?await Qe():[],Ce(),ue(),ge(n),s,f,F].flat()},"eslintConfig");module.exports=ir;
|
|
1
|
+
"use strict";var ee=Object.create;var g=Object.defineProperty;var re=Object.getOwnPropertyDescriptor;var te=Object.getOwnPropertyNames;var se=Object.getPrototypeOf,oe=Object.prototype.hasOwnProperty;var t=(e,r)=>g(e,"name",{value:r,configurable:!0});var ne=(e,r,s,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of te(r))!oe.call(e,a)&&a!==s&&g(e,a,{get:()=>r[a],enumerable:!(n=re(r,a))||n.enumerable});return e};var o=(e,r,s)=>(s=e!=null?ee(se(e)):{},ne(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"),ie=require("@eslint/js"),_=require("eslint-plugin-perfectionist"),ae=require("eslint-config-prettier"),c=require("local-pkg"),ce=require("eslint-plugin-regexp"),q=require("eslint-plugin-unicorn");function le(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(le,"_interopNamespaceDefault");var T=le(ce);const l="?([cm])[jt]s?(x)",pe=["**/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",fe="**/*.?([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}`],ue=[R,m,fe,j],me="**/*.cjs",de="**/*.astro",ge=["vi.mock","describe","expect","it"],ye=["@testing-library/react"],i=t(async e=>{const r=await e;return r.default??r},"interopDefault"),je=t(async()=>{const e=[de],[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"),xe=t(()=>[{files:[me],languageOptions:{globals:y.commonjs},name:"jimmy.codes/commonjs"}],"commonjsConfig"),he={...O.recommended.rules,"@eslint-community/eslint-comments/no-unused-disable":"off","@eslint-community/eslint-comments/require-description":"error"},be=t(()=>[{...O.recommended,name:"jimmy.codes/eslint-comments",rules:he}],"eslintCommentsConfig"),we=t(e=>[{ignores:[...pe,...e],name:"jimmy.codes/ignores"}],"ignoresConfig"),ve={...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"},ke={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}}},Pe=t(({typescript:e=!1}={})=>[{name:"jimmy.codes/imports",plugins:{"import-x":u,n:C},rules:ve},...e?[ke]:[]],"importsConfig"),Ee={...ie.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"},Oe=t(()=>[{linterOptions:{reportUnusedDisableDirectives:!0},name:"jimmy.codes/javascript",rules:Ee}],"javascriptConfig"),S=t((e={})=>Object.fromEntries(Object.entries(e).map(([r,s])=>[r,s==="warn"?"error":s])),"warningAsErrors"),Ce=t(async()=>{const e=await i(import("@next/eslint-plugin-next"));return S(e.configs.recommended.rules)},"nextjsRules"),_e=t(async()=>{const e=await i(import("@next/eslint-plugin-next"));return[{files:ue,name:"jimmy.codes/nextjs",plugins:{"@next/next":e},rules:await Ce()}]},"nextjsConfig"),qe={"n/no-process-exit":"off","n/prefer-node-protocol":"error"},Te=t(()=>[{name:"jimmy.codes/node",plugins:{n:C},rules:qe}],"nodeConfig"),Re={..._.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"},Le=t(()=>[{name:"jimmy.codes/perfectionist",plugins:{perfectionist:_},rules:Re}],"perfectionistConfig"),Se=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"),Ge=t(async()=>[{...(await i(import("eslint-plugin-playwright"))).configs["flat/recommended"],files:L,name:"jimmy.codes/playwright",rules:await Se()}],"playwrightConfig"),Ae=t(()=>[{name:"jimmy.codes/prettier",...ae}],"prettierConfig"),Ne=t(()=>c.isPackageExists("typescript"),"hasTypescript"),Ie=t(()=>c.isPackageExists("react"),"hasReact"),G=t(()=>c.isPackageExists("vitest"),"hasVitest"),A=t(()=>c.isPackageExists("jest"),"hasJest"),Be=t(()=>G()||A(),"hasTesting"),$e=t(()=>ye.some(e=>c.isPackageExists(e)),"hasTestingLibrary"),Fe=t(()=>c.isPackageExists("@tanstack/react-query"),"hasReactQuery"),Ve=t(()=>c.isPackageExists("astro"),"hasAstro"),Je=t(()=>c.isPackageExists("@playwright/test"),"hasPlaywright"),Ue=t(()=>c.isPackageExists("storybook"),"hasStorybook"),N=t(()=>c.isPackageExists("next"),"hasNext"),Xe=t(()=>c.isPackageExists("vite"),"hasVite"),ze=t(e=>e===2?"error":e===1?"warn":"off","toStringSeverity"),I=t((e={})=>Object.fromEntries(Object.entries(e).map(([r,s])=>[r,typeof s=="number"?ze(s):s])),"normalizeRuleEntries"),Qe=["dynamic","dynamicParams","revalidate","fetchCache","runtime","preferredRegion","maxDuration","config","generateStaticParams","metadata","generateMetadata","viewport","generateViewport"],He=t(async()=>{const[e,r]=await Promise.all([i(import("eslint-plugin-react")),i(import("eslint-plugin-jsx-a11y"))]),s=N(),n=Xe();return{...r.configs.recommended.rules,...I(e.configs.flat?.recommended?.rules),...I(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?Qe:[]}],"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"),Me=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 He(),settings:{react:{version:"detect"}}}]},"reactConfig"),We={...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"},Ye=t(()=>[{name:"jimmy.codes/regexp",plugins:{regexp:T},rules:We}],"regexpConfig"),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:{...S(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"),B=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 B(),"jest/no-deprecated-functions":"off","jest/require-hook":["error",{allowedFunctionCalls:ge}]}),"vitestRules"),er=t(async({framework:e="vitest"}={},r=!0)=>{const s=r?G():e==="vitest",n=e==="jest"||r&&A(),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 B()})}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&&Fe(),"shouldEnableTanstackQuery"),fr=t(({utilities:e=[]},r)=>e.includes("testing-library")||r&&$e(),"shouldEnableTestingLibrary"),ur=t(async({astro:e=!1,autoDetect:r=!0,configs:s=[],ignores:n=[],jest:a=!1,nextjs:f=!1,overrides:$=[],playwright:F=!1,react:h=!1,storybook:V=!1,tanstackQuery:J=!1,testing:b=!1,testingLibrary:U=!1,typescript:w=!1,vitest:v=!1}={},...X)=>{const z=lr(h),k=cr(b,{jest:a,testingLibrary:U,vitest:v}),P=ar(w),E=w||!!P||r&&Ne(),Q=h||r&&Ie(),H=b||a||v||r&&Be(),M=e||r&&Ve(),W=pr(z,J,r),Y=fr(k,r),D=F||r&&Je(),K=V||r&&Ue(),Z=f||r&&N();return[Oe(),Le(),Te(),ir(),be(),Ye(),Pe({typescript:E}),E?or(P):[],Q?await Me():[],W?await Ke():[],M?await je():[],H?await er(k,r):[],Y?await tr():[],D?await Ge():[],K?await De():[],Z?await _e():[],Ae(),xe(),we(n),s,$,X].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
|
|
@@ -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
|
|
|
@@ -10876,6 +10982,11 @@ interface Options {
|
|
|
10876
10982
|
* @default false
|
|
10877
10983
|
*/
|
|
10878
10984
|
jest?: boolean;
|
|
10985
|
+
/**
|
|
10986
|
+
* Are Next.js rules enabled?
|
|
10987
|
+
* @default false
|
|
10988
|
+
*/
|
|
10989
|
+
nextjs?: boolean;
|
|
10879
10990
|
/**
|
|
10880
10991
|
* Additional configs to either extend or overrides configurations
|
|
10881
10992
|
* @default []
|
|
@@ -10924,7 +11035,7 @@ interface Options {
|
|
|
10924
11035
|
vitest?: boolean;
|
|
10925
11036
|
}
|
|
10926
11037
|
|
|
10927
|
-
declare const eslintConfig: ({ astro, autoDetect, configs, ignores, jest, overrides, playwright, react, storybook, tanstackQuery, testing, testingLibrary, typescript, vitest, }?: Options, ...moreOverrides: Linter.Config[] | TypedConfigItem[]) => Promise<(TypedConfigItem | Linter.Config<Linter.RulesRecord> | _typescript_eslint_utils_ts_eslint.FlatConfig.Config | {
|
|
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 | {
|
|
10928
11039
|
files: string[];
|
|
10929
11040
|
languageOptions: {
|
|
10930
11041
|
globals: {
|
|
@@ -11573,6 +11684,20 @@ declare const eslintConfig: ({ astro, autoDetect, configs, ignores, jest, overri
|
|
|
11573
11684
|
"object-shorthand": "error";
|
|
11574
11685
|
"prefer-arrow-callback": "error";
|
|
11575
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
|
+
[k: string]: 0 | 1 | 2 | "off" | "error" | [Linter.RuleSeverity, ...any[]] | undefined;
|
|
11700
|
+
};
|
|
11576
11701
|
} | {
|
|
11577
11702
|
name: string;
|
|
11578
11703
|
plugins: {
|
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
|
|
@@ -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
|
|
|
@@ -10876,6 +10982,11 @@ interface Options {
|
|
|
10876
10982
|
* @default false
|
|
10877
10983
|
*/
|
|
10878
10984
|
jest?: boolean;
|
|
10985
|
+
/**
|
|
10986
|
+
* Are Next.js rules enabled?
|
|
10987
|
+
* @default false
|
|
10988
|
+
*/
|
|
10989
|
+
nextjs?: boolean;
|
|
10879
10990
|
/**
|
|
10880
10991
|
* Additional configs to either extend or overrides configurations
|
|
10881
10992
|
* @default []
|
|
@@ -10924,7 +11035,7 @@ interface Options {
|
|
|
10924
11035
|
vitest?: boolean;
|
|
10925
11036
|
}
|
|
10926
11037
|
|
|
10927
|
-
declare const eslintConfig: ({ astro, autoDetect, configs, ignores, jest, overrides, playwright, react, storybook, tanstackQuery, testing, testingLibrary, typescript, vitest, }?: Options, ...moreOverrides: Linter.Config[] | TypedConfigItem[]) => Promise<(TypedConfigItem | Linter.Config<Linter.RulesRecord> | _typescript_eslint_utils_ts_eslint.FlatConfig.Config | {
|
|
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 | {
|
|
10928
11039
|
files: string[];
|
|
10929
11040
|
languageOptions: {
|
|
10930
11041
|
globals: {
|
|
@@ -11573,6 +11684,20 @@ declare const eslintConfig: ({ astro, autoDetect, configs, ignores, jest, overri
|
|
|
11573
11684
|
"object-shorthand": "error";
|
|
11574
11685
|
"prefer-arrow-callback": "error";
|
|
11575
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
|
+
[k: string]: 0 | 1 | 2 | "off" | "error" | [Linter.RuleSeverity, ...any[]] | undefined;
|
|
11700
|
+
};
|
|
11576
11701
|
} | {
|
|
11577
11702
|
name: string;
|
|
11578
11703
|
plugins: {
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var H=Object.defineProperty;var r=(e,t)=>H(e,"name",{value:t,configurable:!0});import u from"globals";import{parser as M,configs as p}from"typescript-eslint";import v from"@eslint-community/eslint-plugin-eslint-comments/configs";import f from"eslint-plugin-import-x";import P from"eslint-plugin-n";import W from"@eslint/js";import C from"eslint-plugin-perfectionist";import Y from"eslint-config-prettier";import{isPackageExists as i}from"local-pkg";import*as O from"eslint-plugin-regexp";import E from"eslint-plugin-unicorn";const a="?([cm])[jt]s?(x)",D=["**/node_modules","**/dist","**/package-lock.json","**/yarn.lock","**/pnpm-lock.yaml","**/bun.lockb","**/output","**/coverage","**/temp","**/.temp","**/tmp","**/.tmp","**/.history","**/.vitepress/cache","**/.nuxt","**/.next","**/.vercel","**/.changeset","**/.idea","**/.cache","**/.output","**/.vite-inspect","**/.yarn","**/storybook-static","**/.eslint-config-inspector","**/playwright-report","**/.astro","**/.vinxi","**/app.config.timestamp_*.js","**/CHANGELOG*.md","**/*.min.*","**/LICENSE*","**/__snapshots__","**/auto-import?(s).d.ts","**/components.d.ts","**/vite.config.ts.*.mjs","**/*.gen.*","!.storybook"],K="**/*.?([cm])js",d="**/*.?([cm])jsx",R="**/*.?([cm])tsx",m=[`**/__tests__/**/*.${a}`,`**/*.spec.${a}`,`**/*.test.${a}`,`**/*.bench.${a}`,`**/*.benchmark.${a}`],T=[`**/e2e/**/*.spec.${a}`,`**/e2e/**/*.test.${a}`],g=[...T,`**/cypress/**/*.spec.${a}`,`**/cypress/**/*.test.${a}`],Z="**/*.cjs",ee="**/*.astro",re=["vi.mock","describe","expect","it"],te=["@testing-library/react"],s=r(async e=>{const t=await e;return t.default??t},"interopDefault"),oe=r(async()=>{const e=[ee],[t,o,n]=await Promise.all([import("eslint-plugin-astro"),import("astro-eslint-parser"),s(import("eslint-plugin-jsx-a11y"))]);return[{files:e,languageOptions:{globals:{...u.node,Astro:!1,Fragment:!1},parser:o,parserOptions:{extraFileExtensions:[".astro"],parser:M},sourceType:"module"},name:"jimmy.codes/astro",plugins:{astro:t,"jsx-a11y":n},processor:"astro/client-side-ts",rules:{...n.configs.recommended.rules,"astro/missing-client-only-directive-value":"error","astro/no-conflict-set-directives":"error","astro/no-deprecated-astro-canonicalurl":"error","astro/no-deprecated-astro-fetchcontent":"error","astro/no-deprecated-astro-resolve":"error","astro/no-deprecated-getentrybyslug":"error","astro/no-exports-from-components":"off","astro/no-unused-define-vars-in-style":"error","astro/valid-compile":"error"}},{files:e,languageOptions:{parserOptions:p.disableTypeChecked.languageOptions?.parserOptions},name:"jimmy.codes/astro/disable-type-checked",rules:p.disableTypeChecked.rules},{name:"jimmy.codes/astro/imports",settings:{"import-x/core-modules":["astro:content"]}}]},"astroConfig"),se=r(()=>[{files:[Z],languageOptions:{globals:u.commonjs},name:"jimmy.codes/commonjs"}],"commonjsConfig"),ne={...v.recommended.rules,"@eslint-community/eslint-comments/no-unused-disable":"off","@eslint-community/eslint-comments/require-description":"error"},ie=r(()=>[{...v.recommended,name:"jimmy.codes/eslint-comments",rules:ne}],"eslintCommentsConfig"),ae=r(e=>[{ignores:[...D,...e],name:"jimmy.codes/ignores"}],"ignoresConfig"),ce={...f.configs.recommended.rules,"import-x/consistent-type-specifier-style":["error","prefer-top-level"],"import-x/extensions":["error","never",{checkTypedImports:!0,svg:"always"}],"import-x/first":"error","import-x/namespace":"off","import-x/newline-after-import":"error","import-x/no-absolute-path":"error","import-x/no-duplicates":"error","import-x/no-empty-named-blocks":"error","import-x/no-named-as-default":"error","import-x/no-named-as-default-member":"error","import-x/no-self-import":"error","import-x/no-unresolved":["error",{ignore:[String.raw`\.svg$`]}],"import-x/no-useless-path-segments":"error"},le={name:"jimmy.codes/imports/typescript",rules:f.configs.typescript.rules,settings:{...f.configs.typescript.settings,"import-x/resolver":{...f.configs.typescript.settings["import-x/resolver"],typescript:!0}}},pe=r(({typescript:e=!1}={})=>[{name:"jimmy.codes/imports",plugins:{"import-x":f,n:P},rules:ce},...e?[le]:[]],"importsConfig"),fe={...W.configs.recommended.rules,"array-callback-return":["error",{allowImplicit:!0}],"arrow-body-style":["error","always"],curly:["error","all"],"no-console":"warn","no-self-compare":"error","no-template-curly-in-string":"error","no-unmodified-loop-condition":"error","no-unreachable-loop":"error","no-use-before-define":["error",{allowNamedExports:!1,classes:!1,functions:!1,variables:!0}],"no-useless-rename":"error","object-shorthand":"error","prefer-arrow-callback":"error"},me=r(()=>[{linterOptions:{reportUnusedDisableDirectives:!0},name:"jimmy.codes/javascript",rules:fe}],"javascriptConfig"),ue={"n/no-process-exit":"off","n/prefer-node-protocol":"error"},de=r(()=>[{name:"jimmy.codes/node",plugins:{n:P},rules:ue}],"nodeConfig"),ge={...C.configs["recommended-natural"].rules,"perfectionist/sort-imports":["error",{customGroups:{type:{},value:{}},environment:"node",groups:["side-effect-style","builtin","type","external","internal-type","internal",["parent-type","sibling-type","index-type"],["parent","sibling","index"],"object","style","unknown"],internalPattern:["^~/.*","^@/.*"],order:"asc",type:"natural"}],"perfectionist/sort-modules":"off"},ye=r(()=>[{name:"jimmy.codes/perfectionist",plugins:{perfectionist:C},rules:ge}],"perfectionistConfig"),je=r(async()=>({...(await s(import("eslint-plugin-playwright"))).configs["flat/recommended"].rules,"playwright/expect-expect":"error","playwright/max-nested-describe":"error","playwright/no-conditional-expect":"error","playwright/no-conditional-in-test":"error","playwright/no-element-handle":"error","playwright/no-eval":"error","playwright/no-force-option":"error","playwright/no-nested-step":"error","playwright/no-page-pause":"error","playwright/no-skipped-test":"error","playwright/no-useless-await":"error","playwright/no-useless-not":"error","playwright/no-wait-for-selector":"error","playwright/no-wait-for-timeout":"error"}),"playwrightRules"),he=r(async()=>[{...(await s(import("eslint-plugin-playwright"))).configs["flat/recommended"],files:T,name:"jimmy.codes/playwright",rules:await je()}],"playwrightConfig"),xe=r(()=>[{name:"jimmy.codes/prettier",...Y}],"prettierConfig"),be=r(()=>i("typescript"),"hasTypescript"),we=r(()=>i("react"),"hasReact"),_=r(()=>i("vitest"),"hasVitest"),L=r(()=>i("jest"),"hasJest"),ke=r(()=>_()||L(),"hasTesting"),ve=r(()=>te.some(e=>i(e)),"hasTestingLibrary"),Pe=r(()=>i("@tanstack/react-query"),"hasReactQuery"),Ce=r(()=>i("astro"),"hasAstro"),Oe=r(()=>i("@playwright/test"),"hasPlaywright"),Ee=r(()=>i("storybook"),"hasStorybook"),Re=r(()=>i("next"),"hasNext"),Te=r(()=>i("vite"),"hasVite"),_e=r(e=>e===2?"error":e===1?"warn":"off","toStringSeverity"),S=r((e={})=>Object.fromEntries(Object.entries(e).map(([t,o])=>[t,typeof o=="number"?_e(o):o])),"normalizeRuleEntries"),Le=["dynamic","dynamicParams","revalidate","fetchCache","runtime","preferredRegion","maxDuration","config","generateStaticParams","metadata","generateMetadata","viewport","generateViewport"],Se=r(async()=>{const[e,t]=await Promise.all([s(import("eslint-plugin-react")),s(import("eslint-plugin-jsx-a11y"))]),o=Re(),n=Te();return{...t.configs.recommended.rules,...S(e.configs.flat?.recommended?.rules),...S(e.configs.flat?.["jsx-runtime"]?.rules),"react-compiler/react-compiler":"error","react-hooks/exhaustive-deps":"error","react-hooks/rules-of-hooks":"error","react-refresh/only-export-components":["warn",{allowConstantExport:n,allowExportNames:o?Le:[]}],"react/boolean-prop-naming":"off","react/button-has-type":"error","react/checked-requires-onchange-or-readonly":"error","react/default-props-match-prop-types":"error","react/destructuring-assignment":"off","react/forbid-component-props":"off","react/forbid-dom-props":"off","react/forbid-elements":"off","react/forbid-foreign-prop-types":"off","react/forbid-prop-types":"off","react/forward-ref-uses-ref":"error","react/function-component-definition":"off","react/hook-use-state":"error","react/iframe-missing-sandbox":"error","react/jsx-boolean-value":["error","never"],"react/jsx-curly-brace-presence":"error","react/jsx-filename-extension":"off","react/jsx-fragments":["error","syntax"],"react/jsx-handler-names":"off","react/jsx-max-depth":"off","react/jsx-no-bind":"off","react/jsx-no-constructed-context-values":"error","react/jsx-no-leaked-render":"error","react/jsx-no-literals":"off","react/jsx-no-script-url":"error","react/jsx-no-useless-fragment":"error","react/jsx-one-expression-per-line":"off","react/jsx-pascal-case":["error",{allowNamespace:!0}],"react/jsx-props-no-spread-multi":"off","react/jsx-props-no-spreading":"off","react/jsx-sort-default-props":"off","react/jsx-sort-props":"off","react/no-access-state-in-setstate":"error","react/no-adjacent-inline-elements":"off","react/no-array-index-key":"off","react/no-arrow-function-lifecycle":"error","react/no-danger":"off","react/no-did-mount-set-state":"error","react/no-did-update-set-state":"error","react/no-invalid-html-attribute":"error","react/no-multi-comp":"off","react/no-namespace":"error","react/no-object-type-as-default-prop":"error","react/no-redundant-should-component-update":"error","react/no-set-state":"off","react/no-this-in-sfc":"error","react/no-typos":"error","react/no-unstable-nested-components":"error","react/no-unused-class-component-methods":"error","react/no-unused-prop-types":"error","react/no-unused-state":"error","react/no-will-update-set-state":"error","react/prefer-es6-class":"off","react/prefer-exact-props":"off","react/prefer-read-only-props":"off","react/prefer-stateless-function":"off","react/require-default-props":"off","react/require-optimization":"off","react/self-closing-comp":"error","react/sort-comp":"off","react/sort-default-props":"off","react/sort-prop-types":"off","react/state-in-constructor":"off","react/static-property-placement":"off","react/style-prop-object":"error","react/void-dom-elements-no-children":"error"}},"reactRules"),qe=r(async()=>{const[e,t,o,n,c]=await Promise.all([s(import("eslint-plugin-react")),s(import("eslint-plugin-jsx-a11y")),import("eslint-plugin-react-hooks"),s(import("eslint-plugin-react-refresh")),s(import("eslint-plugin-react-compiler"))]);return[{files:[d,R],languageOptions:{globals:{...u.browser},parserOptions:{ecmaFeatures:{jsx:!0},jsxPragma:null}},name:"jimmy.codes/react",plugins:{"jsx-a11y":t,react:e,"react-compiler":c,"react-hooks":o,"react-refresh":n},rules:await Se(),settings:{react:{version:"detect"}}}]},"reactConfig"),Ae={...O.configs["flat/recommended"].rules,"regexp/confusing-quantifier":"error","regexp/no-empty-alternative":"error","regexp/no-lazy-ends":"error","regexp/no-potentially-useless-backreference":"error","regexp/no-useless-flag":"error","regexp/optimal-lookaround-quantifier":"error"},Ge=r(()=>[{name:"jimmy.codes/regexp",plugins:{regexp:O},rules:Ae}],"regexpConfig"),Ie=r((e={})=>Object.fromEntries(Object.entries(e).map(([t,o])=>[t,o==="warn"?"error":o])),"warningAsErrors"),Ne=r(async()=>{const{configs:e}=await s(import("eslint-plugin-storybook")),[t,o,n]=e["flat/recommended"];return[{name:"jimmy.codes/storybook/setup",plugins:t?.plugins},{files:o?.files,name:"jimmy.codes/storybook/stories-rules",rules:{...Ie(o?.rules),"import-x/no-anonymous-default-export":"off","unicorn/no-anonymous-default-export":"off"}},{files:n?.files,name:"jimmy.codes/storybook/main-rules",rules:{...n?.rules}}]},"storybookConfig"),Be=r(async()=>{const e=await s(import("@tanstack/eslint-plugin-query"));return[{files:[d,R],name:"jimmy.codes/react/query",plugins:{"@tanstack/query":e},rules:{"@tanstack/query/exhaustive-deps":"error","@tanstack/query/no-rest-destructuring":"warn","@tanstack/query/stable-query-client":"error"}}]},"tanstackQueryConfig"),q=r(async()=>{const e=await s(import("eslint-plugin-jest"));return{...e.configs["flat/recommended"].rules,...e.configs["flat/style"].rules,"jest/consistent-test-it":["error",{fn:"test",withinDescribe:"it"}],"jest/expect-expect":"error","jest/no-alias-methods":"error","jest/no-commented-out-tests":"error","jest/no-conditional-in-test":"error","jest/no-confusing-set-timeout":"error","jest/no-duplicate-hooks":"error","jest/no-hooks":"off","jest/no-large-snapshots":"off","jest/no-restricted-jest-methods":"off","jest/no-restricted-matchers":"off","jest/no-test-return-statement":"error","jest/no-untyped-mock-factory":"off","jest/prefer-called-with":"error","jest/prefer-comparison-matcher":"error","jest/prefer-each":"error","jest/prefer-equality-matcher":"error","jest/prefer-expect-assertions":"off","jest/prefer-expect-resolves":"error","jest/prefer-hooks-in-order":"error","jest/prefer-hooks-on-top":"error","jest/prefer-lowercase-title":"off","jest/prefer-mock-promise-shorthand":"error","jest/prefer-snapshot-hint":"error","jest/prefer-spy-on":"off","jest/prefer-strict-equal":"error","jest/prefer-todo":"warn","jest/require-hook":"error","jest/require-to-throw-message":"error","jest/require-top-level-describe":"off","jest/unbound-method":"off"}},"jestRules"),$e=r(async()=>({...await q(),"jest/no-deprecated-functions":"off","jest/require-hook":["error",{allowedFunctionCalls:re}]}),"vitestRules"),Fe=r(async({framework:e="vitest"}={},t=!0)=>{const o=t?_():e==="vitest",n=e==="jest"||t&&L(),c=[];if(o){const l=await s(import("eslint-plugin-jest"));c.push({files:m,ignores:g,...l.configs["flat/recommended"],name:"jimmy.codes/vitest",rules:await $e()})}if(n){const l=await s(import("eslint-plugin-jest"));c.push({files:m,ignores:g,...l.configs["flat/recommended"],name:"jimmy.codes/jest",rules:await q()})}return c},"testingConfig"),Ve=r(async()=>{const[e,t]=await Promise.all([import("eslint-plugin-jest-dom"),s(import("eslint-plugin-testing-library"))]);return{...t.configs["flat/react"].rules,...e.configs["flat/recommended"].rules}},"testingLibraryRules"),Je=r(async()=>{const[e,t]=await Promise.all([import("eslint-plugin-jest-dom"),s(import("eslint-plugin-testing-library"))]);return[{files:m,ignores:g,name:"jimmy.codes/testing-library",plugins:{"jest-dom":e,"testing-library":t},rules:await Ve()}]},"testingLibraryConfig"),Ue={"@typescript-eslint/consistent-type-exports":["error",{fixMixedExportsWithInlineTypeSpecifier:!1}],"@typescript-eslint/consistent-type-imports":["error",{fixStyle:"separate-type-imports"}],"@typescript-eslint/no-deprecated":"warn","@typescript-eslint/no-misused-promises":["error",{checksVoidReturn:{attributes:!1}}],"@typescript-eslint/no-unused-vars":["error",{args:"all",argsIgnorePattern:"^_",caughtErrors:"all",caughtErrorsIgnorePattern:"^_",destructuredArrayIgnorePattern:"^_",ignoreRestSiblings:!0,varsIgnorePattern:"^_"}],"@typescript-eslint/no-use-before-define":["error",{allowNamedExports:!1,classes:!1,functions:!1,variables:!0}],"@typescript-eslint/restrict-template-expressions":["error",{allowNumber:!0}],"no-use-before-define":"off"},Qe=r(e=>[...p.strictTypeChecked,...p.stylisticTypeChecked.filter(t=>t.name==="typescript-eslint/stylistic-type-checked"),{languageOptions:{parserOptions:{...e?.project?{project:e.project}:{projectService:!0},tsconfigRootDir:process.cwd()}},name:"jimmy.codes/typescript",rules:Ue},{files:[K,d],...p.disableTypeChecked},{files:m,name:"jimmy.codes/typescript/testing",rules:{"@typescript-eslint/no-unsafe-argument":"off","@typescript-eslint/no-unsafe-assignment":"off"}}],"typescriptConfig"),Xe={...E.configs["flat/recommended"].rules,"unicorn/filename-case":"off","unicorn/import-style":"off","unicorn/no-abusive-eslint-disable":"off","unicorn/no-anonymous-default-export":"off","unicorn/no-array-callback-reference":"off","unicorn/no-array-reduce":"off","unicorn/no-null":"off","unicorn/no-process-exit":"off","unicorn/no-useless-undefined":["error",{checkArguments:!1,checkArrowFunctionBody:!1}],"unicorn/prefer-node-protocol":"off","unicorn/prevent-abbreviations":"off"},ze=r(()=>[{...E.configs["flat/recommended"],name:"jimmy.codes/unicorn",rules:Xe}],"unicornConfig"),He=r(e=>typeof e=="object"?e:void 0,"getTypescriptOptions"),Me=r((e,t)=>typeof e=="object"?e:{framework:t.vitest?"vitest":t.jest?"jest":"vitest",...t.testingLibrary&&{utilities:["testing-library"]}},"getTestingOptions"),We=r(e=>typeof e=="object"?e:{utilities:[]},"getReactOptions"),Ye=r(({utilities:e=[]},t,o)=>t||e.includes("@tanstack/query")||o&&Pe(),"shouldEnableTanstackQuery"),De=r(({utilities:e=[]},t)=>e.includes("testing-library")||t&&ve(),"shouldEnableTestingLibrary"),Ke=r(async({astro:e=!1,autoDetect:t=!0,configs:o=[],ignores:n=[],jest:c=!1,overrides:l=[],playwright:A=!1,react:y=!1,storybook:G=!1,tanstackQuery:I=!1,testing:j=!1,testingLibrary:N=!1,typescript:h=!1,vitest:x=!1}={},...B)=>{const $=We(y),b=Me(j,{jest:c,testingLibrary:N,vitest:x}),w=He(h),k=h||!!w||t&&be(),F=y||t&&we(),V=j||c||x||t&&ke(),J=e||t&&Ce(),U=Ye($,I,t),Q=De(b,t),X=A||t&&Oe(),z=G||t&&Ee();return[me(),ye(),de(),ze(),ie(),Ge(),pe({typescript:k}),k?Qe(w):[],F?await qe():[],U?await Be():[],J?await oe():[],V?await Fe(b,t):[],Q?await Je():[],X?await he():[],z?await Ne():[],xe(),se(),ae(n),o,l,B].flat()},"eslintConfig");export{Ke as default};
|
|
1
|
+
var Z=Object.defineProperty;var r=(e,t)=>Z(e,"name",{value:t,configurable:!0});import d from"globals";import{parser as D,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 ee from"@eslint/js";import O from"eslint-plugin-perfectionist";import re 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)",te=["**/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",oe="**/*.?([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}`],se=[_,m,oe,g],ne="**/*.cjs",ie="**/*.astro",ae=["vi.mock","describe","expect","it"],ce=["@testing-library/react"],s=r(async e=>{const t=await e;return t.default??t},"interopDefault"),le=r(async()=>{const e=[ie],[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:D},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"),pe=r(()=>[{files:[ne],languageOptions:{globals:d.commonjs},name:"jimmy.codes/commonjs"}],"commonjsConfig"),fe={...P.recommended.rules,"@eslint-community/eslint-comments/no-unused-disable":"off","@eslint-community/eslint-comments/require-description":"error"},me=r(()=>[{...P.recommended,name:"jimmy.codes/eslint-comments",rules:fe}],"eslintCommentsConfig"),ue=r(e=>[{ignores:[...te,...e],name:"jimmy.codes/ignores"}],"ignoresConfig"),de={...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"},ge={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}}},ye=r(({typescript:e=!1}={})=>[{name:"jimmy.codes/imports",plugins:{"import-x":f,n:C},rules:de},...e?[ge]:[]],"importsConfig"),je={...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"},xe=r(()=>[{linterOptions:{reportUnusedDisableDirectives:!0},name:"jimmy.codes/javascript",rules:je}],"javascriptConfig"),L=r((e={})=>Object.fromEntries(Object.entries(e).map(([t,o])=>[t,o==="warn"?"error":o])),"warningAsErrors"),he=r(async()=>{const e=await s(import("@next/eslint-plugin-next"));return L(e.configs.recommended.rules)},"nextjsRules"),be=r(async()=>{const e=await s(import("@next/eslint-plugin-next"));return[{files:se,name:"jimmy.codes/nextjs",plugins:{"@next/next":e},rules:await he()}]},"nextjsConfig"),we={"n/no-process-exit":"off","n/prefer-node-protocol":"error"},ke=r(()=>[{name:"jimmy.codes/node",plugins:{n:C},rules:we}],"nodeConfig"),ve={...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"},Pe=r(()=>[{name:"jimmy.codes/perfectionist",plugins:{perfectionist:O},rules:ve}],"perfectionistConfig"),Ce=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"),Oe=r(async()=>[{...(await s(import("eslint-plugin-playwright"))).configs["flat/recommended"],files:R,name:"jimmy.codes/playwright",rules:await Ce()}],"playwrightConfig"),Ee=r(()=>[{name:"jimmy.codes/prettier",...re}],"prettierConfig"),Te=r(()=>i("typescript"),"hasTypescript"),_e=r(()=>i("react"),"hasReact"),S=r(()=>i("vitest"),"hasVitest"),q=r(()=>i("jest"),"hasJest"),Re=r(()=>S()||q(),"hasTesting"),Le=r(()=>ce.some(e=>i(e)),"hasTestingLibrary"),Se=r(()=>i("@tanstack/react-query"),"hasReactQuery"),qe=r(()=>i("astro"),"hasAstro"),Ge=r(()=>i("@playwright/test"),"hasPlaywright"),Ae=r(()=>i("storybook"),"hasStorybook"),G=r(()=>i("next"),"hasNext"),Ie=r(()=>i("vite"),"hasVite"),Ne=r(e=>e===2?"error":e===1?"warn":"off","toStringSeverity"),A=r((e={})=>Object.fromEntries(Object.entries(e).map(([t,o])=>[t,typeof o=="number"?Ne(o):o])),"normalizeRuleEntries"),Be=["dynamic","dynamicParams","revalidate","fetchCache","runtime","preferredRegion","maxDuration","config","generateStaticParams","metadata","generateMetadata","viewport","generateViewport"],$e=r(async()=>{const[e,t]=await Promise.all([s(import("eslint-plugin-react")),s(import("eslint-plugin-jsx-a11y"))]),o=G(),n=Ie();return{...t.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:o?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=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 $e(),settings:{react:{version:"detect"}}}]},"reactConfig"),Ve={...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"},Je=r(()=>[{name:"jimmy.codes/regexp",plugins:{regexp:E},rules:Ve}],"regexpConfig"),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:{...L(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"),I=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 I(),"jest/no-deprecated-functions":"off","jest/require-hook":["error",{allowedFunctionCalls:ae}]}),"vitestRules"),ze=r(async({framework:e="vitest"}={},t=!0)=>{const o=t?S():e==="vitest",n=e==="jest"||t&&q(),c=[];if(o){const l=await s(import("eslint-plugin-jest"));c.push({files: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 I()})}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&&Se(),"shouldEnableTanstackQuery"),or=r(({utilities:e=[]},t)=>e.includes("testing-library")||t&&Le(),"shouldEnableTestingLibrary"),sr=r(async({astro:e=!1,autoDetect:t=!0,configs:o=[],ignores:n=[],jest:c=!1,nextjs:l=!1,overrides:N=[],playwright:B=!1,react:j=!1,storybook:$=!1,tanstackQuery:F=!1,testing:x=!1,testingLibrary:V=!1,typescript:h=!1,vitest:b=!1}={},...J)=>{const U=rr(j),w=er(x,{jest:c,testingLibrary:V,vitest:b}),k=De(h),v=h||!!k||t&&Te(),X=j||t&&_e(),Q=x||c||b||t&&Re(),z=e||t&&qe(),H=tr(U,F,t),M=or(w,t),W=B||t&&Ge(),Y=$||t&&Ae(),K=l||t&&G();return[xe(),Pe(),ke(),Ze(),me(),Je(),ye({typescript:v}),v?Ye(k):[],X?await Fe():[],H?await Xe():[],z?await le():[],Q?await ze(w,t):[],M?await Me():[],W?await Oe():[],Y?await Ue():[],K?await be():[],Ee(),pe(),ue(n),o,N,J].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.
|
|
3
|
+
"version": "3.25.0",
|
|
4
4
|
"description": "another opinionated eslint config",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.4.1",
|
|
35
35
|
"@eslint/js": "^9.16.0",
|
|
36
|
+
"@next/eslint-plugin-next": "^15.0.3",
|
|
36
37
|
"@tanstack/eslint-plugin-query": "^5.62.1",
|
|
37
38
|
"@types/eslint": "9.6.1",
|
|
38
39
|
"@typescript-eslint/parser": "^8.17.0",
|