@jimmy.codes/eslint-config 4.3.1 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -9
- package/dist/astro-Z5RFF624.js +71 -0
- package/dist/chunk-72FT76PY.js +9 -0
- package/dist/chunk-BJU7UEJ3.js +12 -0
- package/dist/chunk-N5KZEOXT.js +80 -0
- package/dist/chunk-OCS4JNPP.js +55 -0
- package/dist/{index.d.cts → index.d.ts} +2541 -460
- package/dist/index.js +538 -0
- package/dist/jest-AHG2WRSU.js +72 -0
- package/dist/nextjs-RCR4GYMK.js +35 -0
- package/dist/playwright-U4PCWDYV.js +49 -0
- package/dist/react-X5DWOH4Y.js +189 -0
- package/dist/storybook-4KS3DD3C.js +37 -0
- package/dist/tanstack-query-UHBVVQ7V.js +32 -0
- package/dist/testing-library-7RTMAEOX.js +42 -0
- package/dist/typescript-IBCLQD7Q.js +85 -0
- package/dist/vitest-YI6KNRZE.js +85 -0
- package/package.json +12 -20
- package/dist/index.cjs +0 -1
- package/dist/index.d.mts +0 -15945
- package/dist/index.mjs +0 -1
package/dist/index.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
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 l}from"typescript-eslint";import x 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 h from"eslint-plugin-n";import re from"@eslint/js";import b from"eslint-plugin-jsdoc";import v from"eslint-plugin-perfectionist";import te from"eslint-config-prettier/flat";import{isPackageExists as i}from"local-pkg";import*as w from"eslint-plugin-regexp";import k from"eslint-plugin-unicorn";const c="?([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"],P="**/*.?([cm])js",f="**/*.?([cm])jsx",se="**/*.?([cm])ts",g="**/*.?([cm])tsx",p=[`**/__tests__/**/*.${c}`,`**/*.spec.${c}`,`**/*.test.${c}`,`**/*.bench.${c}`,`**/*.benchmark.${c}`],C=[`**/e2e/**/*.spec.${c}`,`**/e2e/**/*.test.${c}`],y=[...C,`**/cypress/**/*.spec.${c}`,`**/cypress/**/*.test.${c}`],ne=[P,f,se,g],ie="**/*.cjs",ae="**/*.astro",ce=["@testing-library/react"],o=r(async e=>{const t=await e;return t.default??t},"interopDefault"),le=r(async()=>{const e=[ae],[t,s,n]=await Promise.all([import("eslint-plugin-astro"),import("astro-eslint-parser"),o(import("eslint-plugin-jsx-a11y"))]);return[{files:e,languageOptions:{globals:{...u.node,Astro:!1,Fragment:!1},parser:s,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:l.disableTypeChecked.languageOptions?.parserOptions},name:"jimmy.codes/astro/disable-type-checked",rules:l.disableTypeChecked.rules},{name:"jimmy.codes/astro/imports",settings:{"import-x/core-modules":["astro:content"]}}]},"astroConfig"),pe=r(()=>[{files:[ie],languageOptions:{globals:u.commonjs},name:"jimmy.codes/commonjs"}],"commonjsConfig"),fe={...x.recommended.rules,"@eslint-community/eslint-comments/no-unused-disable":"off","@eslint-community/eslint-comments/require-description":"error"},me=r(()=>[{...x.recommended,name:"jimmy.codes/eslint-comments",rules:fe}],"eslintCommentsConfig"),ue=r(e=>[{ignores:[...oe,...e],name:"jimmy.codes/ignores"}],"ignoresConfig"),de={...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"},ge=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"),ye=r(({typescript:e=!1}={})=>[{name:"jimmy.codes/imports",plugins:{"import-x":d,n:h},rules:de},...e?ge():[]],"importsConfig"),je={"array-callback-return":["error",{allowImplicit:!0}],"arrow-body-style":["error","always"],"class-methods-use-this":"error","consistent-return":"error",curly:["error","all"],"default-case":"error","default-case-last":"error","no-console":"warn","no-implicit-coercion":"error","no-implicit-globals":"error","no-loop-func":"error","no-magic-numbers":["error",{ignore:[0,1,-1,2]}],"no-new-wrappers":"error","no-param-reassign":["error",{props:!0}],"no-promise-executor-return":"error","no-self-compare":"error","no-template-curly-in-string":"error","no-throw-literal":"error","no-unmodified-loop-condition":"error","no-unreachable-loop":"error","no-use-before-define":["error",{allowNamedExports:!1,classes:!1,functions:!0,variables:!0}],"no-useless-computed-key":"error","no-useless-constructor":"error","no-useless-rename":"error","no-useless-return":"error","no-var":"error","object-shorthand":"error","prefer-arrow-callback":"error","prefer-const":"error","prefer-destructuring":["error",{AssignmentExpression:{array:!1,object:!1},VariableDeclarator:{array:!1,object:!0}}],"prefer-object-spread":"error","prefer-rest-params":"error","prefer-spread":"error","prefer-template":"error",radix:"error","require-await":"error",strict:["error","safe"],"symbol-description":"error"},xe={...re.configs.recommended.rules,...je},he=r(()=>[{linterOptions:{reportUnusedDisableDirectives:!0},name:"jimmy.codes/javascript",rules:xe},{files:p,name:"jimmy.codes/javascript/testing",rules:{"no-magic-numbers":"off"}}],"javascriptConfig"),be=r(async()=>{const e=await o(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"),ve=r(async()=>{const e=await o(import("eslint-plugin-jest"));return[{files:p,ignores:y,...e.configs["flat/recommended"],name:"jimmy.codes/jest",rules:await be()}]},"jestConfig"),we=r(()=>({...b.configs["flat/recommended-typescript-error"].rules,"jsdoc/require-jsdoc":"off","jsdoc/require-param":"off","jsdoc/require-returns":"off","jsdoc/tag-lines":["error","always",{applyToEndTag:!1,startLines:1}]}),"jsdocRules"),ke=r(()=>[{...b.configs["flat/recommended-typescript-error"],name:"jimmy.codes/jsdoc",rules:we()}],"jsdocConfig"),E=r((e={})=>Object.fromEntries(Object.entries(e).map(([t,s])=>[t,s==="warn"?"error":s])),"warningAsErrors"),Pe=r(async()=>{const e=await o(import("@next/eslint-plugin-next"));return E(e.configs.recommended.rules)},"nextjsRules"),Ce=r(async()=>{const e=await o(import("@next/eslint-plugin-next"));return[{files:ne,name:"jimmy.codes/nextjs",plugins:{"@next/next":e},rules:await Pe()}]},"nextjsConfig"),Ee={"n/no-process-exit":"off","n/prefer-node-protocol":"error"},Re=r(()=>[{name:"jimmy.codes/node",plugins:{n:h},rules:Ee}],"nodeConfig"),Oe={...v.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"},Te=r(()=>[{name:"jimmy.codes/perfectionist",plugins:{perfectionist:v},rules:Oe}],"perfectionistConfig"),_e=r(async()=>({...(await o(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-slowed-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"),qe=r(async()=>[{...(await o(import("eslint-plugin-playwright"))).configs["flat/recommended"],files:C,name:"jimmy.codes/playwright",rules:await _e()}],"playwrightConfig"),Le=r(()=>[{...te,name:"jimmy.codes/prettier"}],"prettierConfig"),Se=r(()=>i("typescript"),"hasTypescript"),Ge=r(()=>i("react"),"hasReact"),Ae=r(()=>i("vitest"),"hasVitest"),Be=r(()=>i("jest"),"hasJest"),Ie=r(()=>ce.some(e=>i(e)),"hasTestingLibrary"),Ne=r(()=>i("@tanstack/react-query"),"hasReactQuery"),De=r(()=>i("astro"),"hasAstro"),$e=r(()=>i("@playwright/test"),"hasPlaywright"),Ve=r(()=>i("storybook"),"hasStorybook"),R=r(()=>i("next"),"hasNext"),Fe=r(()=>i("vite"),"hasVite"),Je=r(e=>e===2?"error":e===1?"warn":"off","toStringSeverity"),O=r((e={})=>Object.fromEntries(Object.entries(e).map(([t,s])=>[t,typeof s=="number"?Je(s):s])),"normalizeRuleEntries"),Xe=["dynamic","dynamicParams","revalidate","fetchCache","runtime","preferredRegion","maxDuration","config","generateStaticParams","metadata","generateMetadata","viewport","generateViewport"],Ue=r(async()=>{const[e,t]=await Promise.all([o(import("eslint-plugin-react")),o(import("eslint-plugin-jsx-a11y"))]),s=R(),n=Fe();return{...t.configs.recommended.rules,...O(e.configs.flat.recommended?.rules),...O(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?Xe:[]}],"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"),ze=r(async()=>{const[e,t,s,n,m]=await Promise.all([o(import("eslint-plugin-react")),o(import("eslint-plugin-jsx-a11y")),import("eslint-plugin-react-hooks"),o(import("eslint-plugin-react-refresh")),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":m,"react-hooks":s,"react-refresh":n},rules:await Ue(),settings:{react:{version:"detect"}}}]},"reactConfig"),He={...w.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"},Me=r(()=>[{name:"jimmy.codes/regexp",plugins:{regexp:w},rules:He}],"regexpConfig"),Qe=r(async()=>{const{configs:e}=await o(import("eslint-plugin-storybook")),[t,s,n]=e["flat/recommended"];return[{name:"jimmy.codes/storybook/setup",plugins:t?.plugins},{files:s?.files,name:"jimmy.codes/storybook/stories-rules",rules:{...E(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"),Ye=r(async()=>{const e=await o(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"),We=r(async()=>{const[e,t]=await Promise.all([import("eslint-plugin-jest-dom"),o(import("eslint-plugin-testing-library"))]);return{...t.configs["flat/react"].rules,...e.configs["flat/recommended"].rules}},"testingLibraryRules"),Ke=r(async()=>{const[e,t]=await Promise.all([import("eslint-plugin-jest-dom"),o(import("eslint-plugin-testing-library"))]);return[{files:p,ignores:y,name:"jimmy.codes/testing-library",plugins:{"jest-dom":e,"testing-library":t},rules:await We()}]},"testingLibraryConfig"),Ze={"@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"},er=r(()=>[...l.strictTypeChecked,...l.stylisticTypeChecked.filter(e=>e.name==="typescript-eslint/stylistic-type-checked"),{languageOptions:{parserOptions:{projectService:!0,tsconfigRootDir:process.cwd()}},name:"jimmy.codes/typescript",rules:Ze},{files:[P,f],...l.disableTypeChecked},{files:p,name:"jimmy.codes/typescript/testing",rules:{"@typescript-eslint/no-unsafe-argument":"off","@typescript-eslint/no-unsafe-assignment":"off"}}],"typescriptConfig"),rr={...k.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"},tr=r(()=>[{...k.configs["flat/recommended"],name:"jimmy.codes/unicorn",rules:rr}],"unicornConfig"),or=r(async()=>({...(await o(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-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-boolean-matchers":"error","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-expect":"error","vitest/valid-expect-in-promise":"error","vitest/valid-title":"error"}),"vitestRules"),sr=r(async()=>{const e=await o(import("@vitest/eslint-plugin"));return[{files:p,ignores:y,...e.configs.recommended,name:"jimmy.codes/vitest",rules:await or()}]},"vitestConfig"),T=r(async({astro:e=!1,autoDetect:t=!0,ignores:s=[],jest:n=!1,nextjs:m=!1,overrides:_=[],playwright:q=!1,react:L=!1,storybook:S=!1,tanstackQuery:G=!1,testingLibrary:A=!1,typescript:B=!1,vitest:I=!1}={},...N)=>{const a=r((Y,W)=>Y||t&&W(),"resolveFlag"),j=a(B,Se),D=a(L,Ge),$=a(e,De),V=a(G,Ne),F=a(A,Ie),J=a(q,$e),X=a(S,Ve),U=a(m,R),z=a(n,Be),H=a(I,Ae),M=[he(),Te(),Re(),tr(),me(),Me(),ke(),ye({typescript:j})],Q=[j&&er(),D&&await ze(),V&&await Ye(),$&&await le(),z&&await ve(),H&&await sr(),F&&await Ke(),J&&await qe(),X&&await Qe(),U&&await Ce()].filter(Boolean);return[...M,...Q,Le(),pe(),ue(s),_,N].flat()},"defineConfig");export{T as default,T as defineConfig};
|