@jimmy.codes/eslint-config 3.26.0 → 3.27.1
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 +402 -0
- package/dist/index.d.mts +402 -0
- package/dist/index.mjs +1 -1
- package/package.json +2 -1
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
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"),C=require("eslint-plugin-n"),ae=require("@eslint/js"),T=require("eslint-plugin-perfectionist"),ce=require("eslint-config-prettier"),c=require("local-pkg"),le=require("eslint-plugin-regexp"),_=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 q=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"],R="**/*.?([cm])js",u="**/*.?([cm])jsx",ue="**/*.?([cm])ts",x="**/*.?([cm])tsx",m=[`**/__tests__/**/*.${l}`,`**/*.spec.${l}`,`**/*.test.${l}`,`**/*.bench.${l}`,`**/*.benchmark.${l}`],L=[`**/e2e/**/*.spec.${l}`,`**/e2e/**/*.test.${l}`],j=[...L,`**/cypress/**/*.spec.${l}`,`**/cypress/**/*.test.${l}`],me=[R,u,ue,x],de="**/*.cjs",ge="**/*.astro",ye=["vi.mock","describe","expect","it"],xe=["@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"),he=t(()=>[{files:[de],languageOptions:{globals:g.commonjs},name:"jimmy.codes/commonjs"}],"commonjsConfig"),be={...O.recommended.rules,"@eslint-community/eslint-comments/no-unused-disable":"off","@eslint-community/eslint-comments/require-description":"error"},we=t(()=>[{...O.recommended,name:"jimmy.codes/eslint-comments",rules:be}],"eslintCommentsConfig"),ve=t(e=>[{ignores:[...fe,...e],name:"jimmy.codes/ignores"}],"ignoresConfig"),ke={...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"},Pe=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"),Ee=t(({typescript:e=!1}={})=>[{name:"jimmy.codes/imports",plugins:{"import-x":y,n:C},rules:ke},...e?Pe():[]],"importsConfig"),Oe={...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"},Ce=t(()=>[{linterOptions:{reportUnusedDisableDirectives:!0},name:"jimmy.codes/javascript",rules:Oe}],"javascriptConfig"),S=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 S(e.configs.recommended.rules)},"nextjsRules"),_e=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"),qe={"n/no-process-exit":"off","n/prefer-node-protocol":"error"},Re=t(()=>[{name:"jimmy.codes/node",plugins:{n:C},rules:qe}],"nodeConfig"),Le={...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"},Se=t(()=>[{name:"jimmy.codes/perfectionist",plugins:{perfectionist:T},rules:Le}],"perfectionistConfig"),Ge=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"),Ae=t(async()=>[{...(await i(import("eslint-plugin-playwright"))).configs["flat/recommended"],files:L,name:"jimmy.codes/playwright",rules:await Ge()}],"playwrightConfig"),Ie=t(()=>[{name:"jimmy.codes/prettier",...ce}],"prettierConfig"),Ne=t(()=>c.isPackageExists("typescript"),"hasTypescript"),Be=t(()=>c.isPackageExists("react"),"hasReact"),G=t(()=>c.isPackageExists("vitest"),"hasVitest"),A=t(()=>c.isPackageExists("jest"),"hasJest"),$e=t(()=>G()||A(),"hasTesting"),Fe=t(()=>xe.some(e=>c.isPackageExists(e)),"hasTestingLibrary"),Ve=t(()=>c.isPackageExists("@tanstack/react-query"),"hasReactQuery"),Je=t(()=>c.isPackageExists("astro"),"hasAstro"),Ue=t(()=>c.isPackageExists("@playwright/test"),"hasPlaywright"),Xe=t(()=>c.isPackageExists("storybook"),"hasStorybook"),I=t(()=>c.isPackageExists("next"),"hasNext"),ze=t(()=>c.isPackageExists("vite"),"hasVite"),Qe=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"?Qe(s):s])),"normalizeRuleEntries"),He=["dynamic","dynamicParams","revalidate","fetchCache","runtime","preferredRegion","maxDuration","config","generateStaticParams","metadata","generateMetadata","viewport","generateViewport"],Me=t(async()=>{const[e,r]=await Promise.all([i(import("eslint-plugin-react")),i(import("eslint-plugin-jsx-a11y"))]),s=I(),n=ze();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?He:[]}],"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,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 Me(),settings:{react:{version:"detect"}}}]},"reactConfig"),Ye={...q.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"},De=t(()=>[{name:"jimmy.codes/regexp",plugins:{regexp:q},rules:Ye}],"regexpConfig"),Ke=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"),Ze=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"),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"),er=t(async()=>({...await B(),"jest/no-deprecated-functions":"off","jest/require-hook":["error",{allowedFunctionCalls:ye}]}),"vitestRules"),rr=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:m,ignores:j,...f.configs["flat/recommended"],name:"jimmy.codes/vitest",rules:await er()})}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 B()})}return a},"testingConfig"),tr=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"),sr=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 tr()}]},"testingLibraryConfig"),or={"@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"},nr=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:or},{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"),ir={..._.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"},ar=t(()=>[{..._.configs["flat/recommended"],name:"jimmy.codes/unicorn",rules:ir}],"unicornConfig"),cr=t(e=>typeof e=="object"?e:void 0,"getTypescriptOptions"),lr=t((e,r)=>typeof e=="object"?e:{framework:r.vitest?"vitest":r.jest?"jest":"vitest",...r.testingLibrary&&{utilities:["testing-library"]}},"getTestingOptions"),pr=t(e=>typeof e=="object"?e:{utilities:[]},"getReactOptions"),fr=t(({utilities:e=[]},r,s)=>r||e.includes("@tanstack/query")||s&&Ve(),"shouldEnableTanstackQuery"),ur=t(({utilities:e=[]},r)=>e.includes("testing-library")||r&&Fe(),"shouldEnableTestingLibrary"),mr=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=pr(h),k=lr(b,{jest:a,testingLibrary:U,vitest:v}),P=cr(w),E=w||!!P||r&&Ne(),Q=h||r&&Be(),H=b||a||v||r&&$e(),M=e||r&&Je(),W=fr(z,J,r),Y=ur(k,r),D=F||r&&Ue(),K=V||r&&Xe(),Z=f||r&&I();return[Ce(),Se(),Re(),ar(),we(),De(),Ee({typescript:E}),E?nr(P):[],Q?await We():[],W?await Ze():[],M?await je():[],H?await rr(k,r):[],Y?await sr():[],D?await Ae():[],K?await Ke():[],Z?await _e():[],Ie(),he(),ve(n),s,$,X].flat()},"eslintConfig");module.exports=mr;
|
|
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"),O=require("@eslint-community/eslint-plugin-eslint-comments/configs"),ne=require("eslint-import-resolver-typescript"),y=require("eslint-plugin-import-x"),C=require("eslint-plugin-n"),ie=require("@eslint/js"),q=require("eslint-plugin-perfectionist"),ae=require("eslint-config-prettier"),c=require("local-pkg"),ce=require("eslint-plugin-regexp"),T=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 R=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"],_="**/*.?([cm])js",u="**/*.?([cm])jsx",fe="**/*.?([cm])ts",x="**/*.?([cm])tsx",m=[`**/__tests__/**/*.${l}`,`**/*.spec.${l}`,`**/*.test.${l}`,`**/*.bench.${l}`,`**/*.benchmark.${l}`],L=[`**/e2e/**/*.spec.${l}`,`**/e2e/**/*.test.${l}`],h=[...L,`**/cypress/**/*.spec.${l}`,`**/cypress/**/*.test.${l}`],ue=[_,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={...O.recommended.rules,"@eslint-community/eslint-comments/no-unused-disable":"off","@eslint-community/eslint-comments/require-description":"error"},je=t(()=>[{...O.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:C},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:C},rules:qe}],"nodeConfig"),Re={...q.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:q},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:L,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={...R.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:R},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,ignores:h,...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:h,...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:h,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:[_,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={...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"},ir=t(()=>[{...T.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:j=!1,storybook:J=!1,tanstackQuery:V=!1,testing:v=!1,testingLibrary:F=!1,typescript:b=!1,vitest:w=!1}={},...X)=>{const z=lr(j),k=cr(v,{jest:a,testingLibrary:F,vitest:w}),P=ar(b),E=b||!!P||r&&Ae(),Q=j||r&&Ie(),U=v||a||w||r&&Ne(),H=e||r&&Je(),M=pr(z,V,r),Y=fr(k,r),W=$||r&&Ve(),D=J||r&&Fe(),K=f||r&&I();return[Ee(),_e(),Te(),ir(),je(),Ye(),ke({typescript:E}),E?or(P):[],Q?await He():[],M?await De():[],H?await ye():[],U?await er(k,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;
|
package/dist/index.d.cts
CHANGED
|
@@ -5808,6 +5808,317 @@ interface RuleOptions {
|
|
|
5808
5808
|
* @see https://eslint.org/docs/latest/rules/vars-on-top
|
|
5809
5809
|
*/
|
|
5810
5810
|
'vars-on-top'?: Linter.RuleEntry<[]>
|
|
5811
|
+
/**
|
|
5812
|
+
* require .spec test file pattern
|
|
5813
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/consistent-test-filename.md
|
|
5814
|
+
*/
|
|
5815
|
+
'vitest/consistent-test-filename'?: Linter.RuleEntry<VitestConsistentTestFilename>
|
|
5816
|
+
/**
|
|
5817
|
+
* enforce using test or it but not both
|
|
5818
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/consistent-test-it.md
|
|
5819
|
+
*/
|
|
5820
|
+
'vitest/consistent-test-it'?: Linter.RuleEntry<VitestConsistentTestIt>
|
|
5821
|
+
/**
|
|
5822
|
+
* enforce having expectation in test body
|
|
5823
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/expect-expect.md
|
|
5824
|
+
*/
|
|
5825
|
+
'vitest/expect-expect'?: Linter.RuleEntry<VitestExpectExpect>
|
|
5826
|
+
/**
|
|
5827
|
+
* enforce a maximum number of expect per test
|
|
5828
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/max-expects.md
|
|
5829
|
+
*/
|
|
5830
|
+
'vitest/max-expects'?: Linter.RuleEntry<VitestMaxExpects>
|
|
5831
|
+
/**
|
|
5832
|
+
* require describe block to be less than set max value or default value
|
|
5833
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/max-nested-describe.md
|
|
5834
|
+
*/
|
|
5835
|
+
'vitest/max-nested-describe'?: Linter.RuleEntry<VitestMaxNestedDescribe>
|
|
5836
|
+
/**
|
|
5837
|
+
* disallow alias methods
|
|
5838
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-alias-methods.md
|
|
5839
|
+
*/
|
|
5840
|
+
'vitest/no-alias-methods'?: Linter.RuleEntry<[]>
|
|
5841
|
+
/**
|
|
5842
|
+
* disallow commented out tests
|
|
5843
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-commented-out-tests.md
|
|
5844
|
+
*/
|
|
5845
|
+
'vitest/no-commented-out-tests'?: Linter.RuleEntry<[]>
|
|
5846
|
+
/**
|
|
5847
|
+
* disallow conditional expects
|
|
5848
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-conditional-expect.md
|
|
5849
|
+
*/
|
|
5850
|
+
'vitest/no-conditional-expect'?: Linter.RuleEntry<[]>
|
|
5851
|
+
/**
|
|
5852
|
+
* disallow conditional tests
|
|
5853
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-conditional-in-test.md
|
|
5854
|
+
*/
|
|
5855
|
+
'vitest/no-conditional-in-test'?: Linter.RuleEntry<[]>
|
|
5856
|
+
/**
|
|
5857
|
+
* disallow conditional tests
|
|
5858
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-conditional-tests.md
|
|
5859
|
+
*/
|
|
5860
|
+
'vitest/no-conditional-tests'?: Linter.RuleEntry<[]>
|
|
5861
|
+
/**
|
|
5862
|
+
* disallow disabled tests
|
|
5863
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-disabled-tests.md
|
|
5864
|
+
*/
|
|
5865
|
+
'vitest/no-disabled-tests'?: Linter.RuleEntry<[]>
|
|
5866
|
+
/**
|
|
5867
|
+
* disallow using a callback in asynchronous tests and hooks
|
|
5868
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-done-callback.md
|
|
5869
|
+
* @deprecated
|
|
5870
|
+
*/
|
|
5871
|
+
'vitest/no-done-callback'?: Linter.RuleEntry<[]>
|
|
5872
|
+
/**
|
|
5873
|
+
* disallow duplicate hooks and teardown hooks
|
|
5874
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-duplicate-hooks.md
|
|
5875
|
+
*/
|
|
5876
|
+
'vitest/no-duplicate-hooks'?: Linter.RuleEntry<[]>
|
|
5877
|
+
/**
|
|
5878
|
+
* disallow focused tests
|
|
5879
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-focused-tests.md
|
|
5880
|
+
*/
|
|
5881
|
+
'vitest/no-focused-tests'?: Linter.RuleEntry<VitestNoFocusedTests>
|
|
5882
|
+
/**
|
|
5883
|
+
* disallow setup and teardown hooks
|
|
5884
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-hooks.md
|
|
5885
|
+
*/
|
|
5886
|
+
'vitest/no-hooks'?: Linter.RuleEntry<VitestNoHooks>
|
|
5887
|
+
/**
|
|
5888
|
+
* disallow identical titles
|
|
5889
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-identical-title.md
|
|
5890
|
+
*/
|
|
5891
|
+
'vitest/no-identical-title'?: Linter.RuleEntry<[]>
|
|
5892
|
+
/**
|
|
5893
|
+
* disallow importing `node:test`
|
|
5894
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-import-node-test.md
|
|
5895
|
+
*/
|
|
5896
|
+
'vitest/no-import-node-test'?: Linter.RuleEntry<[]>
|
|
5897
|
+
/**
|
|
5898
|
+
* disallow string interpolation in snapshots
|
|
5899
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-interpolation-in-snapshots.md
|
|
5900
|
+
*/
|
|
5901
|
+
'vitest/no-interpolation-in-snapshots'?: Linter.RuleEntry<[]>
|
|
5902
|
+
/**
|
|
5903
|
+
* disallow large snapshots
|
|
5904
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-large-snapshots.md
|
|
5905
|
+
*/
|
|
5906
|
+
'vitest/no-large-snapshots'?: Linter.RuleEntry<VitestNoLargeSnapshots>
|
|
5907
|
+
/**
|
|
5908
|
+
* disallow importing from __mocks__ directory
|
|
5909
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-mocks-import.md
|
|
5910
|
+
*/
|
|
5911
|
+
'vitest/no-mocks-import'?: Linter.RuleEntry<[]>
|
|
5912
|
+
/**
|
|
5913
|
+
* disallow the use of certain matchers
|
|
5914
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-restricted-matchers.md
|
|
5915
|
+
*/
|
|
5916
|
+
'vitest/no-restricted-matchers'?: Linter.RuleEntry<VitestNoRestrictedMatchers>
|
|
5917
|
+
/**
|
|
5918
|
+
* disallow specific `vi.` methods
|
|
5919
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-restricted-vi-methods.md
|
|
5920
|
+
*/
|
|
5921
|
+
'vitest/no-restricted-vi-methods'?: Linter.RuleEntry<VitestNoRestrictedViMethods>
|
|
5922
|
+
/**
|
|
5923
|
+
* disallow using `expect` outside of `it` or `test` blocks
|
|
5924
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-standalone-expect.md
|
|
5925
|
+
*/
|
|
5926
|
+
'vitest/no-standalone-expect'?: Linter.RuleEntry<VitestNoStandaloneExpect>
|
|
5927
|
+
/**
|
|
5928
|
+
* disallow using `test` as a prefix
|
|
5929
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-test-prefixes.md
|
|
5930
|
+
*/
|
|
5931
|
+
'vitest/no-test-prefixes'?: Linter.RuleEntry<[]>
|
|
5932
|
+
/**
|
|
5933
|
+
* disallow return statements in tests
|
|
5934
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-test-return-statement.md
|
|
5935
|
+
*/
|
|
5936
|
+
'vitest/no-test-return-statement'?: Linter.RuleEntry<[]>
|
|
5937
|
+
/**
|
|
5938
|
+
* Enforce padding around `afterAll` blocks
|
|
5939
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/padding-around-after-all-blocks.md
|
|
5940
|
+
*/
|
|
5941
|
+
'vitest/padding-around-after-all-blocks'?: Linter.RuleEntry<[]>
|
|
5942
|
+
/**
|
|
5943
|
+
* Enforce padding around `afterEach` blocks
|
|
5944
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/padding-around-after-each-blocks.md
|
|
5945
|
+
*/
|
|
5946
|
+
'vitest/padding-around-after-each-blocks'?: Linter.RuleEntry<[]>
|
|
5947
|
+
/**
|
|
5948
|
+
* Enforce padding around vitest functions
|
|
5949
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/padding-around-all.md
|
|
5950
|
+
*/
|
|
5951
|
+
'vitest/padding-around-all'?: Linter.RuleEntry<[]>
|
|
5952
|
+
/**
|
|
5953
|
+
* Enforce padding around `beforeAll` blocks
|
|
5954
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/padding-around-before-all-blocks.md
|
|
5955
|
+
*/
|
|
5956
|
+
'vitest/padding-around-before-all-blocks'?: Linter.RuleEntry<[]>
|
|
5957
|
+
/**
|
|
5958
|
+
* Enforce padding around `beforeEach` blocks
|
|
5959
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/padding-around-before-each-blocks.md
|
|
5960
|
+
*/
|
|
5961
|
+
'vitest/padding-around-before-each-blocks'?: Linter.RuleEntry<[]>
|
|
5962
|
+
/**
|
|
5963
|
+
* Enforce padding around `describe` blocks
|
|
5964
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/padding-around-describe-blocks.md
|
|
5965
|
+
*/
|
|
5966
|
+
'vitest/padding-around-describe-blocks'?: Linter.RuleEntry<[]>
|
|
5967
|
+
/**
|
|
5968
|
+
* Enforce padding around `expect` groups
|
|
5969
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/padding-around-expect-groups.md
|
|
5970
|
+
*/
|
|
5971
|
+
'vitest/padding-around-expect-groups'?: Linter.RuleEntry<[]>
|
|
5972
|
+
/**
|
|
5973
|
+
* Enforce padding around afterAll blocks
|
|
5974
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/padding-around-test-blocks.md
|
|
5975
|
+
*/
|
|
5976
|
+
'vitest/padding-around-test-blocks'?: Linter.RuleEntry<[]>
|
|
5977
|
+
/**
|
|
5978
|
+
* enforce using `toBeCalledWith()` or `toHaveBeenCalledWith()`
|
|
5979
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-called-with.md
|
|
5980
|
+
*/
|
|
5981
|
+
'vitest/prefer-called-with'?: Linter.RuleEntry<[]>
|
|
5982
|
+
/**
|
|
5983
|
+
* enforce using the built-in comparison matchers
|
|
5984
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-comparison-matcher.md
|
|
5985
|
+
*/
|
|
5986
|
+
'vitest/prefer-comparison-matcher'?: Linter.RuleEntry<[]>
|
|
5987
|
+
/**
|
|
5988
|
+
* enforce using `each` rather than manual loops
|
|
5989
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-each.md
|
|
5990
|
+
*/
|
|
5991
|
+
'vitest/prefer-each'?: Linter.RuleEntry<[]>
|
|
5992
|
+
/**
|
|
5993
|
+
* enforce using the built-in quality matchers
|
|
5994
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-equality-matcher.md
|
|
5995
|
+
*/
|
|
5996
|
+
'vitest/prefer-equality-matcher'?: Linter.RuleEntry<[]>
|
|
5997
|
+
/**
|
|
5998
|
+
* enforce using expect assertions instead of callbacks
|
|
5999
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-expect-assertions.md
|
|
6000
|
+
*/
|
|
6001
|
+
'vitest/prefer-expect-assertions'?: Linter.RuleEntry<VitestPreferExpectAssertions>
|
|
6002
|
+
/**
|
|
6003
|
+
* enforce using `expect().resolves` over `expect(await ...)` syntax
|
|
6004
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-expect-resolves.md
|
|
6005
|
+
*/
|
|
6006
|
+
'vitest/prefer-expect-resolves'?: Linter.RuleEntry<[]>
|
|
6007
|
+
/**
|
|
6008
|
+
* enforce having hooks in consistent order
|
|
6009
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-hooks-in-order.md
|
|
6010
|
+
*/
|
|
6011
|
+
'vitest/prefer-hooks-in-order'?: Linter.RuleEntry<[]>
|
|
6012
|
+
/**
|
|
6013
|
+
* enforce having hooks before any test cases
|
|
6014
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-hooks-on-top.md
|
|
6015
|
+
*/
|
|
6016
|
+
'vitest/prefer-hooks-on-top'?: Linter.RuleEntry<[]>
|
|
6017
|
+
/**
|
|
6018
|
+
* enforce lowercase titles
|
|
6019
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-lowercase-title.md
|
|
6020
|
+
*/
|
|
6021
|
+
'vitest/prefer-lowercase-title'?: Linter.RuleEntry<VitestPreferLowercaseTitle>
|
|
6022
|
+
/**
|
|
6023
|
+
* enforce mock resolved/rejected shorthands for promises
|
|
6024
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-mock-promise-shorthand.md
|
|
6025
|
+
*/
|
|
6026
|
+
'vitest/prefer-mock-promise-shorthand'?: Linter.RuleEntry<[]>
|
|
6027
|
+
/**
|
|
6028
|
+
* enforce including a hint with external snapshots
|
|
6029
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-snapshot-hint.md
|
|
6030
|
+
*/
|
|
6031
|
+
'vitest/prefer-snapshot-hint'?: Linter.RuleEntry<VitestPreferSnapshotHint>
|
|
6032
|
+
/**
|
|
6033
|
+
* enforce using `vi.spyOn`
|
|
6034
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-spy-on.md
|
|
6035
|
+
*/
|
|
6036
|
+
'vitest/prefer-spy-on'?: Linter.RuleEntry<[]>
|
|
6037
|
+
/**
|
|
6038
|
+
* enforce strict equal over equal
|
|
6039
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-strict-equal.md
|
|
6040
|
+
*/
|
|
6041
|
+
'vitest/prefer-strict-equal'?: Linter.RuleEntry<[]>
|
|
6042
|
+
/**
|
|
6043
|
+
* enforce using toBe()
|
|
6044
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-to-be.md
|
|
6045
|
+
*/
|
|
6046
|
+
'vitest/prefer-to-be'?: Linter.RuleEntry<[]>
|
|
6047
|
+
/**
|
|
6048
|
+
* enforce using toBeFalsy()
|
|
6049
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-to-be-falsy.md
|
|
6050
|
+
*/
|
|
6051
|
+
'vitest/prefer-to-be-falsy'?: Linter.RuleEntry<[]>
|
|
6052
|
+
/**
|
|
6053
|
+
* enforce using toBeObject()
|
|
6054
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-to-be-object.md
|
|
6055
|
+
*/
|
|
6056
|
+
'vitest/prefer-to-be-object'?: Linter.RuleEntry<[]>
|
|
6057
|
+
/**
|
|
6058
|
+
* enforce using `toBeTruthy`
|
|
6059
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-to-be-truthy.md
|
|
6060
|
+
*/
|
|
6061
|
+
'vitest/prefer-to-be-truthy'?: Linter.RuleEntry<[]>
|
|
6062
|
+
/**
|
|
6063
|
+
* enforce using toContain()
|
|
6064
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-to-contain.md
|
|
6065
|
+
*/
|
|
6066
|
+
'vitest/prefer-to-contain'?: Linter.RuleEntry<[]>
|
|
6067
|
+
/**
|
|
6068
|
+
* enforce using toHaveLength()
|
|
6069
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-to-have-length.md
|
|
6070
|
+
*/
|
|
6071
|
+
'vitest/prefer-to-have-length'?: Linter.RuleEntry<[]>
|
|
6072
|
+
/**
|
|
6073
|
+
* enforce using `test.todo`
|
|
6074
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-todo.md
|
|
6075
|
+
*/
|
|
6076
|
+
'vitest/prefer-todo'?: Linter.RuleEntry<[]>
|
|
6077
|
+
/**
|
|
6078
|
+
* Prefer `vi.mocked()` over `fn as Mock`
|
|
6079
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-vi-mocked.md
|
|
6080
|
+
*/
|
|
6081
|
+
'vitest/prefer-vi-mocked'?: Linter.RuleEntry<[]>
|
|
6082
|
+
/**
|
|
6083
|
+
* require setup and teardown to be within a hook
|
|
6084
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/require-hook.md
|
|
6085
|
+
*/
|
|
6086
|
+
'vitest/require-hook'?: Linter.RuleEntry<VitestRequireHook>
|
|
6087
|
+
/**
|
|
6088
|
+
* require local Test Context for concurrent snapshot tests
|
|
6089
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/require-local-test-context-for-concurrent-snapshots.md
|
|
6090
|
+
*/
|
|
6091
|
+
'vitest/require-local-test-context-for-concurrent-snapshots'?: Linter.RuleEntry<[]>
|
|
6092
|
+
/**
|
|
6093
|
+
* require toThrow() to be called with an error message
|
|
6094
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/require-to-throw-message.md
|
|
6095
|
+
*/
|
|
6096
|
+
'vitest/require-to-throw-message'?: Linter.RuleEntry<[]>
|
|
6097
|
+
/**
|
|
6098
|
+
* enforce that all tests are in a top-level describe
|
|
6099
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/require-top-level-describe.md
|
|
6100
|
+
*/
|
|
6101
|
+
'vitest/require-top-level-describe'?: Linter.RuleEntry<VitestRequireTopLevelDescribe>
|
|
6102
|
+
/**
|
|
6103
|
+
* enforce valid describe callback
|
|
6104
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/valid-describe-callback.md
|
|
6105
|
+
*/
|
|
6106
|
+
'vitest/valid-describe-callback'?: Linter.RuleEntry<[]>
|
|
6107
|
+
/**
|
|
6108
|
+
* enforce valid `expect()` usage
|
|
6109
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/valid-expect.md
|
|
6110
|
+
*/
|
|
6111
|
+
'vitest/valid-expect'?: Linter.RuleEntry<VitestValidExpect>
|
|
6112
|
+
/**
|
|
6113
|
+
* Require promises that have expectations in their chain to be valid
|
|
6114
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/valid-expect-in-promise.md
|
|
6115
|
+
*/
|
|
6116
|
+
'vitest/valid-expect-in-promise'?: Linter.RuleEntry<[]>
|
|
6117
|
+
/**
|
|
6118
|
+
* enforce valid titles
|
|
6119
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/valid-title.md
|
|
6120
|
+
*/
|
|
6121
|
+
'vitest/valid-title'?: Linter.RuleEntry<VitestValidTitle>
|
|
5811
6122
|
/**
|
|
5812
6123
|
* Require parentheses around immediate `function` invocations
|
|
5813
6124
|
* @see https://eslint.org/docs/latest/rules/wrap-iife
|
|
@@ -10946,6 +11257,97 @@ type UseIsnan = []|[{
|
|
|
10946
11257
|
type ValidTypeof = []|[{
|
|
10947
11258
|
requireStringLiterals?: boolean
|
|
10948
11259
|
}]
|
|
11260
|
+
// ----- vitest/consistent-test-filename -----
|
|
11261
|
+
type VitestConsistentTestFilename = []|[{
|
|
11262
|
+
pattern?: string
|
|
11263
|
+
allTestPattern?: string
|
|
11264
|
+
}]
|
|
11265
|
+
// ----- vitest/consistent-test-it -----
|
|
11266
|
+
type VitestConsistentTestIt = []|[{
|
|
11267
|
+
fn?: ("test" | "it")
|
|
11268
|
+
withinDescribe?: ("test" | "it")
|
|
11269
|
+
}]
|
|
11270
|
+
// ----- vitest/expect-expect -----
|
|
11271
|
+
type VitestExpectExpect = []|[{
|
|
11272
|
+
assertFunctionNames?: string[]
|
|
11273
|
+
additionalTestBlockFunctions?: string[]
|
|
11274
|
+
}]
|
|
11275
|
+
// ----- vitest/max-expects -----
|
|
11276
|
+
type VitestMaxExpects = []|[{
|
|
11277
|
+
max?: number
|
|
11278
|
+
}]
|
|
11279
|
+
// ----- vitest/max-nested-describe -----
|
|
11280
|
+
type VitestMaxNestedDescribe = []|[{
|
|
11281
|
+
max?: number
|
|
11282
|
+
}]
|
|
11283
|
+
// ----- vitest/no-focused-tests -----
|
|
11284
|
+
type VitestNoFocusedTests = []|[{
|
|
11285
|
+
fixable?: boolean
|
|
11286
|
+
}]
|
|
11287
|
+
// ----- vitest/no-hooks -----
|
|
11288
|
+
type VitestNoHooks = []|[{
|
|
11289
|
+
allow?: unknown[]
|
|
11290
|
+
}]
|
|
11291
|
+
// ----- vitest/no-large-snapshots -----
|
|
11292
|
+
type VitestNoLargeSnapshots = []|[{
|
|
11293
|
+
maxSize?: number
|
|
11294
|
+
inlineMaxSize?: number
|
|
11295
|
+
allowedSnapshots?: {
|
|
11296
|
+
[k: string]: unknown[] | undefined
|
|
11297
|
+
}
|
|
11298
|
+
}]
|
|
11299
|
+
// ----- vitest/no-restricted-matchers -----
|
|
11300
|
+
type VitestNoRestrictedMatchers = []|[{
|
|
11301
|
+
[k: string]: (string | null) | undefined
|
|
11302
|
+
}]
|
|
11303
|
+
// ----- vitest/no-restricted-vi-methods -----
|
|
11304
|
+
type VitestNoRestrictedViMethods = []|[{
|
|
11305
|
+
[k: string]: (string | null) | undefined
|
|
11306
|
+
}]
|
|
11307
|
+
// ----- vitest/no-standalone-expect -----
|
|
11308
|
+
type VitestNoStandaloneExpect = []|[{
|
|
11309
|
+
additionaltestblockfunctions?: string[]
|
|
11310
|
+
[k: string]: unknown | undefined
|
|
11311
|
+
}]
|
|
11312
|
+
// ----- vitest/prefer-expect-assertions -----
|
|
11313
|
+
type VitestPreferExpectAssertions = []|[{
|
|
11314
|
+
onlyFunctionsWithAsyncKeyword?: boolean
|
|
11315
|
+
onlyFunctionsWithExpectInLoop?: boolean
|
|
11316
|
+
onlyFunctionsWithExpectInCallback?: boolean
|
|
11317
|
+
}]
|
|
11318
|
+
// ----- vitest/prefer-lowercase-title -----
|
|
11319
|
+
type VitestPreferLowercaseTitle = []|[{
|
|
11320
|
+
ignore?: ("describe" | "test" | "it")[]
|
|
11321
|
+
allowedPrefixes?: string[]
|
|
11322
|
+
ignoreTopLevelDescribe?: boolean
|
|
11323
|
+
lowercaseFirstCharacterOnly?: boolean
|
|
11324
|
+
}]
|
|
11325
|
+
// ----- vitest/prefer-snapshot-hint -----
|
|
11326
|
+
type VitestPreferSnapshotHint = []|[("always" | "multi")]
|
|
11327
|
+
// ----- vitest/require-hook -----
|
|
11328
|
+
type VitestRequireHook = []|[{
|
|
11329
|
+
allowedFunctionCalls?: string[]
|
|
11330
|
+
}]
|
|
11331
|
+
// ----- vitest/require-top-level-describe -----
|
|
11332
|
+
type VitestRequireTopLevelDescribe = []|[{
|
|
11333
|
+
maxNumberOfTopLevelDescribes?: number
|
|
11334
|
+
}]
|
|
11335
|
+
// ----- vitest/valid-expect -----
|
|
11336
|
+
type VitestValidExpect = []|[{
|
|
11337
|
+
alwaysAwait?: boolean
|
|
11338
|
+
asyncMatchers?: string[]
|
|
11339
|
+
minArgs?: number
|
|
11340
|
+
maxArgs?: number
|
|
11341
|
+
}]
|
|
11342
|
+
// ----- vitest/valid-title -----
|
|
11343
|
+
type VitestValidTitle = []|[{
|
|
11344
|
+
ignoreTypeOfDescribeName?: boolean
|
|
11345
|
+
allowArguments?: boolean
|
|
11346
|
+
disallowedWords?: string[]
|
|
11347
|
+
[k: string]: (string | [string]|[string, string] | {
|
|
11348
|
+
[k: string]: (string | [string]|[string, string]) | undefined
|
|
11349
|
+
})
|
|
11350
|
+
}]
|
|
10949
11351
|
// ----- wrap-iife -----
|
|
10950
11352
|
type WrapIife = []|[("outside" | "inside" | "any")]|[("outside" | "inside" | "any"), {
|
|
10951
11353
|
functionPrototypeMethods?: boolean
|
package/dist/index.d.mts
CHANGED
|
@@ -5808,6 +5808,317 @@ interface RuleOptions {
|
|
|
5808
5808
|
* @see https://eslint.org/docs/latest/rules/vars-on-top
|
|
5809
5809
|
*/
|
|
5810
5810
|
'vars-on-top'?: Linter.RuleEntry<[]>
|
|
5811
|
+
/**
|
|
5812
|
+
* require .spec test file pattern
|
|
5813
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/consistent-test-filename.md
|
|
5814
|
+
*/
|
|
5815
|
+
'vitest/consistent-test-filename'?: Linter.RuleEntry<VitestConsistentTestFilename>
|
|
5816
|
+
/**
|
|
5817
|
+
* enforce using test or it but not both
|
|
5818
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/consistent-test-it.md
|
|
5819
|
+
*/
|
|
5820
|
+
'vitest/consistent-test-it'?: Linter.RuleEntry<VitestConsistentTestIt>
|
|
5821
|
+
/**
|
|
5822
|
+
* enforce having expectation in test body
|
|
5823
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/expect-expect.md
|
|
5824
|
+
*/
|
|
5825
|
+
'vitest/expect-expect'?: Linter.RuleEntry<VitestExpectExpect>
|
|
5826
|
+
/**
|
|
5827
|
+
* enforce a maximum number of expect per test
|
|
5828
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/max-expects.md
|
|
5829
|
+
*/
|
|
5830
|
+
'vitest/max-expects'?: Linter.RuleEntry<VitestMaxExpects>
|
|
5831
|
+
/**
|
|
5832
|
+
* require describe block to be less than set max value or default value
|
|
5833
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/max-nested-describe.md
|
|
5834
|
+
*/
|
|
5835
|
+
'vitest/max-nested-describe'?: Linter.RuleEntry<VitestMaxNestedDescribe>
|
|
5836
|
+
/**
|
|
5837
|
+
* disallow alias methods
|
|
5838
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-alias-methods.md
|
|
5839
|
+
*/
|
|
5840
|
+
'vitest/no-alias-methods'?: Linter.RuleEntry<[]>
|
|
5841
|
+
/**
|
|
5842
|
+
* disallow commented out tests
|
|
5843
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-commented-out-tests.md
|
|
5844
|
+
*/
|
|
5845
|
+
'vitest/no-commented-out-tests'?: Linter.RuleEntry<[]>
|
|
5846
|
+
/**
|
|
5847
|
+
* disallow conditional expects
|
|
5848
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-conditional-expect.md
|
|
5849
|
+
*/
|
|
5850
|
+
'vitest/no-conditional-expect'?: Linter.RuleEntry<[]>
|
|
5851
|
+
/**
|
|
5852
|
+
* disallow conditional tests
|
|
5853
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-conditional-in-test.md
|
|
5854
|
+
*/
|
|
5855
|
+
'vitest/no-conditional-in-test'?: Linter.RuleEntry<[]>
|
|
5856
|
+
/**
|
|
5857
|
+
* disallow conditional tests
|
|
5858
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-conditional-tests.md
|
|
5859
|
+
*/
|
|
5860
|
+
'vitest/no-conditional-tests'?: Linter.RuleEntry<[]>
|
|
5861
|
+
/**
|
|
5862
|
+
* disallow disabled tests
|
|
5863
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-disabled-tests.md
|
|
5864
|
+
*/
|
|
5865
|
+
'vitest/no-disabled-tests'?: Linter.RuleEntry<[]>
|
|
5866
|
+
/**
|
|
5867
|
+
* disallow using a callback in asynchronous tests and hooks
|
|
5868
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-done-callback.md
|
|
5869
|
+
* @deprecated
|
|
5870
|
+
*/
|
|
5871
|
+
'vitest/no-done-callback'?: Linter.RuleEntry<[]>
|
|
5872
|
+
/**
|
|
5873
|
+
* disallow duplicate hooks and teardown hooks
|
|
5874
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-duplicate-hooks.md
|
|
5875
|
+
*/
|
|
5876
|
+
'vitest/no-duplicate-hooks'?: Linter.RuleEntry<[]>
|
|
5877
|
+
/**
|
|
5878
|
+
* disallow focused tests
|
|
5879
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-focused-tests.md
|
|
5880
|
+
*/
|
|
5881
|
+
'vitest/no-focused-tests'?: Linter.RuleEntry<VitestNoFocusedTests>
|
|
5882
|
+
/**
|
|
5883
|
+
* disallow setup and teardown hooks
|
|
5884
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-hooks.md
|
|
5885
|
+
*/
|
|
5886
|
+
'vitest/no-hooks'?: Linter.RuleEntry<VitestNoHooks>
|
|
5887
|
+
/**
|
|
5888
|
+
* disallow identical titles
|
|
5889
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-identical-title.md
|
|
5890
|
+
*/
|
|
5891
|
+
'vitest/no-identical-title'?: Linter.RuleEntry<[]>
|
|
5892
|
+
/**
|
|
5893
|
+
* disallow importing `node:test`
|
|
5894
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-import-node-test.md
|
|
5895
|
+
*/
|
|
5896
|
+
'vitest/no-import-node-test'?: Linter.RuleEntry<[]>
|
|
5897
|
+
/**
|
|
5898
|
+
* disallow string interpolation in snapshots
|
|
5899
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-interpolation-in-snapshots.md
|
|
5900
|
+
*/
|
|
5901
|
+
'vitest/no-interpolation-in-snapshots'?: Linter.RuleEntry<[]>
|
|
5902
|
+
/**
|
|
5903
|
+
* disallow large snapshots
|
|
5904
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-large-snapshots.md
|
|
5905
|
+
*/
|
|
5906
|
+
'vitest/no-large-snapshots'?: Linter.RuleEntry<VitestNoLargeSnapshots>
|
|
5907
|
+
/**
|
|
5908
|
+
* disallow importing from __mocks__ directory
|
|
5909
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-mocks-import.md
|
|
5910
|
+
*/
|
|
5911
|
+
'vitest/no-mocks-import'?: Linter.RuleEntry<[]>
|
|
5912
|
+
/**
|
|
5913
|
+
* disallow the use of certain matchers
|
|
5914
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-restricted-matchers.md
|
|
5915
|
+
*/
|
|
5916
|
+
'vitest/no-restricted-matchers'?: Linter.RuleEntry<VitestNoRestrictedMatchers>
|
|
5917
|
+
/**
|
|
5918
|
+
* disallow specific `vi.` methods
|
|
5919
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-restricted-vi-methods.md
|
|
5920
|
+
*/
|
|
5921
|
+
'vitest/no-restricted-vi-methods'?: Linter.RuleEntry<VitestNoRestrictedViMethods>
|
|
5922
|
+
/**
|
|
5923
|
+
* disallow using `expect` outside of `it` or `test` blocks
|
|
5924
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-standalone-expect.md
|
|
5925
|
+
*/
|
|
5926
|
+
'vitest/no-standalone-expect'?: Linter.RuleEntry<VitestNoStandaloneExpect>
|
|
5927
|
+
/**
|
|
5928
|
+
* disallow using `test` as a prefix
|
|
5929
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-test-prefixes.md
|
|
5930
|
+
*/
|
|
5931
|
+
'vitest/no-test-prefixes'?: Linter.RuleEntry<[]>
|
|
5932
|
+
/**
|
|
5933
|
+
* disallow return statements in tests
|
|
5934
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-test-return-statement.md
|
|
5935
|
+
*/
|
|
5936
|
+
'vitest/no-test-return-statement'?: Linter.RuleEntry<[]>
|
|
5937
|
+
/**
|
|
5938
|
+
* Enforce padding around `afterAll` blocks
|
|
5939
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/padding-around-after-all-blocks.md
|
|
5940
|
+
*/
|
|
5941
|
+
'vitest/padding-around-after-all-blocks'?: Linter.RuleEntry<[]>
|
|
5942
|
+
/**
|
|
5943
|
+
* Enforce padding around `afterEach` blocks
|
|
5944
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/padding-around-after-each-blocks.md
|
|
5945
|
+
*/
|
|
5946
|
+
'vitest/padding-around-after-each-blocks'?: Linter.RuleEntry<[]>
|
|
5947
|
+
/**
|
|
5948
|
+
* Enforce padding around vitest functions
|
|
5949
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/padding-around-all.md
|
|
5950
|
+
*/
|
|
5951
|
+
'vitest/padding-around-all'?: Linter.RuleEntry<[]>
|
|
5952
|
+
/**
|
|
5953
|
+
* Enforce padding around `beforeAll` blocks
|
|
5954
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/padding-around-before-all-blocks.md
|
|
5955
|
+
*/
|
|
5956
|
+
'vitest/padding-around-before-all-blocks'?: Linter.RuleEntry<[]>
|
|
5957
|
+
/**
|
|
5958
|
+
* Enforce padding around `beforeEach` blocks
|
|
5959
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/padding-around-before-each-blocks.md
|
|
5960
|
+
*/
|
|
5961
|
+
'vitest/padding-around-before-each-blocks'?: Linter.RuleEntry<[]>
|
|
5962
|
+
/**
|
|
5963
|
+
* Enforce padding around `describe` blocks
|
|
5964
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/padding-around-describe-blocks.md
|
|
5965
|
+
*/
|
|
5966
|
+
'vitest/padding-around-describe-blocks'?: Linter.RuleEntry<[]>
|
|
5967
|
+
/**
|
|
5968
|
+
* Enforce padding around `expect` groups
|
|
5969
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/padding-around-expect-groups.md
|
|
5970
|
+
*/
|
|
5971
|
+
'vitest/padding-around-expect-groups'?: Linter.RuleEntry<[]>
|
|
5972
|
+
/**
|
|
5973
|
+
* Enforce padding around afterAll blocks
|
|
5974
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/padding-around-test-blocks.md
|
|
5975
|
+
*/
|
|
5976
|
+
'vitest/padding-around-test-blocks'?: Linter.RuleEntry<[]>
|
|
5977
|
+
/**
|
|
5978
|
+
* enforce using `toBeCalledWith()` or `toHaveBeenCalledWith()`
|
|
5979
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-called-with.md
|
|
5980
|
+
*/
|
|
5981
|
+
'vitest/prefer-called-with'?: Linter.RuleEntry<[]>
|
|
5982
|
+
/**
|
|
5983
|
+
* enforce using the built-in comparison matchers
|
|
5984
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-comparison-matcher.md
|
|
5985
|
+
*/
|
|
5986
|
+
'vitest/prefer-comparison-matcher'?: Linter.RuleEntry<[]>
|
|
5987
|
+
/**
|
|
5988
|
+
* enforce using `each` rather than manual loops
|
|
5989
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-each.md
|
|
5990
|
+
*/
|
|
5991
|
+
'vitest/prefer-each'?: Linter.RuleEntry<[]>
|
|
5992
|
+
/**
|
|
5993
|
+
* enforce using the built-in quality matchers
|
|
5994
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-equality-matcher.md
|
|
5995
|
+
*/
|
|
5996
|
+
'vitest/prefer-equality-matcher'?: Linter.RuleEntry<[]>
|
|
5997
|
+
/**
|
|
5998
|
+
* enforce using expect assertions instead of callbacks
|
|
5999
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-expect-assertions.md
|
|
6000
|
+
*/
|
|
6001
|
+
'vitest/prefer-expect-assertions'?: Linter.RuleEntry<VitestPreferExpectAssertions>
|
|
6002
|
+
/**
|
|
6003
|
+
* enforce using `expect().resolves` over `expect(await ...)` syntax
|
|
6004
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-expect-resolves.md
|
|
6005
|
+
*/
|
|
6006
|
+
'vitest/prefer-expect-resolves'?: Linter.RuleEntry<[]>
|
|
6007
|
+
/**
|
|
6008
|
+
* enforce having hooks in consistent order
|
|
6009
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-hooks-in-order.md
|
|
6010
|
+
*/
|
|
6011
|
+
'vitest/prefer-hooks-in-order'?: Linter.RuleEntry<[]>
|
|
6012
|
+
/**
|
|
6013
|
+
* enforce having hooks before any test cases
|
|
6014
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-hooks-on-top.md
|
|
6015
|
+
*/
|
|
6016
|
+
'vitest/prefer-hooks-on-top'?: Linter.RuleEntry<[]>
|
|
6017
|
+
/**
|
|
6018
|
+
* enforce lowercase titles
|
|
6019
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-lowercase-title.md
|
|
6020
|
+
*/
|
|
6021
|
+
'vitest/prefer-lowercase-title'?: Linter.RuleEntry<VitestPreferLowercaseTitle>
|
|
6022
|
+
/**
|
|
6023
|
+
* enforce mock resolved/rejected shorthands for promises
|
|
6024
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-mock-promise-shorthand.md
|
|
6025
|
+
*/
|
|
6026
|
+
'vitest/prefer-mock-promise-shorthand'?: Linter.RuleEntry<[]>
|
|
6027
|
+
/**
|
|
6028
|
+
* enforce including a hint with external snapshots
|
|
6029
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-snapshot-hint.md
|
|
6030
|
+
*/
|
|
6031
|
+
'vitest/prefer-snapshot-hint'?: Linter.RuleEntry<VitestPreferSnapshotHint>
|
|
6032
|
+
/**
|
|
6033
|
+
* enforce using `vi.spyOn`
|
|
6034
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-spy-on.md
|
|
6035
|
+
*/
|
|
6036
|
+
'vitest/prefer-spy-on'?: Linter.RuleEntry<[]>
|
|
6037
|
+
/**
|
|
6038
|
+
* enforce strict equal over equal
|
|
6039
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-strict-equal.md
|
|
6040
|
+
*/
|
|
6041
|
+
'vitest/prefer-strict-equal'?: Linter.RuleEntry<[]>
|
|
6042
|
+
/**
|
|
6043
|
+
* enforce using toBe()
|
|
6044
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-to-be.md
|
|
6045
|
+
*/
|
|
6046
|
+
'vitest/prefer-to-be'?: Linter.RuleEntry<[]>
|
|
6047
|
+
/**
|
|
6048
|
+
* enforce using toBeFalsy()
|
|
6049
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-to-be-falsy.md
|
|
6050
|
+
*/
|
|
6051
|
+
'vitest/prefer-to-be-falsy'?: Linter.RuleEntry<[]>
|
|
6052
|
+
/**
|
|
6053
|
+
* enforce using toBeObject()
|
|
6054
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-to-be-object.md
|
|
6055
|
+
*/
|
|
6056
|
+
'vitest/prefer-to-be-object'?: Linter.RuleEntry<[]>
|
|
6057
|
+
/**
|
|
6058
|
+
* enforce using `toBeTruthy`
|
|
6059
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-to-be-truthy.md
|
|
6060
|
+
*/
|
|
6061
|
+
'vitest/prefer-to-be-truthy'?: Linter.RuleEntry<[]>
|
|
6062
|
+
/**
|
|
6063
|
+
* enforce using toContain()
|
|
6064
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-to-contain.md
|
|
6065
|
+
*/
|
|
6066
|
+
'vitest/prefer-to-contain'?: Linter.RuleEntry<[]>
|
|
6067
|
+
/**
|
|
6068
|
+
* enforce using toHaveLength()
|
|
6069
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-to-have-length.md
|
|
6070
|
+
*/
|
|
6071
|
+
'vitest/prefer-to-have-length'?: Linter.RuleEntry<[]>
|
|
6072
|
+
/**
|
|
6073
|
+
* enforce using `test.todo`
|
|
6074
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-todo.md
|
|
6075
|
+
*/
|
|
6076
|
+
'vitest/prefer-todo'?: Linter.RuleEntry<[]>
|
|
6077
|
+
/**
|
|
6078
|
+
* Prefer `vi.mocked()` over `fn as Mock`
|
|
6079
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-vi-mocked.md
|
|
6080
|
+
*/
|
|
6081
|
+
'vitest/prefer-vi-mocked'?: Linter.RuleEntry<[]>
|
|
6082
|
+
/**
|
|
6083
|
+
* require setup and teardown to be within a hook
|
|
6084
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/require-hook.md
|
|
6085
|
+
*/
|
|
6086
|
+
'vitest/require-hook'?: Linter.RuleEntry<VitestRequireHook>
|
|
6087
|
+
/**
|
|
6088
|
+
* require local Test Context for concurrent snapshot tests
|
|
6089
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/require-local-test-context-for-concurrent-snapshots.md
|
|
6090
|
+
*/
|
|
6091
|
+
'vitest/require-local-test-context-for-concurrent-snapshots'?: Linter.RuleEntry<[]>
|
|
6092
|
+
/**
|
|
6093
|
+
* require toThrow() to be called with an error message
|
|
6094
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/require-to-throw-message.md
|
|
6095
|
+
*/
|
|
6096
|
+
'vitest/require-to-throw-message'?: Linter.RuleEntry<[]>
|
|
6097
|
+
/**
|
|
6098
|
+
* enforce that all tests are in a top-level describe
|
|
6099
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/require-top-level-describe.md
|
|
6100
|
+
*/
|
|
6101
|
+
'vitest/require-top-level-describe'?: Linter.RuleEntry<VitestRequireTopLevelDescribe>
|
|
6102
|
+
/**
|
|
6103
|
+
* enforce valid describe callback
|
|
6104
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/valid-describe-callback.md
|
|
6105
|
+
*/
|
|
6106
|
+
'vitest/valid-describe-callback'?: Linter.RuleEntry<[]>
|
|
6107
|
+
/**
|
|
6108
|
+
* enforce valid `expect()` usage
|
|
6109
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/valid-expect.md
|
|
6110
|
+
*/
|
|
6111
|
+
'vitest/valid-expect'?: Linter.RuleEntry<VitestValidExpect>
|
|
6112
|
+
/**
|
|
6113
|
+
* Require promises that have expectations in their chain to be valid
|
|
6114
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/valid-expect-in-promise.md
|
|
6115
|
+
*/
|
|
6116
|
+
'vitest/valid-expect-in-promise'?: Linter.RuleEntry<[]>
|
|
6117
|
+
/**
|
|
6118
|
+
* enforce valid titles
|
|
6119
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/valid-title.md
|
|
6120
|
+
*/
|
|
6121
|
+
'vitest/valid-title'?: Linter.RuleEntry<VitestValidTitle>
|
|
5811
6122
|
/**
|
|
5812
6123
|
* Require parentheses around immediate `function` invocations
|
|
5813
6124
|
* @see https://eslint.org/docs/latest/rules/wrap-iife
|
|
@@ -10946,6 +11257,97 @@ type UseIsnan = []|[{
|
|
|
10946
11257
|
type ValidTypeof = []|[{
|
|
10947
11258
|
requireStringLiterals?: boolean
|
|
10948
11259
|
}]
|
|
11260
|
+
// ----- vitest/consistent-test-filename -----
|
|
11261
|
+
type VitestConsistentTestFilename = []|[{
|
|
11262
|
+
pattern?: string
|
|
11263
|
+
allTestPattern?: string
|
|
11264
|
+
}]
|
|
11265
|
+
// ----- vitest/consistent-test-it -----
|
|
11266
|
+
type VitestConsistentTestIt = []|[{
|
|
11267
|
+
fn?: ("test" | "it")
|
|
11268
|
+
withinDescribe?: ("test" | "it")
|
|
11269
|
+
}]
|
|
11270
|
+
// ----- vitest/expect-expect -----
|
|
11271
|
+
type VitestExpectExpect = []|[{
|
|
11272
|
+
assertFunctionNames?: string[]
|
|
11273
|
+
additionalTestBlockFunctions?: string[]
|
|
11274
|
+
}]
|
|
11275
|
+
// ----- vitest/max-expects -----
|
|
11276
|
+
type VitestMaxExpects = []|[{
|
|
11277
|
+
max?: number
|
|
11278
|
+
}]
|
|
11279
|
+
// ----- vitest/max-nested-describe -----
|
|
11280
|
+
type VitestMaxNestedDescribe = []|[{
|
|
11281
|
+
max?: number
|
|
11282
|
+
}]
|
|
11283
|
+
// ----- vitest/no-focused-tests -----
|
|
11284
|
+
type VitestNoFocusedTests = []|[{
|
|
11285
|
+
fixable?: boolean
|
|
11286
|
+
}]
|
|
11287
|
+
// ----- vitest/no-hooks -----
|
|
11288
|
+
type VitestNoHooks = []|[{
|
|
11289
|
+
allow?: unknown[]
|
|
11290
|
+
}]
|
|
11291
|
+
// ----- vitest/no-large-snapshots -----
|
|
11292
|
+
type VitestNoLargeSnapshots = []|[{
|
|
11293
|
+
maxSize?: number
|
|
11294
|
+
inlineMaxSize?: number
|
|
11295
|
+
allowedSnapshots?: {
|
|
11296
|
+
[k: string]: unknown[] | undefined
|
|
11297
|
+
}
|
|
11298
|
+
}]
|
|
11299
|
+
// ----- vitest/no-restricted-matchers -----
|
|
11300
|
+
type VitestNoRestrictedMatchers = []|[{
|
|
11301
|
+
[k: string]: (string | null) | undefined
|
|
11302
|
+
}]
|
|
11303
|
+
// ----- vitest/no-restricted-vi-methods -----
|
|
11304
|
+
type VitestNoRestrictedViMethods = []|[{
|
|
11305
|
+
[k: string]: (string | null) | undefined
|
|
11306
|
+
}]
|
|
11307
|
+
// ----- vitest/no-standalone-expect -----
|
|
11308
|
+
type VitestNoStandaloneExpect = []|[{
|
|
11309
|
+
additionaltestblockfunctions?: string[]
|
|
11310
|
+
[k: string]: unknown | undefined
|
|
11311
|
+
}]
|
|
11312
|
+
// ----- vitest/prefer-expect-assertions -----
|
|
11313
|
+
type VitestPreferExpectAssertions = []|[{
|
|
11314
|
+
onlyFunctionsWithAsyncKeyword?: boolean
|
|
11315
|
+
onlyFunctionsWithExpectInLoop?: boolean
|
|
11316
|
+
onlyFunctionsWithExpectInCallback?: boolean
|
|
11317
|
+
}]
|
|
11318
|
+
// ----- vitest/prefer-lowercase-title -----
|
|
11319
|
+
type VitestPreferLowercaseTitle = []|[{
|
|
11320
|
+
ignore?: ("describe" | "test" | "it")[]
|
|
11321
|
+
allowedPrefixes?: string[]
|
|
11322
|
+
ignoreTopLevelDescribe?: boolean
|
|
11323
|
+
lowercaseFirstCharacterOnly?: boolean
|
|
11324
|
+
}]
|
|
11325
|
+
// ----- vitest/prefer-snapshot-hint -----
|
|
11326
|
+
type VitestPreferSnapshotHint = []|[("always" | "multi")]
|
|
11327
|
+
// ----- vitest/require-hook -----
|
|
11328
|
+
type VitestRequireHook = []|[{
|
|
11329
|
+
allowedFunctionCalls?: string[]
|
|
11330
|
+
}]
|
|
11331
|
+
// ----- vitest/require-top-level-describe -----
|
|
11332
|
+
type VitestRequireTopLevelDescribe = []|[{
|
|
11333
|
+
maxNumberOfTopLevelDescribes?: number
|
|
11334
|
+
}]
|
|
11335
|
+
// ----- vitest/valid-expect -----
|
|
11336
|
+
type VitestValidExpect = []|[{
|
|
11337
|
+
alwaysAwait?: boolean
|
|
11338
|
+
asyncMatchers?: string[]
|
|
11339
|
+
minArgs?: number
|
|
11340
|
+
maxArgs?: number
|
|
11341
|
+
}]
|
|
11342
|
+
// ----- vitest/valid-title -----
|
|
11343
|
+
type VitestValidTitle = []|[{
|
|
11344
|
+
ignoreTypeOfDescribeName?: boolean
|
|
11345
|
+
allowArguments?: boolean
|
|
11346
|
+
disallowedWords?: string[]
|
|
11347
|
+
[k: string]: (string | [string]|[string, string] | {
|
|
11348
|
+
[k: string]: (string | [string]|[string, string]) | undefined
|
|
11349
|
+
})
|
|
11350
|
+
}]
|
|
10949
11351
|
// ----- wrap-iife -----
|
|
10950
11352
|
type WrapIife = []|[("outside" | "inside" | "any")]|[("outside" | "inside" | "any"), {
|
|
10951
11353
|
functionPrototypeMethods?: boolean
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var Z=Object.defineProperty;var r=(e,t)=>Z(e,"name",{value:t,configurable:!0});import u from"globals";import{parser as D,configs as p}from"typescript-eslint";import P from"@eslint-community/eslint-plugin-eslint-comments/configs";import{createTypeScriptImportResolver as ee}from"eslint-import-resolver-typescript";import d from"eslint-plugin-import-x";import C from"eslint-plugin-n";import re from"@eslint/js";import O from"eslint-plugin-perfectionist";import te 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)",oe=["**/node_modules","**/dist","**/package-lock.json","**/yarn.lock","**/pnpm-lock.yaml","**/bun.lockb","**/output","**/coverage","**/temp","**/.temp","**/tmp","**/.tmp","**/.history","**/.vitepress/cache","**/.nuxt","**/.next","**/.vercel","**/.changeset","**/.idea","**/.cache","**/.output","**/.vite-inspect","**/.yarn","**/storybook-static","**/.eslint-config-inspector","**/playwright-report","**/.astro","**/.vinxi","**/app.config.timestamp_*.js","**/CHANGELOG*.md","**/*.min.*","**/LICENSE*","**/__snapshots__","**/auto-import?(s).d.ts","**/components.d.ts","**/vite.config.ts.*.mjs","**/*.gen.*","!.storybook"],R="**/*.?([cm])js",m="**/*.?([cm])jsx",se="**/*.?([cm])ts",g="**/*.?([cm])tsx",f=[`**/__tests__/**/*.${a}`,`**/*.spec.${a}`,`**/*.test.${a}`,`**/*.bench.${a}`,`**/*.benchmark.${a}`],_=[`**/e2e/**/*.spec.${a}`,`**/e2e/**/*.test.${a}`],y=[..._,`**/cypress/**/*.spec.${a}`,`**/cypress/**/*.test.${a}`],ne=[R,m,se,g],ie="**/*.cjs",ae="**/*.astro",ce=["vi.mock","describe","expect","it"],le=["@testing-library/react"],s=r(async e=>{const t=await e;return t.default??t},"interopDefault"),pe=r(async()=>{const e=[ae],[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: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"),me=r(()=>[{files:[ie],languageOptions:{globals:u.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"},ue=r(()=>[{...P.recommended,name:"jimmy.codes/eslint-comments",rules:fe}],"eslintCommentsConfig"),de=r(e=>[{ignores:[...oe,...e],name:"jimmy.codes/ignores"}],"ignoresConfig"),ge={...d.configs.recommended.rules,"import-x/consistent-type-specifier-style":["error","prefer-top-level"],"import-x/extensions":["error","never",{checkTypedImports:!0,svg:"always"}],"import-x/first":"error","import-x/namespace":"off","import-x/newline-after-import":"error","import-x/no-absolute-path":"error","import-x/no-duplicates":"error","import-x/no-empty-named-blocks":"error","import-x/no-named-as-default":"error","import-x/no-named-as-default-member":"error","import-x/no-self-import":"error","import-x/no-unresolved":["error",{ignore:[String.raw`\.svg$`]}],"import-x/no-useless-path-segments":"error"},ye=r(()=>{const{rules:e,settings:t}=d.configs.typescript;return[{name:"jimmy.codes/imports/typescript",rules:e,settings:{"import-x/extensions":t["import-x/extensions"],"import-x/external-module-folders":t["import-x/external-module-folders"],"import-x/parsers":t["import-x/parsers"],"import-x/resolver-next":[ee({alwaysTryTypes:!0})]}}]},"importsTypescriptConfig"),je=r(({typescript:e=!1}={})=>[{name:"jimmy.codes/imports",plugins:{"import-x":d,n:C},rules:ge},...e?ye():[]],"importsConfig"),xe={...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"},he=r(()=>[{linterOptions:{reportUnusedDisableDirectives:!0},name:"jimmy.codes/javascript",rules:xe}],"javascriptConfig"),L=r((e={})=>Object.fromEntries(Object.entries(e).map(([t,o])=>[t,o==="warn"?"error":o])),"warningAsErrors"),be=r(async()=>{const e=await s(import("@next/eslint-plugin-next"));return L(e.configs.recommended.rules)},"nextjsRules"),we=r(async()=>{const e=await s(import("@next/eslint-plugin-next"));return[{files:ne,name:"jimmy.codes/nextjs",plugins:{"@next/next":e},rules:await be()}]},"nextjsConfig"),ke={"n/no-process-exit":"off","n/prefer-node-protocol":"error"},ve=r(()=>[{name:"jimmy.codes/node",plugins:{n:C},rules:ke}],"nodeConfig"),Pe={...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"},Ce=r(()=>[{name:"jimmy.codes/perfectionist",plugins:{perfectionist:O},rules:Pe}],"perfectionistConfig"),Oe=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"),Ee=r(async()=>[{...(await s(import("eslint-plugin-playwright"))).configs["flat/recommended"],files:_,name:"jimmy.codes/playwright",rules:await Oe()}],"playwrightConfig"),Te=r(()=>[{name:"jimmy.codes/prettier",...te}],"prettierConfig"),Re=r(()=>i("typescript"),"hasTypescript"),_e=r(()=>i("react"),"hasReact"),S=r(()=>i("vitest"),"hasVitest"),q=r(()=>i("jest"),"hasJest"),Le=r(()=>S()||q(),"hasTesting"),Se=r(()=>le.some(e=>i(e)),"hasTestingLibrary"),qe=r(()=>i("@tanstack/react-query"),"hasReactQuery"),Ge=r(()=>i("astro"),"hasAstro"),Ae=r(()=>i("@playwright/test"),"hasPlaywright"),Ie=r(()=>i("storybook"),"hasStorybook"),G=r(()=>i("next"),"hasNext"),Ne=r(()=>i("vite"),"hasVite"),Be=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"?Be(o):o])),"normalizeRuleEntries"),$e=["dynamic","dynamicParams","revalidate","fetchCache","runtime","preferredRegion","maxDuration","config","generateStaticParams","metadata","generateMetadata","viewport","generateViewport"],Fe=r(async()=>{const[e,t]=await Promise.all([s(import("eslint-plugin-react")),s(import("eslint-plugin-jsx-a11y"))]),o=G(),n=Ne();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?$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=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:{...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 Fe(),settings:{react:{version:"detect"}}}]},"reactConfig"),Je={...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"},Ue=r(()=>[{name:"jimmy.codes/regexp",plugins:{regexp:E},rules:Je}],"regexpConfig"),Xe=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"),Qe=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"),ze=r(async()=>({...await I(),"jest/no-deprecated-functions":"off","jest/require-hook":["error",{allowedFunctionCalls:ce}]}),"vitestRules"),He=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:f,ignores:y,...l.configs["flat/recommended"],name:"jimmy.codes/vitest",rules:await ze()})}if(n){const l=await s(import("eslint-plugin-jest"));c.push({files:f,ignores:y,...l.configs["flat/recommended"],name:"jimmy.codes/jest",rules:await I()})}return c},"testingConfig"),Me=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"),We=r(async()=>{const[e,t]=await Promise.all([import("eslint-plugin-jest-dom"),s(import("eslint-plugin-testing-library"))]);return[{files:f,ignores:y,name:"jimmy.codes/testing-library",plugins:{"jest-dom":e,"testing-library":t},rules:await Me()}]},"testingLibraryConfig"),Ye={"@typescript-eslint/consistent-type-exports":["error",{fixMixedExportsWithInlineTypeSpecifier:!1}],"@typescript-eslint/consistent-type-imports":["error",{fixStyle:"separate-type-imports"}],"@typescript-eslint/no-deprecated":"warn","@typescript-eslint/no-misused-promises":["error",{checksVoidReturn:{attributes:!1}}],"@typescript-eslint/no-unused-vars":["error",{args:"all",argsIgnorePattern:"^_",caughtErrors:"all",caughtErrorsIgnorePattern:"^_",destructuredArrayIgnorePattern:"^_",ignoreRestSiblings:!0,varsIgnorePattern:"^_"}],"@typescript-eslint/no-use-before-define":["error",{allowNamedExports:!1,classes:!1,functions:!1,variables:!0}],"@typescript-eslint/restrict-template-expressions":["error",{allowNumber:!0}],"no-use-before-define":"off"},Ke=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:Ye},{files:[R,m],...p.disableTypeChecked},{files:f,name:"jimmy.codes/typescript/testing",rules:{"@typescript-eslint/no-unsafe-argument":"off","@typescript-eslint/no-unsafe-assignment":"off"}}],"typescriptConfig"),Ze={...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"},De=r(()=>[{...T.configs["flat/recommended"],name:"jimmy.codes/unicorn",rules:Ze}],"unicornConfig"),er=r(e=>typeof e=="object"?e:void 0,"getTypescriptOptions"),rr=r((e,t)=>typeof e=="object"?e:{framework:t.vitest?"vitest":t.jest?"jest":"vitest",...t.testingLibrary&&{utilities:["testing-library"]}},"getTestingOptions"),tr=r(e=>typeof e=="object"?e:{utilities:[]},"getReactOptions"),or=r(({utilities:e=[]},t,o)=>t||e.includes("@tanstack/query")||o&&qe(),"shouldEnableTanstackQuery"),sr=r(({utilities:e=[]},t)=>e.includes("testing-library")||t&&Se(),"shouldEnableTestingLibrary"),nr=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=tr(j),w=rr(x,{jest:c,testingLibrary:V,vitest:b}),k=er(h),v=h||!!k||t&&Re(),X=j||t&&_e(),Q=x||c||b||t&&Le(),z=e||t&&Ge(),H=or(U,F,t),M=sr(w,t),W=B||t&&Ae(),Y=$||t&&Ie(),K=l||t&&G();return[he(),Ce(),ve(),De(),ue(),Ue(),je({typescript:v}),v?Ke(k):[],X?await Ve():[],H?await Qe():[],z?await pe():[],Q?await He(w,t):[],M?await We():[],W?await Ee():[],Y?await Xe():[],K?await we():[],Te(),me(),de(n),o,N,J].flat()},"eslintConfig");export{nr as default};
|
|
1
|
+
var K=Object.defineProperty;var r=(e,t)=>K(e,"name",{value:t,configurable:!0});import u from"globals";import{parser as Z,configs as p}from"typescript-eslint";import P from"@eslint-community/eslint-plugin-eslint-comments/configs";import{createTypeScriptImportResolver as D}from"eslint-import-resolver-typescript";import d 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"],R="**/*.?([cm])js",f="**/*.?([cm])jsx",oe="**/*.?([cm])ts",g="**/*.?([cm])tsx",m=[`**/__tests__/**/*.${a}`,`**/*.spec.${a}`,`**/*.test.${a}`,`**/*.bench.${a}`,`**/*.benchmark.${a}`],_=[`**/e2e/**/*.spec.${a}`,`**/e2e/**/*.test.${a}`],y=[..._,`**/cypress/**/*.spec.${a}`,`**/cypress/**/*.test.${a}`],se=[R,f,oe,g],ne="**/*.cjs",ie="**/*.astro",ae=["@testing-library/react"],s=r(async e=>{const t=await e;return t.default??t},"interopDefault"),ce=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:{...u.node,Astro:!1,Fragment:!1},parser:o,parserOptions:{extraFileExtensions:[".astro"],parser:Z},sourceType:"module"},name:"jimmy.codes/astro",plugins:{astro:t,"jsx-a11y":n},processor:"astro/client-side-ts",rules:{...n.configs.recommended.rules,"astro/missing-client-only-directive-value":"error","astro/no-conflict-set-directives":"error","astro/no-deprecated-astro-canonicalurl":"error","astro/no-deprecated-astro-fetchcontent":"error","astro/no-deprecated-astro-resolve":"error","astro/no-deprecated-getentrybyslug":"error","astro/no-exports-from-components":"off","astro/no-unused-define-vars-in-style":"error","astro/valid-compile":"error"}},{files:e,languageOptions:{parserOptions:p.disableTypeChecked.languageOptions?.parserOptions},name:"jimmy.codes/astro/disable-type-checked",rules:p.disableTypeChecked.rules},{name:"jimmy.codes/astro/imports",settings:{"import-x/core-modules":["astro:content"]}}]},"astroConfig"),le=r(()=>[{files:[ne],languageOptions:{globals:u.commonjs},name:"jimmy.codes/commonjs"}],"commonjsConfig"),pe={...P.recommended.rules,"@eslint-community/eslint-comments/no-unused-disable":"off","@eslint-community/eslint-comments/require-description":"error"},fe=r(()=>[{...P.recommended,name:"jimmy.codes/eslint-comments",rules:pe}],"eslintCommentsConfig"),me=r(e=>[{ignores:[...te,...e],name:"jimmy.codes/ignores"}],"ignoresConfig"),ue={...d.configs.recommended.rules,"import-x/consistent-type-specifier-style":["error","prefer-top-level"],"import-x/extensions":["error","never",{checkTypedImports:!0,svg:"always"}],"import-x/first":"error","import-x/namespace":"off","import-x/newline-after-import":"error","import-x/no-absolute-path":"error","import-x/no-duplicates":"error","import-x/no-empty-named-blocks":"error","import-x/no-named-as-default":"error","import-x/no-named-as-default-member":"error","import-x/no-self-import":"error","import-x/no-unresolved":["error",{ignore:[String.raw`\.svg$`]}],"import-x/no-useless-path-segments":"error"},de=r(()=>{const{rules:e,settings:t}=d.configs.typescript;return[{name:"jimmy.codes/imports/typescript",rules:e,settings:{"import-x/extensions":t["import-x/extensions"],"import-x/external-module-folders":t["import-x/external-module-folders"],"import-x/parsers":t["import-x/parsers"],"import-x/resolver-next":[D({alwaysTryTypes:!0})]}}]},"importsTypescriptConfig"),ge=r(({typescript:e=!1}={})=>[{name:"jimmy.codes/imports",plugins:{"import-x":d,n:C},rules:ue},...e?de():[]],"importsConfig"),ye={...ee.configs.recommended.rules,"array-callback-return":["error",{allowImplicit:!0}],"arrow-body-style":["error","always"],curly:["error","all"],"no-console":"warn","no-self-compare":"error","no-template-curly-in-string":"error","no-unmodified-loop-condition":"error","no-unreachable-loop":"error","no-use-before-define":["error",{allowNamedExports:!1,classes:!1,functions:!1,variables:!0}],"no-useless-rename":"error","object-shorthand":"error","prefer-arrow-callback":"error"},he=r(()=>[{linterOptions:{reportUnusedDisableDirectives:!0},name:"jimmy.codes/javascript",rules:ye}],"javascriptConfig"),q=r((e={})=>Object.fromEntries(Object.entries(e).map(([t,o])=>[t,o==="warn"?"error":o])),"warningAsErrors"),xe=r(async()=>{const e=await s(import("@next/eslint-plugin-next"));return q(e.configs.recommended.rules)},"nextjsRules"),je=r(async()=>{const e=await s(import("@next/eslint-plugin-next"));return[{files:se,name:"jimmy.codes/nextjs",plugins:{"@next/next":e},rules:await xe()}]},"nextjsConfig"),ve={"n/no-process-exit":"off","n/prefer-node-protocol":"error"},be=r(()=>[{name:"jimmy.codes/node",plugins:{n:C},rules:ve}],"nodeConfig"),we={...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"},ke=r(()=>[{name:"jimmy.codes/perfectionist",plugins:{perfectionist:O},rules:we}],"perfectionistConfig"),Pe=r(async()=>({...(await s(import("eslint-plugin-playwright"))).configs["flat/recommended"].rules,"playwright/expect-expect":"error","playwright/max-nested-describe":"error","playwright/no-conditional-expect":"error","playwright/no-conditional-in-test":"error","playwright/no-element-handle":"error","playwright/no-eval":"error","playwright/no-force-option":"error","playwright/no-nested-step":"error","playwright/no-page-pause":"error","playwright/no-skipped-test":"error","playwright/no-useless-await":"error","playwright/no-useless-not":"error","playwright/no-wait-for-selector":"error","playwright/no-wait-for-timeout":"error"}),"playwrightRules"),Ce=r(async()=>[{...(await s(import("eslint-plugin-playwright"))).configs["flat/recommended"],files:_,name:"jimmy.codes/playwright",rules:await Pe()}],"playwrightConfig"),Oe=r(()=>[{name:"jimmy.codes/prettier",...re}],"prettierConfig"),Ee=r(()=>i("typescript"),"hasTypescript"),Te=r(()=>i("react"),"hasReact"),L=r(()=>i("vitest"),"hasVitest"),S=r(()=>i("jest"),"hasJest"),Re=r(()=>L()||S(),"hasTesting"),_e=r(()=>ae.some(e=>i(e)),"hasTestingLibrary"),qe=r(()=>i("@tanstack/react-query"),"hasReactQuery"),Le=r(()=>i("astro"),"hasAstro"),Se=r(()=>i("@playwright/test"),"hasPlaywright"),Ge=r(()=>i("storybook"),"hasStorybook"),G=r(()=>i("next"),"hasNext"),Ae=r(()=>i("vite"),"hasVite"),Be=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"?Be(o):o])),"normalizeRuleEntries"),Ie=["dynamic","dynamicParams","revalidate","fetchCache","runtime","preferredRegion","maxDuration","config","generateStaticParams","metadata","generateMetadata","viewport","generateViewport"],Ne=r(async()=>{const[e,t]=await Promise.all([s(import("eslint-plugin-react")),s(import("eslint-plugin-jsx-a11y"))]),o=G(),n=Ae();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?Ie:[]}],"react/boolean-prop-naming":"off","react/button-has-type":"error","react/checked-requires-onchange-or-readonly":"error","react/default-props-match-prop-types":"error","react/destructuring-assignment":"off","react/forbid-component-props":"off","react/forbid-dom-props":"off","react/forbid-elements":"off","react/forbid-foreign-prop-types":"off","react/forbid-prop-types":"off","react/forward-ref-uses-ref":"error","react/function-component-definition":"off","react/hook-use-state":"error","react/iframe-missing-sandbox":"error","react/jsx-boolean-value":["error","never"],"react/jsx-curly-brace-presence":"error","react/jsx-filename-extension":"off","react/jsx-fragments":["error","syntax"],"react/jsx-handler-names":"off","react/jsx-max-depth":"off","react/jsx-no-bind":"off","react/jsx-no-constructed-context-values":"error","react/jsx-no-leaked-render":"error","react/jsx-no-literals":"off","react/jsx-no-script-url":"error","react/jsx-no-useless-fragment":"error","react/jsx-one-expression-per-line":"off","react/jsx-pascal-case":["error",{allowNamespace:!0}],"react/jsx-props-no-spread-multi":"off","react/jsx-props-no-spreading":"off","react/jsx-sort-default-props":"off","react/jsx-sort-props":"off","react/no-access-state-in-setstate":"error","react/no-adjacent-inline-elements":"off","react/no-array-index-key":"off","react/no-arrow-function-lifecycle":"error","react/no-danger":"off","react/no-did-mount-set-state":"error","react/no-did-update-set-state":"error","react/no-invalid-html-attribute":"error","react/no-multi-comp":"off","react/no-namespace":"error","react/no-object-type-as-default-prop":"error","react/no-redundant-should-component-update":"error","react/no-set-state":"off","react/no-this-in-sfc":"error","react/no-typos":"error","react/no-unstable-nested-components":"error","react/no-unused-class-component-methods":"error","react/no-unused-prop-types":"error","react/no-unused-state":"error","react/no-will-update-set-state":"error","react/prefer-es6-class":"off","react/prefer-exact-props":"off","react/prefer-read-only-props":"off","react/prefer-stateless-function":"off","react/require-default-props":"off","react/require-optimization":"off","react/self-closing-comp":"error","react/sort-comp":"off","react/sort-default-props":"off","react/sort-prop-types":"off","react/state-in-constructor":"off","react/static-property-placement":"off","react/style-prop-object":"error","react/void-dom-elements-no-children":"error"}},"reactRules"),$e=r(async()=>{const[e,t,o,n,c]=await Promise.all([s(import("eslint-plugin-react")),s(import("eslint-plugin-jsx-a11y")),import("eslint-plugin-react-hooks"),s(import("eslint-plugin-react-refresh")),s(import("eslint-plugin-react-compiler"))]);return[{files:[f,g],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 Ne(),settings:{react:{version:"detect"}}}]},"reactConfig"),Je={...E.configs["flat/recommended"].rules,"regexp/confusing-quantifier":"error","regexp/no-empty-alternative":"error","regexp/no-lazy-ends":"error","regexp/no-potentially-useless-backreference":"error","regexp/no-useless-flag":"error","regexp/optimal-lookaround-quantifier":"error"},Ve=r(()=>[{name:"jimmy.codes/regexp",plugins:{regexp:E},rules:Je}],"regexpConfig"),Fe=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:{...q(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:[f,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"),Qe=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"),Ue=r(async()=>({...(await s(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"),ze=r(async({framework:e="vitest"}={},t=!0)=>{const o=t?L():e==="vitest",n=e==="jest"||t&&S(),c=[];if(o){const l=await s(import("@vitest/eslint-plugin"));c.push({files:m,ignores:y,...l.configs.recommended,name:"jimmy.codes/vitest",rules:await Ue()})}if(n){const l=await s(import("eslint-plugin-jest"));c.push({files:m,ignores:y,...l.configs["flat/recommended"],name:"jimmy.codes/jest",rules:await Qe()})}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:m,ignores:y,name:"jimmy.codes/testing-library",plugins:{"jest-dom":e,"testing-library":t},rules:await He()}]},"testingLibraryConfig"),Ye={"@typescript-eslint/consistent-type-exports":["error",{fixMixedExportsWithInlineTypeSpecifier:!1}],"@typescript-eslint/consistent-type-imports":["error",{fixStyle:"separate-type-imports"}],"@typescript-eslint/no-deprecated":"warn","@typescript-eslint/no-misused-promises":["error",{checksVoidReturn:{attributes:!1}}],"@typescript-eslint/no-unused-vars":["error",{args:"all",argsIgnorePattern:"^_",caughtErrors:"all",caughtErrorsIgnorePattern:"^_",destructuredArrayIgnorePattern:"^_",ignoreRestSiblings:!0,varsIgnorePattern:"^_"}],"@typescript-eslint/no-use-before-define":["error",{allowNamedExports:!1,classes:!1,functions:!1,variables:!0}],"@typescript-eslint/restrict-template-expressions":["error",{allowNumber:!0}],"no-use-before-define":"off"},We=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:Ye},{files:[R,f],...p.disableTypeChecked},{files:m,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&&qe(),"shouldEnableTanstackQuery"),or=r(({utilities:e=[]},t)=>e.includes("testing-library")||t&&_e(),"shouldEnableTestingLibrary"),sr=r(async({astro:e=!1,autoDetect:t=!0,configs:o=[],ignores:n=[],jest:c=!1,nextjs:l=!1,overrides:B=[],playwright:I=!1,react:h=!1,storybook:N=!1,tanstackQuery:$=!1,testing:x=!1,testingLibrary:J=!1,typescript:j=!1,vitest:v=!1}={},...V)=>{const F=rr(h),b=er(x,{jest:c,testingLibrary:J,vitest:v}),w=De(j),k=j||!!w||t&&Ee(),X=h||t&&Te(),Q=x||c||v||t&&Re(),U=e||t&&Le(),z=tr(F,$,t),H=or(b,t),M=I||t&&Se(),Y=N||t&&Ge(),W=l||t&&G();return[he(),ke(),be(),Ze(),fe(),Ve(),ge({typescript:k}),k?We(w):[],X?await $e():[],z?await Xe():[],U?await ce():[],Q?await ze(b,t):[],H?await Me():[],M?await Ce():[],Y?await Fe():[],W?await je():[],Oe(),le(),me(n),o,B,V].flat()},"eslintConfig");export{sr as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jimmy.codes/eslint-config",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.27.1",
|
|
4
4
|
"description": "another opinionated eslint config",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
"@types/eslint": "9.6.1",
|
|
39
39
|
"@typescript-eslint/parser": "^8.17.0",
|
|
40
40
|
"@typescript-eslint/utils": "^8.17.0",
|
|
41
|
+
"@vitest/eslint-plugin": "^1.1.14",
|
|
41
42
|
"astro-eslint-parser": "^1.1.0",
|
|
42
43
|
"eslint-config-prettier": "^9.1.0",
|
|
43
44
|
"eslint-import-resolver-typescript": "^3.7.0",
|