@jimmy.codes/eslint-config 3.27.0 → 3.28.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/dist/index.cjs +1 -1
- package/dist/index.d.cts +765 -1
- package/dist/index.d.mts +765 -1
- package/dist/index.mjs +1 -1
- package/package.json +2 -1
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var Z=Object.create;var d=Object.defineProperty;var ee=Object.getOwnPropertyDescriptor;var re=Object.getOwnPropertyNames;var te=Object.getPrototypeOf,se=Object.prototype.hasOwnProperty;var t=(e,r)=>d(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&&d(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?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"),ne=require("eslint-import-resolver-typescript"),y=require("eslint-plugin-import-x"),O=require("eslint-plugin-n"),ie=require("@eslint/js"),C=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",u="**/*.?([cm])jsx",fe="**/*.?([cm])ts",x="**/*.?([cm])tsx",m=[`**/__tests__/**/*.${l}`,`**/*.spec.${l}`,`**/*.test.${l}`,`**/*.bench.${l}`,`**/*.benchmark.${l}`],_=[`**/e2e/**/*.spec.${l}`,`**/e2e/**/*.test.${l}`],L=[..._,`**/cypress/**/*.spec.${l}`,`**/cypress/**/*.test.${l}`],ue=[R,u,fe,x],me="**/*.cjs",de="**/*.astro",ge=["@testing-library/react"],i=t(async e=>{const r=await e;return r.default??r},"interopDefault"),ye=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:{...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"),xe=t(()=>[{files:[me],languageOptions:{globals:g.commonjs},name:"jimmy.codes/commonjs"}],"commonjsConfig"),he={...E.recommended.rules,"@eslint-community/eslint-comments/no-unused-disable":"off","@eslint-community/eslint-comments/require-description":"error"},je=t(()=>[{...E.recommended,name:"jimmy.codes/eslint-comments",rules:he}],"eslintCommentsConfig"),ve=t(e=>[{ignores:[...pe,...e],name:"jimmy.codes/ignores"}],"ignoresConfig"),be={...y.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"},we=t(()=>{const{rules:e,settings:r}=y.configs.typescript;return[{name:"jimmy.codes/imports/typescript",rules:e,settings:{"import-x/extensions":r["import-x/extensions"],"import-x/external-module-folders":r["import-x/external-module-folders"],"import-x/parsers":r["import-x/parsers"],"import-x/resolver-next":[ne.createTypeScriptImportResolver({alwaysTryTypes:!0})]}}]},"importsTypescriptConfig"),ke=t(({typescript:e=!1}={})=>[{name:"jimmy.codes/imports",plugins:{"import-x":y,n:O},rules:be},...e?we():[]],"importsConfig"),Pe={...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"},Ee=t(()=>[{linterOptions:{reportUnusedDisableDirectives:!0},name:"jimmy.codes/javascript",rules:Pe}],"javascriptConfig"),S=t((e={})=>Object.fromEntries(Object.entries(e).map(([r,s])=>[r,s==="warn"?"error":s])),"warningAsErrors"),Oe=t(async()=>{const e=await i(import("@next/eslint-plugin-next"));return S(e.configs.recommended.rules)},"nextjsRules"),Ce=t(async()=>{const e=await i(import("@next/eslint-plugin-next"));return[{files:ue,name:"jimmy.codes/nextjs",plugins:{"@next/next":e},rules:await Oe()}]},"nextjsConfig"),qe={"n/no-process-exit":"off","n/prefer-node-protocol":"error"},Te=t(()=>[{name:"jimmy.codes/node",plugins:{n:O},rules:qe}],"nodeConfig"),Re={...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"},_e=t(()=>[{name:"jimmy.codes/perfectionist",plugins:{perfectionist:C},rules:Re}],"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:_,name:"jimmy.codes/playwright",rules:await Le()}],"playwrightConfig"),Ge=t(()=>[{name:"jimmy.codes/prettier",...ae}],"prettierConfig"),Ae=t(()=>c.isPackageExists("typescript"),"hasTypescript"),Ie=t(()=>c.isPackageExists("react"),"hasReact"),G=t(()=>c.isPackageExists("vitest"),"hasVitest"),A=t(()=>c.isPackageExists("jest"),"hasJest"),Ne=t(()=>G()||A(),"hasTesting"),Be=t(()=>ge.some(e=>c.isPackageExists(e)),"hasTestingLibrary"),$e=t(()=>c.isPackageExists("@tanstack/react-query"),"hasReactQuery"),Je=t(()=>c.isPackageExists("astro"),"hasAstro"),Ve=t(()=>c.isPackageExists("@playwright/test"),"hasPlaywright"),Fe=t(()=>c.isPackageExists("storybook"),"hasStorybook"),I=t(()=>c.isPackageExists("next"),"hasNext"),Xe=t(()=>c.isPackageExists("vite"),"hasVite"),ze=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"?ze(s):s])),"normalizeRuleEntries"),Qe=["dynamic","dynamicParams","revalidate","fetchCache","runtime","preferredRegion","maxDuration","config","generateStaticParams","metadata","generateMetadata","viewport","generateViewport"],Ue=t(async()=>{const[e,r]=await Promise.all([i(import("eslint-plugin-react")),i(import("eslint-plugin-jsx-a11y"))]),s=I(),n=Xe();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?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"),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:[u,x],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 Ue(),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"},Ye=t(()=>[{name:"jimmy.codes/regexp",plugins:{regexp:T},rules:Me}],"regexpConfig"),We=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"),De=t(async()=>{const e=await i(import("@tanstack/eslint-plugin-query"));return[{files:[u,x],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"),Ke=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(import("@vitest/eslint-plugin"))).configs.recommended.rules,"vitest/consistent-test-it":["error",{fn:"test",withinDescribe:"it"}],"vitest/no-alias-methods":"error","vitest/no-commented-out-tests":"error","vitest/no-conditional-in-test":"error","vitest/no-disabled-tests":"warn","vitest/no-done-callback":"error","vitest/no-duplicate-hooks":"error","vitest/no-focused-tests":"error","vitest/no-hooks":"off","vitest/no-identical-title":"error","vitest/no-interpolation-in-snapshots":"error","vitest/no-large-snapshots":"off","vitest/no-mocks-import":"error","vitest/no-restricted-matchers":"off","vitest/no-restricted-vi-methods":"off","vitest/no-standalone-expect":"error","vitest/no-test-prefixes":"error","vitest/no-test-return-statement":"error","vitest/prefer-called-with":"error","vitest/prefer-comparison-matcher":"error","vitest/prefer-each":"error","vitest/prefer-equality-matcher":"error","vitest/prefer-expect-assertions":"off","vitest/prefer-expect-resolves":"error","vitest/prefer-hooks-in-order":"error","vitest/prefer-hooks-on-top":"error","vitest/prefer-lowercase-title":"off","vitest/prefer-mock-promise-shorthand":"error","vitest/prefer-snapshot-hint":"error","vitest/prefer-spy-on":"off","vitest/prefer-strict-equal":"error","vitest/prefer-to-be":"error","vitest/prefer-to-contain":"error","vitest/prefer-to-have-length":"error","vitest/prefer-todo":"warn","vitest/require-hook":"error","vitest/require-to-throw-message":"error","vitest/require-top-level-describe":"off","vitest/valid-describe-callback":"error","vitest/valid-expect":"error","vitest/valid-expect-in-promise":"error","vitest/valid-title":"error"}),"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("@vitest/eslint-plugin"));a.push({files:m,...f.configs.recommended,name:"jimmy.codes/vitest",rules:await Ze()})}if(n){const f=await i(import("eslint-plugin-jest"));a.push({files:m,ignores:L,...f.configs["flat/recommended"],name:"jimmy.codes/jest",rules:await Ke()})}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:m,ignores:L,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,u],...p.configs.disableTypeChecked},{files:m,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:J=!1,tanstackQuery:V=!1,testing:j=!1,testingLibrary:F=!1,typescript:v=!1,vitest:b=!1}={},...X)=>{const z=lr(h),w=cr(j,{jest:a,testingLibrary:F,vitest:b}),k=ar(v),P=v||!!k||r&&Ae(),Q=h||r&&Ie(),U=j||a||b||r&&Ne(),H=e||r&&Je(),M=pr(z,V,r),Y=fr(w,r),W=$||r&&Ve(),D=J||r&&Fe(),K=f||r&&I();return[Ee(),_e(),Te(),ir(),je(),Ye(),ke({typescript:P}),P?or(k):[],Q?await He():[],M?await De():[],H?await ye():[],U?await er(w,r):[],Y?await tr():[],W?await Se():[],D?await We():[],K?await Ce():[],Ge(),xe(),ve(n),s,B,X].flat()},"eslintConfig");module.exports=ur;
|
|
1
|
+
"use strict";var ee=Object.create;var d=Object.defineProperty;var re=Object.getOwnPropertyDescriptor;var te=Object.getOwnPropertyNames;var se=Object.getPrototypeOf,oe=Object.prototype.hasOwnProperty;var t=(e,r)=>d(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&&d(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?d(s,"default",{value:e,enumerable:!0}):s,e));var g=require("globals"),p=require("typescript-eslint"),O=require("@eslint-community/eslint-plugin-eslint-comments/configs"),ie=require("eslint-import-resolver-typescript"),y=require("eslint-plugin-import-x"),q=require("eslint-plugin-n"),ae=require("@eslint/js"),C=require("eslint-plugin-jsdoc"),T=require("eslint-plugin-perfectionist"),ce=require("eslint-config-prettier"),c=require("local-pkg"),le=require("eslint-plugin-regexp"),R=require("eslint-plugin-unicorn");function pe(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(pe,"_interopNamespaceDefault");var _=pe(le);const l="?([cm])[jt]s?(x)",fe=["**/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"],L="**/*.?([cm])js",u="**/*.?([cm])jsx",ue="**/*.?([cm])ts",j="**/*.?([cm])tsx",m=[`**/__tests__/**/*.${l}`,`**/*.spec.${l}`,`**/*.test.${l}`,`**/*.bench.${l}`,`**/*.benchmark.${l}`],S=[`**/e2e/**/*.spec.${l}`,`**/e2e/**/*.test.${l}`],x=[...S,`**/cypress/**/*.spec.${l}`,`**/cypress/**/*.test.${l}`],me=[L,u,ue,j],de="**/*.cjs",ge="**/*.astro",ye=["@testing-library/react"],i=t(async e=>{const r=await e;return r.default??r},"interopDefault"),je=t(async()=>{const e=[ge],[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"),xe=t(()=>[{files:[de],languageOptions:{globals:g.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"},ve=t(()=>[{...O.recommended,name:"jimmy.codes/eslint-comments",rules:he}],"eslintCommentsConfig"),be=t(e=>[{ignores:[...fe,...e],name:"jimmy.codes/ignores"}],"ignoresConfig"),we={...y.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=t(()=>{const{rules:e,settings:r}=y.configs.typescript;return[{name:"jimmy.codes/imports/typescript",rules:e,settings:{"import-x/extensions":r["import-x/extensions"],"import-x/external-module-folders":r["import-x/external-module-folders"],"import-x/parsers":r["import-x/parsers"],"import-x/resolver-next":[ie.createTypeScriptImportResolver({alwaysTryTypes:!0})]}}]},"importsTypescriptConfig"),Pe=t(({typescript:e=!1}={})=>[{name:"jimmy.codes/imports",plugins:{"import-x":y,n:q},rules:we},...e?ke():[]],"importsConfig"),Ee={...ae.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"),qe=t(()=>({...C.configs["flat/recommended-typescript-error"].rules,"jsdoc/require-jsdoc":"off","jsdoc/require-param":"off","jsdoc/require-returns":"off","jsdoc/tag-lines":["error","always",{applyToEndTag:!1}]}),"jsdocRules"),Ce=t(()=>[{...C.configs["flat/recommended-typescript-error"],name:"jimmy.codes/jsdoc",rules:qe()}],"jsdocConfig"),G=t((e={})=>Object.fromEntries(Object.entries(e).map(([r,s])=>[r,s==="warn"?"error":s])),"warningAsErrors"),Te=t(async()=>{const e=await i(import("@next/eslint-plugin-next"));return G(e.configs.recommended.rules)},"nextjsRules"),Re=t(async()=>{const e=await i(import("@next/eslint-plugin-next"));return[{files:me,name:"jimmy.codes/nextjs",plugins:{"@next/next":e},rules:await Te()}]},"nextjsConfig"),_e={"n/no-process-exit":"off","n/prefer-node-protocol":"error"},Le=t(()=>[{name:"jimmy.codes/node",plugins:{n:q},rules:_e}],"nodeConfig"),Se={...T.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=t(()=>[{name:"jimmy.codes/perfectionist",plugins:{perfectionist:T},rules:Se}],"perfectionistConfig"),Ae=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"),Ie=t(async()=>[{...(await i(import("eslint-plugin-playwright"))).configs["flat/recommended"],files:S,name:"jimmy.codes/playwright",rules:await Ae()}],"playwrightConfig"),Ne=t(()=>[{name:"jimmy.codes/prettier",...ce}],"prettierConfig"),Be=t(()=>c.isPackageExists("typescript"),"hasTypescript"),$e=t(()=>c.isPackageExists("react"),"hasReact"),A=t(()=>c.isPackageExists("vitest"),"hasVitest"),I=t(()=>c.isPackageExists("jest"),"hasJest"),Je=t(()=>A()||I(),"hasTesting"),Ve=t(()=>ye.some(e=>c.isPackageExists(e)),"hasTestingLibrary"),Fe=t(()=>c.isPackageExists("@tanstack/react-query"),"hasReactQuery"),Xe=t(()=>c.isPackageExists("astro"),"hasAstro"),ze=t(()=>c.isPackageExists("@playwright/test"),"hasPlaywright"),Qe=t(()=>c.isPackageExists("storybook"),"hasStorybook"),N=t(()=>c.isPackageExists("next"),"hasNext"),Ue=t(()=>c.isPackageExists("vite"),"hasVite"),He=t(e=>e===2?"error":e===1?"warn":"off","toStringSeverity"),B=t((e={})=>Object.fromEntries(Object.entries(e).map(([r,s])=>[r,typeof s=="number"?He(s):s])),"normalizeRuleEntries"),Me=["dynamic","dynamicParams","revalidate","fetchCache","runtime","preferredRegion","maxDuration","config","generateStaticParams","metadata","generateMetadata","viewport","generateViewport"],Ye=t(async()=>{const[e,r]=await Promise.all([i(import("eslint-plugin-react")),i(import("eslint-plugin-jsx-a11y"))]),s=N(),n=Ue();return{...r.configs.recommended.rules,...B(e.configs.flat?.recommended?.rules),...B(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?Me:[]}],"react/boolean-prop-naming":"off","react/button-has-type":"error","react/checked-requires-onchange-or-readonly":"error","react/default-props-match-prop-types":"error","react/destructuring-assignment":"off","react/forbid-component-props":"off","react/forbid-dom-props":"off","react/forbid-elements":"off","react/forbid-foreign-prop-types":"off","react/forbid-prop-types":"off","react/forward-ref-uses-ref":"error","react/function-component-definition":"off","react/hook-use-state":"error","react/iframe-missing-sandbox":"error","react/jsx-boolean-value":["error","never"],"react/jsx-curly-brace-presence":"error","react/jsx-filename-extension":"off","react/jsx-fragments":["error","syntax"],"react/jsx-handler-names":"off","react/jsx-max-depth":"off","react/jsx-no-bind":"off","react/jsx-no-constructed-context-values":"error","react/jsx-no-leaked-render":"error","react/jsx-no-literals":"off","react/jsx-no-script-url":"error","react/jsx-no-useless-fragment":"error","react/jsx-one-expression-per-line":"off","react/jsx-pascal-case":["error",{allowNamespace:!0}],"react/jsx-props-no-spread-multi":"off","react/jsx-props-no-spreading":"off","react/jsx-sort-default-props":"off","react/jsx-sort-props":"off","react/no-access-state-in-setstate":"error","react/no-adjacent-inline-elements":"off","react/no-array-index-key":"off","react/no-arrow-function-lifecycle":"error","react/no-danger":"off","react/no-did-mount-set-state":"error","react/no-did-update-set-state":"error","react/no-invalid-html-attribute":"error","react/no-multi-comp":"off","react/no-namespace":"error","react/no-object-type-as-default-prop":"error","react/no-redundant-should-component-update":"error","react/no-set-state":"off","react/no-this-in-sfc":"error","react/no-typos":"error","react/no-unstable-nested-components":"error","react/no-unused-class-component-methods":"error","react/no-unused-prop-types":"error","react/no-unused-state":"error","react/no-will-update-set-state":"error","react/prefer-es6-class":"off","react/prefer-exact-props":"off","react/prefer-read-only-props":"off","react/prefer-stateless-function":"off","react/require-default-props":"off","react/require-optimization":"off","react/self-closing-comp":"error","react/sort-comp":"off","react/sort-default-props":"off","react/sort-prop-types":"off","react/state-in-constructor":"off","react/static-property-placement":"off","react/style-prop-object":"error","react/void-dom-elements-no-children":"error"}},"reactRules"),We=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:[u,j],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 Ye(),settings:{react:{version:"detect"}}}]},"reactConfig"),De={..._.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"},Ke=t(()=>[{name:"jimmy.codes/regexp",plugins:{regexp:_},rules:De}],"regexpConfig"),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:{...G(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"),er=t(async()=>{const e=await i(import("@tanstack/eslint-plugin-query"));return[{files:[u,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"),rr=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"),tr=t(async()=>({...(await i(import("@vitest/eslint-plugin"))).configs.recommended.rules,"vitest/consistent-test-it":["error",{fn:"test",withinDescribe:"it"}],"vitest/no-alias-methods":"error","vitest/no-commented-out-tests":"error","vitest/no-conditional-in-test":"error","vitest/no-disabled-tests":"warn","vitest/no-done-callback":"error","vitest/no-duplicate-hooks":"error","vitest/no-focused-tests":"error","vitest/no-hooks":"off","vitest/no-identical-title":"error","vitest/no-interpolation-in-snapshots":"error","vitest/no-large-snapshots":"off","vitest/no-mocks-import":"error","vitest/no-restricted-matchers":"off","vitest/no-restricted-vi-methods":"off","vitest/no-standalone-expect":"error","vitest/no-test-prefixes":"error","vitest/no-test-return-statement":"error","vitest/prefer-called-with":"error","vitest/prefer-comparison-matcher":"error","vitest/prefer-each":"error","vitest/prefer-equality-matcher":"error","vitest/prefer-expect-assertions":"off","vitest/prefer-expect-resolves":"error","vitest/prefer-hooks-in-order":"error","vitest/prefer-hooks-on-top":"error","vitest/prefer-lowercase-title":"off","vitest/prefer-mock-promise-shorthand":"error","vitest/prefer-snapshot-hint":"error","vitest/prefer-spy-on":"off","vitest/prefer-strict-equal":"error","vitest/prefer-to-be":"error","vitest/prefer-to-contain":"error","vitest/prefer-to-have-length":"error","vitest/prefer-todo":"warn","vitest/require-hook":"error","vitest/require-to-throw-message":"error","vitest/require-top-level-describe":"off","vitest/valid-describe-callback":"error","vitest/valid-expect":"error","vitest/valid-expect-in-promise":"error","vitest/valid-title":"error"}),"vitestRules"),sr=t(async({framework:e="vitest"}={},r=!0)=>{const s=r?A():e==="vitest",n=e==="jest"||r&&I(),a=[];if(s){const f=await i(import("@vitest/eslint-plugin"));a.push({files:m,ignores:x,...f.configs.recommended,name:"jimmy.codes/vitest",rules:await tr()})}if(n){const f=await i(import("eslint-plugin-jest"));a.push({files:m,ignores:x,...f.configs["flat/recommended"],name:"jimmy.codes/jest",rules:await rr()})}return a},"testingConfig"),or=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"),nr=t(async()=>{const[e,r]=await Promise.all([import("eslint-plugin-jest-dom"),i(import("eslint-plugin-testing-library"))]);return[{files:m,ignores:x,name:"jimmy.codes/testing-library",plugins:{"jest-dom":e,"testing-library":r},rules:await or()}]},"testingLibraryConfig"),ir={"@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"},ar=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:ir},{files:[L,u],...p.configs.disableTypeChecked},{files:m,name:"jimmy.codes/typescript/testing",rules:{"@typescript-eslint/no-unsafe-argument":"off","@typescript-eslint/no-unsafe-assignment":"off"}}],"typescriptConfig"),cr={...R.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"},lr=t(()=>[{...R.configs["flat/recommended"],name:"jimmy.codes/unicorn",rules:cr}],"unicornConfig"),pr=t(e=>typeof e=="object"?e:void 0,"getTypescriptOptions"),fr=t((e,r)=>typeof e=="object"?e:{framework:r.vitest?"vitest":r.jest?"jest":"vitest",...r.testingLibrary&&{utilities:["testing-library"]}},"getTestingOptions"),ur=t(e=>typeof e=="object"?e:{utilities:[]},"getReactOptions"),mr=t(({utilities:e=[]},r,s)=>r||e.includes("@tanstack/query")||s&&Fe(),"shouldEnableTanstackQuery"),dr=t(({utilities:e=[]},r)=>e.includes("testing-library")||r&&Ve(),"shouldEnableTestingLibrary"),gr=t(async({astro:e=!1,autoDetect:r=!0,configs:s=[],ignores:n=[],jest:a=!1,nextjs:f=!1,overrides:$=[],playwright:J=!1,react:h=!1,storybook:V=!1,tanstackQuery:F=!1,testing:v=!1,testingLibrary:X=!1,typescript:b=!1,vitest:w=!1}={},...z)=>{const Q=ur(h),k=fr(v,{jest:a,testingLibrary:X,vitest:w}),P=pr(b),E=b||!!P||r&&Be(),U=h||r&&$e(),H=v||a||w||r&&Je(),M=e||r&&Xe(),Y=mr(Q,F,r),W=dr(k,r),D=J||r&&ze(),K=V||r&&Qe(),Z=f||r&&N();return[Oe(),Ge(),Le(),lr(),ve(),Ke(),Ce(),Pe({typescript:E}),E?ar(P):[],U?await We():[],Y?await er():[],M?await je():[],H?await sr(k,r):[],W?await nr():[],D?await Ie():[],K?await Ze():[],Z?await Re():[],Ne(),xe(),be(n),s,$,z].flat()},"eslintConfig");module.exports=gr;
|