@anolilab/eslint-config 16.2.9 → 16.2.10
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 +10 -0
- package/README.md +9 -12
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +37 -1
- package/dist/index.d.mts +37 -1
- package/dist/index.d.ts +37 -1
- package/dist/index.mjs +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
## @anolilab/eslint-config [16.2.10](https://github.com/anolilab/javascript-style-guide/compare/@anolilab/eslint-config@16.2.9...@anolilab/eslint-config@16.2.10) (2025-06-02)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
* **eslint-config:** added missing eslint-plugin-react-refresh package to install ([714a011](https://github.com/anolilab/javascript-style-guide/commit/714a011f6b4fd50ef236fa2dcab1172d76fe2ab5))
|
|
6
|
+
|
|
7
|
+
### Code Refactoring
|
|
8
|
+
|
|
9
|
+
* **eslint-config:** remove type imports and simplify config exports in README.md ([d50eab8](https://github.com/anolilab/javascript-style-guide/commit/d50eab887dbd9586254689e7dc43694247f6522e))
|
|
10
|
+
|
|
1
11
|
## @anolilab/eslint-config [16.2.9](https://github.com/anolilab/javascript-style-guide/compare/@anolilab/eslint-config@16.2.8...@anolilab/eslint-config@16.2.9) (2025-06-01)
|
|
2
12
|
|
|
3
13
|
### Bug Fixes
|
package/README.md
CHANGED
|
@@ -77,10 +77,9 @@ Create `eslint.config.mjs` in your project root:
|
|
|
77
77
|
|
|
78
78
|
```js
|
|
79
79
|
// eslint.config.mjs
|
|
80
|
-
import type { PromiseFlatConfigComposer } from "@anolilab/eslint-config";
|
|
81
80
|
import { createConfig } from "@anolilab/eslint-config";
|
|
82
81
|
|
|
83
|
-
export default createConfig()
|
|
82
|
+
export default createConfig();
|
|
84
83
|
```
|
|
85
84
|
|
|
86
85
|
<details>
|
|
@@ -92,7 +91,6 @@ If you still use some configs from the legacy eslintrc format, you can use the [
|
|
|
92
91
|
|
|
93
92
|
```js
|
|
94
93
|
// eslint.config.mjs
|
|
95
|
-
import type { PromiseFlatConfigComposer } from "@anolilab/eslint-config";
|
|
96
94
|
import { createConfig } from "@anolilab/eslint-config";
|
|
97
95
|
import { FlatCompat } from "@eslint/eslintrc";
|
|
98
96
|
|
|
@@ -112,7 +110,7 @@ export default createConfig(
|
|
|
112
110
|
}),
|
|
113
111
|
|
|
114
112
|
// Other flat configs...
|
|
115
|
-
)
|
|
113
|
+
);
|
|
116
114
|
```
|
|
117
115
|
|
|
118
116
|
> Note that `.eslintignore` no longer works in Flat config.
|
|
@@ -123,9 +121,9 @@ Or you can configure each integration individually, for example:
|
|
|
123
121
|
|
|
124
122
|
```js
|
|
125
123
|
// eslint.config.js
|
|
126
|
-
import type { PromiseFlatConfigComposer } from "@anolilab/eslint-config";
|
|
127
124
|
import { createConfig } from "@anolilab/eslint-config";
|
|
128
125
|
|
|
126
|
+
/** @type {import("@anolilab/eslint-config").PromiseFlatConfigComposer} */
|
|
129
127
|
export default createConfig({
|
|
130
128
|
// Enable stylistic formatting rules
|
|
131
129
|
// stylistic: true,
|
|
@@ -149,7 +147,7 @@ export default createConfig({
|
|
|
149
147
|
vue: true,
|
|
150
148
|
|
|
151
149
|
yaml: false,
|
|
152
|
-
})
|
|
150
|
+
});
|
|
153
151
|
```
|
|
154
152
|
|
|
155
153
|
### Add script for package.json
|
|
@@ -169,7 +167,6 @@ The factory function also accepts any number of arbitrary custom config override
|
|
|
169
167
|
|
|
170
168
|
```js
|
|
171
169
|
// eslint.config.js
|
|
172
|
-
import type { PromiseFlatConfigComposer } from "@anolilab/eslint-config";
|
|
173
170
|
import { createConfig } from "@anolilab/eslint-config";
|
|
174
171
|
|
|
175
172
|
export default createConfig(
|
|
@@ -186,16 +183,16 @@ export default createConfig(
|
|
|
186
183
|
{
|
|
187
184
|
rules: {},
|
|
188
185
|
},
|
|
189
|
-
)
|
|
186
|
+
);
|
|
190
187
|
```
|
|
191
188
|
|
|
192
189
|
We also provided the `overrides` options in each integration to make it easier:
|
|
193
190
|
|
|
194
191
|
```js
|
|
195
192
|
// eslint.config.js
|
|
196
|
-
import type { PromiseFlatConfigComposer } from "@anolilab/eslint-config";
|
|
197
193
|
import { createConfig } from "@anolilab/eslint-config";
|
|
198
194
|
|
|
195
|
+
/** @type {import("@anolilab/eslint-config").PromiseFlatConfigComposer} */
|
|
199
196
|
export default createConfig({
|
|
200
197
|
typescript: {
|
|
201
198
|
overrides: {
|
|
@@ -207,7 +204,7 @@ export default createConfig({
|
|
|
207
204
|
// ...
|
|
208
205
|
},
|
|
209
206
|
},
|
|
210
|
-
})
|
|
207
|
+
});
|
|
211
208
|
```
|
|
212
209
|
|
|
213
210
|
## IDE Support (auto fix on save)
|
|
@@ -407,14 +404,14 @@ You can optionally enable the [type aware](https://typescript-eslint.io/linting/
|
|
|
407
404
|
|
|
408
405
|
```js
|
|
409
406
|
// eslint.config.js
|
|
410
|
-
import type { PromiseFlatConfigComposer } from "@anolilab/eslint-config";
|
|
411
407
|
import { createConfig } from "@anolilab/eslint-config";
|
|
412
408
|
|
|
409
|
+
/** @type {import("@anolilab/eslint-config").PromiseFlatConfigComposer} */
|
|
413
410
|
export default createConfig({
|
|
414
411
|
typescript: {
|
|
415
412
|
tsconfigPath: "tsconfig.json",
|
|
416
413
|
},
|
|
417
|
-
})
|
|
414
|
+
});
|
|
418
415
|
```
|
|
419
416
|
|
|
420
417
|
### Utilities
|
package/dist/index.cjs
CHANGED
|
@@ -14,7 +14,7 @@ Please remove "eslint-plugin-typescript-sort-keys" from your package.json, it co
|
|
|
14
14
|
If you dont use the new react jsx-runtime in you project, please enable it manually.
|
|
15
15
|
`))}E=E&&d!==!1;let B;return E&&(console.info(`
|
|
16
16
|
@anolilab/eslint-config enabling react-compiler plugin
|
|
17
|
-
`),B=c(import("eslint-plugin-react-compiler"))),[{name:"anolilab/react/setup",plugins:{react:A,"react-dom":N["@eslint-react/dom"],"react-hooks":J,"react-hooks-extra":N["@eslint-react/hooks-extra"],"react-naming-convention":N["@eslint-react/naming-convention"],"react-perf":D,"react-refresh":$,"react-web-api":N["@eslint-react/web-api"],"react-x":N["@eslint-react"],"react-you-might-not-need-an-effect":I,...E?{"react-compiler":B}:{}}},{files:o,languageOptions:{parserOptions:{ecmaFeatures:{jsx:!0}}},name:"anolilab/react/rules",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",{...oe,allow:[...oe.allow,"__REDUX_DEVTOOLS_EXTENSION_COMPOSE__"]}],"react-hooks-extra/no-direct-set-state-in-use-effect":"error","react-hooks-extra/no-unnecessary-use-callback":"error","react-hooks-extra/no-unnecessary-use-memo":"error","react-hooks-extra/no-unnecessary-use-prefix":"error","react-hooks-extra/prefer-use-state-lazy-initialization":"error","react-hooks/exhaustive-deps":"error","react-hooks/rules-of-hooks":"error","react-naming-convention/component-name":"error","react-naming-convention/context-name":"error","react-naming-convention/filename":"off","react-naming-convention/use-state":"error","react-refresh/only-export-components":["error",{allowConstantExport:_,allowExportNames:[...L?["dynamic","dynamicParams","revalidate","fetchCache","runtime","preferredRegion","maxDuration","config","generateStaticParams","metadata","generateMetadata","viewport","generateViewport"]:[],...U||P?["meta","links","headers","loader","action"]:[]]}],"react-web-api/no-leaked-event-listener":"error","react-web-api/no-leaked-interval":"error","react-web-api/no-leaked-resize-observer":"error","react-web-api/no-leaked-timeout":"error","react-x/avoid-shorthand-boolean":"off","react-x/avoid-shorthand-fragment":"off","react-x/jsx-key-before-spread":"error","react-x/jsx-no-duplicate-props":"error","react-x/jsx-no-undef":"off","react-x/jsx-uses-react":G?"off":"error","react-x/jsx-uses-vars":"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-prop":"off","react-x/no-children-to-array":"error","react-x/no-class-component":"off","react-x/no-clone-element":"error","react-x/no-comment-textnodes":"error","react-x/no-complex-conditional-rendering":"off","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-default-props":"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":"error","react-x/no-leaked-conditional-rendering":"error","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/no-prop-types":"error","react-x/no-redundant-should-component-update":"error","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-string-refs":"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/no-useless-forward-ref":"error","react-x/no-useless-fragment":"off","react-x/prefer-destructuring-assignment":"off","react-x/prefer-react-namespace-import":"off","react-x/prefer-read-only-props":"off","react-x/prefer-shorthand-boolean":"off","react-x/prefer-shorthand-fragment":"off","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":["error","line-aligned"],"react/jsx-curly-brace-presence":["error",{children:"never",props:"never"}],"react/jsx-curly-newline":["error",{multiline:"consistent",singleline:"consistent"}],"react/jsx-curly-spacing":["error","never",{allowMultiline:!0}],"react/jsx-equals-spacing":["error","never"],"react/jsx-first-prop-new-line":["error","multiline-multiprop"],"react/jsx-fragments":["error","syntax"],"react/jsx-handler-names":["off",{eventHandlerPrefix:"handle",eventHandlerPropPrefix:"on"}],"react/jsx-indent":["error",k,{checkAttributes:!0,indentLogicalExpressions:!0}],"react/jsx-indent-props":["error",k],"react/jsx-key":"off","react/jsx-max-depth":"off","react/jsx-max-props-per-line":["error",{maximum:1,when:"multiline"}],"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":["error",{allow:"single-child"}],"react/jsx-pascal-case":["error",{allowAllCaps:!0,ignore:[]}],"react/jsx-props-no-multi-spaces":"error","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":["error",{afterOpening:"never",beforeClosing:"never",beforeSelfClosing:"always",closingSlash:"never"}],"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":G?"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",...E?{"react-compiler/react-compiler":"error"}:{},...D?.configs?.flat?.recommended?.rules,"react-you-might-not-need-an-effect/you-might-not-need-an-effect":"warn",...p?{"react/jsx-child-element-spacing":"off","react/jsx-closing-bracket-location":"off","react/jsx-closing-tag-location":"off","react/jsx-curly-newline":"off","react/jsx-curly-spacing":"off","react/jsx-equals-spacing":"off","react/jsx-first-prop-new-line":"off","react/jsx-indent":"off","react/jsx-indent-props":"off","react/jsx-max-props-per-line":"off","react/jsx-newline":"off","react/jsx-one-expression-per-line":"off","react/jsx-props-no-multi-spaces":"off","react/jsx-tag-spacing":"off","react/jsx-wrap-multilines":"off"}:{},...a},settings:{propWrapperFunctions:["forbidExtraProps","exact","Object.freeze"],react:{version:S??"detect"},"react-x":{version:S??"detect"}}},{files:["**/*.jsx"],languageOptions:{parserOptions:{ecmaFeatures:{jsx:!0}}},name:"anolilab/react/jsx",rules:{"react-x/naming-convention/filename-extension":["error","as-needed"],"react/jsx-closing-tag-location":"error","react/jsx-filename-extension":"off","react/jsx-wrap-multilines":["error",{arrow:"parens-new-line",assignment:"parens-new-line",condition:"parens-new-line",declaration:"parens-new-line",logical:"parens-new-line",prop:"parens-new-line",return:"parens-new-line"}],"react/no-typos":"error"},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"}},{files:n.getFilesGlobs("storybook"),name:"anolilab/react/storybook",rules:{"react/jsx-props-no-spreading":"off"}},...q?[{files:s,ignores:t,name:"anolilab/react/type-aware-rules",rules:{...T}}]:[]]}),kr=n.createConfig("all",async(e,r)=>{const{files:o=r,level:s,overrides:t}=e,a=De.configs["flat/recommended"],i={...a.rules};if(s==="warn")for(const p in i)i[p]==="error"&&(i[p]="warn");return[{...a,files:o,name:"anolilab/regexp/rules",rules:{...i,...t}}]}),Pr=n.createConfig("all",async(e,r)=>{const{files:o=r,overrides:s}=e,t=await c(import("eslint-plugin-simple-import-sort"));return[{files:o,name:"anolilab/simple-import-sort",plugins:{"simple-import-sort":t},rules:{"simple-import-sort/exports":"error","simple-import-sort/imports":"error",...s}}]}),Cr=n.createConfig("all",async(e,r)=>{const{files:o=r,overrides:s}=e,t=await c(import("eslint-plugin-sonarjs"));return[{name:"anolilab/sonarjs/plugin",plugins:{sonarjs:t}},{files:o,name:"anolilab/sonarjs/rules",rules:{...t.configs.recommended.rules,"sonarjs/file-name-differ-from-class":"error","sonarjs/no-collapsible-if":"error","sonarjs/no-nested-template-literals":"off","sonarjs/no-tab":"error","sonarjs/todo-tag":"off",...s}},{files:n.getFilesGlobs("js_and_ts"),name:"anolilab/sonarjs/js-and-ts-rules",rules:{"sonarjs/cognitive-complexity":["error",15],"sonarjs/no-duplicate-string":"off"}},{files:n.getFilesGlobs("js"),languageOptions:{ecmaVersion:2020},name:"anolilab/sonarjs/js-rules",rules:{"sonarjs/no-all-duplicated-branches":"off","sonarjs/no-duplicate-string":"off"}}]}),Or=n.createConfig("storybook",async e=>{const{overrides:r}=e,o=[...(await c(import("eslint-plugin-storybook"))).configs["flat/recommended"]];return o[0].rules={...o[0].rules,...r},o}),Dr=n.createConfig("jsx_and_tsx",async(e,r)=>{const{files:o=r,overrides:s}=e,t=[...(await c(import("eslint-plugin-tailwindcss"))).configs["flat/recommended"]];return t[1].files=o,t[1].rules={...t[1].rules,...s},t}),_r=n.createConfig("all",async(e,r)=>{const{files:o=r,overrides:s}=e,t=await c(import("@tanstack/eslint-plugin-query"));return[{files:o,plugins:{"@tanstack/query":t},rules:{...t.configs.recommended.rules,...s}}]}),Sr=n.createConfig("all",async(e,r)=>{const{files:o=r,overrides:s}=e,t=await c(import("@tanstack/eslint-plugin-router"));return[{files:o,plugins:{"@tanstack/router":t},rules:{...t.configs.recommended.rules,...s}}]}),Fr=n.createConfig("vitest",async(e,r)=>{const{files:o=r,overrides:s,packageJson:t}=e,a=await c(import("eslint-plugin-testing-library")),i=m.hasPackageJsonAnyDependency(t,["react","react-dom","eslint-plugin-react"]);return[{files:o,plugins:{"testing-library":a},rules:{...a.configs["flat/dom"].rules,...i?a.configs["flat/react"].rules:{},...s}}]}),qr=n.createConfig("toml",async(e,r)=>{const{files:o=r,overrides:s={},stylistic:t=!0}=e,{indent:a=2}=typeof t=="boolean"?{}:t,[i,p]=await Promise.all([c(import("eslint-plugin-toml")),c(import("toml-eslint-parser"))]);return[{files:o,languageOptions:{parser:p},name:"anolilab/toml",plugins:{toml:i},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",a==="tab"?2:a],"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"}:{},...s}}]}),Er=n.createConfig("ts",async(e,r)=>{const{files:o=r,overrides:s}=e,t=await c(import("eslint-plugin-tsdoc"));return[{files:o,plugins:{tsdoc:t},rules:{"tsdoc/syntax":"error",...s}}]}),Q={"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"},...Fe.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":["error",{args:"after-used",ignoreRestSiblings:!0,vars:"all"}],"no-use-before-define":["error",{classes:!0,functions:!0,variables:!0}]},Ar=n.createConfig("all",async(e,r)=>{const{files:o=r}=e;return[{files:o,name:"anolilab/variables/rules",rules:Q},{files:n.getFilesGlobs("ts"),name:"anolilab/variables/ts-rules",rules:{"no-shadow":"off","no-undef":"off","no-unused-vars":"off","no-use-before-define":"off"}}]});var Ir=Object.defineProperty,Nr=w((e,r)=>Ir(e,"name",{value:r,configurable:!0}),"w");const Tr=n.createConfig("ts",async(e,r)=>{const{componentExts:o=[],files:s=r,isInEditor:t=!1,overrides:a,overridesTypeAware:i,parserOptions:p,prettier:d}=e,h=ue,x=pe(t),[v,q,k,T]=await Promise.all([c(import("@typescript-eslint/eslint-plugin")),c(import("@typescript-eslint/parser")),c(import("typescript-eslint")),c(import("eslint-plugin-no-for-of-array"))]),R=e.filesTypeAware??n.getFilesGlobs("ts"),A=e.ignoresTypeAware??["**/*.mdx/**",...n.getFilesGlobs("astro")],J=e?.tsconfigPath??void 0,$=J!==void 0,D=Nr((_,U,L)=>({files:[...U,...o.map(P=>`**/*.${P}`)],...L?{ignores:L}:{},languageOptions:{parser:q,parserOptions:{extraFileExtensions:o.map(P=>`.${P}`),sourceType:"module",..._?{projectService:{allowDefaultProject:["./*.js"],defaultProject:J},tsconfigRootDir:process.cwd()}:{},...p}},name:`anolilab/typescript/${_?"type-aware-parser":"parser"}`}),"makeParser"),I=[{name:"anolilab/typescript/setup",plugins:{"@typescript-eslint":v,"no-for-of-array":T}},...$?[D(!1,s),D(!0,R,A)]:[D(!1,s)],...k.configs.strict];return $&&I.push(...k.configs.strictTypeCheckedOnly,{files:[...R,...o.map(_=>`**/*.${_}`)],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/prefer-nullish-coalescing":"error","@typescript-eslint/prefer-optional-chain":"error",...i}},{files:n.getFilesGlobs("all"),name:"anolilab/typescript/no-for-of-array/rules",rules:{"no-for-of-array/no-for-of-array":"error"}}),I.push({files:s,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":h["no-array-constructor"],"@typescript-eslint/no-confusing-non-null-assertion":"error","@typescript-eslint/no-dupe-class-members":x["no-dupe-class-members"],"@typescript-eslint/no-duplicate-enum-values":"error","@typescript-eslint/no-dynamic-delete":"warn","@typescript-eslint/no-empty-function":M["no-empty-function"],"@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":M["no-loop-func"],"@typescript-eslint/no-magic-numbers":M["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":M["no-redeclare"],"@typescript-eslint/no-require-imports":"error","@typescript-eslint/no-shadow":Q["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":M["no-unused-expressions"],"@typescript-eslint/no-unused-vars":Q["no-unused-vars"],"@typescript-eslint/no-use-before-define":Q["no-use-before-define"],"@typescript-eslint/no-useless-constructor":x["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":M["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":h["space-infix-ops"],...a,...d?{"@typescript-eslint/block-spacing":"off","@typescript-eslint/brace-style":"off","@typescript-eslint/comma-dangle":"off","@typescript-eslint/comma-spacing":"off","@typescript-eslint/func-call-spacing":"off","@typescript-eslint/indent":"off","@typescript-eslint/key-spacing":"off","@typescript-eslint/keyword-spacing":"off","@typescript-eslint/lines-around-comment":0,"@typescript-eslint/member-delimiter-style":"off","@typescript-eslint/no-extra-parens":"off","@typescript-eslint/no-extra-semi":"off","@typescript-eslint/object-curly-spacing":"off","@typescript-eslint/quotes":0,"@typescript-eslint/semi":"off","@typescript-eslint/space-before-blocks":"off","@typescript-eslint/space-before-function-paren":"off","@typescript-eslint/space-infix-ops":"off","@typescript-eslint/type-annotation-spacing":"off"}:{}}}),I}),Jr=n.createConfig("all",async(e,r)=>{const{files:o=r,overrides:s,packageJson:t,prettier:a,stylistic:i=!0}=e,{indent:p=4}=typeof i=="boolean"?{}:i,d=await c(import("eslint-plugin-unicorn"));return[{languageOptions:{globals:K.builtin},name:"anolilab/unicorn/plugin",plugins:{unicorn:d}},{files:o,name:"anolilab/unicorn/rules",rules:{...d.configs.recommended.rules,"unicorn/better-regex":"off","unicorn/consistent-destructuring":"off","unicorn/consistent-function-scoping":"off","unicorn/filename-case":["error",{case:"kebabCase",ignore:[/(FUNDING\.yml|README\.md|CHANGELOG\.md|CONTRIBUTING\.md|CODE_OF_CONDUCT\.md|SECURITY\.md|LICENSE)/u]}],"unicorn/no-abusive-eslint-disable":"error","unicorn/no-array-for-each":"off","unicorn/no-instanceof-builtins":"error","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"],...a?{"unicorn/empty-brace-spaces":"off","unicorn/no-nested-ternary":"off","unicorn/number-literal-case":"off","unicorn/template-indent":"off"}:{"unicorn/template-indent":["error",{indent:p}]},...s}},{files:["tsconfig.dev.json","tsconfig.prod.json"],name:"anolilab/unicorn/tsconfig-overrides",rules:{"unicorn/prevent-abbreviations":"off"}},{files:["**/*.ts","**/*.tsx","**/*.mts","**/*.cts"],name:"anolilab/unicorn/ts-overrides",rules:{"unicorn/import-style":"off"}}]});var $r=Object.defineProperty,Ur=w((e,r)=>$r(e,"name",{value:r,configurable:!0}),"n$2");const Lr=Ur(async e=>{const{attributify:r=!0,strict:o=!1}=e;return[{name:"anolilab/unocss",plugins:{unocss:await c(import("@unocss/eslint-plugin"))},rules:{"unocss/order":"warn",...r?{"unocss/order-attributify":"warn"}:{},...o?{"unocss/blocklist":"error"}:{}}}]},"unocss"),Mr=n.createConfig("jsx_and_tsx",async(e,r)=>{const{files:o=r,overrides:s}=e,t=await c(import("eslint-plugin-validate-jsx-nesting"));return[{files:o,name:"anolilab/validate-jsx-nesting/setup",plugins:{"validate-jsx-nesting":t},rules:{"validate-jsx-nesting/no-invalid-jsx-nesting":"error",...s}}]}),Rr={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,onTestFailed:!0,onTestFinished:!0};let re;const Gr=n.createConfig("vitest",async(e,r)=>{const{files:o=r,isInEditor:s=!1,overrides:t,prettier:a,tsconfigPath:i}=e,[p,d]=await Promise.all([c(import("@vitest/eslint-plugin")),c(import("eslint-plugin-no-only-tests"))]);return re=re||{...p,rules:{...p.rules,...d.rules}},[{name:"anolilab/vitest/setup",plugins:{vitest:re}},{files:o,...i?{...p.configs.env,settings:{vitest:{typecheck:!0}}}:{},languageOptions:{globals:{...Rr}},name:"anolilab/vitest/rules",rules:{...p.configs.all.rules,...p.configs.recommended.rules,"@typescript-eslint/explicit-function-return-type":"off","antfu/no-top-level-await":"off","n/prefer-global/process":"off","no-unused-expressions":"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":s?"off":"error","vitest/no-restricted-vi-methods":"off","vitest/no-standalone-expect":"error","vitest/valid-expect":["error",{alwaysAwait:!0,maxArgs:2,minArgs:1}],"vitest/valid-title":"off",...t,...a?{"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"}:{}}}]}),zr=n.createConfig("yaml",async(e,r)=>{const{files:o=r,overrides:s={},prettier:t,stylistic:a=!0}=e,{indent:i=4,quotes:p="double"}=typeof a=="boolean"?{}:a,[d,h]=await Promise.all([c(import("eslint-plugin-yml")),c(import("yaml-eslint-parser"))]);return[{files:o,languageOptions:{parser:h},name:"anolilab/yaml",plugins:{yaml:d},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","yaml/vue-custom-block/no-parsing-error":"error",...a?{"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",i==="tab"?2:i],"yaml/key-spacing":"error","yaml/no-tab-indent":"error","yaml/quotes":["error",{avoidEscape:!0,prefer:p==="backtick"?"single":p}],"yaml/spaced-comment":"error"}:{},...t?d.configs.prettier.rules:{},...s}},{files:["pnpm-workspace.yaml"],name:"anolilab/yaml/pnpm-workspace",rules:{"yaml/sort-keys":["error",{order:["packages","overrides","patchedDependencies","hoistPattern","catalog","catalogs","allowedDeprecatedVersions","allowNonAppliedPatches","configDependencies","ignoredBuiltDependencies","ignoredOptionalDependencies","neverBuiltDependencies","onlyBuiltDependencies","onlyBuiltDependenciesFile","packageExtensions","peerDependencyRules","supportedArchitectures"],pathPattern:"^$"}]}}]}),Vr=n.createConfig("all",async(e,r)=>{const{files:o=r,overrides:s}=e,t=await c(import("eslint-plugin-you-dont-need-lodash-underscore"));return[{files:o,plugins:{"you-dont-need-lodash-underscore":ce.fixupPluginRules(t)},rules:{...t.configs.all.rules,...s}}]}),Br=n.createConfig("all",async(e,r)=>{const{files:o=r,overrides:s}=e,t=await c(import("eslint-plugin-zod"));return[{files:o,plugins:{zod:t},rules:{"zod/prefer-enum":"error","zod/require-strict":"error",...s}}]});var Wr=Object.defineProperty,Xr=w((e,r)=>Wr(e,"name",{value:r,configurable:!0}),"e$1");const Hr=Xr(()=>!!(process.env.GIT_PARAMS||process.env.VSCODE_GIT_COMMAND||process.env.npm_lifecycle_script?.startsWith("lint-staged")),"isInGitHooksOrLintStaged");var Kr=Object.defineProperty,Qr=w((e,r)=>Kr(e,"name",{value:r,configurable:!0}),"e");const Yr=Qr(()=>process.env.CI||Hr()?!1:!!(process.env.VSCODE_PID??process.env.VSCODE_CWD??process.env.JETBRAINS_IDE??process.env.VIM??process.env.NVIM),"isInEditorEnvironment");var Zr=Object.defineProperty,W=w((e,r)=>Zr(e,"name",{value:r,configurable:!0}),"p");const es=["name","languageOptions","linterOptions","processor","plugins","rules","settings"],X=W((e,r)=>typeof e[r]=="boolean"?{}:e[r]||{},"resolveSubOptions"),u=W((e,r)=>{const o=X(e,r);return{...e.overrides?.[r],..."overrides"in o?o.overrides:{}}},"getOverrides"),g=W((e,r)=>{const o=X(e,r);if("files"in o)return typeof o.files=="string"?[o.files]:o.files},"getFiles"),rs=W(async(e={},...r)=>{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 o=e.cwd??process.cwd(),s=m.parsePackageJson(je.readFileSync(ve.join(o,"package.json"),"utf8")),t=m.hasPackageJsonAnyDependency(s,["prettier"]),a=m.hasPackageJsonAnyDependency(s,["@anolilab/eslint-config"]),i=m.hasPackageJsonAnyDependency(s,["react","react-dom"]),p=s?.dependencies?.react||s?.devDependencies?.react;let d=!1;if(p!==void 0){const f=se.parse(p);f?.major&&f.major>=19&&(d=!0)}let h=!1;const x=s?.dependencies?.tailwindcss||s?.devDependencies?.tailwindcss;if(x){const f=se.parse(x);f?.major&&f.major<=3&&(h=!0)}const{astro:v=m.hasPackageJsonAnyDependency(s,["astro"]),componentExts:q=[],css:k=m.hasPackageJsonAnyDependency(s,["postcss","cssnano"]),gitignore:T=!0,html:R=!1,jsx:A=m.hasPackageJsonAnyDependency(s,["eslint-plugin-jsx-a11y","eslint-plugin-validate-jsx-nesting"])||i,lodash:J=m.hasPackageJsonAnyDependency(s,["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"]),playwright:$=m.hasPackageJsonAnyDependency(s,["playwright","eslint-plugin-playwright"]),react:D=i||m.hasPackageJsonAnyDependency(s,["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"]),reactCompiler:I=d,regexp:_=!0,silent:U=!1,storybook:L=m.hasPackageJsonAnyDependency(s,["storybook","eslint-plugin-storybook"]),tailwindcss:P=h,tanstackQuery:N=m.hasPackageJsonAnyDependency(s,["@tanstack/react-query"]),tanstackRouter:S=m.hasPackageJsonAnyDependency(s,["@tanstack/react-router"]),testingLibrary:E=m.hasPackageJsonAnyDependency(s,["@testing-library/dom","@testing-library/react"]),tsdoc:G=!1,typescript:B=m.hasPackageJsonAnyDependency(s,["typescript"]),unicorn:C=!0,unocss:ne=!1,vitest:me=m.hasPackageJsonAnyDependency(s,["vitest"]),zod:ae=m.hasPackageJsonAnyDependency(s,["zod"])}=e;if(a){let f=[];ae&&f.push("eslint-plugin-zod"),ne&&f.push("@unocss/eslint-plugin"),N&&f.push("@tanstack/eslint-plugin-query"),S&&f.push("@tanstack/eslint-plugin-router"),(k||P)&&f.push("@eslint/css"),P&&f.push("eslint-plugin-tailwindcss"),L&&f.push("eslint-plugin-storybook"),D&&f.push("eslint-plugin-react","@eslint-react/eslint-plugin","eslint-plugin-react-hooks","eslint-plugin-react-perf","eslint-plugin-react-you-might-not-need-an-effect"),D&&I&&f.push("eslint-plugin-react-compiler"),E&&f.push("eslint-plugin-testing-library"),A&&f.push("eslint-plugin-jsx-a11y","eslint-plugin-validate-jsx-nesting"),J&&f.push("eslint-plugin-you-dont-need-lodash-underscore"),G&&f.push("eslint-plugin-tsdoc"),e.formatters&&f.push("eslint-plugin-format"),$&&f.push("playwright-eslint-plugin"),v&&(f.push("eslint-plugin-astro","astro-eslint-parser","@typescript-eslint/parser"),typeof e.formatters=="object"&&e.formatters.astro&&f.push("prettier-plugin-astro")),typeof e.formatters=="object"&&(e.formatters?.markdown&&e.formatters?.slidev&&f.push("prettier-plugin-slidev"),(e.formatters?.xml||e.formatters?.svg)&&f.push("@prettier/plugin-xml")),f=f.filter(Boolean),f.length>0&&await m.ensurePackages(s,f,"devDependencies",{confirm:{message:W(V=>`@anolilab/eslint-config requires the following ${V.length===1?"package":"packages"} to be installed:
|
|
17
|
+
`),B=c(import("eslint-plugin-react-compiler"))),[{name:"anolilab/react/setup",plugins:{react:A,"react-dom":N["@eslint-react/dom"],"react-hooks":J,"react-hooks-extra":N["@eslint-react/hooks-extra"],"react-naming-convention":N["@eslint-react/naming-convention"],"react-perf":D,"react-refresh":$,"react-web-api":N["@eslint-react/web-api"],"react-x":N["@eslint-react"],"react-you-might-not-need-an-effect":I,...E?{"react-compiler":B}:{}}},{files:o,languageOptions:{parserOptions:{ecmaFeatures:{jsx:!0}}},name:"anolilab/react/rules",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",{...oe,allow:[...oe.allow,"__REDUX_DEVTOOLS_EXTENSION_COMPOSE__"]}],"react-hooks-extra/no-direct-set-state-in-use-effect":"error","react-hooks-extra/no-unnecessary-use-callback":"error","react-hooks-extra/no-unnecessary-use-memo":"error","react-hooks-extra/no-unnecessary-use-prefix":"error","react-hooks-extra/prefer-use-state-lazy-initialization":"error","react-hooks/exhaustive-deps":"error","react-hooks/rules-of-hooks":"error","react-naming-convention/component-name":"error","react-naming-convention/context-name":"error","react-naming-convention/filename":"off","react-naming-convention/use-state":"error","react-refresh/only-export-components":["error",{allowConstantExport:_,allowExportNames:[...L?["dynamic","dynamicParams","revalidate","fetchCache","runtime","preferredRegion","maxDuration","config","generateStaticParams","metadata","generateMetadata","viewport","generateViewport"]:[],...U||P?["meta","links","headers","loader","action"]:[]]}],"react-web-api/no-leaked-event-listener":"error","react-web-api/no-leaked-interval":"error","react-web-api/no-leaked-resize-observer":"error","react-web-api/no-leaked-timeout":"error","react-x/avoid-shorthand-boolean":"off","react-x/avoid-shorthand-fragment":"off","react-x/jsx-key-before-spread":"error","react-x/jsx-no-duplicate-props":"error","react-x/jsx-no-undef":"off","react-x/jsx-uses-react":G?"off":"error","react-x/jsx-uses-vars":"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-prop":"off","react-x/no-children-to-array":"error","react-x/no-class-component":"off","react-x/no-clone-element":"error","react-x/no-comment-textnodes":"error","react-x/no-complex-conditional-rendering":"off","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-default-props":"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":"error","react-x/no-leaked-conditional-rendering":"error","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/no-prop-types":"error","react-x/no-redundant-should-component-update":"error","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-string-refs":"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/no-useless-forward-ref":"error","react-x/no-useless-fragment":"off","react-x/prefer-destructuring-assignment":"off","react-x/prefer-react-namespace-import":"off","react-x/prefer-read-only-props":"off","react-x/prefer-shorthand-boolean":"off","react-x/prefer-shorthand-fragment":"off","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":["error","line-aligned"],"react/jsx-curly-brace-presence":["error",{children:"never",props:"never"}],"react/jsx-curly-newline":["error",{multiline:"consistent",singleline:"consistent"}],"react/jsx-curly-spacing":["error","never",{allowMultiline:!0}],"react/jsx-equals-spacing":["error","never"],"react/jsx-first-prop-new-line":["error","multiline-multiprop"],"react/jsx-fragments":["error","syntax"],"react/jsx-handler-names":["off",{eventHandlerPrefix:"handle",eventHandlerPropPrefix:"on"}],"react/jsx-indent":["error",k,{checkAttributes:!0,indentLogicalExpressions:!0}],"react/jsx-indent-props":["error",k],"react/jsx-key":"off","react/jsx-max-depth":"off","react/jsx-max-props-per-line":["error",{maximum:1,when:"multiline"}],"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":["error",{allow:"single-child"}],"react/jsx-pascal-case":["error",{allowAllCaps:!0,ignore:[]}],"react/jsx-props-no-multi-spaces":"error","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":["error",{afterOpening:"never",beforeClosing:"never",beforeSelfClosing:"always",closingSlash:"never"}],"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":G?"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",...E?{"react-compiler/react-compiler":"error"}:{},...D?.configs?.flat?.recommended?.rules,"react-you-might-not-need-an-effect/you-might-not-need-an-effect":"warn",...p?{"react/jsx-child-element-spacing":"off","react/jsx-closing-bracket-location":"off","react/jsx-closing-tag-location":"off","react/jsx-curly-newline":"off","react/jsx-curly-spacing":"off","react/jsx-equals-spacing":"off","react/jsx-first-prop-new-line":"off","react/jsx-indent":"off","react/jsx-indent-props":"off","react/jsx-max-props-per-line":"off","react/jsx-newline":"off","react/jsx-one-expression-per-line":"off","react/jsx-props-no-multi-spaces":"off","react/jsx-tag-spacing":"off","react/jsx-wrap-multilines":"off"}:{},...a},settings:{propWrapperFunctions:["forbidExtraProps","exact","Object.freeze"],react:{version:S??"detect"},"react-x":{version:S??"detect"}}},{files:["**/*.jsx"],languageOptions:{parserOptions:{ecmaFeatures:{jsx:!0}}},name:"anolilab/react/jsx",rules:{"react-x/naming-convention/filename-extension":["error","as-needed"],"react/jsx-closing-tag-location":"error","react/jsx-filename-extension":"off","react/jsx-wrap-multilines":["error",{arrow:"parens-new-line",assignment:"parens-new-line",condition:"parens-new-line",declaration:"parens-new-line",logical:"parens-new-line",prop:"parens-new-line",return:"parens-new-line"}],"react/no-typos":"error"},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"}},{files:n.getFilesGlobs("storybook"),name:"anolilab/react/storybook",rules:{"react/jsx-props-no-spreading":"off"}},...q?[{files:s,ignores:t,name:"anolilab/react/type-aware-rules",rules:{...T}}]:[]]}),kr=n.createConfig("all",async(e,r)=>{const{files:o=r,level:s,overrides:t}=e,a=De.configs["flat/recommended"],i={...a.rules};if(s==="warn")for(const p in i)i[p]==="error"&&(i[p]="warn");return[{...a,files:o,name:"anolilab/regexp/rules",rules:{...i,...t}}]}),Pr=n.createConfig("all",async(e,r)=>{const{files:o=r,overrides:s}=e,t=await c(import("eslint-plugin-simple-import-sort"));return[{files:o,name:"anolilab/simple-import-sort",plugins:{"simple-import-sort":t},rules:{"simple-import-sort/exports":"error","simple-import-sort/imports":"error",...s}}]}),Cr=n.createConfig("all",async(e,r)=>{const{files:o=r,overrides:s}=e,t=await c(import("eslint-plugin-sonarjs"));return[{name:"anolilab/sonarjs/plugin",plugins:{sonarjs:t}},{files:o,name:"anolilab/sonarjs/rules",rules:{...t.configs.recommended.rules,"sonarjs/file-name-differ-from-class":"error","sonarjs/no-collapsible-if":"error","sonarjs/no-nested-template-literals":"off","sonarjs/no-tab":"error","sonarjs/todo-tag":"off",...s}},{files:n.getFilesGlobs("js_and_ts"),name:"anolilab/sonarjs/js-and-ts-rules",rules:{"sonarjs/cognitive-complexity":["error",15],"sonarjs/no-duplicate-string":"off"}},{files:n.getFilesGlobs("js"),languageOptions:{ecmaVersion:2020},name:"anolilab/sonarjs/js-rules",rules:{"sonarjs/no-all-duplicated-branches":"off","sonarjs/no-duplicate-string":"off"}}]}),Or=n.createConfig("storybook",async e=>{const{overrides:r}=e,o=[...(await c(import("eslint-plugin-storybook"))).configs["flat/recommended"]];return o[0].rules={...o[0].rules,...r},o}),Dr=n.createConfig("jsx_and_tsx",async(e,r)=>{const{files:o=r,overrides:s}=e,t=[...(await c(import("eslint-plugin-tailwindcss"))).configs["flat/recommended"]];return t[1].files=o,t[1].rules={...t[1].rules,...s},t}),_r=n.createConfig("all",async(e,r)=>{const{files:o=r,overrides:s}=e,t=await c(import("@tanstack/eslint-plugin-query"));return[{files:o,plugins:{"@tanstack/query":t},rules:{...t.configs.recommended.rules,...s}}]}),Sr=n.createConfig("all",async(e,r)=>{const{files:o=r,overrides:s}=e,t=await c(import("@tanstack/eslint-plugin-router"));return[{files:o,plugins:{"@tanstack/router":t},rules:{...t.configs.recommended.rules,...s}}]}),Fr=n.createConfig("vitest",async(e,r)=>{const{files:o=r,overrides:s,packageJson:t}=e,a=await c(import("eslint-plugin-testing-library")),i=m.hasPackageJsonAnyDependency(t,["react","react-dom","eslint-plugin-react"]);return[{files:o,plugins:{"testing-library":a},rules:{...a.configs["flat/dom"].rules,...i?a.configs["flat/react"].rules:{},...s}}]}),qr=n.createConfig("toml",async(e,r)=>{const{files:o=r,overrides:s={},stylistic:t=!0}=e,{indent:a=2}=typeof t=="boolean"?{}:t,[i,p]=await Promise.all([c(import("eslint-plugin-toml")),c(import("toml-eslint-parser"))]);return[{files:o,languageOptions:{parser:p},name:"anolilab/toml",plugins:{toml:i},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",a==="tab"?2:a],"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"}:{},...s}}]}),Er=n.createConfig("ts",async(e,r)=>{const{files:o=r,overrides:s}=e,t=await c(import("eslint-plugin-tsdoc"));return[{files:o,plugins:{tsdoc:t},rules:{"tsdoc/syntax":"error",...s}}]}),Q={"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"},...Fe.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":["error",{args:"after-used",ignoreRestSiblings:!0,vars:"all"}],"no-use-before-define":["error",{classes:!0,functions:!0,variables:!0}]},Ar=n.createConfig("all",async(e,r)=>{const{files:o=r}=e;return[{files:o,name:"anolilab/variables/rules",rules:Q},{files:n.getFilesGlobs("ts"),name:"anolilab/variables/ts-rules",rules:{"no-shadow":"off","no-undef":"off","no-unused-vars":"off","no-use-before-define":"off"}}]});var Ir=Object.defineProperty,Nr=w((e,r)=>Ir(e,"name",{value:r,configurable:!0}),"w");const Tr=n.createConfig("ts",async(e,r)=>{const{componentExts:o=[],files:s=r,isInEditor:t=!1,overrides:a,overridesTypeAware:i,parserOptions:p,prettier:d}=e,h=ue,x=pe(t),[v,q,k,T]=await Promise.all([c(import("@typescript-eslint/eslint-plugin")),c(import("@typescript-eslint/parser")),c(import("typescript-eslint")),c(import("eslint-plugin-no-for-of-array"))]),R=e.filesTypeAware??n.getFilesGlobs("ts"),A=e.ignoresTypeAware??["**/*.mdx/**",...n.getFilesGlobs("astro")],J=e?.tsconfigPath??void 0,$=J!==void 0,D=Nr((_,U,L)=>({files:[...U,...o.map(P=>`**/*.${P}`)],...L?{ignores:L}:{},languageOptions:{parser:q,parserOptions:{extraFileExtensions:o.map(P=>`.${P}`),sourceType:"module",..._?{projectService:{allowDefaultProject:["./*.js"],defaultProject:J},tsconfigRootDir:process.cwd()}:{},...p}},name:`anolilab/typescript/${_?"type-aware-parser":"parser"}`}),"makeParser"),I=[{name:"anolilab/typescript/setup",plugins:{"@typescript-eslint":v,"no-for-of-array":T}},...$?[D(!1,s),D(!0,R,A)]:[D(!1,s)],...k.configs.strict];return $&&I.push(...k.configs.strictTypeCheckedOnly,{files:[...R,...o.map(_=>`**/*.${_}`)],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/prefer-nullish-coalescing":"error","@typescript-eslint/prefer-optional-chain":"error",...i}},{files:n.getFilesGlobs("all"),name:"anolilab/typescript/no-for-of-array/rules",rules:{"no-for-of-array/no-for-of-array":"error"}}),I.push({files:s,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":h["no-array-constructor"],"@typescript-eslint/no-confusing-non-null-assertion":"error","@typescript-eslint/no-dupe-class-members":x["no-dupe-class-members"],"@typescript-eslint/no-duplicate-enum-values":"error","@typescript-eslint/no-dynamic-delete":"warn","@typescript-eslint/no-empty-function":M["no-empty-function"],"@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":M["no-loop-func"],"@typescript-eslint/no-magic-numbers":M["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":M["no-redeclare"],"@typescript-eslint/no-require-imports":"error","@typescript-eslint/no-shadow":Q["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":M["no-unused-expressions"],"@typescript-eslint/no-unused-vars":Q["no-unused-vars"],"@typescript-eslint/no-use-before-define":Q["no-use-before-define"],"@typescript-eslint/no-useless-constructor":x["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":M["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":h["space-infix-ops"],...a,...d?{"@typescript-eslint/block-spacing":"off","@typescript-eslint/brace-style":"off","@typescript-eslint/comma-dangle":"off","@typescript-eslint/comma-spacing":"off","@typescript-eslint/func-call-spacing":"off","@typescript-eslint/indent":"off","@typescript-eslint/key-spacing":"off","@typescript-eslint/keyword-spacing":"off","@typescript-eslint/lines-around-comment":0,"@typescript-eslint/member-delimiter-style":"off","@typescript-eslint/no-extra-parens":"off","@typescript-eslint/no-extra-semi":"off","@typescript-eslint/object-curly-spacing":"off","@typescript-eslint/quotes":0,"@typescript-eslint/semi":"off","@typescript-eslint/space-before-blocks":"off","@typescript-eslint/space-before-function-paren":"off","@typescript-eslint/space-infix-ops":"off","@typescript-eslint/type-annotation-spacing":"off"}:{}}}),I}),Jr=n.createConfig("all",async(e,r)=>{const{files:o=r,overrides:s,packageJson:t,prettier:a,stylistic:i=!0}=e,{indent:p=4}=typeof i=="boolean"?{}:i,d=await c(import("eslint-plugin-unicorn"));return[{languageOptions:{globals:K.builtin},name:"anolilab/unicorn/plugin",plugins:{unicorn:d}},{files:o,name:"anolilab/unicorn/rules",rules:{...d.configs.recommended.rules,"unicorn/better-regex":"off","unicorn/consistent-destructuring":"off","unicorn/consistent-function-scoping":"off","unicorn/filename-case":["error",{case:"kebabCase",ignore:[/(FUNDING\.yml|README\.md|CHANGELOG\.md|CONTRIBUTING\.md|CODE_OF_CONDUCT\.md|SECURITY\.md|LICENSE)/u]}],"unicorn/no-abusive-eslint-disable":"error","unicorn/no-array-for-each":"off","unicorn/no-instanceof-builtins":"error","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"],...a?{"unicorn/empty-brace-spaces":"off","unicorn/no-nested-ternary":"off","unicorn/number-literal-case":"off","unicorn/template-indent":"off"}:{"unicorn/template-indent":["error",{indent:p}]},...s}},{files:["tsconfig.dev.json","tsconfig.prod.json"],name:"anolilab/unicorn/tsconfig-overrides",rules:{"unicorn/prevent-abbreviations":"off"}},{files:["**/*.ts","**/*.tsx","**/*.mts","**/*.cts"],name:"anolilab/unicorn/ts-overrides",rules:{"unicorn/import-style":"off"}}]});var $r=Object.defineProperty,Ur=w((e,r)=>$r(e,"name",{value:r,configurable:!0}),"n$2");const Lr=Ur(async e=>{const{attributify:r=!0,strict:o=!1}=e;return[{name:"anolilab/unocss",plugins:{unocss:await c(import("@unocss/eslint-plugin"))},rules:{"unocss/order":"warn",...r?{"unocss/order-attributify":"warn"}:{},...o?{"unocss/blocklist":"error"}:{}}}]},"unocss"),Mr=n.createConfig("jsx_and_tsx",async(e,r)=>{const{files:o=r,overrides:s}=e,t=await c(import("eslint-plugin-validate-jsx-nesting"));return[{files:o,name:"anolilab/validate-jsx-nesting/setup",plugins:{"validate-jsx-nesting":t},rules:{"validate-jsx-nesting/no-invalid-jsx-nesting":"error",...s}}]}),Rr={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,onTestFailed:!0,onTestFinished:!0};let re;const Gr=n.createConfig("vitest",async(e,r)=>{const{files:o=r,isInEditor:s=!1,overrides:t,prettier:a,tsconfigPath:i}=e,[p,d]=await Promise.all([c(import("@vitest/eslint-plugin")),c(import("eslint-plugin-no-only-tests"))]);return re=re||{...p,rules:{...p.rules,...d.rules}},[{name:"anolilab/vitest/setup",plugins:{vitest:re}},{files:o,...i?{...p.configs.env,settings:{vitest:{typecheck:!0}}}:{},languageOptions:{globals:{...Rr}},name:"anolilab/vitest/rules",rules:{...p.configs.all.rules,...p.configs.recommended.rules,"@typescript-eslint/explicit-function-return-type":"off","antfu/no-top-level-await":"off","n/prefer-global/process":"off","no-unused-expressions":"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":s?"off":"error","vitest/no-restricted-vi-methods":"off","vitest/no-standalone-expect":"error","vitest/valid-expect":["error",{alwaysAwait:!0,maxArgs:2,minArgs:1}],"vitest/valid-title":"off",...t,...a?{"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"}:{}}}]}),zr=n.createConfig("yaml",async(e,r)=>{const{files:o=r,overrides:s={},prettier:t,stylistic:a=!0}=e,{indent:i=4,quotes:p="double"}=typeof a=="boolean"?{}:a,[d,h]=await Promise.all([c(import("eslint-plugin-yml")),c(import("yaml-eslint-parser"))]);return[{files:o,languageOptions:{parser:h},name:"anolilab/yaml",plugins:{yaml:d},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","yaml/vue-custom-block/no-parsing-error":"error",...a?{"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",i==="tab"?2:i],"yaml/key-spacing":"error","yaml/no-tab-indent":"error","yaml/quotes":["error",{avoidEscape:!0,prefer:p==="backtick"?"single":p}],"yaml/spaced-comment":"error"}:{},...t?d.configs.prettier.rules:{},...s}},{files:["pnpm-workspace.yaml"],name:"anolilab/yaml/pnpm-workspace",rules:{"yaml/sort-keys":["error",{order:["packages","overrides","patchedDependencies","hoistPattern","catalog","catalogs","allowedDeprecatedVersions","allowNonAppliedPatches","configDependencies","ignoredBuiltDependencies","ignoredOptionalDependencies","neverBuiltDependencies","onlyBuiltDependencies","onlyBuiltDependenciesFile","packageExtensions","peerDependencyRules","supportedArchitectures"],pathPattern:"^$"}]}}]}),Vr=n.createConfig("all",async(e,r)=>{const{files:o=r,overrides:s}=e,t=await c(import("eslint-plugin-you-dont-need-lodash-underscore"));return[{files:o,plugins:{"you-dont-need-lodash-underscore":ce.fixupPluginRules(t)},rules:{...t.configs.all.rules,...s}}]}),Br=n.createConfig("all",async(e,r)=>{const{files:o=r,overrides:s}=e,t=await c(import("eslint-plugin-zod"));return[{files:o,plugins:{zod:t},rules:{"zod/prefer-enum":"error","zod/require-strict":"error",...s}}]});var Wr=Object.defineProperty,Xr=w((e,r)=>Wr(e,"name",{value:r,configurable:!0}),"e$1");const Hr=Xr(()=>!!(process.env.GIT_PARAMS||process.env.VSCODE_GIT_COMMAND||process.env.npm_lifecycle_script?.startsWith("lint-staged")),"isInGitHooksOrLintStaged");var Kr=Object.defineProperty,Qr=w((e,r)=>Kr(e,"name",{value:r,configurable:!0}),"e");const Yr=Qr(()=>process.env.CI||Hr()?!1:!!(process.env.VSCODE_PID??process.env.VSCODE_CWD??process.env.JETBRAINS_IDE??process.env.VIM??process.env.NVIM),"isInEditorEnvironment");var Zr=Object.defineProperty,W=w((e,r)=>Zr(e,"name",{value:r,configurable:!0}),"p");const es=["name","languageOptions","linterOptions","processor","plugins","rules","settings"],X=W((e,r)=>typeof e[r]=="boolean"?{}:e[r]||{},"resolveSubOptions"),u=W((e,r)=>{const o=X(e,r);return{...e.overrides?.[r],..."overrides"in o?o.overrides:{}}},"getOverrides"),g=W((e,r)=>{const o=X(e,r);if("files"in o)return typeof o.files=="string"?[o.files]:o.files},"getFiles"),rs=W(async(e={},...r)=>{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 o=e.cwd??process.cwd(),s=m.parsePackageJson(je.readFileSync(ve.join(o,"package.json"),"utf8")),t=m.hasPackageJsonAnyDependency(s,["prettier"]),a=m.hasPackageJsonAnyDependency(s,["@anolilab/eslint-config"]),i=m.hasPackageJsonAnyDependency(s,["react","react-dom"]),p=s?.dependencies?.react||s?.devDependencies?.react;let d=!1;if(p!==void 0){const f=se.parse(p);f?.major&&f.major>=19&&(d=!0)}let h=!1;const x=s?.dependencies?.tailwindcss||s?.devDependencies?.tailwindcss;if(x){const f=se.parse(x);f?.major&&f.major<=3&&(h=!0)}const{astro:v=m.hasPackageJsonAnyDependency(s,["astro"]),componentExts:q=[],css:k=m.hasPackageJsonAnyDependency(s,["postcss","cssnano"]),gitignore:T=!0,html:R=!1,jsx:A=m.hasPackageJsonAnyDependency(s,["eslint-plugin-jsx-a11y","eslint-plugin-validate-jsx-nesting"])||i,lodash:J=m.hasPackageJsonAnyDependency(s,["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"]),playwright:$=m.hasPackageJsonAnyDependency(s,["playwright","eslint-plugin-playwright"]),react:D=i||m.hasPackageJsonAnyDependency(s,["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"]),reactCompiler:I=d,regexp:_=!0,silent:U=!1,storybook:L=m.hasPackageJsonAnyDependency(s,["storybook","eslint-plugin-storybook"]),tailwindcss:P=h,tanstackQuery:N=m.hasPackageJsonAnyDependency(s,["@tanstack/react-query"]),tanstackRouter:S=m.hasPackageJsonAnyDependency(s,["@tanstack/react-router"]),testingLibrary:E=m.hasPackageJsonAnyDependency(s,["@testing-library/dom","@testing-library/react"]),tsdoc:G=!1,typescript:B=m.hasPackageJsonAnyDependency(s,["typescript"]),unicorn:C=!0,unocss:ne=!1,vitest:me=m.hasPackageJsonAnyDependency(s,["vitest"]),zod:ae=m.hasPackageJsonAnyDependency(s,["zod"])}=e;if(a){let f=[];ae&&f.push("eslint-plugin-zod"),ne&&f.push("@unocss/eslint-plugin"),N&&f.push("@tanstack/eslint-plugin-query"),S&&f.push("@tanstack/eslint-plugin-router"),(k||P)&&f.push("@eslint/css"),P&&f.push("eslint-plugin-tailwindcss"),L&&f.push("eslint-plugin-storybook"),D&&f.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"),D&&I&&f.push("eslint-plugin-react-compiler"),E&&f.push("eslint-plugin-testing-library"),A&&f.push("eslint-plugin-jsx-a11y","eslint-plugin-validate-jsx-nesting"),J&&f.push("eslint-plugin-you-dont-need-lodash-underscore"),G&&f.push("eslint-plugin-tsdoc"),e.formatters&&f.push("eslint-plugin-format"),$&&f.push("playwright-eslint-plugin"),v&&(f.push("eslint-plugin-astro","astro-eslint-parser","@typescript-eslint/parser"),typeof e.formatters=="object"&&e.formatters.astro&&f.push("prettier-plugin-astro")),typeof e.formatters=="object"&&(e.formatters?.markdown&&e.formatters?.slidev&&f.push("prettier-plugin-slidev"),(e.formatters?.xml||e.formatters?.svg)&&f.push("@prettier/plugin-xml")),f=f.filter(Boolean),f.length>0&&await m.ensurePackages(s,f,"devDependencies",{confirm:{message:W(V=>`@anolilab/eslint-config requires the following ${V.length===1?"package":"packages"} to be installed:
|
|
18
18
|
|
|
19
19
|
"${V.join(`"
|
|
20
20
|
"`)}"
|
package/dist/index.d.cts
CHANGED
|
@@ -2650,6 +2650,11 @@ interface RuleOptions {
|
|
|
2650
2650
|
* @see https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/no-sync.md
|
|
2651
2651
|
*/
|
|
2652
2652
|
'n/no-sync'?: Linter.RuleEntry<NNoSync>
|
|
2653
|
+
/**
|
|
2654
|
+
* disallow top-level `await` in published modules
|
|
2655
|
+
* @see https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/no-top-level-await.md
|
|
2656
|
+
*/
|
|
2657
|
+
'n/no-top-level-await'?: Linter.RuleEntry<NNoTopLevelAwait>
|
|
2653
2658
|
/**
|
|
2654
2659
|
* disallow `bin` files that npm ignores
|
|
2655
2660
|
* @see https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/no-unpublished-bin.md
|
|
@@ -11395,7 +11400,38 @@ type NNoRestrictedRequire = []|[(string | {
|
|
|
11395
11400
|
// ----- n/no-sync -----
|
|
11396
11401
|
type NNoSync = []|[{
|
|
11397
11402
|
allowAtRootLevel?: boolean
|
|
11398
|
-
ignores?: string
|
|
11403
|
+
ignores?: (string | {
|
|
11404
|
+
from?: "file"
|
|
11405
|
+
path?: string
|
|
11406
|
+
name?: string[]
|
|
11407
|
+
} | {
|
|
11408
|
+
from?: "lib"
|
|
11409
|
+
name?: string[]
|
|
11410
|
+
} | {
|
|
11411
|
+
from?: "package"
|
|
11412
|
+
package?: string
|
|
11413
|
+
name?: string[]
|
|
11414
|
+
})[]
|
|
11415
|
+
}]
|
|
11416
|
+
// ----- n/no-top-level-await -----
|
|
11417
|
+
type NNoTopLevelAwait = []|[{
|
|
11418
|
+
ignoreBin?: boolean
|
|
11419
|
+
convertPath?: ({
|
|
11420
|
+
|
|
11421
|
+
[k: string]: [string, string]
|
|
11422
|
+
} | [{
|
|
11423
|
+
|
|
11424
|
+
include: [string, ...(string)[]]
|
|
11425
|
+
exclude?: string[]
|
|
11426
|
+
|
|
11427
|
+
replace: [string, string]
|
|
11428
|
+
}, ...({
|
|
11429
|
+
|
|
11430
|
+
include: [string, ...(string)[]]
|
|
11431
|
+
exclude?: string[]
|
|
11432
|
+
|
|
11433
|
+
replace: [string, string]
|
|
11434
|
+
})[]])
|
|
11399
11435
|
}]
|
|
11400
11436
|
// ----- n/no-unpublished-bin -----
|
|
11401
11437
|
type NNoUnpublishedBin = []|[{
|
package/dist/index.d.mts
CHANGED
|
@@ -2650,6 +2650,11 @@ interface RuleOptions {
|
|
|
2650
2650
|
* @see https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/no-sync.md
|
|
2651
2651
|
*/
|
|
2652
2652
|
'n/no-sync'?: Linter.RuleEntry<NNoSync>
|
|
2653
|
+
/**
|
|
2654
|
+
* disallow top-level `await` in published modules
|
|
2655
|
+
* @see https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/no-top-level-await.md
|
|
2656
|
+
*/
|
|
2657
|
+
'n/no-top-level-await'?: Linter.RuleEntry<NNoTopLevelAwait>
|
|
2653
2658
|
/**
|
|
2654
2659
|
* disallow `bin` files that npm ignores
|
|
2655
2660
|
* @see https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/no-unpublished-bin.md
|
|
@@ -11395,7 +11400,38 @@ type NNoRestrictedRequire = []|[(string | {
|
|
|
11395
11400
|
// ----- n/no-sync -----
|
|
11396
11401
|
type NNoSync = []|[{
|
|
11397
11402
|
allowAtRootLevel?: boolean
|
|
11398
|
-
ignores?: string
|
|
11403
|
+
ignores?: (string | {
|
|
11404
|
+
from?: "file"
|
|
11405
|
+
path?: string
|
|
11406
|
+
name?: string[]
|
|
11407
|
+
} | {
|
|
11408
|
+
from?: "lib"
|
|
11409
|
+
name?: string[]
|
|
11410
|
+
} | {
|
|
11411
|
+
from?: "package"
|
|
11412
|
+
package?: string
|
|
11413
|
+
name?: string[]
|
|
11414
|
+
})[]
|
|
11415
|
+
}]
|
|
11416
|
+
// ----- n/no-top-level-await -----
|
|
11417
|
+
type NNoTopLevelAwait = []|[{
|
|
11418
|
+
ignoreBin?: boolean
|
|
11419
|
+
convertPath?: ({
|
|
11420
|
+
|
|
11421
|
+
[k: string]: [string, string]
|
|
11422
|
+
} | [{
|
|
11423
|
+
|
|
11424
|
+
include: [string, ...(string)[]]
|
|
11425
|
+
exclude?: string[]
|
|
11426
|
+
|
|
11427
|
+
replace: [string, string]
|
|
11428
|
+
}, ...({
|
|
11429
|
+
|
|
11430
|
+
include: [string, ...(string)[]]
|
|
11431
|
+
exclude?: string[]
|
|
11432
|
+
|
|
11433
|
+
replace: [string, string]
|
|
11434
|
+
})[]])
|
|
11399
11435
|
}]
|
|
11400
11436
|
// ----- n/no-unpublished-bin -----
|
|
11401
11437
|
type NNoUnpublishedBin = []|[{
|
package/dist/index.d.ts
CHANGED
|
@@ -2650,6 +2650,11 @@ interface RuleOptions {
|
|
|
2650
2650
|
* @see https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/no-sync.md
|
|
2651
2651
|
*/
|
|
2652
2652
|
'n/no-sync'?: Linter.RuleEntry<NNoSync>
|
|
2653
|
+
/**
|
|
2654
|
+
* disallow top-level `await` in published modules
|
|
2655
|
+
* @see https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/no-top-level-await.md
|
|
2656
|
+
*/
|
|
2657
|
+
'n/no-top-level-await'?: Linter.RuleEntry<NNoTopLevelAwait>
|
|
2653
2658
|
/**
|
|
2654
2659
|
* disallow `bin` files that npm ignores
|
|
2655
2660
|
* @see https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/no-unpublished-bin.md
|
|
@@ -11395,7 +11400,38 @@ type NNoRestrictedRequire = []|[(string | {
|
|
|
11395
11400
|
// ----- n/no-sync -----
|
|
11396
11401
|
type NNoSync = []|[{
|
|
11397
11402
|
allowAtRootLevel?: boolean
|
|
11398
|
-
ignores?: string
|
|
11403
|
+
ignores?: (string | {
|
|
11404
|
+
from?: "file"
|
|
11405
|
+
path?: string
|
|
11406
|
+
name?: string[]
|
|
11407
|
+
} | {
|
|
11408
|
+
from?: "lib"
|
|
11409
|
+
name?: string[]
|
|
11410
|
+
} | {
|
|
11411
|
+
from?: "package"
|
|
11412
|
+
package?: string
|
|
11413
|
+
name?: string[]
|
|
11414
|
+
})[]
|
|
11415
|
+
}]
|
|
11416
|
+
// ----- n/no-top-level-await -----
|
|
11417
|
+
type NNoTopLevelAwait = []|[{
|
|
11418
|
+
ignoreBin?: boolean
|
|
11419
|
+
convertPath?: ({
|
|
11420
|
+
|
|
11421
|
+
[k: string]: [string, string]
|
|
11422
|
+
} | [{
|
|
11423
|
+
|
|
11424
|
+
include: [string, ...(string)[]]
|
|
11425
|
+
exclude?: string[]
|
|
11426
|
+
|
|
11427
|
+
replace: [string, string]
|
|
11428
|
+
}, ...({
|
|
11429
|
+
|
|
11430
|
+
include: [string, ...(string)[]]
|
|
11431
|
+
exclude?: string[]
|
|
11432
|
+
|
|
11433
|
+
replace: [string, string]
|
|
11434
|
+
})[]])
|
|
11399
11435
|
}]
|
|
11400
11436
|
// ----- n/no-unpublished-bin -----
|
|
11401
11437
|
type NNoUnpublishedBin = []|[{
|
package/dist/index.mjs
CHANGED
|
@@ -16,7 +16,7 @@ Please remove "eslint-plugin-typescript-sort-keys" from your package.json, it co
|
|
|
16
16
|
If you dont use the new react jsx-runtime in you project, please enable it manually.
|
|
17
17
|
`))}I=I&&f!==!1;let W;return I&&(console.info(`
|
|
18
18
|
@anolilab/eslint-config enabling react-compiler plugin
|
|
19
|
-
`),W=i(import("eslint-plugin-react-compiler"))),[{name:"anolilab/react/setup",plugins:{react:F,"react-dom":T["@eslint-react/dom"],"react-hooks":$,"react-hooks-extra":T["@eslint-react/hooks-extra"],"react-naming-convention":T["@eslint-react/naming-convention"],"react-perf":S,"react-refresh":U,"react-web-api":T["@eslint-react/web-api"],"react-x":T["@eslint-react"],"react-you-might-not-need-an-effect":N,...I?{"react-compiler":W}:{}}},{files:o,languageOptions:{parserOptions:{ecmaFeatures:{jsx:!0}}},name:"anolilab/react/rules",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",{...se,allow:[...se.allow,"__REDUX_DEVTOOLS_EXTENSION_COMPOSE__"]}],"react-hooks-extra/no-direct-set-state-in-use-effect":"error","react-hooks-extra/no-unnecessary-use-callback":"error","react-hooks-extra/no-unnecessary-use-memo":"error","react-hooks-extra/no-unnecessary-use-prefix":"error","react-hooks-extra/prefer-use-state-lazy-initialization":"error","react-hooks/exhaustive-deps":"error","react-hooks/rules-of-hooks":"error","react-naming-convention/component-name":"error","react-naming-convention/context-name":"error","react-naming-convention/filename":"off","react-naming-convention/use-state":"error","react-refresh/only-export-components":["error",{allowConstantExport:_,allowExportNames:[...M?["dynamic","dynamicParams","revalidate","fetchCache","runtime","preferredRegion","maxDuration","config","generateStaticParams","metadata","generateMetadata","viewport","generateViewport"]:[],...L||O?["meta","links","headers","loader","action"]:[]]}],"react-web-api/no-leaked-event-listener":"error","react-web-api/no-leaked-interval":"error","react-web-api/no-leaked-resize-observer":"error","react-web-api/no-leaked-timeout":"error","react-x/avoid-shorthand-boolean":"off","react-x/avoid-shorthand-fragment":"off","react-x/jsx-key-before-spread":"error","react-x/jsx-no-duplicate-props":"error","react-x/jsx-no-undef":"off","react-x/jsx-uses-react":z?"off":"error","react-x/jsx-uses-vars":"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-prop":"off","react-x/no-children-to-array":"error","react-x/no-class-component":"off","react-x/no-clone-element":"error","react-x/no-comment-textnodes":"error","react-x/no-complex-conditional-rendering":"off","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-default-props":"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":"error","react-x/no-leaked-conditional-rendering":"error","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/no-prop-types":"error","react-x/no-redundant-should-component-update":"error","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-string-refs":"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/no-useless-forward-ref":"error","react-x/no-useless-fragment":"off","react-x/prefer-destructuring-assignment":"off","react-x/prefer-react-namespace-import":"off","react-x/prefer-read-only-props":"off","react-x/prefer-shorthand-boolean":"off","react-x/prefer-shorthand-fragment":"off","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":["error","line-aligned"],"react/jsx-curly-brace-presence":["error",{children:"never",props:"never"}],"react/jsx-curly-newline":["error",{multiline:"consistent",singleline:"consistent"}],"react/jsx-curly-spacing":["error","never",{allowMultiline:!0}],"react/jsx-equals-spacing":["error","never"],"react/jsx-first-prop-new-line":["error","multiline-multiprop"],"react/jsx-fragments":["error","syntax"],"react/jsx-handler-names":["off",{eventHandlerPrefix:"handle",eventHandlerPropPrefix:"on"}],"react/jsx-indent":["error",k,{checkAttributes:!0,indentLogicalExpressions:!0}],"react/jsx-indent-props":["error",k],"react/jsx-key":"off","react/jsx-max-depth":"off","react/jsx-max-props-per-line":["error",{maximum:1,when:"multiline"}],"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":["error",{allow:"single-child"}],"react/jsx-pascal-case":["error",{allowAllCaps:!0,ignore:[]}],"react/jsx-props-no-multi-spaces":"error","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":["error",{afterOpening:"never",beforeClosing:"never",beforeSelfClosing:"always",closingSlash:"never"}],"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",...I?{"react-compiler/react-compiler":"error"}:{},...S?.configs?.flat?.recommended?.rules,"react-you-might-not-need-an-effect/you-might-not-need-an-effect":"warn",...l?{"react/jsx-child-element-spacing":"off","react/jsx-closing-bracket-location":"off","react/jsx-closing-tag-location":"off","react/jsx-curly-newline":"off","react/jsx-curly-spacing":"off","react/jsx-equals-spacing":"off","react/jsx-first-prop-new-line":"off","react/jsx-indent":"off","react/jsx-indent-props":"off","react/jsx-max-props-per-line":"off","react/jsx-newline":"off","react/jsx-one-expression-per-line":"off","react/jsx-props-no-multi-spaces":"off","react/jsx-tag-spacing":"off","react/jsx-wrap-multilines":"off"}:{},...n},settings:{propWrapperFunctions:["forbidExtraProps","exact","Object.freeze"],react:{version:E??"detect"},"react-x":{version:E??"detect"}}},{files:["**/*.jsx"],languageOptions:{parserOptions:{ecmaFeatures:{jsx:!0}}},name:"anolilab/react/jsx",rules:{"react-x/naming-convention/filename-extension":["error","as-needed"],"react/jsx-closing-tag-location":"error","react/jsx-filename-extension":"off","react/jsx-wrap-multilines":["error",{arrow:"parens-new-line",assignment:"parens-new-line",condition:"parens-new-line",declaration:"parens-new-line",logical:"parens-new-line",prop:"parens-new-line",return:"parens-new-line"}],"react/no-typos":"error"},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"}},{files:u("storybook"),name:"anolilab/react/storybook",rules:{"react/jsx-props-no-spreading":"off"}},...q?[{files:s,ignores:t,name:"anolilab/react/type-aware-rules",rules:{...A}}]:[]]}),gr=p("all",async(e,r)=>{const{files:o=r,level:s,overrides:t}=e,n=ve["flat/recommended"],a={...n.rules};if(s==="warn")for(const l in a)a[l]==="error"&&(a[l]="warn");return[{...n,files:o,name:"anolilab/regexp/rules",rules:{...a,...t}}]}),hr=p("all",async(e,r)=>{const{files:o=r,overrides:s}=e,t=await i(import("eslint-plugin-simple-import-sort"));return[{files:o,name:"anolilab/simple-import-sort",plugins:{"simple-import-sort":t},rules:{"simple-import-sort/exports":"error","simple-import-sort/imports":"error",...s}}]}),br=p("all",async(e,r)=>{const{files:o=r,overrides:s}=e,t=await i(import("eslint-plugin-sonarjs"));return[{name:"anolilab/sonarjs/plugin",plugins:{sonarjs:t}},{files:o,name:"anolilab/sonarjs/rules",rules:{...t.configs.recommended.rules,"sonarjs/file-name-differ-from-class":"error","sonarjs/no-collapsible-if":"error","sonarjs/no-nested-template-literals":"off","sonarjs/no-tab":"error","sonarjs/todo-tag":"off",...s}},{files:u("js_and_ts"),name:"anolilab/sonarjs/js-and-ts-rules",rules:{"sonarjs/cognitive-complexity":["error",15],"sonarjs/no-duplicate-string":"off"}},{files:u("js"),languageOptions:{ecmaVersion:2020},name:"anolilab/sonarjs/js-rules",rules:{"sonarjs/no-all-duplicated-branches":"off","sonarjs/no-duplicate-string":"off"}}]}),xr=p("storybook",async e=>{const{overrides:r}=e,o=[...(await i(import("eslint-plugin-storybook"))).configs["flat/recommended"]];return o[0].rules={...o[0].rules,...r},o}),wr=p("jsx_and_tsx",async(e,r)=>{const{files:o=r,overrides:s}=e,t=[...(await i(import("eslint-plugin-tailwindcss"))).configs["flat/recommended"]];return t[1].files=o,t[1].rules={...t[1].rules,...s},t}),jr=p("all",async(e,r)=>{const{files:o=r,overrides:s}=e,t=await i(import("@tanstack/eslint-plugin-query"));return[{files:o,plugins:{"@tanstack/query":t},rules:{...t.configs.recommended.rules,...s}}]}),vr=p("all",async(e,r)=>{const{files:o=r,overrides:s}=e,t=await i(import("@tanstack/eslint-plugin-router"));return[{files:o,plugins:{"@tanstack/router":t},rules:{...t.configs.recommended.rules,...s}}]}),kr=p("vitest",async(e,r)=>{const{files:o=r,overrides:s,packageJson:t}=e,n=await i(import("eslint-plugin-testing-library")),a=y(t,["react","react-dom","eslint-plugin-react"]);return[{files:o,plugins:{"testing-library":n},rules:{...n.configs["flat/dom"].rules,...a?n.configs["flat/react"].rules:{},...s}}]}),Or=p("toml",async(e,r)=>{const{files:o=r,overrides:s={},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:o,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"}:{},...s}}]}),Pr=p("ts",async(e,r)=>{const{files:o=r,overrides:s}=e,t=await i(import("eslint-plugin-tsdoc"));return[{files:o,plugins:{tsdoc:t},rules:{"tsdoc/syntax":"error",...s}}]}),K={"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"},...ke.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":["error",{args:"after-used",ignoreRestSiblings:!0,vars:"all"}],"no-use-before-define":["error",{classes:!0,functions:!0,variables:!0}]},Cr=p("all",async(e,r)=>{const{files:o=r}=e;return[{files:o,name:"anolilab/variables/rules",rules:K},{files:u("ts"),name:"anolilab/variables/ts-rules",rules:{"no-shadow":"off","no-undef":"off","no-unused-vars":"off","no-use-before-define":"off"}}]});var Sr=Object.defineProperty,_r=w((e,r)=>Sr(e,"name",{value:r,configurable:!0}),"w");const Er=p("ts",async(e,r)=>{const{componentExts:o=[],files:s=r,isInEditor:t=!1,overrides:n,overridesTypeAware:a,parserOptions:l,prettier:f}=e,h=pe,x=ie(t),[v,q,k,A]=await Promise.all([i(import("@typescript-eslint/eslint-plugin")),i(import("@typescript-eslint/parser")),i(import("typescript-eslint")),i(import("eslint-plugin-no-for-of-array"))]),J=e.filesTypeAware??u("ts"),F=e.ignoresTypeAware??["**/*.mdx/**",...u("astro")],$=e?.tsconfigPath??void 0,U=$!==void 0,S=_r((_,L,M)=>({files:[...L,...o.map(O=>`**/*.${O}`)],...M?{ignores:M}:{},languageOptions:{parser:q,parserOptions:{extraFileExtensions:o.map(O=>`.${O}`),sourceType:"module",..._?{projectService:{allowDefaultProject:["./*.js"],defaultProject:$},tsconfigRootDir:process.cwd()}:{},...l}},name:`anolilab/typescript/${_?"type-aware-parser":"parser"}`}),"makeParser"),N=[{name:"anolilab/typescript/setup",plugins:{"@typescript-eslint":v,"no-for-of-array":A}},...U?[S(!1,s),S(!0,J,F)]:[S(!1,s)],...k.configs.strict];return U&&N.push(...k.configs.strictTypeCheckedOnly,{files:[...J,...o.map(_=>`**/*.${_}`)],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/prefer-nullish-coalescing":"error","@typescript-eslint/prefer-optional-chain":"error",...a}},{files:u("all"),name:"anolilab/typescript/no-for-of-array/rules",rules:{"no-for-of-array/no-for-of-array":"error"}}),N.push({files:s,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":h["no-array-constructor"],"@typescript-eslint/no-confusing-non-null-assertion":"error","@typescript-eslint/no-dupe-class-members":x["no-dupe-class-members"],"@typescript-eslint/no-duplicate-enum-values":"error","@typescript-eslint/no-dynamic-delete":"warn","@typescript-eslint/no-empty-function":R["no-empty-function"],"@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":R["no-loop-func"],"@typescript-eslint/no-magic-numbers":R["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":R["no-redeclare"],"@typescript-eslint/no-require-imports":"error","@typescript-eslint/no-shadow":K["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":R["no-unused-expressions"],"@typescript-eslint/no-unused-vars":K["no-unused-vars"],"@typescript-eslint/no-use-before-define":K["no-use-before-define"],"@typescript-eslint/no-useless-constructor":x["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":R["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":h["space-infix-ops"],...n,...f?{"@typescript-eslint/block-spacing":"off","@typescript-eslint/brace-style":"off","@typescript-eslint/comma-dangle":"off","@typescript-eslint/comma-spacing":"off","@typescript-eslint/func-call-spacing":"off","@typescript-eslint/indent":"off","@typescript-eslint/key-spacing":"off","@typescript-eslint/keyword-spacing":"off","@typescript-eslint/lines-around-comment":0,"@typescript-eslint/member-delimiter-style":"off","@typescript-eslint/no-extra-parens":"off","@typescript-eslint/no-extra-semi":"off","@typescript-eslint/object-curly-spacing":"off","@typescript-eslint/quotes":0,"@typescript-eslint/semi":"off","@typescript-eslint/space-before-blocks":"off","@typescript-eslint/space-before-function-paren":"off","@typescript-eslint/space-infix-ops":"off","@typescript-eslint/type-annotation-spacing":"off"}:{}}}),N}),Dr=p("all",async(e,r)=>{const{files:o=r,overrides:s,packageJson:t,prettier:n,stylistic:a=!0}=e,{indent:l=4}=typeof a=="boolean"?{}:a,f=await i(import("eslint-plugin-unicorn"));return[{languageOptions:{globals:H.builtin},name:"anolilab/unicorn/plugin",plugins:{unicorn:f}},{files:o,name:"anolilab/unicorn/rules",rules:{...f.configs.recommended.rules,"unicorn/better-regex":"off","unicorn/consistent-destructuring":"off","unicorn/consistent-function-scoping":"off","unicorn/filename-case":["error",{case:"kebabCase",ignore:[/(FUNDING\.yml|README\.md|CHANGELOG\.md|CONTRIBUTING\.md|CODE_OF_CONDUCT\.md|SECURITY\.md|LICENSE)/u]}],"unicorn/no-abusive-eslint-disable":"error","unicorn/no-array-for-each":"off","unicorn/no-instanceof-builtins":"error","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?{"unicorn/empty-brace-spaces":"off","unicorn/no-nested-ternary":"off","unicorn/number-literal-case":"off","unicorn/template-indent":"off"}:{"unicorn/template-indent":["error",{indent:l}]},...s}},{files:["tsconfig.dev.json","tsconfig.prod.json"],name:"anolilab/unicorn/tsconfig-overrides",rules:{"unicorn/prevent-abbreviations":"off"}},{files:["**/*.ts","**/*.tsx","**/*.mts","**/*.cts"],name:"anolilab/unicorn/ts-overrides",rules:{"unicorn/import-style":"off"}}]});var qr=Object.defineProperty,Ir=w((e,r)=>qr(e,"name",{value:r,configurable:!0}),"n$2");const Fr=Ir(async e=>{const{attributify:r=!0,strict:o=!1}=e;return[{name:"anolilab/unocss",plugins:{unocss:await i(import("@unocss/eslint-plugin"))},rules:{"unocss/order":"warn",...r?{"unocss/order-attributify":"warn"}:{},...o?{"unocss/blocklist":"error"}:{}}}]},"unocss"),Nr=p("jsx_and_tsx",async(e,r)=>{const{files:o=r,overrides:s}=e,t=await i(import("eslint-plugin-validate-jsx-nesting"));return[{files:o,name:"anolilab/validate-jsx-nesting/setup",plugins:{"validate-jsx-nesting":t},rules:{"validate-jsx-nesting/no-invalid-jsx-nesting":"error",...s}}]}),Tr={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,onTestFailed:!0,onTestFinished:!0};let ee;const Ar=p("vitest",async(e,r)=>{const{files:o=r,isInEditor:s=!1,overrides:t,prettier:n,tsconfigPath:a}=e,[l,f]=await Promise.all([i(import("@vitest/eslint-plugin")),i(import("eslint-plugin-no-only-tests"))]);return ee=ee||{...l,rules:{...l.rules,...f.rules}},[{name:"anolilab/vitest/setup",plugins:{vitest:ee}},{files:o,...a?{...l.configs.env,settings:{vitest:{typecheck:!0}}}:{},languageOptions:{globals:{...Tr}},name:"anolilab/vitest/rules",rules:{...l.configs.all.rules,...l.configs.recommended.rules,"@typescript-eslint/explicit-function-return-type":"off","antfu/no-top-level-await":"off","n/prefer-global/process":"off","no-unused-expressions":"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":s?"off":"error","vitest/no-restricted-vi-methods":"off","vitest/no-standalone-expect":"error","vitest/valid-expect":["error",{alwaysAwait:!0,maxArgs:2,minArgs:1}],"vitest/valid-title":"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"}:{}}}]}),$r=p("yaml",async(e,r)=>{const{files:o=r,overrides:s={},prettier:t,stylistic:n=!0}=e,{indent:a=4,quotes:l="double"}=typeof n=="boolean"?{}:n,[f,h]=await Promise.all([i(import("eslint-plugin-yml")),i(import("yaml-eslint-parser"))]);return[{files:o,languageOptions:{parser:h},name:"anolilab/yaml",plugins:{yaml:f},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","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"}:{},...t?f.configs.prettier.rules:{},...s}},{files:["pnpm-workspace.yaml"],name:"anolilab/yaml/pnpm-workspace",rules:{"yaml/sort-keys":["error",{order:["packages","overrides","patchedDependencies","hoistPattern","catalog","catalogs","allowedDeprecatedVersions","allowNonAppliedPatches","configDependencies","ignoredBuiltDependencies","ignoredOptionalDependencies","neverBuiltDependencies","onlyBuiltDependencies","onlyBuiltDependenciesFile","packageExtensions","peerDependencyRules","supportedArchitectures"],pathPattern:"^$"}]}}]}),Ur=p("all",async(e,r)=>{const{files:o=r,overrides:s}=e,t=await i(import("eslint-plugin-you-dont-need-lodash-underscore"));return[{files:o,plugins:{"you-dont-need-lodash-underscore":ae(t)},rules:{...t.configs.all.rules,...s}}]}),Lr=p("all",async(e,r)=>{const{files:o=r,overrides:s}=e,t=await i(import("eslint-plugin-zod"));return[{files:o,plugins:{zod:t},rules:{"zod/prefer-enum":"error","zod/require-strict":"error",...s}}]});var Mr=Object.defineProperty,Rr=w((e,r)=>Mr(e,"name",{value:r,configurable:!0}),"e$1");const Jr=Rr(()=>!!(process.env.GIT_PARAMS||process.env.VSCODE_GIT_COMMAND||process.env.npm_lifecycle_script?.startsWith("lint-staged")),"isInGitHooksOrLintStaged");var zr=Object.defineProperty,Vr=w((e,r)=>zr(e,"name",{value:r,configurable:!0}),"e");const Br=Vr(()=>process.env.CI||Jr()?!1:!!(process.env.VSCODE_PID??process.env.VSCODE_CWD??process.env.JETBRAINS_IDE??process.env.VIM??process.env.NVIM),"isInEditorEnvironment");var Wr=Object.defineProperty,X=w((e,r)=>Wr(e,"name",{value:r,configurable:!0}),"p");const Xr=["name","languageOptions","linterOptions","processor","plugins","rules","settings"],Q=X((e,r)=>typeof e[r]=="boolean"?{}:e[r]||{},"resolveSubOptions"),d=X((e,r)=>{const o=Q(e,r);return{...e.overrides?.[r],..."overrides"in o?o.overrides:{}}},"getOverrides"),g=X((e,r)=>{const o=Q(e,r);if("files"in o)return typeof o.files=="string"?[o.files]:o.files},"getFiles"),ls=X(async(e={},...r)=>{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 o=e.cwd??process.cwd(),s=ye(ue(me(o,"package.json"),"utf8")),t=y(s,["prettier"]),n=y(s,["@anolilab/eslint-config"]),a=y(s,["react","react-dom"]),l=s?.dependencies?.react||s?.devDependencies?.react;let f=!1;if(l!==void 0){const c=re(l);c?.major&&c.major>=19&&(f=!0)}let h=!1;const x=s?.dependencies?.tailwindcss||s?.devDependencies?.tailwindcss;if(x){const c=re(x);c?.major&&c.major<=3&&(h=!0)}const{astro:v=y(s,["astro"]),componentExts:q=[],css:k=y(s,["postcss","cssnano"]),gitignore:A=!0,html:J=!1,jsx:F=y(s,["eslint-plugin-jsx-a11y","eslint-plugin-validate-jsx-nesting"])||a,lodash:$=y(s,["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"]),playwright:U=y(s,["playwright","eslint-plugin-playwright"]),react:S=a||y(s,["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"]),reactCompiler:N=f,regexp:_=!0,silent:L=!1,storybook:M=y(s,["storybook","eslint-plugin-storybook"]),tailwindcss:O=h,tanstackQuery:T=y(s,["@tanstack/react-query"]),tanstackRouter:E=y(s,["@tanstack/react-router"]),testingLibrary:I=y(s,["@testing-library/dom","@testing-library/react"]),tsdoc:z=!1,typescript:W=y(s,["typescript"]),unicorn:P=!0,unocss:oe=!1,vitest:fe=y(s,["vitest"]),zod:te=y(s,["zod"])}=e;if(n){let c=[];te&&c.push("eslint-plugin-zod"),oe&&c.push("@unocss/eslint-plugin"),T&&c.push("@tanstack/eslint-plugin-query"),E&&c.push("@tanstack/eslint-plugin-router"),(k||O)&&c.push("@eslint/css"),O&&c.push("eslint-plugin-tailwindcss"),M&&c.push("eslint-plugin-storybook"),S&&c.push("eslint-plugin-react","@eslint-react/eslint-plugin","eslint-plugin-react-hooks","eslint-plugin-react-perf","eslint-plugin-react-you-might-not-need-an-effect"),S&&N&&c.push("eslint-plugin-react-compiler"),I&&c.push("eslint-plugin-testing-library"),F&&c.push("eslint-plugin-jsx-a11y","eslint-plugin-validate-jsx-nesting"),$&&c.push("eslint-plugin-you-dont-need-lodash-underscore"),z&&c.push("eslint-plugin-tsdoc"),e.formatters&&c.push("eslint-plugin-format"),U&&c.push("playwright-eslint-plugin"),v&&(c.push("eslint-plugin-astro","astro-eslint-parser","@typescript-eslint/parser"),typeof e.formatters=="object"&&e.formatters.astro&&c.push("prettier-plugin-astro")),typeof e.formatters=="object"&&(e.formatters?.markdown&&e.formatters?.slidev&&c.push("prettier-plugin-slidev"),(e.formatters?.xml||e.formatters?.svg)&&c.push("@prettier/plugin-xml")),c=c.filter(Boolean),c.length>0&&await ge(s,c,"devDependencies",{confirm:{message:X(B=>`@anolilab/eslint-config requires the following ${B.length===1?"package":"packages"} to be installed:
|
|
19
|
+
`),W=i(import("eslint-plugin-react-compiler"))),[{name:"anolilab/react/setup",plugins:{react:F,"react-dom":T["@eslint-react/dom"],"react-hooks":$,"react-hooks-extra":T["@eslint-react/hooks-extra"],"react-naming-convention":T["@eslint-react/naming-convention"],"react-perf":S,"react-refresh":U,"react-web-api":T["@eslint-react/web-api"],"react-x":T["@eslint-react"],"react-you-might-not-need-an-effect":N,...I?{"react-compiler":W}:{}}},{files:o,languageOptions:{parserOptions:{ecmaFeatures:{jsx:!0}}},name:"anolilab/react/rules",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",{...se,allow:[...se.allow,"__REDUX_DEVTOOLS_EXTENSION_COMPOSE__"]}],"react-hooks-extra/no-direct-set-state-in-use-effect":"error","react-hooks-extra/no-unnecessary-use-callback":"error","react-hooks-extra/no-unnecessary-use-memo":"error","react-hooks-extra/no-unnecessary-use-prefix":"error","react-hooks-extra/prefer-use-state-lazy-initialization":"error","react-hooks/exhaustive-deps":"error","react-hooks/rules-of-hooks":"error","react-naming-convention/component-name":"error","react-naming-convention/context-name":"error","react-naming-convention/filename":"off","react-naming-convention/use-state":"error","react-refresh/only-export-components":["error",{allowConstantExport:_,allowExportNames:[...M?["dynamic","dynamicParams","revalidate","fetchCache","runtime","preferredRegion","maxDuration","config","generateStaticParams","metadata","generateMetadata","viewport","generateViewport"]:[],...L||O?["meta","links","headers","loader","action"]:[]]}],"react-web-api/no-leaked-event-listener":"error","react-web-api/no-leaked-interval":"error","react-web-api/no-leaked-resize-observer":"error","react-web-api/no-leaked-timeout":"error","react-x/avoid-shorthand-boolean":"off","react-x/avoid-shorthand-fragment":"off","react-x/jsx-key-before-spread":"error","react-x/jsx-no-duplicate-props":"error","react-x/jsx-no-undef":"off","react-x/jsx-uses-react":z?"off":"error","react-x/jsx-uses-vars":"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-prop":"off","react-x/no-children-to-array":"error","react-x/no-class-component":"off","react-x/no-clone-element":"error","react-x/no-comment-textnodes":"error","react-x/no-complex-conditional-rendering":"off","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-default-props":"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":"error","react-x/no-leaked-conditional-rendering":"error","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/no-prop-types":"error","react-x/no-redundant-should-component-update":"error","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-string-refs":"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/no-useless-forward-ref":"error","react-x/no-useless-fragment":"off","react-x/prefer-destructuring-assignment":"off","react-x/prefer-react-namespace-import":"off","react-x/prefer-read-only-props":"off","react-x/prefer-shorthand-boolean":"off","react-x/prefer-shorthand-fragment":"off","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":["error","line-aligned"],"react/jsx-curly-brace-presence":["error",{children:"never",props:"never"}],"react/jsx-curly-newline":["error",{multiline:"consistent",singleline:"consistent"}],"react/jsx-curly-spacing":["error","never",{allowMultiline:!0}],"react/jsx-equals-spacing":["error","never"],"react/jsx-first-prop-new-line":["error","multiline-multiprop"],"react/jsx-fragments":["error","syntax"],"react/jsx-handler-names":["off",{eventHandlerPrefix:"handle",eventHandlerPropPrefix:"on"}],"react/jsx-indent":["error",k,{checkAttributes:!0,indentLogicalExpressions:!0}],"react/jsx-indent-props":["error",k],"react/jsx-key":"off","react/jsx-max-depth":"off","react/jsx-max-props-per-line":["error",{maximum:1,when:"multiline"}],"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":["error",{allow:"single-child"}],"react/jsx-pascal-case":["error",{allowAllCaps:!0,ignore:[]}],"react/jsx-props-no-multi-spaces":"error","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":["error",{afterOpening:"never",beforeClosing:"never",beforeSelfClosing:"always",closingSlash:"never"}],"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",...I?{"react-compiler/react-compiler":"error"}:{},...S?.configs?.flat?.recommended?.rules,"react-you-might-not-need-an-effect/you-might-not-need-an-effect":"warn",...l?{"react/jsx-child-element-spacing":"off","react/jsx-closing-bracket-location":"off","react/jsx-closing-tag-location":"off","react/jsx-curly-newline":"off","react/jsx-curly-spacing":"off","react/jsx-equals-spacing":"off","react/jsx-first-prop-new-line":"off","react/jsx-indent":"off","react/jsx-indent-props":"off","react/jsx-max-props-per-line":"off","react/jsx-newline":"off","react/jsx-one-expression-per-line":"off","react/jsx-props-no-multi-spaces":"off","react/jsx-tag-spacing":"off","react/jsx-wrap-multilines":"off"}:{},...n},settings:{propWrapperFunctions:["forbidExtraProps","exact","Object.freeze"],react:{version:E??"detect"},"react-x":{version:E??"detect"}}},{files:["**/*.jsx"],languageOptions:{parserOptions:{ecmaFeatures:{jsx:!0}}},name:"anolilab/react/jsx",rules:{"react-x/naming-convention/filename-extension":["error","as-needed"],"react/jsx-closing-tag-location":"error","react/jsx-filename-extension":"off","react/jsx-wrap-multilines":["error",{arrow:"parens-new-line",assignment:"parens-new-line",condition:"parens-new-line",declaration:"parens-new-line",logical:"parens-new-line",prop:"parens-new-line",return:"parens-new-line"}],"react/no-typos":"error"},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"}},{files:u("storybook"),name:"anolilab/react/storybook",rules:{"react/jsx-props-no-spreading":"off"}},...q?[{files:s,ignores:t,name:"anolilab/react/type-aware-rules",rules:{...A}}]:[]]}),gr=p("all",async(e,r)=>{const{files:o=r,level:s,overrides:t}=e,n=ve["flat/recommended"],a={...n.rules};if(s==="warn")for(const l in a)a[l]==="error"&&(a[l]="warn");return[{...n,files:o,name:"anolilab/regexp/rules",rules:{...a,...t}}]}),hr=p("all",async(e,r)=>{const{files:o=r,overrides:s}=e,t=await i(import("eslint-plugin-simple-import-sort"));return[{files:o,name:"anolilab/simple-import-sort",plugins:{"simple-import-sort":t},rules:{"simple-import-sort/exports":"error","simple-import-sort/imports":"error",...s}}]}),br=p("all",async(e,r)=>{const{files:o=r,overrides:s}=e,t=await i(import("eslint-plugin-sonarjs"));return[{name:"anolilab/sonarjs/plugin",plugins:{sonarjs:t}},{files:o,name:"anolilab/sonarjs/rules",rules:{...t.configs.recommended.rules,"sonarjs/file-name-differ-from-class":"error","sonarjs/no-collapsible-if":"error","sonarjs/no-nested-template-literals":"off","sonarjs/no-tab":"error","sonarjs/todo-tag":"off",...s}},{files:u("js_and_ts"),name:"anolilab/sonarjs/js-and-ts-rules",rules:{"sonarjs/cognitive-complexity":["error",15],"sonarjs/no-duplicate-string":"off"}},{files:u("js"),languageOptions:{ecmaVersion:2020},name:"anolilab/sonarjs/js-rules",rules:{"sonarjs/no-all-duplicated-branches":"off","sonarjs/no-duplicate-string":"off"}}]}),xr=p("storybook",async e=>{const{overrides:r}=e,o=[...(await i(import("eslint-plugin-storybook"))).configs["flat/recommended"]];return o[0].rules={...o[0].rules,...r},o}),wr=p("jsx_and_tsx",async(e,r)=>{const{files:o=r,overrides:s}=e,t=[...(await i(import("eslint-plugin-tailwindcss"))).configs["flat/recommended"]];return t[1].files=o,t[1].rules={...t[1].rules,...s},t}),jr=p("all",async(e,r)=>{const{files:o=r,overrides:s}=e,t=await i(import("@tanstack/eslint-plugin-query"));return[{files:o,plugins:{"@tanstack/query":t},rules:{...t.configs.recommended.rules,...s}}]}),vr=p("all",async(e,r)=>{const{files:o=r,overrides:s}=e,t=await i(import("@tanstack/eslint-plugin-router"));return[{files:o,plugins:{"@tanstack/router":t},rules:{...t.configs.recommended.rules,...s}}]}),kr=p("vitest",async(e,r)=>{const{files:o=r,overrides:s,packageJson:t}=e,n=await i(import("eslint-plugin-testing-library")),a=y(t,["react","react-dom","eslint-plugin-react"]);return[{files:o,plugins:{"testing-library":n},rules:{...n.configs["flat/dom"].rules,...a?n.configs["flat/react"].rules:{},...s}}]}),Or=p("toml",async(e,r)=>{const{files:o=r,overrides:s={},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:o,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"}:{},...s}}]}),Pr=p("ts",async(e,r)=>{const{files:o=r,overrides:s}=e,t=await i(import("eslint-plugin-tsdoc"));return[{files:o,plugins:{tsdoc:t},rules:{"tsdoc/syntax":"error",...s}}]}),K={"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"},...ke.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":["error",{args:"after-used",ignoreRestSiblings:!0,vars:"all"}],"no-use-before-define":["error",{classes:!0,functions:!0,variables:!0}]},Cr=p("all",async(e,r)=>{const{files:o=r}=e;return[{files:o,name:"anolilab/variables/rules",rules:K},{files:u("ts"),name:"anolilab/variables/ts-rules",rules:{"no-shadow":"off","no-undef":"off","no-unused-vars":"off","no-use-before-define":"off"}}]});var Sr=Object.defineProperty,_r=w((e,r)=>Sr(e,"name",{value:r,configurable:!0}),"w");const Er=p("ts",async(e,r)=>{const{componentExts:o=[],files:s=r,isInEditor:t=!1,overrides:n,overridesTypeAware:a,parserOptions:l,prettier:f}=e,h=pe,x=ie(t),[v,q,k,A]=await Promise.all([i(import("@typescript-eslint/eslint-plugin")),i(import("@typescript-eslint/parser")),i(import("typescript-eslint")),i(import("eslint-plugin-no-for-of-array"))]),J=e.filesTypeAware??u("ts"),F=e.ignoresTypeAware??["**/*.mdx/**",...u("astro")],$=e?.tsconfigPath??void 0,U=$!==void 0,S=_r((_,L,M)=>({files:[...L,...o.map(O=>`**/*.${O}`)],...M?{ignores:M}:{},languageOptions:{parser:q,parserOptions:{extraFileExtensions:o.map(O=>`.${O}`),sourceType:"module",..._?{projectService:{allowDefaultProject:["./*.js"],defaultProject:$},tsconfigRootDir:process.cwd()}:{},...l}},name:`anolilab/typescript/${_?"type-aware-parser":"parser"}`}),"makeParser"),N=[{name:"anolilab/typescript/setup",plugins:{"@typescript-eslint":v,"no-for-of-array":A}},...U?[S(!1,s),S(!0,J,F)]:[S(!1,s)],...k.configs.strict];return U&&N.push(...k.configs.strictTypeCheckedOnly,{files:[...J,...o.map(_=>`**/*.${_}`)],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/prefer-nullish-coalescing":"error","@typescript-eslint/prefer-optional-chain":"error",...a}},{files:u("all"),name:"anolilab/typescript/no-for-of-array/rules",rules:{"no-for-of-array/no-for-of-array":"error"}}),N.push({files:s,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":h["no-array-constructor"],"@typescript-eslint/no-confusing-non-null-assertion":"error","@typescript-eslint/no-dupe-class-members":x["no-dupe-class-members"],"@typescript-eslint/no-duplicate-enum-values":"error","@typescript-eslint/no-dynamic-delete":"warn","@typescript-eslint/no-empty-function":R["no-empty-function"],"@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":R["no-loop-func"],"@typescript-eslint/no-magic-numbers":R["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":R["no-redeclare"],"@typescript-eslint/no-require-imports":"error","@typescript-eslint/no-shadow":K["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":R["no-unused-expressions"],"@typescript-eslint/no-unused-vars":K["no-unused-vars"],"@typescript-eslint/no-use-before-define":K["no-use-before-define"],"@typescript-eslint/no-useless-constructor":x["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":R["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":h["space-infix-ops"],...n,...f?{"@typescript-eslint/block-spacing":"off","@typescript-eslint/brace-style":"off","@typescript-eslint/comma-dangle":"off","@typescript-eslint/comma-spacing":"off","@typescript-eslint/func-call-spacing":"off","@typescript-eslint/indent":"off","@typescript-eslint/key-spacing":"off","@typescript-eslint/keyword-spacing":"off","@typescript-eslint/lines-around-comment":0,"@typescript-eslint/member-delimiter-style":"off","@typescript-eslint/no-extra-parens":"off","@typescript-eslint/no-extra-semi":"off","@typescript-eslint/object-curly-spacing":"off","@typescript-eslint/quotes":0,"@typescript-eslint/semi":"off","@typescript-eslint/space-before-blocks":"off","@typescript-eslint/space-before-function-paren":"off","@typescript-eslint/space-infix-ops":"off","@typescript-eslint/type-annotation-spacing":"off"}:{}}}),N}),Dr=p("all",async(e,r)=>{const{files:o=r,overrides:s,packageJson:t,prettier:n,stylistic:a=!0}=e,{indent:l=4}=typeof a=="boolean"?{}:a,f=await i(import("eslint-plugin-unicorn"));return[{languageOptions:{globals:H.builtin},name:"anolilab/unicorn/plugin",plugins:{unicorn:f}},{files:o,name:"anolilab/unicorn/rules",rules:{...f.configs.recommended.rules,"unicorn/better-regex":"off","unicorn/consistent-destructuring":"off","unicorn/consistent-function-scoping":"off","unicorn/filename-case":["error",{case:"kebabCase",ignore:[/(FUNDING\.yml|README\.md|CHANGELOG\.md|CONTRIBUTING\.md|CODE_OF_CONDUCT\.md|SECURITY\.md|LICENSE)/u]}],"unicorn/no-abusive-eslint-disable":"error","unicorn/no-array-for-each":"off","unicorn/no-instanceof-builtins":"error","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?{"unicorn/empty-brace-spaces":"off","unicorn/no-nested-ternary":"off","unicorn/number-literal-case":"off","unicorn/template-indent":"off"}:{"unicorn/template-indent":["error",{indent:l}]},...s}},{files:["tsconfig.dev.json","tsconfig.prod.json"],name:"anolilab/unicorn/tsconfig-overrides",rules:{"unicorn/prevent-abbreviations":"off"}},{files:["**/*.ts","**/*.tsx","**/*.mts","**/*.cts"],name:"anolilab/unicorn/ts-overrides",rules:{"unicorn/import-style":"off"}}]});var qr=Object.defineProperty,Ir=w((e,r)=>qr(e,"name",{value:r,configurable:!0}),"n$2");const Fr=Ir(async e=>{const{attributify:r=!0,strict:o=!1}=e;return[{name:"anolilab/unocss",plugins:{unocss:await i(import("@unocss/eslint-plugin"))},rules:{"unocss/order":"warn",...r?{"unocss/order-attributify":"warn"}:{},...o?{"unocss/blocklist":"error"}:{}}}]},"unocss"),Nr=p("jsx_and_tsx",async(e,r)=>{const{files:o=r,overrides:s}=e,t=await i(import("eslint-plugin-validate-jsx-nesting"));return[{files:o,name:"anolilab/validate-jsx-nesting/setup",plugins:{"validate-jsx-nesting":t},rules:{"validate-jsx-nesting/no-invalid-jsx-nesting":"error",...s}}]}),Tr={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,onTestFailed:!0,onTestFinished:!0};let ee;const Ar=p("vitest",async(e,r)=>{const{files:o=r,isInEditor:s=!1,overrides:t,prettier:n,tsconfigPath:a}=e,[l,f]=await Promise.all([i(import("@vitest/eslint-plugin")),i(import("eslint-plugin-no-only-tests"))]);return ee=ee||{...l,rules:{...l.rules,...f.rules}},[{name:"anolilab/vitest/setup",plugins:{vitest:ee}},{files:o,...a?{...l.configs.env,settings:{vitest:{typecheck:!0}}}:{},languageOptions:{globals:{...Tr}},name:"anolilab/vitest/rules",rules:{...l.configs.all.rules,...l.configs.recommended.rules,"@typescript-eslint/explicit-function-return-type":"off","antfu/no-top-level-await":"off","n/prefer-global/process":"off","no-unused-expressions":"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":s?"off":"error","vitest/no-restricted-vi-methods":"off","vitest/no-standalone-expect":"error","vitest/valid-expect":["error",{alwaysAwait:!0,maxArgs:2,minArgs:1}],"vitest/valid-title":"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"}:{}}}]}),$r=p("yaml",async(e,r)=>{const{files:o=r,overrides:s={},prettier:t,stylistic:n=!0}=e,{indent:a=4,quotes:l="double"}=typeof n=="boolean"?{}:n,[f,h]=await Promise.all([i(import("eslint-plugin-yml")),i(import("yaml-eslint-parser"))]);return[{files:o,languageOptions:{parser:h},name:"anolilab/yaml",plugins:{yaml:f},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","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"}:{},...t?f.configs.prettier.rules:{},...s}},{files:["pnpm-workspace.yaml"],name:"anolilab/yaml/pnpm-workspace",rules:{"yaml/sort-keys":["error",{order:["packages","overrides","patchedDependencies","hoistPattern","catalog","catalogs","allowedDeprecatedVersions","allowNonAppliedPatches","configDependencies","ignoredBuiltDependencies","ignoredOptionalDependencies","neverBuiltDependencies","onlyBuiltDependencies","onlyBuiltDependenciesFile","packageExtensions","peerDependencyRules","supportedArchitectures"],pathPattern:"^$"}]}}]}),Ur=p("all",async(e,r)=>{const{files:o=r,overrides:s}=e,t=await i(import("eslint-plugin-you-dont-need-lodash-underscore"));return[{files:o,plugins:{"you-dont-need-lodash-underscore":ae(t)},rules:{...t.configs.all.rules,...s}}]}),Lr=p("all",async(e,r)=>{const{files:o=r,overrides:s}=e,t=await i(import("eslint-plugin-zod"));return[{files:o,plugins:{zod:t},rules:{"zod/prefer-enum":"error","zod/require-strict":"error",...s}}]});var Mr=Object.defineProperty,Rr=w((e,r)=>Mr(e,"name",{value:r,configurable:!0}),"e$1");const Jr=Rr(()=>!!(process.env.GIT_PARAMS||process.env.VSCODE_GIT_COMMAND||process.env.npm_lifecycle_script?.startsWith("lint-staged")),"isInGitHooksOrLintStaged");var zr=Object.defineProperty,Vr=w((e,r)=>zr(e,"name",{value:r,configurable:!0}),"e");const Br=Vr(()=>process.env.CI||Jr()?!1:!!(process.env.VSCODE_PID??process.env.VSCODE_CWD??process.env.JETBRAINS_IDE??process.env.VIM??process.env.NVIM),"isInEditorEnvironment");var Wr=Object.defineProperty,X=w((e,r)=>Wr(e,"name",{value:r,configurable:!0}),"p");const Xr=["name","languageOptions","linterOptions","processor","plugins","rules","settings"],Q=X((e,r)=>typeof e[r]=="boolean"?{}:e[r]||{},"resolveSubOptions"),d=X((e,r)=>{const o=Q(e,r);return{...e.overrides?.[r],..."overrides"in o?o.overrides:{}}},"getOverrides"),g=X((e,r)=>{const o=Q(e,r);if("files"in o)return typeof o.files=="string"?[o.files]:o.files},"getFiles"),ls=X(async(e={},...r)=>{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 o=e.cwd??process.cwd(),s=ye(ue(me(o,"package.json"),"utf8")),t=y(s,["prettier"]),n=y(s,["@anolilab/eslint-config"]),a=y(s,["react","react-dom"]),l=s?.dependencies?.react||s?.devDependencies?.react;let f=!1;if(l!==void 0){const c=re(l);c?.major&&c.major>=19&&(f=!0)}let h=!1;const x=s?.dependencies?.tailwindcss||s?.devDependencies?.tailwindcss;if(x){const c=re(x);c?.major&&c.major<=3&&(h=!0)}const{astro:v=y(s,["astro"]),componentExts:q=[],css:k=y(s,["postcss","cssnano"]),gitignore:A=!0,html:J=!1,jsx:F=y(s,["eslint-plugin-jsx-a11y","eslint-plugin-validate-jsx-nesting"])||a,lodash:$=y(s,["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"]),playwright:U=y(s,["playwright","eslint-plugin-playwright"]),react:S=a||y(s,["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"]),reactCompiler:N=f,regexp:_=!0,silent:L=!1,storybook:M=y(s,["storybook","eslint-plugin-storybook"]),tailwindcss:O=h,tanstackQuery:T=y(s,["@tanstack/react-query"]),tanstackRouter:E=y(s,["@tanstack/react-router"]),testingLibrary:I=y(s,["@testing-library/dom","@testing-library/react"]),tsdoc:z=!1,typescript:W=y(s,["typescript"]),unicorn:P=!0,unocss:oe=!1,vitest:fe=y(s,["vitest"]),zod:te=y(s,["zod"])}=e;if(n){let c=[];te&&c.push("eslint-plugin-zod"),oe&&c.push("@unocss/eslint-plugin"),T&&c.push("@tanstack/eslint-plugin-query"),E&&c.push("@tanstack/eslint-plugin-router"),(k||O)&&c.push("@eslint/css"),O&&c.push("eslint-plugin-tailwindcss"),M&&c.push("eslint-plugin-storybook"),S&&c.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"),S&&N&&c.push("eslint-plugin-react-compiler"),I&&c.push("eslint-plugin-testing-library"),F&&c.push("eslint-plugin-jsx-a11y","eslint-plugin-validate-jsx-nesting"),$&&c.push("eslint-plugin-you-dont-need-lodash-underscore"),z&&c.push("eslint-plugin-tsdoc"),e.formatters&&c.push("eslint-plugin-format"),U&&c.push("playwright-eslint-plugin"),v&&(c.push("eslint-plugin-astro","astro-eslint-parser","@typescript-eslint/parser"),typeof e.formatters=="object"&&e.formatters.astro&&c.push("prettier-plugin-astro")),typeof e.formatters=="object"&&(e.formatters?.markdown&&e.formatters?.slidev&&c.push("prettier-plugin-slidev"),(e.formatters?.xml||e.formatters?.svg)&&c.push("@prettier/plugin-xml")),c=c.filter(Boolean),c.length>0&&await ge(s,c,"devDependencies",{confirm:{message:X(B=>`@anolilab/eslint-config requires the following ${B.length===1?"package":"packages"} to be installed:
|
|
20
20
|
|
|
21
21
|
"${B.join(`"
|
|
22
22
|
"`)}"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anolilab/eslint-config",
|
|
3
|
-
"version": "16.2.
|
|
3
|
+
"version": "16.2.10",
|
|
4
4
|
"description": "ESLint shareable config for the Anolilab JavaScript style guide.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"anolilab",
|
|
@@ -112,8 +112,8 @@
|
|
|
112
112
|
"@html-eslint/parser": "^0.41.0",
|
|
113
113
|
"@stylistic/eslint-plugin": "^4.4.0",
|
|
114
114
|
"@stylistic/eslint-plugin-ts": "^4.4.0",
|
|
115
|
-
"@typescript-eslint/eslint-plugin": "^8.33.
|
|
116
|
-
"@typescript-eslint/parser": "^8.33.
|
|
115
|
+
"@typescript-eslint/eslint-plugin": "^8.33.1",
|
|
116
|
+
"@typescript-eslint/parser": "^8.33.1",
|
|
117
117
|
"@visulima/package": "^3.5.6",
|
|
118
118
|
"@visulima/tsconfig": "^1.1.17",
|
|
119
119
|
"@vitest/eslint-plugin": "^1.2.1",
|
|
@@ -130,7 +130,7 @@
|
|
|
130
130
|
"eslint-plugin-import-x": "^4.15.0",
|
|
131
131
|
"eslint-plugin-jsdoc": "^50.7.1",
|
|
132
132
|
"eslint-plugin-jsonc": "^2.20.1",
|
|
133
|
-
"eslint-plugin-n": "^17.
|
|
133
|
+
"eslint-plugin-n": "^17.19.0",
|
|
134
134
|
"eslint-plugin-no-for-of-array": "^0.1.0",
|
|
135
135
|
"eslint-plugin-no-only-tests": "^3.3.0",
|
|
136
136
|
"eslint-plugin-no-secrets": "^2.2.1",
|
|
@@ -150,7 +150,7 @@
|
|
|
150
150
|
"parse-gitignore": "^2.0.0",
|
|
151
151
|
"semver": "^7.7.2",
|
|
152
152
|
"toml-eslint-parser": "^0.10.0",
|
|
153
|
-
"typescript-eslint": "^8.33.
|
|
153
|
+
"typescript-eslint": "^8.33.1",
|
|
154
154
|
"yaml-eslint-parser": "^1.3.0"
|
|
155
155
|
},
|
|
156
156
|
"peerDependencies": {
|