@anolilab/eslint-config 29.0.1 → 30.0.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/CHANGELOG.md CHANGED
@@ -1,3 +1,5 @@
1
+ ## @anolilab/eslint-config [30.0.0](https://github.com/anolilab/javascript-style-guide/compare/%40anolilab%2Feslint-config%4029.0.1...%40anolilab%2Feslint-config%4030.0.0) (2026-08-17)
2
+
1
3
  ## @anolilab/eslint-config [29.0.1](https://github.com/anolilab/javascript-style-guide/compare/%40anolilab%2Feslint-config%4029.0.0...%40anolilab%2Feslint-config%4029.0.1) (2026-08-17)
2
4
 
3
5
  ## @anolilab/eslint-config [29.0.0](https://github.com/anolilab/javascript-style-guide/compare/%40anolilab%2Feslint-config%4028.1.5...%40anolilab%2Feslint-config%4029.0.0) (2026-08-17)
package/dist/index.d.ts CHANGED
@@ -18692,7 +18692,7 @@ type ZodSchemaErrorPropertyStyle = [] | [{
18692
18692
  example?: string;
18693
18693
  }];
18694
18694
  // Names of all the configs
18695
- type ConfigNames = 'anolilab/antfu' | 'anolilab/astro/setup' | 'anolilab/astro/rules' | 'anolilab/best-practices/rules' | 'anolilab/best-practices/ts-rules' | 'compat/flat/recommended' | 'anolilab/errors/rules' | 'anolilab/errors/ts-rules' | 'anolilab/html/setup' | 'anolilab/no-secrets' | 'anolilab/no-unsanitized/setup' | 'anolilab/promise/rules' | 'anolilab/simple-import-sort' | 'anolilab/sonarjs/plugin' | 'anolilab/sonarjs/rules' | 'anolilab/sonarjs/js-and-ts-rules' | 'anolilab/sonarjs/js-rules' | 'storybook:recommended:setup' | 'storybook:recommended:stories-rules' | 'storybook:recommended:main-rules' | 'anolilab/tailwindcss/setup' | 'anolilab/validate-jsx-nesting/setup' | 'anolilab/variables/rules' | 'anolilab/variables/ts-rules' | 'anolilab/style/rules' | 'anolilab/style/ts-rules' | 'anolilab/eslint-comments/rules' | 'anolilab/formatter/setup' | 'anolilab/imports/setup' | 'anolilab/imports/rules' | 'anolilab/imports/d.ts-rules' | 'anolilab/javascript/setup' | '@eslint/js/recommended' | 'anolilab/jsx-a11y/setup' | 'anolilab/jsdoc/setup' | 'anolilab/jsdoc/js-rules' | 'anolilab/jsonc/json5-rules' | 'anolilab/jsonc/jsonc-rules' | 'anolilab/jsonc/json-rules' | 'anolilab/jsonc/package.json-rules' | 'anolilab/jsonc/tsconfig-json' | 'anolilab/markdown/setup' | 'anolilab/markdown/processor' | 'anolilab/markdown/parser' | 'anolilab/markdown/rules' | 'anolilab/markdown/disables/markdown' | 'anolilab/markdown/disables/code' | 'anolilab/perfectionist/setup' | 'anolilab/perfectionist/rules' | 'anolilab/perfectionist/typescript' | 'anolilab/perfectionist/postcss' | 'anolilab/react/setup' | 'anolilab/react/rules' | 'anolilab/react/jsx' | 'anolilab/react/tsx' | 'anolilab/react/storybook' | 'anolilab/node/setup' | 'anolilab/node/rules' | 'anolilab/stylistic/rules' | 'anolilab/vitest/setup' | 'anolilab/vitest/rules' | 'anolilab/toml' | 'anolilab/regexp/rules' | 'anolilab/typescript/setup' | 'anolilab/typescript/parser' | 'anolilab/typescript/type-aware-parser' | 'typescript-eslint/base' | 'typescript-eslint/eslint-recommended' | 'typescript-eslint/strict' | 'typescript-eslint/base' | 'typescript-eslint/eslint-recommended' | 'typescript-eslint/strict-type-checked-only' | 'anolilab/typescript/rules-type-aware' | 'anolilab/typescript/no-for-of-array/rules' | 'anolilab/typescript/rules' | 'anolilab/unicorn/plugin' | 'anolilab/unicorn/rules' | 'anolilab/unicorn/tsconfig-overrides' | 'anolilab/unicorn/ts-overrides' | 'anolilab/unocss' | 'anolilab/yaml' | 'anolilab/zod/rules';
18695
+ type ConfigNames = 'anolilab/antfu' | 'anolilab/astro/setup' | 'anolilab/astro/rules' | 'anolilab/best-practices/rules' | 'anolilab/best-practices/ts-rules' | 'compat/flat/recommended' | 'anolilab/errors/rules' | 'anolilab/errors/ts-rules' | 'anolilab/html/setup' | 'anolilab/no-secrets' | 'anolilab/no-unsanitized/setup' | 'anolilab/promise/rules' | 'anolilab/simple-import-sort' | 'anolilab/sonarjs/plugin' | 'anolilab/sonarjs/rules' | 'anolilab/sonarjs/js-and-ts-rules' | 'anolilab/sonarjs/js-rules' | 'storybook:recommended:setup' | 'storybook:recommended:stories-rules' | 'storybook:recommended:main-rules' | 'anolilab/tailwindcss/setup' | 'anolilab/validate-jsx-nesting/setup' | 'anolilab/variables/rules' | 'anolilab/variables/ts-rules' | 'anolilab/style/rules' | 'anolilab/style/ts-rules' | 'anolilab/eslint-comments/rules' | 'anolilab/formatter/setup' | 'anolilab/imports/setup' | 'anolilab/imports/rules' | 'anolilab/imports/d.ts-rules' | 'anolilab/javascript/setup' | '@eslint/js/recommended' | 'anolilab/jsx-a11y/setup' | 'anolilab/jsdoc/setup' | 'anolilab/jsdoc/js-rules' | 'anolilab/jsonc/json5-rules' | 'anolilab/jsonc/jsonc-rules' | 'anolilab/jsonc/json-rules' | 'anolilab/jsonc/package.json-rules' | 'anolilab/jsonc/tsconfig-json' | 'anolilab/markdown/setup' | 'anolilab/markdown/processor' | 'anolilab/markdown/parser' | 'anolilab/markdown/rules' | 'anolilab/markdown/disables/markdown' | 'anolilab/markdown/disables/code' | 'anolilab/perfectionist/setup' | 'anolilab/perfectionist/rules' | 'anolilab/perfectionist/typescript' | 'anolilab/perfectionist/postcss' | 'anolilab/react/setup' | 'anolilab/react/rules' | 'anolilab/react/jsx' | 'anolilab/react/tsx' | 'anolilab/node/setup' | 'anolilab/node/rules' | 'anolilab/stylistic/rules' | 'anolilab/vitest/setup' | 'anolilab/vitest/rules' | 'anolilab/toml' | 'anolilab/regexp/rules' | 'anolilab/typescript/setup' | 'anolilab/typescript/parser' | 'anolilab/typescript/type-aware-parser' | 'typescript-eslint/base' | 'typescript-eslint/eslint-recommended' | 'typescript-eslint/strict' | 'typescript-eslint/base' | 'typescript-eslint/eslint-recommended' | 'typescript-eslint/strict-type-checked-only' | 'anolilab/typescript/rules-type-aware' | 'anolilab/typescript/no-for-of-array/rules' | 'anolilab/typescript/rules' | 'anolilab/unicorn/plugin' | 'anolilab/unicorn/rules' | 'anolilab/unicorn/tsconfig-overrides' | 'anolilab/unicorn/ts-overrides' | 'anolilab/unocss' | 'anolilab/yaml' | 'anolilab/zod/rules';
18696
18696
  type VendoredPrettierOptions = Partial<VendoredPrettierOptionsRequired>;
18697
18697
  interface VendoredPrettierOptionsRequired {
18698
18698
  arrowParens: "always" | "avoid";
package/dist/index.js CHANGED
@@ -15,7 +15,7 @@ Please remove "eslint-plugin-typescript-sort-keys" from your package.json, it co
15
15
  If you dont use the new react jsx-runtime in you project, please enable it manually.
16
16
  `))}j=a??j;let X;j&&(console.info(`@anolilab/eslint-config enabling react-compiler plugin
17
17
  `),X=await i(import("eslint-plugin-react-compiler")));const H=l??!1;let V;return H&&(console.info(`@anolilab/eslint-config enabling react-unhookify plugin
18
- `),V=await i(import("@ospm/eslint-plugin-react-unhookify"))),[{name:"anolilab/react/setup",plugins:{react:we(E),"react-hooks":$,"react-perf":F,"react-refresh":q,"react-x":se,"react-you-might-not-need-an-effect":O,...j&&X?.configs.recommended.plugins,...H&&V&&{"react-unhookify":V}}},{files:s,languageOptions:{globals:{...Y.browser},parserOptions:{ecmaFeatures:{jsx:!0}}},name:"anolilab/react/rules",rules:{...S.configs["disable-conflict-eslint-plugin-react"].rules,"class-methods-use-this":["error",{exceptMethods:["render","getInitialState","getDefaultProps","getChildContext","componentWillMount","UNSAFE_componentWillMount","componentDidMount","componentWillReceiveProps","UNSAFE_componentWillReceiveProps","shouldComponentUpdate","componentWillUpdate","UNSAFE_componentWillUpdate","componentDidUpdate","componentWillUnmount","componentDidCatch","getSnapshotBeforeUpdate"]}],"jsx-quotes":["error","prefer-double"],"no-underscore-dangle":["error",{...ce,allow:[...ce.allow,"__REDUX_DEVTOOLS_EXTENSION_COMPOSE__"]}],"react-hooks/exhaustive-deps":"error","react-hooks/rules-of-hooks":"error","react-refresh/only-export-components":N?"off":["error",{allowConstantExport:C,allowExportNames:[...L?["dynamic","dynamicParams","revalidate","fetchCache","runtime","preferredRegion","maxDuration","config","generateStaticParams","metadata","generateMetadata","viewport","generateViewport"]:[],...T||D?["meta","links","headers","loader","action","clientLoader","clientAction","handle","shouldRevalidate"]:[]]}],"react-x/jsx-no-children-prop":"off","react-x/naming-convention-context-name":"error","react-x/no-access-state-in-setstate":"error","react-x/no-array-index-key":"error","react-x/no-children-count":"error","react-x/no-children-for-each":"error","react-x/no-children-map":"error","react-x/no-children-only":"error","react-x/no-children-to-array":"error","react-x/no-class-component":"off","react-x/no-clone-element":"error","react-x/no-component-will-mount":"error","react-x/no-component-will-receive-props":"error","react-x/no-component-will-update":"error","react-x/no-context-provider":"error","react-x/no-create-ref":"error","react-x/no-direct-mutation-state":"error","react-x/no-duplicate-key":"error","react-x/no-forward-ref":"error","react-x/no-implicit-key":"off","react-x/no-missing-component-display-name":"off","react-x/no-missing-context-display-name":"off","react-x/no-missing-key":"error","react-x/no-misused-capture-owner-stack":"off","react-x/no-nested-component-definitions":"error","react-x/no-nested-lazy-component-declarations":"error","react-x/web-api-no-leaked-event-listener":"error","react-x/web-api-no-leaked-interval":"error","react-x/web-api-no-leaked-resize-observer":"error","react-x/web-api-no-leaked-timeout":"error",...!Q&&{"react-x/no-redundant-should-component-update":"error"},"react-x/jsx-no-useless-fragment":"off","react-x/no-set-state-in-component-did-mount":"error","react-x/no-set-state-in-component-did-update":"error","react-x/no-set-state-in-component-will-update":"error","react-x/no-unnecessary-use-prefix":"error","react-x/no-unsafe-component-will-mount":"error","react-x/no-unsafe-component-will-receive-props":"error","react-x/no-unsafe-component-will-update":"error","react-x/no-unstable-context-value":"error","react-x/no-unstable-default-props":"error","react-x/no-unused-class-component-members":"error","react-x/no-unused-state":"error","react-x/no-use-context":"error","react-x/set-state-in-effect":"error","react/boolean-prop-naming":["off",{message:"",propTypeNames:["bool","mutuallyExclusiveTrueProps"],rule:"^(is|has)[A-Z]([A-Za-z0-9]?)+"}],"react/button-has-type":["error",{button:!0,reset:!1,submit:!0}],"react/default-props-match-prop-types":["error",{allowRequiredDefaults:!1}],"react/destructuring-assignment":["error","always"],"react/display-name":["off",{ignoreTranspilerName:!1}],"react/forbid-component-props":["off",{forbid:[]}],"react/forbid-dom-props":["off",{forbid:[]}],"react/forbid-elements":["off",{forbid:[]}],"react/forbid-foreign-prop-types":["error",{allowInPropTypes:!0}],"react/forbid-prop-types":["error",{checkChildContextTypes:!0,checkContextTypes:!0,forbid:["any","array","object"]}],"react/function-component-definition":["error",{namedComponents:"arrow-function",unnamedComponents:"arrow-function"}],"react/jsx-boolean-value":["error","never",{always:[]}],"react/jsx-child-element-spacing":"off","react/jsx-closing-bracket-location":"off","react/jsx-curly-brace-presence":["error",{children:"never",props:"never"}],"react/jsx-curly-newline":"off","react/jsx-curly-spacing":"off","react/jsx-equals-spacing":"off","react/jsx-first-prop-new-line":"off","react/jsx-fragments":["error","syntax"],"react/jsx-handler-names":["off",{eventHandlerPrefix:"handle",eventHandlerPropPrefix:"on"}],"react/jsx-indent":"off","react/jsx-indent-props":"off","react/jsx-key":"off","react/jsx-max-depth":"off","react/jsx-max-props-per-line":"off","react/jsx-newline":"off","react/jsx-no-bind":["error",{allowArrowFunctions:!0,allowBind:!1,allowFunctions:!1,ignoreDOMComponents:!0,ignoreRefs:!0}],"react/jsx-no-comment-textnodes":"off","react/jsx-no-constructed-context-values":"error","react/jsx-no-duplicate-props":"off","react/jsx-no-literals":["off",{noStrings:!0}],"react/jsx-no-script-url":["error",[{name:"Link",props:["to"]}]],"react/jsx-no-target-blank":["error",{enforceDynamicLinks:"always"}],"react/jsx-no-undef":"off","react/jsx-no-useless-fragment":"off","react/jsx-one-expression-per-line":"off","react/jsx-pascal-case":["error",{allowAllCaps:!0,ignore:[]}],"react/jsx-props-no-multi-spaces":"off","react/jsx-props-no-spreading":["error",{custom:"enforce",exceptions:[],explicitSpread:"ignore",html:"enforce"}],"react/jsx-sort-props":"off","react/jsx-space-before-closing":["off","always"],"react/jsx-tag-spacing":"off","react/jsx-uses-react":"off","react/jsx-uses-vars":"off","react/no-access-state-in-setstate":"off","react/no-adjacent-inline-elements":"error","react/no-array-index-key":"off","react/no-children-prop":"off","react/no-danger":"error","react/no-danger-with-children":"error","react/no-deprecated":["error"],"react/no-did-mount-set-state":"off","react/no-did-update-set-state":"error","react/no-direct-mutation-state":"off","react/no-find-dom-node":"error","react/no-is-mounted":"error","react/no-multi-comp":"off","react/no-redundant-should-component-update":"off","react/no-render-return-value":"error","react/no-set-state":"off","react/no-string-refs":"off","react/no-this-in-sfc":"error","react/no-unescaped-entities":"error","react/no-unknown-property":"error","react/no-unsafe":"off","react/no-unused-prop-types":["error",{customValidators:[],skipShapeProps:!0}],"react/no-unused-state":"off","react/no-will-update-set-state":"error","react/prefer-es6-class":["error","always"],"react/prefer-read-only-props":"off","react/prefer-stateless-function":["error",{ignorePureComponents:!0}],"react/prop-types":"off","react/react-in-jsx-scope":z?"off":"error","react/require-default-props":"off","react/require-optimization":["off",{allowDecorators:[]}],"react/require-render-return":"error","react/self-closing-comp":"error","react/sort-comp":["error",{groups:{lifecycle:["displayName","propTypes","contextTypes","childContextTypes","mixins","statics","defaultProps","constructor","getDefaultProps","getInitialState","state","getChildContext","getDerivedStateFromProps","componentWillMount","UNSAFE_componentWillMount","componentDidMount","componentWillReceiveProps","UNSAFE_componentWillReceiveProps","shouldComponentUpdate","componentWillUpdate","UNSAFE_componentWillUpdate","getSnapshotBeforeUpdate","componentDidUpdate","componentDidCatch","componentWillUnmount"],rendering:["/^render.+$/","render"]},order:["static-variables","static-methods","instance-variables","lifecycle","/^handle.+$/","/^on.+$/","getters","setters","/^(get|set)(?!(InitialState$|DefaultProps$|ChildContext$)).+$/","instance-methods","everything-else","rendering"]}],"react/sort-default-props":["error",{ignoreCase:!0}],"react/sort-prop-types":["off",{callbacksLast:!1,ignoreCase:!0,requiredFirst:!1,sortShapeProp:!0}],"react/state-in-constructor":["error","never"],"react/static-property-placement":["error","static public field"],"react/style-prop-object":"error","react/void-dom-elements-no-children":"error",...j&&X&&{"react-compiler/react-compiler":"error","react-hooks/component-hook-factories":"error","react-hooks/config":"error","react-hooks/error-boundaries":"error","react-hooks/gating":"error","react-hooks/globals":"error","react-hooks/immutability":"error","react-hooks/incompatible-library":"warn","react-hooks/preserve-manual-memoization":"error","react-hooks/purity":"error","react-hooks/refs":"error","react-hooks/set-state-in-effect":"error","react-hooks/set-state-in-render":"error","react-hooks/static-components":"error","react-hooks/unsupported-syntax":"warn","react-hooks/use-memo":"error"},...H&&V&&{"react-unhookify/remove-memo":"error","react-unhookify/remove-use-callback":"error","react-unhookify/remove-use-memo":"error"},...ee(F.configs?.flat?.recommended),...O.configs.recommended.rules,...z&&(E.configs.flat["jsx-runtime"]?.rules??{}),...t},settings:{propWrapperFunctions:["forbidExtraProps","exact","Object.freeze"],react:{version:U??"detect"},"react-x":{version:U??"detect"}}},{files:["**/*.jsx"],languageOptions:{parserOptions:{ecmaFeatures:{jsx:!0},...z&&(E.configs.flat["jsx-runtime"]?.languageOptions.parserOptions??{})}},name:"anolilab/react/jsx",rules:{"react/jsx-closing-tag-location":"off","react/jsx-filename-extension":"off","react/jsx-wrap-multilines":"off","react/no-typos":"error","unicorn/no-null":"off"},settings:{extensions:[".jsx"]}},{files:["**/*.tsx"],name:"anolilab/react/tsx",rules:{"react/default-props-match-prop-types":"off","react/jsx-filename-extension":"off","react/prop-types":"off","react/require-default-props":"off","unicorn/no-null":"off"}},{files:d("storybook"),name:"anolilab/react/storybook",rules:{"react/jsx-props-no-spreading":"off"}},...w?[{files:r,ignores:x,name:"anolilab/react/type-aware-rules",rules:{...P}}]:[]]}),Fr=f("all",async(e,o)=>{const{files:s=o,level:r,overrides:t}=e,n=Ve["flat/recommended"],a={...n.rules};if(r==="warn")for(const l in a)a[l]==="error"&&(a[l]="warn");return[{...n,files:s,name:"anolilab/regexp/rules",rules:{...a,...t}}]}),Nr=f("all",async(e,o)=>{const{files:s=o,overrides:r}=e,t=await i(import("eslint-plugin-simple-import-sort"));return[{files:s,name:"anolilab/simple-import-sort",plugins:{"simple-import-sort":t},rules:{"simple-import-sort/exports":"error","simple-import-sort/imports":"error",...r}}]}),Ur=f("all",async(e,o)=>{const{files:s=o,overrides:r}=e,t=await i(import("eslint-plugin-sonarjs")),n=t.configs?.recommended,a={};return Array.isArray(n)?n.forEach(l=>{Object.assign(a,l.rules)}):Object.assign(a,n?.rules),[{name:"anolilab/sonarjs/plugin",plugins:{sonarjs:t}},{files:s,name:"anolilab/sonarjs/rules",rules:{...a,"sonarjs/file-name-differ-from-class":"off","sonarjs/no-collapsible-if":"error","sonarjs/no-nested-template-literals":"off","sonarjs/no-tab":"error","sonarjs/todo-tag":"off",...r}},{files:d("js_and_ts"),name:"anolilab/sonarjs/js-and-ts-rules",rules:{"sonarjs/cognitive-complexity":["error",15],"sonarjs/no-duplicate-string":"off"}},{files:d("js"),languageOptions:{ecmaVersion:"latest"},name:"anolilab/sonarjs/js-rules",rules:{"sonarjs/no-all-duplicated-branches":"off","sonarjs/no-duplicate-string":"off","sonarjs/public-static-readonly":"off"}}]}),Mr=f("storybook",async e=>{const{overrides:o}=e,s=[...(await i(import("eslint-plugin-storybook"))).configs["flat/recommended"]];return s[0]&&(s[0].rules={...s[0].rules,...o}),s}),Rr=f("jsx_and_tsx",async(e,o)=>{const{files:s=o,overrides:r}=e,t=await i(import("eslint-plugin-tailwindcss")),n=Z(t.configs.recommended);return[{...n,files:s,name:"anolilab/tailwindcss/setup",rules:{...n.rules,...r}}]}),$r=f("all",async(e,o)=>{const{files:s=o,overrides:r}=e,t=await i(import("@tanstack/eslint-plugin-query"));return[{files:s,plugins:{"@tanstack/query":t},rules:{...t.configs.recommended.rules,...r}}]}),Lr=f("all",async(e,o)=>{const{files:s=o,overrides:r}=e,t=await i(import("@tanstack/eslint-plugin-router"));return[{files:s,plugins:{"@tanstack/router":t},rules:{...t.configs.recommended.rules,...r}},{files:["**/routes/**/*.{ts,tsx}"],rules:{"perfectionist/sort-objects":"off","react-refresh/only-export-components":"off"}}]}),Jr=f("vitest",async(e,o)=>{const{files:s=o,overrides:r,packageJson:t}=e,n=await i(import("eslint-plugin-testing-library")),a=y(t,["react","react-dom","eslint-plugin-react"]);return[{files:s,plugins:{"testing-library":n},rules:{...n.configs["flat/dom"].rules,...a&&n.configs["flat/react"].rules,...r}}]}),zr=f("toml",async(e,o)=>{const{files:s=o,overrides:r={},stylistic:t=!0}=e,{indent:n=2}=typeof t=="boolean"?{}:t,[a,l]=await Promise.all([i(import("eslint-plugin-toml")),i(import("toml-eslint-parser"))]);return[{files:s,languageOptions:{parser:l},name:"anolilab/toml",plugins:{toml:a},rules:{...t&&{"@stylistic/spaced-comment":"off"},"toml/comma-style":"error","toml/keys-order":"error","toml/no-space-dots":"error","toml/no-unreadable-number-separator":"error","toml/precision-of-fractional-seconds":"error","toml/precision-of-integer":"error","toml/tables-order":"error","toml/vue-custom-block/no-parsing-error":"error",...t&&{"toml/array-bracket-newline":"error","toml/array-bracket-spacing":"error","toml/array-element-newline":"error","toml/indent":["error",n==="tab"?2:n],"toml/inline-table-curly-spacing":"error","toml/key-spacing":"error","toml/padding-line-between-pairs":"error","toml/padding-line-between-tables":"error","toml/quoted-keys":"error","toml/spaced-comment":"error","toml/table-bracket-spacing":"error"},...r}}]}),Vr=f("ts",async(e,o)=>{const{files:s=o,overrides:r}=e,t=await i(import("eslint-plugin-tsdoc"));return[{files:s,plugins:{tsdoc:t},rules:{"tsdoc/syntax":"error",...r}}]}),pe={"init-declarations":"off","no-catch-shadow":"off","no-delete-var":"error","no-label-var":"error","no-restricted-globals":["error",{message:"Use Number.isFinite instead https://github.com/airbnb/javascript#standard-library--isfinite",name:"isFinite"},{message:"Use Number.isNaN instead https://github.com/airbnb/javascript#standard-library--isnan",name:"isNaN"},...We.map(e=>({message:`Use window.${e} instead. https://github.com/facebook/create-react-app/blob/HEAD/packages/confusing-browser-globals/README.md`,name:e})),{message:"Use `globalThis` instead.",name:"global"},{message:"Use `globalThis` instead.",name:"self"}],"no-shadow":"error","no-shadow-restricted-names":"error","no-undef":"error","no-undef-init":"error","no-undefined":"off","no-unused-vars":"off","no-use-before-define":["error",{classes:!0,functions:!0,variables:!0}]},Br=f("all",async(e,o)=>{const{files:s=o}=e;return[{files:s,name:"anolilab/variables/rules",rules:pe},{files:d("ts"),name:"anolilab/variables/ts-rules",rules:{"no-shadow":"off","no-undef":"off","no-unused-vars":"off","no-use-before-define":"off"}}]}),Wr=f("ts",async(e,o)=>{const{componentExts:s=[],files:r=o,overrides:t,overridesTypeAware:n,parserOptions:a,prettier:l}=e,c=l?await oe():{},m=je,[g,x]=await Promise.all([i(import("typescript-eslint")),i(import("eslint-plugin-no-for-of-array"))]);let w;a?.erasableSyntaxOnly&&(w=await i(import("eslint-plugin-erasable-syntax-only")));const P=e.filesTypeAware??d("ts"),S=[...d("astro"),...d("markdown"),...d("markdown_inline_js_jsx"),...d("js"),...d("jsx"),"**/*.json","**/*.jsonc",...e.ignoresTypeAware??[]],{tsconfigPath:E}=e,{isTypeAware:$=!0}=e,q=(O,C,T)=>{const L=E?process.cwd():Te(Be(import.meta.url));let D={};return O&&E?D={project:E,tsconfigRootDir:L}:O&&(D={projectService:!0,tsconfigRootDir:L}),{files:[...C,...s.map(N=>`**/*.${N}`)],...T&&{ignores:T},languageOptions:{parser:g.parser,parserOptions:{extraFileExtensions:s.map(N=>`.${N}`),sourceType:"module",...D,...a}},name:`anolilab/typescript/${O?"type-aware-parser":"parser"}`}},F=[{files:r,name:"anolilab/typescript/setup",plugins:{"@typescript-eslint":g.plugin,"no-for-of-array":x,...w?.configs.recommended.plugins}},...$?[q(!1,r),q(!0,P,S)]:[q(!1,r)],...g.configs.strict.map(O=>Z(O))];if($){const O=g.configs.strictTypeCheckedOnly.map(C=>Z(C)).map(C=>({...C,files:P,ignores:S}));F.push(...O,{files:[...P,...s.map(C=>`**/*.${C}`)],name:"anolilab/typescript/rules-type-aware",rules:{"@typescript-eslint/no-unnecessary-type-assertion":"error","@typescript-eslint/no-unsafe-argument":"error","@typescript-eslint/no-unsafe-assignment":"error","@typescript-eslint/no-unsafe-call":"error","@typescript-eslint/no-unsafe-member-access":"error","@typescript-eslint/no-unsafe-return":"error","@typescript-eslint/no-unsafe-type-assertion":"error","@typescript-eslint/prefer-nullish-coalescing":"error","@typescript-eslint/prefer-optional-chain":"error",...n}},{files:P,ignores:S,name:"anolilab/typescript/no-for-of-array/rules",rules:{"no-for-of-array/no-for-of-array":"off"}})}return F.push({files:r,name:"anolilab/typescript/rules",rules:{"@typescript-eslint/adjacent-overload-signatures":"error","@typescript-eslint/array-type":["error",{default:"array",readonly:"generic"}],"@typescript-eslint/ban-ts-comment":["error",{minimumDescriptionLength:3,"ts-check":!1,"ts-expect-error":"allow-with-description","ts-ignore":"allow-with-description","ts-nocheck":!0}],"@typescript-eslint/consistent-generic-constructors":"error","@typescript-eslint/consistent-type-imports":["error",{disallowTypeAnnotations:!1,fixStyle:"separate-type-imports",prefer:"type-imports"}],"@typescript-eslint/explicit-member-accessibility":"error","@typescript-eslint/explicit-module-boundary-types":"error","@typescript-eslint/member-ordering":["error",{default:["public-static-field","protected-static-field","private-static-field","public-static-method","protected-static-method","private-static-method","public-instance-field","protected-instance-field","private-instance-field","constructor","public-instance-method","protected-instance-method","private-instance-method"]}],"@typescript-eslint/method-signature-style":"error","@typescript-eslint/naming-convention":["error",{format:["camelCase","PascalCase","UPPER_CASE"],selector:"variable"},{format:["camelCase","PascalCase"],selector:"function"},{format:["PascalCase"],selector:"typeLike"}],"@typescript-eslint/no-array-constructor":m["no-array-constructor"],"@typescript-eslint/no-confusing-non-null-assertion":"error","@typescript-eslint/no-deprecated":"off","@typescript-eslint/no-dupe-class-members":le["no-dupe-class-members"],"@typescript-eslint/no-duplicate-enum-values":"error","@typescript-eslint/no-dynamic-delete":"warn","@typescript-eslint/no-empty-function":B["no-empty-function"],"@typescript-eslint/no-explicit-any":["error",{fixToUnknown:!1,ignoreRestArgs:!0}],"@typescript-eslint/no-extra-non-null-assertion":"error","@typescript-eslint/no-import-type-side-effects":"error","@typescript-eslint/no-invalid-void-type":"warn","@typescript-eslint/no-loop-func":B["no-loop-func"],"@typescript-eslint/no-magic-numbers":B["no-magic-numbers"],"@typescript-eslint/no-misused-new":"error","@typescript-eslint/no-namespace":"error","@typescript-eslint/no-non-null-asserted-nullish-coalescing":"warn","@typescript-eslint/no-non-null-asserted-optional-chain":"error","@typescript-eslint/no-non-null-assertion":"error","@typescript-eslint/no-redeclare":B["no-redeclare"],"@typescript-eslint/no-require-imports":"error","@typescript-eslint/no-restricted-types":["error",{types:{object:{message:"Describe the properties you actually read, or use `Record<string, T>` with a concrete `T`."},"Record<string, any>":{message:"Describe the keys you actually read, or use a concrete value type."},"Record<string, unknown>":{message:"Describe the keys you actually read, or use a concrete value type."}}}],"@typescript-eslint/no-shadow":pe["no-shadow"],"@typescript-eslint/no-this-alias":"error","@typescript-eslint/no-unnecessary-type-constraint":"error","@typescript-eslint/no-unsafe-declaration-merging":"error","@typescript-eslint/no-unused-expressions":B["no-unused-expressions"],"@typescript-eslint/no-unused-vars":"off","@typescript-eslint/no-use-before-define":pe["no-use-before-define"],"@typescript-eslint/no-useless-constructor":le["no-useless-constructor"],"@typescript-eslint/no-useless-empty-export":"error","@typescript-eslint/non-nullable-type-assertion-style":"off","@typescript-eslint/prefer-enum-initializers":"error","@typescript-eslint/prefer-function-type":"error","@typescript-eslint/prefer-string-starts-ends-with":"off","@typescript-eslint/prefer-ts-expect-error":"off","@typescript-eslint/return-await":B["no-return-await"],"@typescript-eslint/semi":"off","@typescript-eslint/sort-type-constituents":"off","@typescript-eslint/space-before-function-paren":"off","@typescript-eslint/space-infix-ops":m["space-infix-ops"],...w?.configs.recommended.rules,...t,...c}}),F}),Gr=/(FUNDING\.yml|README\.md|CHANGELOG\.md|CONTRIBUTING\.md|CODE_OF_CONDUCT\.md|SECURITY\.md|LICENSE)/u,Xr=f("all",async(e,o)=>{const{files:s=o,overrides:r,packageJson:t,prettier:n,stylistic:a=!0}=e,{indent:l=4}=typeof a=="boolean"?{}:a,c=n?await oe():{},m=await i(import("eslint-plugin-unicorn"));return[{languageOptions:{globals:Y.builtin},name:"anolilab/unicorn/plugin",plugins:{unicorn:m}},{files:s,name:"anolilab/unicorn/rules",rules:{...m.configs.recommended.rules,"unicorn/better-regex":"off","unicorn/consistent-destructuring":"off","unicorn/consistent-function-scoping":"off","unicorn/filename-case":["error",{case:"kebabCase",ignore:[Gr]}],"unicorn/import-style":["error",{styles:{"node:path":{named:!0},"node:util":{named:!0},path:{named:!0},util:{named:!0}}}],"unicorn/name-replacements":["error",{allowList:{e18e:!0,i:!0,j:!0},replacements:{args:!1,dev:!1,dist:!1,env:!1,params:!1,pkg:!1,prop:!1,props:!1,ref:!1,src:!1,utils:!1}}],"unicorn/no-abusive-eslint-disable":"error","unicorn/no-for-each":"off","unicorn/no-instanceof-builtins":"error","unicorn/no-nested-ternary":"off","unicorn/no-useless-undefined":"off","unicorn/prefer-at":"off","unicorn/prefer-json-parse-buffer":"off","unicorn/prefer-module":t.type==="module"?"error":"off","unicorn/prefer-node-protocol":"error","unicorn/prefer-ternary":["error","only-single-line"],...n?c:{"unicorn/template-indent":["error",{indent:l}]},...r}},{files:["tsconfig.dev.json","tsconfig.prod.json"],name:"anolilab/unicorn/tsconfig-overrides",rules:{"unicorn/name-replacements":"off"}},{files:["**/*.ts","**/*.tsx","**/*.mts","**/*.cts"],name:"anolilab/unicorn/ts-overrides",rules:{"unicorn/import-style":"off"}}]}),Hr=async e=>{const{attributify:o=!0,strict:s=!1}=e;return[{name:"anolilab/unocss",plugins:{unocss:await i(import("@unocss/eslint-plugin"))},rules:{"unocss/order":"warn",...o&&{"unocss/order-attributify":"warn"},...s&&{"unocss/blocklist":"error"}}}]},Kr=f("all",async(e,o)=>{const{files:s=o,isInEditor:r,overrides:t}=e,n=await i(import("eslint-plugin-unused-imports"));return[{files:s,name:"anolilab/unused-imports/rules",plugins:{"unused-imports":n},rules:{"@typescript-eslint/no-unused-vars":"off","no-unused-vars":"off","unused-imports/no-unused-imports":r?"off":"error","unused-imports/no-unused-vars":[r?"warn":"error",{args:"after-used",argsIgnorePattern:"^_",vars:"all",varsIgnorePattern:"^_"}],...t}}]}),Qr=f("jsx_and_tsx",async(e,o)=>{const{files:s=o,overrides:r}=e,t=await i(import("eslint-plugin-validate-jsx-nesting"));return[{files:s,name:"anolilab/validate-jsx-nesting/setup",plugins:{"validate-jsx-nesting":t},rules:{"validate-jsx-nesting/no-invalid-jsx-nesting":"error",...r}}]}),Yr={suite:!0,test:!0,chai:!0,describe:!0,it:!0,expectTypeOf:!0,assertType:!0,expect:!0,assert:!0,vitest:!0,vi:!0,beforeAll:!0,afterAll:!0,beforeEach:!0,afterEach:!0,aroundEach:!0,aroundAll:!0,onTestFailed:!0,onTestFinished:!0},he={},Zr=f("vitest",async(e,o)=>{const{files:s=o,isInEditor:r=!1,overrides:t,prettier:n,tsconfigPath:a}=e,[l,c]=await Promise.all([i(import("@vitest/eslint-plugin")),i(import("eslint-plugin-no-only-tests"))]);return he.test??={...l,rules:{...l.rules,...ee(c)}},[{name:"anolilab/vitest/setup",plugins:{vitest:he.test}},{files:s,...a&&{...l.configs.env,settings:{vitest:{typecheck:!0}}},languageOptions:{globals:{...Yr}},name:"anolilab/vitest/rules",rules:{...l.configs.all.rules,...l.configs.recommended.rules,"@typescript-eslint/explicit-function-return-type":"off","@typescript-eslint/naming-convention":"off","antfu/no-top-level-await":"off","import/no-extraneous-dependencies":"off","n/no-unsupported-features/node-builtins":"off","n/prefer-global/process":"off","no-unused-expressions":"off","sonarjs/no-control-regex":"off","unicorn/no-null":"off","unicorn/prefer-module":"off","unused-imports/no-unused-vars":"off","vitest/consistent-test-it":["error",{fn:"it",withinDescribe:"it"}],"vitest/max-expects":"off","vitest/no-hooks":"off","vitest/no-mocks-import":"off","vitest/no-only-tests":r?"off":"error","vitest/no-restricted-vi-methods":"off","vitest/no-standalone-expect":["error",{additionalTestBlockFunctions:[]}],"vitest/valid-expect":["error",{alwaysAwait:!0,maxArgs:2,minArgs:1}],"vitest/valid-title":"off",...!a&&{"vitest/prefer-describe-function-title":"off","vitest/prefer-vi-mocked":"off"},"vitest/require-mock-type-parameters":"off",...t,...n&&{"vitest/padding-around-after-all-blocks":"off","vitest/padding-around-after-each-blocks":"off","vitest/padding-around-all":"off","vitest/padding-around-before-all-blocks":"off","vitest/padding-around-before-each-blocks":"off","vitest/padding-around-describe-blocks":"off","vitest/padding-around-expect-blocks":"off","vitest/padding-around-test-blocks":"off"}}}]}),eo=f("yaml",async(e,o)=>{const{files:s=o,overrides:r={},prettier:t,stylistic:n=!0}=e,{indent:a=4,quotes:l="double"}=typeof n=="boolean"?{}:n,[c,m]=await Promise.all([i(import("eslint-plugin-yml")),i(import("yaml-eslint-parser"))]),g={};if(t){const x=c.configs.prettier;Array.isArray(x)?x.forEach(w=>{Object.assign(g,w.rules)}):Object.assign(g,x.rules)}return[{files:s,languageOptions:{parser:m},name:"anolilab/yaml",plugins:{yaml:c},rules:{"@stylistic/spaced-comment":"off","yaml/block-mapping":"error","yaml/block-sequence":"error","yaml/no-empty-key":"error","yaml/no-empty-sequence-entry":"error","yaml/no-irregular-whitespace":"error","yaml/plain-scalar":["error","never"],"yaml/vue-custom-block/no-parsing-error":"error",...n&&{"yaml/block-mapping-question-indicator-newline":"error","yaml/block-sequence-hyphen-indicator-newline":"error","yaml/flow-mapping-curly-newline":"error","yaml/flow-mapping-curly-spacing":"error","yaml/flow-sequence-bracket-newline":"error","yaml/flow-sequence-bracket-spacing":"error","yaml/indent":[t?"off":"error",a==="tab"?2:a],"yaml/key-spacing":"error","yaml/no-tab-indent":"error","yaml/quotes":["error",{avoidEscape:!0,prefer:l==="backtick"?"single":l}],"yaml/spaced-comment":"error"},...g,...r}}]}),ro=f("all",async(e,o)=>{const{files:s=o,overrides:r}=e,t=await i(import("eslint-plugin-you-dont-need-lodash-underscore"));return[{files:s,plugins:{"you-dont-need-lodash-underscore":we(t)},rules:{...ee(t.configs?.all),...r}}]}),oo=f("all",async(e,o)=>{const{files:s=o,overrides:r}=e,t=await i(import("eslint-plugin-zod"));return[{...t.configs.recommended,files:s,name:"anolilab/zod/rules",rules:{...t.configs.recommended.rules,...r}}]}),so=()=>!!(process.env.GIT_PARAMS??process.env.VSCODE_GIT_COMMAND??process.env.npm_lifecycle_script?.startsWith("lint-staged")??!1),to=()=>process.env.CI||so()?!1:!!(process.env.VSCODE_PID??process.env.VSCODE_CWD??process.env.JETBRAINS_IDE??process.env.VIM??process.env.NVIM),no=["name","languageOptions","linterOptions","processor","plugins","rules","settings"],W=(e,o)=>typeof e[o]=="boolean"?{}:e[o]||{},u=(e,o)=>{const s=W(e,o),r={};return R(s)&&R(s.overrides)&&Object.assign(r,s.overrides),r},b=(e,o)=>{const s=W(e,o);if(!R(s)||!("files"in s))return;const{files:r}=s;return typeof r=="string"?[r]:Array.isArray(r)?r.filter(t=>typeof t=="string"):void 0},jo=async(e={},...o)=>{if("files"in e)throw new Error('[@anolilab/eslint-config] The first argument should not contain the "files" property as the options are supposed to be global. Place it in the second or later config instead.');const s=e.cwd??process.cwd(),r=await qe(ie(s,"package.json"),{resolveCatalogs:!0}),t=r.packageManager?.startsWith("pnpm"),n=y(r,["prettier"]),a=y(r,["oxfmt","@anolilab/oxfmt-config"]),l=n||a,c=y(r,["@anolilab/eslint-config"]),m=y(r,["react","react-dom"]),g=r.dependencies?.react??r.devDependencies?.react,x=y(r,["react-compiler-runtime"]);let w=!1,P=!1;const S=r.dependencies?.tailwindcss??r.devDependencies?.tailwindcss;if(S){const p=be(S);p?.major&&p.major<=3&&(w=!0),p?.major&&p.major>=4&&(P=!0)}const{astro:E=y(r,["astro"]),componentExts:$=[],css:q=y(r,["postcss","cssnano"]),e18e:F=!0,gitignore:O=!0,html:C=!1,jsx:T=y(r,["eslint-plugin-jsx-a11y","eslint-plugin-validate-jsx-nesting"])||m,lodash:L=y(r,["lodash","underscore","lodash-es","@types/lodash","lodash.chunk","lodash.compact","lodash.concat","lodash.difference","lodash.differenceby","lodash.differencewith","lodash.drop","lodash.dropright","lodash.droprightwhile","lodash.dropwhile","lodash.fill","lodash.findindex","lodash.findlastindex","lodash.flatten","lodash.flattendeep","lodash.flattendepth","lodash.frompairs","lodash.head","lodash.indexof","lodash.initial","lodash.intersection","lodash.intersectionby","lodash.intersectionwith","lodash.join","lodash.last","lodash.lastindexof","lodash.nth","lodash.pull","lodash.pullall","lodash.pullallby","lodash.pullallwith","lodash.pullat","lodash.remove","lodash.reverse","lodash.slice","lodash.sortedindex","lodash.sortedindexby","lodash.sortedindexof","lodash.sortedlastindex","lodash.sortedlastindexby","lodash.sortedlastindexof","lodash.sorteduniq","lodash.sorteduniqby","lodash.tail","lodash.take","lodash.takeright","lodash.takerightwhile","lodash.takewhile","lodash.union","lodash.unionby","lodash.unionwith","lodash.uniq","lodash.uniqby","lodash.uniqwith","lodash.unzip","lodash.unzipwith","lodash.without","lodash.xor","lodash.xorby","lodash.xorwith","lodash.zip","lodash.zipobject","lodash.zipobjectdeep","lodash.zipwith","lodash.countby","lodash.every","lodash.filter","lodash.find","lodash.findlast","lodash.flatmap","lodash.flatmapdeep","lodash.flatmapdepth","lodash.foreach","lodash.foreachright","lodash.groupby","lodash.includes","lodash.invokemap","lodash.keyby","lodash.map","lodash.orderby","lodash.partition","lodash.reduce","lodash.reduceright","lodash.reject","lodash.sample","lodash.samplesize","lodash.shuffle","lodash.size","lodash.some","lodash.sortby","lodash.now","lodash.after","lodash.ary","lodash.before","lodash.bind","lodash.bindkey","lodash.curry","lodash.curryright","lodash.debounce","lodash.defer","lodash.delay","lodash.flip","lodash.memoize","lodash.negate","lodash.once","lodash.overargs","lodash.partial","lodash.partialright","lodash.rearg","lodash.rest","lodash.spread","lodash.throttle","lodash.unary","lodash.wrap","lodash.castarray","lodash.clone","lodash.clonedeep","lodash.clonedeepwith","lodash.clonewith","lodash.conformsto","lodash.eq","lodash.gt","lodash.gte","lodash.isarguments","lodash.isarray","lodash.isarraybuffer","lodash.isarraylike","lodash.isarraylikeobject","lodash.isboolean","lodash.isbuffer","lodash.isdate","lodash.iselement","lodash.isempty","lodash.isequal","lodash.isequalwith","lodash.iserror","lodash.isfinite","lodash.isfunction","lodash.isinteger","lodash.islength","lodash.ismap","lodash.ismatch","lodash.ismatchwith","lodash.isnan","lodash.isnative","lodash.isnil","lodash.isnull","lodash.isnumber","lodash.isobject","lodash.isobjectlike","lodash.isplainobject","lodash.isregexp","lodash.issafeinteger","lodash.isset","lodash.isstring","lodash.issymbol","lodash.istypedarray","lodash.isundefined","lodash.isweakmap","lodash.isweakset","lodash.lt","lodash.lte","lodash.toarray","lodash.tofinite","lodash.tointeger","lodash.tolength","lodash.tonumber","lodash.toplainobject","lodash.tosafeinteger","lodash.tostring","lodash.add","lodash.ceil","lodash.divide","lodash.floor","lodash.max","lodash.maxby","lodash.mean","lodash.meanby","lodash.min","lodash.minby","lodash.multiply","lodash.round","lodash.subtract","lodash.sum","lodash.sumby","lodash.clamp","lodash.inrange","lodash.random","lodash.assign","lodash.assignin","lodash.assigninwith","lodash.assignwith","lodash.at","lodash.create","lodash.defaults","lodash.defaultsdeep","lodash.findkey","lodash.findlastkey","lodash.forin","lodash.forinright","lodash.forown","lodash.forownright","lodash.functions","lodash.functionsin","lodash.get","lodash.has","lodash.hasin","lodash.invert","lodash.invertby","lodash.invoke","lodash.keys","lodash.keysin","lodash.mapkeys","lodash.mapvalues","lodash.merge","lodash.mergewith","lodash.omit","lodash.omitby","lodash.pick","lodash.pickby","lodash.result","lodash.set","lodash.setwith","lodash.topairs","lodash.topairsin","lodash.transform","lodash.unset","lodash.update","lodash.updatewith","lodash.values","lodash.valuesin","lodash.chain","lodash.tap","lodash.thru","lodash.camelcase","lodash.capitalize","lodash.deburr","lodash.endswith","lodash.escape","lodash.escaperegexp","lodash.kebabcase","lodash.lowercase","lodash.lowerfirst","lodash.pad","lodash.padend","lodash.padstart","lodash.parseint","lodash.repeat","lodash.replace","lodash.snakecase","lodash.split","lodash.startcase","lodash.startswith","lodash.template","lodash.tolower","lodash.toupper","lodash.trim","lodash.trimend","lodash.trimstart","lodash.truncate","lodash.unescape","lodash.uppercase","lodash.upperfirst","lodash.words","lodash.attempt","lodash.bindall","lodash.cond","lodash.conforms","lodash.constant","lodash.defaultto","lodash.flow","lodash.flowright","lodash.identity","lodash.iteratee","lodash.matches","lodash.matchesproperty","lodash.method","lodash.methodof","lodash.mixin","lodash.noconflict","lodash.noop","lodash.ntharg","lodash.over","lodash.overevery","lodash.oversome","lodash.property","lodash.propertyof","lodash.range","lodash.rangeright","lodash.runincontext","lodash.stubarray","lodash.stubfalse","lodash.stubobject","lodash.stubstring","lodash.stubtrue","lodash.times","lodash.topath","lodash.uniqueid"]),oxlint:D=y(r,["oxlint","@anolilab/oxlint-config"]),playwright:N=y(r,["playwright","eslint-plugin-playwright"]),pnpm:se=t,react:J=m||y(r,["eslint-plugin-react","eslint-plugin-react-hooks","eslint-plugin-react-refresh","@eslint-react/eslint-plugin","eslint-plugin-react-perf","eslint-plugin-react-you-might-not-need-an-effect"]),regexp:Q=!0,silent:G=!1,storybook:U=y(r,["storybook","eslint-plugin-storybook"]),tailwindcss:j=w||P,tanstackQuery:z=y(r,["@tanstack/react-query"]),tanstackRouter:X=y(r,["@tanstack/react-router"]),testingLibrary:H=y(r,["@testing-library/dom","@testing-library/react"]),tsdoc:V=!1,typescript:_=y(r,["typescript"]),unicorn:ke=!0,unocss:fe=!1,vitest:Oe=y(r,["vitest"]),zod:de=y(r,["zod"])}=e,Pe=e.reactCompiler,K=W(e,"react"),Ce="reactVersion"in K?K.reactVersion:void 0,_e="reactCompiler"in K?K.reactCompiler:void 0,Se="reactUnhookify"in K?K.reactUnhookify:void 0,Ee=Ce??g,ue=Pe??_e??x,me=Se??!1;if(c){let p=[];D&&p.push("eslint-plugin-oxlint"),de&&p.push("eslint-plugin-zod"),fe&&p.push("@unocss/eslint-plugin"),z&&p.push("@tanstack/eslint-plugin-query"),X&&p.push("@tanstack/eslint-plugin-router"),(q||j)&&(p.push("@eslint/css"),(j==="v4"||j&&P)&&p.push("tailwind-csstree")),(j==="v3"||j&&w)&&p.push("eslint-plugin-tailwindcss"),U&&p.push("eslint-plugin-storybook"),J&&p.push("eslint-plugin-react","eslint-plugin-react-hooks","eslint-plugin-react-refresh","@eslint-react/eslint-plugin","eslint-plugin-react-perf","eslint-plugin-react-you-might-not-need-an-effect"),J&&ue&&p.push("eslint-plugin-react-compiler"),J&&me&&p.push("@ospm/eslint-plugin-react-unhookify"),H&&p.push("eslint-plugin-testing-library"),T&&p.push("eslint-plugin-jsx-a11y","eslint-plugin-validate-jsx-nesting"),L&&p.push("eslint-plugin-you-dont-need-lodash-underscore"),V&&p.push("eslint-plugin-tsdoc"),e.formatters&&p.push("eslint-plugin-format"),N&&p.push("eslint-plugin-playwright"),E&&(p.push("eslint-plugin-astro","astro-eslint-parser"),typeof e.formatters=="object"&&e.formatters.astro&&p.push("prettier-plugin-astro")),typeof e.formatters=="object"&&(e.formatters.markdown&&e.formatters.slidev&&p.push("prettier-plugin-slidev"),(e.formatters.xml||e.formatters.svg)&&p.push("@prettier/plugin-xml")),p=p.filter(Boolean),p.length>0&&await Fe(r,p,"devDependencies",{confirm:{message:k=>`@anolilab/eslint-config requires the following ${k.length===1?"package":"packages"} to be installed:
18
+ `),V=await i(import("@ospm/eslint-plugin-react-unhookify"))),[{name:"anolilab/react/setup",plugins:{react:we(E),"react-hooks":$,"react-perf":F,"react-refresh":q,"react-x":se,"react-you-might-not-need-an-effect":O,...j&&X?.configs.recommended.plugins,...H&&V&&{"react-unhookify":V}}},{files:s,languageOptions:{globals:{...Y.browser},parserOptions:{ecmaFeatures:{jsx:!0}}},name:"anolilab/react/rules",rules:{...S.configs["disable-conflict-eslint-plugin-react"].rules,"class-methods-use-this":["error",{exceptMethods:["render","getInitialState","getDefaultProps","getChildContext","componentWillMount","UNSAFE_componentWillMount","componentDidMount","componentWillReceiveProps","UNSAFE_componentWillReceiveProps","shouldComponentUpdate","componentWillUpdate","UNSAFE_componentWillUpdate","componentDidUpdate","componentWillUnmount","componentDidCatch","getSnapshotBeforeUpdate"]}],"jsx-quotes":["error","prefer-double"],"no-underscore-dangle":["error",{...ce,allow:[...ce.allow,"__REDUX_DEVTOOLS_EXTENSION_COMPOSE__"]}],"react-hooks/exhaustive-deps":"error","react-hooks/rules-of-hooks":"error","react-refresh/only-export-components":N?"off":["error",{allowConstantExport:C,allowExportNames:[...L?["dynamic","dynamicParams","revalidate","fetchCache","runtime","preferredRegion","maxDuration","config","generateStaticParams","metadata","generateMetadata","viewport","generateViewport"]:[],...T||D?["meta","links","headers","loader","action","clientLoader","clientAction","handle","shouldRevalidate"]:[]]}],"react-x/jsx-no-children-prop":"off","react-x/naming-convention-context-name":"error","react-x/no-access-state-in-setstate":"error","react-x/no-array-index-key":"error","react-x/no-children-count":"error","react-x/no-children-for-each":"error","react-x/no-children-map":"error","react-x/no-children-only":"error","react-x/no-children-to-array":"error","react-x/no-class-component":"off","react-x/no-clone-element":"error","react-x/no-component-will-mount":"error","react-x/no-component-will-receive-props":"error","react-x/no-component-will-update":"error","react-x/no-context-provider":"error","react-x/no-create-ref":"error","react-x/no-direct-mutation-state":"error","react-x/no-duplicate-key":"error","react-x/no-forward-ref":"error","react-x/no-implicit-key":"off","react-x/no-missing-component-display-name":"off","react-x/no-missing-context-display-name":"off","react-x/no-missing-key":"error","react-x/no-misused-capture-owner-stack":"off","react-x/no-nested-component-definitions":"error","react-x/no-nested-lazy-component-declarations":"error","react-x/web-api-no-leaked-event-listener":"error","react-x/web-api-no-leaked-interval":"error","react-x/web-api-no-leaked-resize-observer":"error","react-x/web-api-no-leaked-timeout":"error",...!Q&&{"react-x/no-redundant-should-component-update":"error"},"react-x/jsx-no-useless-fragment":"off","react-x/no-set-state-in-component-did-mount":"error","react-x/no-set-state-in-component-did-update":"error","react-x/no-set-state-in-component-will-update":"error","react-x/no-unnecessary-use-prefix":"error","react-x/no-unsafe-component-will-mount":"error","react-x/no-unsafe-component-will-receive-props":"error","react-x/no-unsafe-component-will-update":"error","react-x/no-unstable-context-value":"error","react-x/no-unstable-default-props":"error","react-x/no-unused-class-component-members":"error","react-x/no-unused-state":"error","react-x/no-use-context":"error","react-x/set-state-in-effect":"error","react/boolean-prop-naming":["off",{message:"",propTypeNames:["bool","mutuallyExclusiveTrueProps"],rule:"^(is|has)[A-Z]([A-Za-z0-9]?)+"}],"react/button-has-type":["error",{button:!0,reset:!1,submit:!0}],"react/default-props-match-prop-types":["error",{allowRequiredDefaults:!1}],"react/destructuring-assignment":["error","always"],"react/display-name":["off",{ignoreTranspilerName:!1}],"react/forbid-component-props":["off",{forbid:[]}],"react/forbid-dom-props":["off",{forbid:[]}],"react/forbid-elements":["off",{forbid:[]}],"react/forbid-foreign-prop-types":["error",{allowInPropTypes:!0}],"react/forbid-prop-types":["error",{checkChildContextTypes:!0,checkContextTypes:!0,forbid:["any","array","object"]}],"react/function-component-definition":["error",{namedComponents:"arrow-function",unnamedComponents:"arrow-function"}],"react/jsx-boolean-value":["error","never",{always:[]}],"react/jsx-child-element-spacing":"off","react/jsx-closing-bracket-location":"off","react/jsx-curly-brace-presence":["error",{children:"never",props:"never"}],"react/jsx-curly-newline":"off","react/jsx-curly-spacing":"off","react/jsx-equals-spacing":"off","react/jsx-first-prop-new-line":"off","react/jsx-fragments":["error","syntax"],"react/jsx-handler-names":["off",{eventHandlerPrefix:"handle",eventHandlerPropPrefix:"on"}],"react/jsx-indent":"off","react/jsx-indent-props":"off","react/jsx-key":"off","react/jsx-max-depth":"off","react/jsx-max-props-per-line":"off","react/jsx-newline":"off","react/jsx-no-bind":["error",{allowArrowFunctions:!0,allowBind:!1,allowFunctions:!1,ignoreDOMComponents:!0,ignoreRefs:!0}],"react/jsx-no-comment-textnodes":"off","react/jsx-no-constructed-context-values":"error","react/jsx-no-duplicate-props":"off","react/jsx-no-literals":["off",{noStrings:!0}],"react/jsx-no-script-url":["error",[{name:"Link",props:["to"]}]],"react/jsx-no-target-blank":["error",{enforceDynamicLinks:"always"}],"react/jsx-no-undef":"off","react/jsx-no-useless-fragment":"off","react/jsx-one-expression-per-line":"off","react/jsx-pascal-case":["error",{allowAllCaps:!0,ignore:[]}],"react/jsx-props-no-multi-spaces":"off","react/jsx-props-no-spreading":"off","react/jsx-sort-props":"off","react/jsx-space-before-closing":["off","always"],"react/jsx-tag-spacing":"off","react/jsx-uses-react":"off","react/jsx-uses-vars":"off","react/no-access-state-in-setstate":"off","react/no-adjacent-inline-elements":"error","react/no-array-index-key":"off","react/no-children-prop":"off","react/no-danger":"error","react/no-danger-with-children":"error","react/no-deprecated":["error"],"react/no-did-mount-set-state":"off","react/no-did-update-set-state":"error","react/no-direct-mutation-state":"off","react/no-find-dom-node":"error","react/no-is-mounted":"error","react/no-multi-comp":"off","react/no-redundant-should-component-update":"off","react/no-render-return-value":"error","react/no-set-state":"off","react/no-string-refs":"off","react/no-this-in-sfc":"error","react/no-unescaped-entities":"error","react/no-unknown-property":"error","react/no-unsafe":"off","react/no-unused-prop-types":["error",{customValidators:[],skipShapeProps:!0}],"react/no-unused-state":"off","react/no-will-update-set-state":"error","react/prefer-es6-class":["error","always"],"react/prefer-read-only-props":"off","react/prefer-stateless-function":["error",{ignorePureComponents:!0}],"react/prop-types":"off","react/react-in-jsx-scope":z?"off":"error","react/require-default-props":"off","react/require-optimization":["off",{allowDecorators:[]}],"react/require-render-return":"error","react/self-closing-comp":"error","react/sort-comp":["error",{groups:{lifecycle:["displayName","propTypes","contextTypes","childContextTypes","mixins","statics","defaultProps","constructor","getDefaultProps","getInitialState","state","getChildContext","getDerivedStateFromProps","componentWillMount","UNSAFE_componentWillMount","componentDidMount","componentWillReceiveProps","UNSAFE_componentWillReceiveProps","shouldComponentUpdate","componentWillUpdate","UNSAFE_componentWillUpdate","getSnapshotBeforeUpdate","componentDidUpdate","componentDidCatch","componentWillUnmount"],rendering:["/^render.+$/","render"]},order:["static-variables","static-methods","instance-variables","lifecycle","/^handle.+$/","/^on.+$/","getters","setters","/^(get|set)(?!(InitialState$|DefaultProps$|ChildContext$)).+$/","instance-methods","everything-else","rendering"]}],"react/sort-default-props":["error",{ignoreCase:!0}],"react/sort-prop-types":["off",{callbacksLast:!1,ignoreCase:!0,requiredFirst:!1,sortShapeProp:!0}],"react/state-in-constructor":["error","never"],"react/static-property-placement":["error","static public field"],"react/style-prop-object":"error","react/void-dom-elements-no-children":"error",...j&&X&&{"react-compiler/react-compiler":"error","react-hooks/component-hook-factories":"error","react-hooks/config":"error","react-hooks/error-boundaries":"error","react-hooks/gating":"error","react-hooks/globals":"error","react-hooks/immutability":"error","react-hooks/incompatible-library":"warn","react-hooks/preserve-manual-memoization":"error","react-hooks/purity":"error","react-hooks/refs":"error","react-hooks/set-state-in-effect":"error","react-hooks/set-state-in-render":"error","react-hooks/static-components":"error","react-hooks/unsupported-syntax":"warn","react-hooks/use-memo":"error"},...H&&V&&{"react-unhookify/remove-memo":"error","react-unhookify/remove-use-callback":"error","react-unhookify/remove-use-memo":"error"},...ee(F.configs?.flat?.recommended),"react-perf/jsx-no-jsx-as-prop":"off","react-perf/jsx-no-new-array-as-prop":"off","react-perf/jsx-no-new-function-as-prop":"off","react-perf/jsx-no-new-object-as-prop":"off",...O.configs.recommended.rules,...z&&(E.configs.flat["jsx-runtime"]?.rules??{}),...t},settings:{propWrapperFunctions:["forbidExtraProps","exact","Object.freeze"],react:{version:U??"detect"},"react-x":{version:U??"detect"}}},{files:["**/*.jsx"],languageOptions:{parserOptions:{ecmaFeatures:{jsx:!0},...z&&(E.configs.flat["jsx-runtime"]?.languageOptions.parserOptions??{})}},name:"anolilab/react/jsx",rules:{"react/jsx-closing-tag-location":"off","react/jsx-filename-extension":"off","react/jsx-wrap-multilines":"off","react/no-typos":"error","unicorn/no-null":"off"},settings:{extensions:[".jsx"]}},{files:["**/*.tsx"],name:"anolilab/react/tsx",rules:{"react/default-props-match-prop-types":"off","react/jsx-filename-extension":"off","react/prop-types":"off","react/require-default-props":"off","unicorn/no-null":"off"}},...w?[{files:r,ignores:x,name:"anolilab/react/type-aware-rules",rules:{...P}}]:[]]}),Fr=f("all",async(e,o)=>{const{files:s=o,level:r,overrides:t}=e,n=Ve["flat/recommended"],a={...n.rules};if(r==="warn")for(const l in a)a[l]==="error"&&(a[l]="warn");return[{...n,files:s,name:"anolilab/regexp/rules",rules:{...a,...t}}]}),Nr=f("all",async(e,o)=>{const{files:s=o,overrides:r}=e,t=await i(import("eslint-plugin-simple-import-sort"));return[{files:s,name:"anolilab/simple-import-sort",plugins:{"simple-import-sort":t},rules:{"simple-import-sort/exports":"error","simple-import-sort/imports":"error",...r}}]}),Ur=f("all",async(e,o)=>{const{files:s=o,overrides:r}=e,t=await i(import("eslint-plugin-sonarjs")),n=t.configs?.recommended,a={};return Array.isArray(n)?n.forEach(l=>{Object.assign(a,l.rules)}):Object.assign(a,n?.rules),[{name:"anolilab/sonarjs/plugin",plugins:{sonarjs:t}},{files:s,name:"anolilab/sonarjs/rules",rules:{...a,"sonarjs/file-name-differ-from-class":"off","sonarjs/no-collapsible-if":"error","sonarjs/no-nested-template-literals":"off","sonarjs/no-tab":"error","sonarjs/todo-tag":"off",...r}},{files:d("js_and_ts"),name:"anolilab/sonarjs/js-and-ts-rules",rules:{"sonarjs/cognitive-complexity":["error",15],"sonarjs/no-duplicate-string":"off"}},{files:d("js"),languageOptions:{ecmaVersion:"latest"},name:"anolilab/sonarjs/js-rules",rules:{"sonarjs/no-all-duplicated-branches":"off","sonarjs/no-duplicate-string":"off","sonarjs/public-static-readonly":"off"}}]}),Mr=f("storybook",async e=>{const{overrides:o}=e,s=[...(await i(import("eslint-plugin-storybook"))).configs["flat/recommended"]];return s[0]&&(s[0].rules={...s[0].rules,...o}),s}),Rr=f("jsx_and_tsx",async(e,o)=>{const{files:s=o,overrides:r}=e,t=await i(import("eslint-plugin-tailwindcss")),n=Z(t.configs.recommended);return[{...n,files:s,name:"anolilab/tailwindcss/setup",rules:{...n.rules,...r}}]}),$r=f("all",async(e,o)=>{const{files:s=o,overrides:r}=e,t=await i(import("@tanstack/eslint-plugin-query"));return[{files:s,plugins:{"@tanstack/query":t},rules:{...t.configs.recommended.rules,...r}}]}),Lr=f("all",async(e,o)=>{const{files:s=o,overrides:r}=e,t=await i(import("@tanstack/eslint-plugin-router"));return[{files:s,plugins:{"@tanstack/router":t},rules:{...t.configs.recommended.rules,...r}},{files:["**/routes/**/*.{ts,tsx}"],rules:{"perfectionist/sort-objects":"off","react-refresh/only-export-components":"off"}}]}),Jr=f("vitest",async(e,o)=>{const{files:s=o,overrides:r,packageJson:t}=e,n=await i(import("eslint-plugin-testing-library")),a=y(t,["react","react-dom","eslint-plugin-react"]);return[{files:s,plugins:{"testing-library":n},rules:{...n.configs["flat/dom"].rules,...a&&n.configs["flat/react"].rules,...r}}]}),zr=f("toml",async(e,o)=>{const{files:s=o,overrides:r={},stylistic:t=!0}=e,{indent:n=2}=typeof t=="boolean"?{}:t,[a,l]=await Promise.all([i(import("eslint-plugin-toml")),i(import("toml-eslint-parser"))]);return[{files:s,languageOptions:{parser:l},name:"anolilab/toml",plugins:{toml:a},rules:{...t&&{"@stylistic/spaced-comment":"off"},"toml/comma-style":"error","toml/keys-order":"error","toml/no-space-dots":"error","toml/no-unreadable-number-separator":"error","toml/precision-of-fractional-seconds":"error","toml/precision-of-integer":"error","toml/tables-order":"error","toml/vue-custom-block/no-parsing-error":"error",...t&&{"toml/array-bracket-newline":"error","toml/array-bracket-spacing":"error","toml/array-element-newline":"error","toml/indent":["error",n==="tab"?2:n],"toml/inline-table-curly-spacing":"error","toml/key-spacing":"error","toml/padding-line-between-pairs":"error","toml/padding-line-between-tables":"error","toml/quoted-keys":"error","toml/spaced-comment":"error","toml/table-bracket-spacing":"error"},...r}}]}),Vr=f("ts",async(e,o)=>{const{files:s=o,overrides:r}=e,t=await i(import("eslint-plugin-tsdoc"));return[{files:s,plugins:{tsdoc:t},rules:{"tsdoc/syntax":"error",...r}}]}),pe={"init-declarations":"off","no-catch-shadow":"off","no-delete-var":"error","no-label-var":"error","no-restricted-globals":["error",{message:"Use Number.isFinite instead https://github.com/airbnb/javascript#standard-library--isfinite",name:"isFinite"},{message:"Use Number.isNaN instead https://github.com/airbnb/javascript#standard-library--isnan",name:"isNaN"},...We.map(e=>({message:`Use window.${e} instead. https://github.com/facebook/create-react-app/blob/HEAD/packages/confusing-browser-globals/README.md`,name:e})),{message:"Use `globalThis` instead.",name:"global"},{message:"Use `globalThis` instead.",name:"self"}],"no-shadow":"error","no-shadow-restricted-names":"error","no-undef":"error","no-undef-init":"error","no-undefined":"off","no-unused-vars":"off","no-use-before-define":["error",{classes:!0,functions:!0,variables:!0}]},Br=f("all",async(e,o)=>{const{files:s=o}=e;return[{files:s,name:"anolilab/variables/rules",rules:pe},{files:d("ts"),name:"anolilab/variables/ts-rules",rules:{"no-shadow":"off","no-undef":"off","no-unused-vars":"off","no-use-before-define":"off"}}]}),Wr=f("ts",async(e,o)=>{const{componentExts:s=[],files:r=o,overrides:t,overridesTypeAware:n,parserOptions:a,prettier:l}=e,c=l?await oe():{},m=je,[g,x]=await Promise.all([i(import("typescript-eslint")),i(import("eslint-plugin-no-for-of-array"))]);let w;a?.erasableSyntaxOnly&&(w=await i(import("eslint-plugin-erasable-syntax-only")));const P=e.filesTypeAware??d("ts"),S=[...d("astro"),...d("markdown"),...d("markdown_inline_js_jsx"),...d("js"),...d("jsx"),"**/*.json","**/*.jsonc",...e.ignoresTypeAware??[]],{tsconfigPath:E}=e,{isTypeAware:$=!0}=e,q=(O,C,T)=>{const L=E?process.cwd():Te(Be(import.meta.url));let D={};return O&&E?D={project:E,tsconfigRootDir:L}:O&&(D={projectService:!0,tsconfigRootDir:L}),{files:[...C,...s.map(N=>`**/*.${N}`)],...T&&{ignores:T},languageOptions:{parser:g.parser,parserOptions:{extraFileExtensions:s.map(N=>`.${N}`),sourceType:"module",...D,...a}},name:`anolilab/typescript/${O?"type-aware-parser":"parser"}`}},F=[{files:r,name:"anolilab/typescript/setup",plugins:{"@typescript-eslint":g.plugin,"no-for-of-array":x,...w?.configs.recommended.plugins}},...$?[q(!1,r),q(!0,P,S)]:[q(!1,r)],...g.configs.strict.map(O=>Z(O))];if($){const O=g.configs.strictTypeCheckedOnly.map(C=>Z(C)).map(C=>({...C,files:P,ignores:S}));F.push(...O,{files:[...P,...s.map(C=>`**/*.${C}`)],name:"anolilab/typescript/rules-type-aware",rules:{"@typescript-eslint/no-unnecessary-type-assertion":"error","@typescript-eslint/no-unsafe-argument":"error","@typescript-eslint/no-unsafe-assignment":"error","@typescript-eslint/no-unsafe-call":"error","@typescript-eslint/no-unsafe-member-access":"error","@typescript-eslint/no-unsafe-return":"error","@typescript-eslint/no-unsafe-type-assertion":"error","@typescript-eslint/prefer-nullish-coalescing":"error","@typescript-eslint/prefer-optional-chain":"error",...n}},{files:P,ignores:S,name:"anolilab/typescript/no-for-of-array/rules",rules:{"no-for-of-array/no-for-of-array":"off"}})}return F.push({files:r,name:"anolilab/typescript/rules",rules:{"@typescript-eslint/adjacent-overload-signatures":"error","@typescript-eslint/array-type":["error",{default:"array",readonly:"generic"}],"@typescript-eslint/ban-ts-comment":["error",{minimumDescriptionLength:3,"ts-check":!1,"ts-expect-error":"allow-with-description","ts-ignore":"allow-with-description","ts-nocheck":!0}],"@typescript-eslint/consistent-generic-constructors":"error","@typescript-eslint/consistent-type-imports":["error",{disallowTypeAnnotations:!1,fixStyle:"separate-type-imports",prefer:"type-imports"}],"@typescript-eslint/explicit-member-accessibility":"error","@typescript-eslint/explicit-module-boundary-types":"error","@typescript-eslint/member-ordering":["error",{default:["public-static-field","protected-static-field","private-static-field","public-static-method","protected-static-method","private-static-method","public-instance-field","protected-instance-field","private-instance-field","constructor","public-instance-method","protected-instance-method","private-instance-method"]}],"@typescript-eslint/method-signature-style":"error","@typescript-eslint/naming-convention":["error",{format:["camelCase","PascalCase","UPPER_CASE"],selector:"variable"},{format:["camelCase","PascalCase"],selector:"function"},{format:["PascalCase"],selector:"typeLike"}],"@typescript-eslint/no-array-constructor":m["no-array-constructor"],"@typescript-eslint/no-confusing-non-null-assertion":"error","@typescript-eslint/no-deprecated":"off","@typescript-eslint/no-dupe-class-members":le["no-dupe-class-members"],"@typescript-eslint/no-duplicate-enum-values":"error","@typescript-eslint/no-dynamic-delete":"warn","@typescript-eslint/no-empty-function":B["no-empty-function"],"@typescript-eslint/no-explicit-any":["error",{fixToUnknown:!1,ignoreRestArgs:!0}],"@typescript-eslint/no-extra-non-null-assertion":"error","@typescript-eslint/no-import-type-side-effects":"error","@typescript-eslint/no-invalid-void-type":"warn","@typescript-eslint/no-loop-func":B["no-loop-func"],"@typescript-eslint/no-magic-numbers":B["no-magic-numbers"],"@typescript-eslint/no-misused-new":"error","@typescript-eslint/no-namespace":"error","@typescript-eslint/no-non-null-asserted-nullish-coalescing":"warn","@typescript-eslint/no-non-null-asserted-optional-chain":"error","@typescript-eslint/no-non-null-assertion":"error","@typescript-eslint/no-redeclare":B["no-redeclare"],"@typescript-eslint/no-require-imports":"error","@typescript-eslint/no-restricted-types":["error",{types:{object:{message:"Describe the properties you actually read, or use `Record<string, T>` with a concrete `T`."},"Record<string, any>":{message:"Describe the keys you actually read, or use a concrete value type."},"Record<string, unknown>":{message:"Describe the keys you actually read, or use a concrete value type."}}}],"@typescript-eslint/no-shadow":pe["no-shadow"],"@typescript-eslint/no-this-alias":"error","@typescript-eslint/no-unnecessary-type-constraint":"error","@typescript-eslint/no-unsafe-declaration-merging":"error","@typescript-eslint/no-unused-expressions":B["no-unused-expressions"],"@typescript-eslint/no-unused-vars":"off","@typescript-eslint/no-use-before-define":pe["no-use-before-define"],"@typescript-eslint/no-useless-constructor":le["no-useless-constructor"],"@typescript-eslint/no-useless-empty-export":"error","@typescript-eslint/non-nullable-type-assertion-style":"off","@typescript-eslint/prefer-enum-initializers":"error","@typescript-eslint/prefer-function-type":"error","@typescript-eslint/prefer-string-starts-ends-with":"off","@typescript-eslint/prefer-ts-expect-error":"off","@typescript-eslint/return-await":B["no-return-await"],"@typescript-eslint/semi":"off","@typescript-eslint/sort-type-constituents":"off","@typescript-eslint/space-before-function-paren":"off","@typescript-eslint/space-infix-ops":m["space-infix-ops"],...w?.configs.recommended.rules,...t,...c}}),F}),Gr=/(FUNDING\.yml|README\.md|CHANGELOG\.md|CONTRIBUTING\.md|CODE_OF_CONDUCT\.md|SECURITY\.md|LICENSE)/u,Xr=f("all",async(e,o)=>{const{files:s=o,overrides:r,packageJson:t,prettier:n,stylistic:a=!0}=e,{indent:l=4}=typeof a=="boolean"?{}:a,c=n?await oe():{},m=await i(import("eslint-plugin-unicorn"));return[{languageOptions:{globals:Y.builtin},name:"anolilab/unicorn/plugin",plugins:{unicorn:m}},{files:s,name:"anolilab/unicorn/rules",rules:{...m.configs.recommended.rules,"unicorn/better-regex":"off","unicorn/consistent-destructuring":"off","unicorn/consistent-function-scoping":"off","unicorn/filename-case":["error",{case:"kebabCase",ignore:[Gr]}],"unicorn/import-style":["error",{styles:{"node:path":{named:!0},"node:util":{named:!0},path:{named:!0},util:{named:!0}}}],"unicorn/name-replacements":["error",{allowList:{e18e:!0,i:!0,j:!0},replacements:{args:!1,dev:!1,dist:!1,env:!1,params:!1,pkg:!1,prop:!1,props:!1,ref:!1,src:!1,utils:!1}}],"unicorn/no-abusive-eslint-disable":"error","unicorn/no-for-each":"off","unicorn/no-instanceof-builtins":"error","unicorn/no-nested-ternary":"off","unicorn/no-useless-undefined":"off","unicorn/prefer-at":"off","unicorn/prefer-json-parse-buffer":"off","unicorn/prefer-module":t.type==="module"?"error":"off","unicorn/prefer-node-protocol":"error","unicorn/prefer-ternary":["error","only-single-line"],...n?c:{"unicorn/template-indent":["error",{indent:l}]},...r}},{files:["tsconfig.dev.json","tsconfig.prod.json"],name:"anolilab/unicorn/tsconfig-overrides",rules:{"unicorn/name-replacements":"off"}},{files:["**/*.ts","**/*.tsx","**/*.mts","**/*.cts"],name:"anolilab/unicorn/ts-overrides",rules:{"unicorn/import-style":"off"}}]}),Hr=async e=>{const{attributify:o=!0,strict:s=!1}=e;return[{name:"anolilab/unocss",plugins:{unocss:await i(import("@unocss/eslint-plugin"))},rules:{"unocss/order":"warn",...o&&{"unocss/order-attributify":"warn"},...s&&{"unocss/blocklist":"error"}}}]},Kr=f("all",async(e,o)=>{const{files:s=o,isInEditor:r,overrides:t}=e,n=await i(import("eslint-plugin-unused-imports"));return[{files:s,name:"anolilab/unused-imports/rules",plugins:{"unused-imports":n},rules:{"@typescript-eslint/no-unused-vars":"off","no-unused-vars":"off","unused-imports/no-unused-imports":r?"off":"error","unused-imports/no-unused-vars":[r?"warn":"error",{args:"after-used",argsIgnorePattern:"^_",vars:"all",varsIgnorePattern:"^_"}],...t}}]}),Qr=f("jsx_and_tsx",async(e,o)=>{const{files:s=o,overrides:r}=e,t=await i(import("eslint-plugin-validate-jsx-nesting"));return[{files:s,name:"anolilab/validate-jsx-nesting/setup",plugins:{"validate-jsx-nesting":t},rules:{"validate-jsx-nesting/no-invalid-jsx-nesting":"error",...r}}]}),Yr={suite:!0,test:!0,chai:!0,describe:!0,it:!0,expectTypeOf:!0,assertType:!0,expect:!0,assert:!0,vitest:!0,vi:!0,beforeAll:!0,afterAll:!0,beforeEach:!0,afterEach:!0,aroundEach:!0,aroundAll:!0,onTestFailed:!0,onTestFinished:!0},he={},Zr=f("vitest",async(e,o)=>{const{files:s=o,isInEditor:r=!1,overrides:t,prettier:n,tsconfigPath:a}=e,[l,c]=await Promise.all([i(import("@vitest/eslint-plugin")),i(import("eslint-plugin-no-only-tests"))]);return he.test??={...l,rules:{...l.rules,...ee(c)}},[{name:"anolilab/vitest/setup",plugins:{vitest:he.test}},{files:s,...a&&{...l.configs.env,settings:{vitest:{typecheck:!0}}},languageOptions:{globals:{...Yr}},name:"anolilab/vitest/rules",rules:{...l.configs.all.rules,...l.configs.recommended.rules,"@typescript-eslint/explicit-function-return-type":"off","@typescript-eslint/naming-convention":"off","antfu/no-top-level-await":"off","import/no-extraneous-dependencies":"off","n/no-unsupported-features/node-builtins":"off","n/prefer-global/process":"off","no-unused-expressions":"off","sonarjs/no-control-regex":"off","unicorn/no-null":"off","unicorn/prefer-module":"off","unused-imports/no-unused-vars":"off","vitest/consistent-test-it":["error",{fn:"it",withinDescribe:"it"}],"vitest/max-expects":"off","vitest/no-hooks":"off","vitest/no-mocks-import":"off","vitest/no-only-tests":r?"off":"error","vitest/no-restricted-vi-methods":"off","vitest/no-standalone-expect":["error",{additionalTestBlockFunctions:[]}],"vitest/valid-expect":["error",{alwaysAwait:!0,maxArgs:2,minArgs:1}],"vitest/valid-title":"off",...!a&&{"vitest/prefer-describe-function-title":"off","vitest/prefer-vi-mocked":"off"},"vitest/require-mock-type-parameters":"off",...t,...n&&{"vitest/padding-around-after-all-blocks":"off","vitest/padding-around-after-each-blocks":"off","vitest/padding-around-all":"off","vitest/padding-around-before-all-blocks":"off","vitest/padding-around-before-each-blocks":"off","vitest/padding-around-describe-blocks":"off","vitest/padding-around-expect-blocks":"off","vitest/padding-around-test-blocks":"off"}}}]}),eo=f("yaml",async(e,o)=>{const{files:s=o,overrides:r={},prettier:t,stylistic:n=!0}=e,{indent:a=4,quotes:l="double"}=typeof n=="boolean"?{}:n,[c,m]=await Promise.all([i(import("eslint-plugin-yml")),i(import("yaml-eslint-parser"))]),g={};if(t){const x=c.configs.prettier;Array.isArray(x)?x.forEach(w=>{Object.assign(g,w.rules)}):Object.assign(g,x.rules)}return[{files:s,languageOptions:{parser:m},name:"anolilab/yaml",plugins:{yaml:c},rules:{"@stylistic/spaced-comment":"off","yaml/block-mapping":"error","yaml/block-sequence":"error","yaml/no-empty-key":"error","yaml/no-empty-sequence-entry":"error","yaml/no-irregular-whitespace":"error","yaml/plain-scalar":["error","never"],"yaml/vue-custom-block/no-parsing-error":"error",...n&&{"yaml/block-mapping-question-indicator-newline":"error","yaml/block-sequence-hyphen-indicator-newline":"error","yaml/flow-mapping-curly-newline":"error","yaml/flow-mapping-curly-spacing":"error","yaml/flow-sequence-bracket-newline":"error","yaml/flow-sequence-bracket-spacing":"error","yaml/indent":[t?"off":"error",a==="tab"?2:a],"yaml/key-spacing":"error","yaml/no-tab-indent":"error","yaml/quotes":["error",{avoidEscape:!0,prefer:l==="backtick"?"single":l}],"yaml/spaced-comment":"error"},...g,...r}}]}),ro=f("all",async(e,o)=>{const{files:s=o,overrides:r}=e,t=await i(import("eslint-plugin-you-dont-need-lodash-underscore"));return[{files:s,plugins:{"you-dont-need-lodash-underscore":we(t)},rules:{...ee(t.configs?.all),...r}}]}),oo=f("all",async(e,o)=>{const{files:s=o,overrides:r}=e,t=await i(import("eslint-plugin-zod"));return[{...t.configs.recommended,files:s,name:"anolilab/zod/rules",rules:{...t.configs.recommended.rules,...r}}]}),so=()=>!!(process.env.GIT_PARAMS??process.env.VSCODE_GIT_COMMAND??process.env.npm_lifecycle_script?.startsWith("lint-staged")??!1),to=()=>process.env.CI||so()?!1:!!(process.env.VSCODE_PID??process.env.VSCODE_CWD??process.env.JETBRAINS_IDE??process.env.VIM??process.env.NVIM),no=["name","languageOptions","linterOptions","processor","plugins","rules","settings"],W=(e,o)=>typeof e[o]=="boolean"?{}:e[o]||{},u=(e,o)=>{const s=W(e,o),r={};return R(s)&&R(s.overrides)&&Object.assign(r,s.overrides),r},b=(e,o)=>{const s=W(e,o);if(!R(s)||!("files"in s))return;const{files:r}=s;return typeof r=="string"?[r]:Array.isArray(r)?r.filter(t=>typeof t=="string"):void 0},jo=async(e={},...o)=>{if("files"in e)throw new Error('[@anolilab/eslint-config] The first argument should not contain the "files" property as the options are supposed to be global. Place it in the second or later config instead.');const s=e.cwd??process.cwd(),r=await qe(ie(s,"package.json"),{resolveCatalogs:!0}),t=r.packageManager?.startsWith("pnpm"),n=y(r,["prettier"]),a=y(r,["oxfmt","@anolilab/oxfmt-config"]),l=n||a,c=y(r,["@anolilab/eslint-config"]),m=y(r,["react","react-dom"]),g=r.dependencies?.react??r.devDependencies?.react,x=y(r,["react-compiler-runtime"]);let w=!1,P=!1;const S=r.dependencies?.tailwindcss??r.devDependencies?.tailwindcss;if(S){const p=be(S);p?.major&&p.major<=3&&(w=!0),p?.major&&p.major>=4&&(P=!0)}const{astro:E=y(r,["astro"]),componentExts:$=[],css:q=y(r,["postcss","cssnano"]),e18e:F=!0,gitignore:O=!0,html:C=!1,jsx:T=y(r,["eslint-plugin-jsx-a11y","eslint-plugin-validate-jsx-nesting"])||m,lodash:L=y(r,["lodash","underscore","lodash-es","@types/lodash","lodash.chunk","lodash.compact","lodash.concat","lodash.difference","lodash.differenceby","lodash.differencewith","lodash.drop","lodash.dropright","lodash.droprightwhile","lodash.dropwhile","lodash.fill","lodash.findindex","lodash.findlastindex","lodash.flatten","lodash.flattendeep","lodash.flattendepth","lodash.frompairs","lodash.head","lodash.indexof","lodash.initial","lodash.intersection","lodash.intersectionby","lodash.intersectionwith","lodash.join","lodash.last","lodash.lastindexof","lodash.nth","lodash.pull","lodash.pullall","lodash.pullallby","lodash.pullallwith","lodash.pullat","lodash.remove","lodash.reverse","lodash.slice","lodash.sortedindex","lodash.sortedindexby","lodash.sortedindexof","lodash.sortedlastindex","lodash.sortedlastindexby","lodash.sortedlastindexof","lodash.sorteduniq","lodash.sorteduniqby","lodash.tail","lodash.take","lodash.takeright","lodash.takerightwhile","lodash.takewhile","lodash.union","lodash.unionby","lodash.unionwith","lodash.uniq","lodash.uniqby","lodash.uniqwith","lodash.unzip","lodash.unzipwith","lodash.without","lodash.xor","lodash.xorby","lodash.xorwith","lodash.zip","lodash.zipobject","lodash.zipobjectdeep","lodash.zipwith","lodash.countby","lodash.every","lodash.filter","lodash.find","lodash.findlast","lodash.flatmap","lodash.flatmapdeep","lodash.flatmapdepth","lodash.foreach","lodash.foreachright","lodash.groupby","lodash.includes","lodash.invokemap","lodash.keyby","lodash.map","lodash.orderby","lodash.partition","lodash.reduce","lodash.reduceright","lodash.reject","lodash.sample","lodash.samplesize","lodash.shuffle","lodash.size","lodash.some","lodash.sortby","lodash.now","lodash.after","lodash.ary","lodash.before","lodash.bind","lodash.bindkey","lodash.curry","lodash.curryright","lodash.debounce","lodash.defer","lodash.delay","lodash.flip","lodash.memoize","lodash.negate","lodash.once","lodash.overargs","lodash.partial","lodash.partialright","lodash.rearg","lodash.rest","lodash.spread","lodash.throttle","lodash.unary","lodash.wrap","lodash.castarray","lodash.clone","lodash.clonedeep","lodash.clonedeepwith","lodash.clonewith","lodash.conformsto","lodash.eq","lodash.gt","lodash.gte","lodash.isarguments","lodash.isarray","lodash.isarraybuffer","lodash.isarraylike","lodash.isarraylikeobject","lodash.isboolean","lodash.isbuffer","lodash.isdate","lodash.iselement","lodash.isempty","lodash.isequal","lodash.isequalwith","lodash.iserror","lodash.isfinite","lodash.isfunction","lodash.isinteger","lodash.islength","lodash.ismap","lodash.ismatch","lodash.ismatchwith","lodash.isnan","lodash.isnative","lodash.isnil","lodash.isnull","lodash.isnumber","lodash.isobject","lodash.isobjectlike","lodash.isplainobject","lodash.isregexp","lodash.issafeinteger","lodash.isset","lodash.isstring","lodash.issymbol","lodash.istypedarray","lodash.isundefined","lodash.isweakmap","lodash.isweakset","lodash.lt","lodash.lte","lodash.toarray","lodash.tofinite","lodash.tointeger","lodash.tolength","lodash.tonumber","lodash.toplainobject","lodash.tosafeinteger","lodash.tostring","lodash.add","lodash.ceil","lodash.divide","lodash.floor","lodash.max","lodash.maxby","lodash.mean","lodash.meanby","lodash.min","lodash.minby","lodash.multiply","lodash.round","lodash.subtract","lodash.sum","lodash.sumby","lodash.clamp","lodash.inrange","lodash.random","lodash.assign","lodash.assignin","lodash.assigninwith","lodash.assignwith","lodash.at","lodash.create","lodash.defaults","lodash.defaultsdeep","lodash.findkey","lodash.findlastkey","lodash.forin","lodash.forinright","lodash.forown","lodash.forownright","lodash.functions","lodash.functionsin","lodash.get","lodash.has","lodash.hasin","lodash.invert","lodash.invertby","lodash.invoke","lodash.keys","lodash.keysin","lodash.mapkeys","lodash.mapvalues","lodash.merge","lodash.mergewith","lodash.omit","lodash.omitby","lodash.pick","lodash.pickby","lodash.result","lodash.set","lodash.setwith","lodash.topairs","lodash.topairsin","lodash.transform","lodash.unset","lodash.update","lodash.updatewith","lodash.values","lodash.valuesin","lodash.chain","lodash.tap","lodash.thru","lodash.camelcase","lodash.capitalize","lodash.deburr","lodash.endswith","lodash.escape","lodash.escaperegexp","lodash.kebabcase","lodash.lowercase","lodash.lowerfirst","lodash.pad","lodash.padend","lodash.padstart","lodash.parseint","lodash.repeat","lodash.replace","lodash.snakecase","lodash.split","lodash.startcase","lodash.startswith","lodash.template","lodash.tolower","lodash.toupper","lodash.trim","lodash.trimend","lodash.trimstart","lodash.truncate","lodash.unescape","lodash.uppercase","lodash.upperfirst","lodash.words","lodash.attempt","lodash.bindall","lodash.cond","lodash.conforms","lodash.constant","lodash.defaultto","lodash.flow","lodash.flowright","lodash.identity","lodash.iteratee","lodash.matches","lodash.matchesproperty","lodash.method","lodash.methodof","lodash.mixin","lodash.noconflict","lodash.noop","lodash.ntharg","lodash.over","lodash.overevery","lodash.oversome","lodash.property","lodash.propertyof","lodash.range","lodash.rangeright","lodash.runincontext","lodash.stubarray","lodash.stubfalse","lodash.stubobject","lodash.stubstring","lodash.stubtrue","lodash.times","lodash.topath","lodash.uniqueid"]),oxlint:D=y(r,["oxlint","@anolilab/oxlint-config"]),playwright:N=y(r,["playwright","eslint-plugin-playwright"]),pnpm:se=t,react:J=m||y(r,["eslint-plugin-react","eslint-plugin-react-hooks","eslint-plugin-react-refresh","@eslint-react/eslint-plugin","eslint-plugin-react-perf","eslint-plugin-react-you-might-not-need-an-effect"]),regexp:Q=!0,silent:G=!1,storybook:U=y(r,["storybook","eslint-plugin-storybook"]),tailwindcss:j=w||P,tanstackQuery:z=y(r,["@tanstack/react-query"]),tanstackRouter:X=y(r,["@tanstack/react-router"]),testingLibrary:H=y(r,["@testing-library/dom","@testing-library/react"]),tsdoc:V=!1,typescript:_=y(r,["typescript"]),unicorn:ke=!0,unocss:fe=!1,vitest:Oe=y(r,["vitest"]),zod:de=y(r,["zod"])}=e,Pe=e.reactCompiler,K=W(e,"react"),Ce="reactVersion"in K?K.reactVersion:void 0,_e="reactCompiler"in K?K.reactCompiler:void 0,Se="reactUnhookify"in K?K.reactUnhookify:void 0,Ee=Ce??g,ue=Pe??_e??x,me=Se??!1;if(c){let p=[];D&&p.push("eslint-plugin-oxlint"),de&&p.push("eslint-plugin-zod"),fe&&p.push("@unocss/eslint-plugin"),z&&p.push("@tanstack/eslint-plugin-query"),X&&p.push("@tanstack/eslint-plugin-router"),(q||j)&&(p.push("@eslint/css"),(j==="v4"||j&&P)&&p.push("tailwind-csstree")),(j==="v3"||j&&w)&&p.push("eslint-plugin-tailwindcss"),U&&p.push("eslint-plugin-storybook"),J&&p.push("eslint-plugin-react","eslint-plugin-react-hooks","eslint-plugin-react-refresh","@eslint-react/eslint-plugin","eslint-plugin-react-perf","eslint-plugin-react-you-might-not-need-an-effect"),J&&ue&&p.push("eslint-plugin-react-compiler"),J&&me&&p.push("@ospm/eslint-plugin-react-unhookify"),H&&p.push("eslint-plugin-testing-library"),T&&p.push("eslint-plugin-jsx-a11y","eslint-plugin-validate-jsx-nesting"),L&&p.push("eslint-plugin-you-dont-need-lodash-underscore"),V&&p.push("eslint-plugin-tsdoc"),e.formatters&&p.push("eslint-plugin-format"),N&&p.push("eslint-plugin-playwright"),E&&(p.push("eslint-plugin-astro","astro-eslint-parser"),typeof e.formatters=="object"&&e.formatters.astro&&p.push("prettier-plugin-astro")),typeof e.formatters=="object"&&(e.formatters.markdown&&e.formatters.slidev&&p.push("prettier-plugin-slidev"),(e.formatters.xml||e.formatters.svg)&&p.push("@prettier/plugin-xml")),p=p.filter(Boolean),p.length>0&&await Fe(r,p,"devDependencies",{confirm:{message:k=>`@anolilab/eslint-config requires the following ${k.length===1?"package":"packages"} to be installed:
19
19
 
20
20
  "${k.join(`"
21
21
  "`)}"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anolilab/eslint-config",
3
- "version": "29.0.1",
3
+ "version": "30.0.0",
4
4
  "description": "ESLint shareable config for the Anolilab JavaScript style guide.",
5
5
  "keywords": [
6
6
  "anolilab",
@@ -105,7 +105,7 @@
105
105
  "@visulima/fs": "5.0.5",
106
106
  "@visulima/package": "^5.0.5",
107
107
  "@visulima/tsconfig": "^3.2.0",
108
- "@vitest/eslint-plugin": "1.6.26",
108
+ "@vitest/eslint-plugin": "1.6.27",
109
109
  "confusing-browser-globals": "^1.0.11",
110
110
  "eslint-config-flat-gitignore": "2.3.0",
111
111
  "eslint-config-prettier": "10.1.8",
@@ -137,7 +137,7 @@
137
137
  "eslint-plugin-unicorn": "72.0.0",
138
138
  "eslint-plugin-unused-imports": "4.4.1",
139
139
  "eslint-plugin-yml": "3.8.1",
140
- "globals": "17.9.0",
140
+ "globals": "17.11.0",
141
141
  "jsonc-eslint-parser": "3.3.0",
142
142
  "parse-gitignore": "^2.0.0",
143
143
  "semver": "7.8.5",
@@ -146,13 +146,13 @@
146
146
  "yaml-eslint-parser": "2.1.0"
147
147
  },
148
148
  "peerDependencies": {
149
- "@eslint-react/eslint-plugin": "5.18.3",
149
+ "@eslint-react/eslint-plugin": "5.18.6",
150
150
  "@eslint/css": "1.4.0",
151
151
  "@ospm/eslint-plugin-react-unhookify": "^1.0.2",
152
152
  "@tanstack/eslint-plugin-query": "5.101.4",
153
153
  "@tanstack/eslint-plugin-router": "1.162.0",
154
154
  "@unocss/eslint-plugin": "66.7.5",
155
- "astro-eslint-parser": "3.0.0",
155
+ "astro-eslint-parser": "3.1.0",
156
156
  "eslint": ">=9.39.5",
157
157
  "eslint-plugin-astro": "3.1.0",
158
158
  "eslint-plugin-format": ">=2.0.1",