@2digits/eslint-config 4.4.13 → 4.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +26 -6
- package/dist/index.d.ts +26 -6
- package/dist/index.mjs +1 -1
- package/package.json +13 -13
package/dist/index.d.mts
CHANGED
|
@@ -260,6 +260,11 @@ interface RuleOptions {
|
|
|
260
260
|
* @see https://github.com/eslint/css/blob/main/docs/rules/no-empty-blocks.md
|
|
261
261
|
*/
|
|
262
262
|
'css/no-empty-blocks'?: Linter.RuleEntry<[]>
|
|
263
|
+
/**
|
|
264
|
+
* Disallow !important flags
|
|
265
|
+
* @see https://github.com/eslint/css/blob/main/docs/rules/no-important.md
|
|
266
|
+
*/
|
|
267
|
+
'css/no-important'?: Linter.RuleEntry<[]>
|
|
263
268
|
/**
|
|
264
269
|
* Disallow invalid at-rules
|
|
265
270
|
* @see https://github.com/eslint/css/blob/main/docs/rules/no-invalid-at-rules.md
|
|
@@ -1289,7 +1294,7 @@ Backward pagination arguments
|
|
|
1289
1294
|
* disallow unnecessary escape usage
|
|
1290
1295
|
* @see https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-useless-escape.html
|
|
1291
1296
|
*/
|
|
1292
|
-
'jsonc/no-useless-escape'?: Linter.RuleEntry<
|
|
1297
|
+
'jsonc/no-useless-escape'?: Linter.RuleEntry<JsoncNoUselessEscape>
|
|
1293
1298
|
/**
|
|
1294
1299
|
* enforce consistent line breaks inside braces
|
|
1295
1300
|
* @see https://ota-meshi.github.io/eslint-plugin-jsonc/rules/object-curly-newline.html
|
|
@@ -2260,6 +2265,11 @@ Backward pagination arguments
|
|
|
2260
2265
|
* @deprecated
|
|
2261
2266
|
*/
|
|
2262
2267
|
'no-trailing-spaces'?: Linter.RuleEntry<NoTrailingSpaces>
|
|
2268
|
+
/**
|
|
2269
|
+
* Disallow `let` or `var` variables that are read but never assigned
|
|
2270
|
+
* @see https://eslint.org/docs/latest/rules/no-unassigned-vars
|
|
2271
|
+
*/
|
|
2272
|
+
'no-unassigned-vars'?: Linter.RuleEntry<[]>
|
|
2263
2273
|
/**
|
|
2264
2274
|
* Disallow the use of undeclared variables unless mentioned in `/*global *\/` comments
|
|
2265
2275
|
* @see https://eslint.org/docs/latest/rules/no-undef
|
|
@@ -2384,7 +2394,7 @@ Backward pagination arguments
|
|
|
2384
2394
|
* Disallow unnecessary escape characters
|
|
2385
2395
|
* @see https://eslint.org/docs/latest/rules/no-useless-escape
|
|
2386
2396
|
*/
|
|
2387
|
-
'no-useless-escape'?: Linter.RuleEntry<
|
|
2397
|
+
'no-useless-escape'?: Linter.RuleEntry<NoUselessEscape>
|
|
2388
2398
|
/**
|
|
2389
2399
|
* Disallow renaming import, export, and destructured assignments to the same name
|
|
2390
2400
|
* @see https://eslint.org/docs/latest/rules/no-useless-rename
|
|
@@ -8492,6 +8502,10 @@ type JsoncNoIrregularWhitespace = []|[{
|
|
|
8492
8502
|
skipRegExps?: boolean
|
|
8493
8503
|
skipJSXText?: boolean
|
|
8494
8504
|
}]
|
|
8505
|
+
// ----- jsonc/no-useless-escape -----
|
|
8506
|
+
type JsoncNoUselessEscape = []|[{
|
|
8507
|
+
allowRegexCharacters?: string[]
|
|
8508
|
+
}]
|
|
8495
8509
|
// ----- jsonc/object-curly-newline -----
|
|
8496
8510
|
type JsoncObjectCurlyNewline = []|[((("always" | "never") | {
|
|
8497
8511
|
multiline?: boolean
|
|
@@ -9118,6 +9132,8 @@ type MaxNestedCallbacks = []|[(number | {
|
|
|
9118
9132
|
type MaxParams = []|[(number | {
|
|
9119
9133
|
maximum?: number
|
|
9120
9134
|
max?: number
|
|
9135
|
+
|
|
9136
|
+
countVoidThis?: boolean
|
|
9121
9137
|
})]
|
|
9122
9138
|
// ----- max-statements -----
|
|
9123
9139
|
type MaxStatements = []|[(number | {
|
|
@@ -9503,6 +9519,10 @@ type NoUseBeforeDefine = []|[("nofunc" | {
|
|
|
9503
9519
|
type NoUselessComputedKey = []|[{
|
|
9504
9520
|
enforceForClassMembers?: boolean
|
|
9505
9521
|
}]
|
|
9522
|
+
// ----- no-useless-escape -----
|
|
9523
|
+
type NoUselessEscape = []|[{
|
|
9524
|
+
allowRegexCharacters?: string[]
|
|
9525
|
+
}]
|
|
9506
9526
|
// ----- no-useless-rename -----
|
|
9507
9527
|
type NoUselessRename = []|[{
|
|
9508
9528
|
ignoreDestructuring?: boolean
|
|
@@ -13395,7 +13415,7 @@ interface OptionsWithDrizzle extends OptionsOverrides {
|
|
|
13395
13415
|
*
|
|
13396
13416
|
* @default ```['drizzle', 'db']```
|
|
13397
13417
|
*/
|
|
13398
|
-
drizzleObjectName?: string | string
|
|
13418
|
+
drizzleObjectName?: string | Array<string>;
|
|
13399
13419
|
}
|
|
13400
13420
|
interface OptionsTypeScriptWithTypes extends OptionsOverrides {
|
|
13401
13421
|
/**
|
|
@@ -13409,7 +13429,7 @@ interface OptionsTypeScriptWithTypes extends OptionsOverrides {
|
|
|
13409
13429
|
}
|
|
13410
13430
|
interface OptionsWithFiles extends OptionsOverrides {
|
|
13411
13431
|
/** An array of glob patterns to match the files to which this configuration applies. */
|
|
13412
|
-
files?: string
|
|
13432
|
+
files?: Array<string>;
|
|
13413
13433
|
}
|
|
13414
13434
|
interface OptionsWithStorybook extends OptionsWithFiles {
|
|
13415
13435
|
/**
|
|
@@ -13431,7 +13451,7 @@ interface OptionsWithIgnores {
|
|
|
13431
13451
|
/** Options to pass to eslint-config-flat-gitignore */
|
|
13432
13452
|
gitIgnore?: Omit<FlatGitignoreOptions, 'name' | 'root'>;
|
|
13433
13453
|
/** An array of glob patterns to ignore in addition to the default ignores. */
|
|
13434
|
-
ignores?: string
|
|
13454
|
+
ignores?: Array<string>;
|
|
13435
13455
|
}
|
|
13436
13456
|
|
|
13437
13457
|
type SharedOptions<T = unknown> = T & {
|
|
@@ -13451,7 +13471,7 @@ interface ESLint2DigitsOptions {
|
|
|
13451
13471
|
tanstack?: SharedOptions<OptionsOverrides> | boolean;
|
|
13452
13472
|
drizzle?: SharedOptions<OptionsWithDrizzle> | boolean;
|
|
13453
13473
|
}
|
|
13454
|
-
declare function twoDigits(options?: ESLint2DigitsOptions, ...userConfig: TypedFlatConfigItem
|
|
13474
|
+
declare function twoDigits(options?: ESLint2DigitsOptions, ...userConfig: Array<TypedFlatConfigItem>): Promise<Array<TypedFlatConfigItem>>;
|
|
13455
13475
|
|
|
13456
13476
|
export { twoDigits as default, twoDigits };
|
|
13457
13477
|
export type { ConfigNames, OptionsOverrides, OptionsTypeScriptWithTypes, OptionsWithDrizzle, OptionsWithFiles, OptionsWithIgnores, OptionsWithReact, OptionsWithStorybook, Rules, TypedFlatConfigItem };
|
package/dist/index.d.ts
CHANGED
|
@@ -260,6 +260,11 @@ interface RuleOptions {
|
|
|
260
260
|
* @see https://github.com/eslint/css/blob/main/docs/rules/no-empty-blocks.md
|
|
261
261
|
*/
|
|
262
262
|
'css/no-empty-blocks'?: Linter.RuleEntry<[]>
|
|
263
|
+
/**
|
|
264
|
+
* Disallow !important flags
|
|
265
|
+
* @see https://github.com/eslint/css/blob/main/docs/rules/no-important.md
|
|
266
|
+
*/
|
|
267
|
+
'css/no-important'?: Linter.RuleEntry<[]>
|
|
263
268
|
/**
|
|
264
269
|
* Disallow invalid at-rules
|
|
265
270
|
* @see https://github.com/eslint/css/blob/main/docs/rules/no-invalid-at-rules.md
|
|
@@ -1289,7 +1294,7 @@ Backward pagination arguments
|
|
|
1289
1294
|
* disallow unnecessary escape usage
|
|
1290
1295
|
* @see https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-useless-escape.html
|
|
1291
1296
|
*/
|
|
1292
|
-
'jsonc/no-useless-escape'?: Linter.RuleEntry<
|
|
1297
|
+
'jsonc/no-useless-escape'?: Linter.RuleEntry<JsoncNoUselessEscape>
|
|
1293
1298
|
/**
|
|
1294
1299
|
* enforce consistent line breaks inside braces
|
|
1295
1300
|
* @see https://ota-meshi.github.io/eslint-plugin-jsonc/rules/object-curly-newline.html
|
|
@@ -2260,6 +2265,11 @@ Backward pagination arguments
|
|
|
2260
2265
|
* @deprecated
|
|
2261
2266
|
*/
|
|
2262
2267
|
'no-trailing-spaces'?: Linter.RuleEntry<NoTrailingSpaces>
|
|
2268
|
+
/**
|
|
2269
|
+
* Disallow `let` or `var` variables that are read but never assigned
|
|
2270
|
+
* @see https://eslint.org/docs/latest/rules/no-unassigned-vars
|
|
2271
|
+
*/
|
|
2272
|
+
'no-unassigned-vars'?: Linter.RuleEntry<[]>
|
|
2263
2273
|
/**
|
|
2264
2274
|
* Disallow the use of undeclared variables unless mentioned in `/*global *\/` comments
|
|
2265
2275
|
* @see https://eslint.org/docs/latest/rules/no-undef
|
|
@@ -2384,7 +2394,7 @@ Backward pagination arguments
|
|
|
2384
2394
|
* Disallow unnecessary escape characters
|
|
2385
2395
|
* @see https://eslint.org/docs/latest/rules/no-useless-escape
|
|
2386
2396
|
*/
|
|
2387
|
-
'no-useless-escape'?: Linter.RuleEntry<
|
|
2397
|
+
'no-useless-escape'?: Linter.RuleEntry<NoUselessEscape>
|
|
2388
2398
|
/**
|
|
2389
2399
|
* Disallow renaming import, export, and destructured assignments to the same name
|
|
2390
2400
|
* @see https://eslint.org/docs/latest/rules/no-useless-rename
|
|
@@ -8492,6 +8502,10 @@ type JsoncNoIrregularWhitespace = []|[{
|
|
|
8492
8502
|
skipRegExps?: boolean
|
|
8493
8503
|
skipJSXText?: boolean
|
|
8494
8504
|
}]
|
|
8505
|
+
// ----- jsonc/no-useless-escape -----
|
|
8506
|
+
type JsoncNoUselessEscape = []|[{
|
|
8507
|
+
allowRegexCharacters?: string[]
|
|
8508
|
+
}]
|
|
8495
8509
|
// ----- jsonc/object-curly-newline -----
|
|
8496
8510
|
type JsoncObjectCurlyNewline = []|[((("always" | "never") | {
|
|
8497
8511
|
multiline?: boolean
|
|
@@ -9118,6 +9132,8 @@ type MaxNestedCallbacks = []|[(number | {
|
|
|
9118
9132
|
type MaxParams = []|[(number | {
|
|
9119
9133
|
maximum?: number
|
|
9120
9134
|
max?: number
|
|
9135
|
+
|
|
9136
|
+
countVoidThis?: boolean
|
|
9121
9137
|
})]
|
|
9122
9138
|
// ----- max-statements -----
|
|
9123
9139
|
type MaxStatements = []|[(number | {
|
|
@@ -9503,6 +9519,10 @@ type NoUseBeforeDefine = []|[("nofunc" | {
|
|
|
9503
9519
|
type NoUselessComputedKey = []|[{
|
|
9504
9520
|
enforceForClassMembers?: boolean
|
|
9505
9521
|
}]
|
|
9522
|
+
// ----- no-useless-escape -----
|
|
9523
|
+
type NoUselessEscape = []|[{
|
|
9524
|
+
allowRegexCharacters?: string[]
|
|
9525
|
+
}]
|
|
9506
9526
|
// ----- no-useless-rename -----
|
|
9507
9527
|
type NoUselessRename = []|[{
|
|
9508
9528
|
ignoreDestructuring?: boolean
|
|
@@ -13395,7 +13415,7 @@ interface OptionsWithDrizzle extends OptionsOverrides {
|
|
|
13395
13415
|
*
|
|
13396
13416
|
* @default ```['drizzle', 'db']```
|
|
13397
13417
|
*/
|
|
13398
|
-
drizzleObjectName?: string | string
|
|
13418
|
+
drizzleObjectName?: string | Array<string>;
|
|
13399
13419
|
}
|
|
13400
13420
|
interface OptionsTypeScriptWithTypes extends OptionsOverrides {
|
|
13401
13421
|
/**
|
|
@@ -13409,7 +13429,7 @@ interface OptionsTypeScriptWithTypes extends OptionsOverrides {
|
|
|
13409
13429
|
}
|
|
13410
13430
|
interface OptionsWithFiles extends OptionsOverrides {
|
|
13411
13431
|
/** An array of glob patterns to match the files to which this configuration applies. */
|
|
13412
|
-
files?: string
|
|
13432
|
+
files?: Array<string>;
|
|
13413
13433
|
}
|
|
13414
13434
|
interface OptionsWithStorybook extends OptionsWithFiles {
|
|
13415
13435
|
/**
|
|
@@ -13431,7 +13451,7 @@ interface OptionsWithIgnores {
|
|
|
13431
13451
|
/** Options to pass to eslint-config-flat-gitignore */
|
|
13432
13452
|
gitIgnore?: Omit<FlatGitignoreOptions, 'name' | 'root'>;
|
|
13433
13453
|
/** An array of glob patterns to ignore in addition to the default ignores. */
|
|
13434
|
-
ignores?: string
|
|
13454
|
+
ignores?: Array<string>;
|
|
13435
13455
|
}
|
|
13436
13456
|
|
|
13437
13457
|
type SharedOptions<T = unknown> = T & {
|
|
@@ -13451,7 +13471,7 @@ interface ESLint2DigitsOptions {
|
|
|
13451
13471
|
tanstack?: SharedOptions<OptionsOverrides> | boolean;
|
|
13452
13472
|
drizzle?: SharedOptions<OptionsWithDrizzle> | boolean;
|
|
13453
13473
|
}
|
|
13454
|
-
declare function twoDigits(options?: ESLint2DigitsOptions, ...userConfig: TypedFlatConfigItem
|
|
13474
|
+
declare function twoDigits(options?: ESLint2DigitsOptions, ...userConfig: Array<TypedFlatConfigItem>): Promise<Array<TypedFlatConfigItem>>;
|
|
13455
13475
|
|
|
13456
13476
|
export { twoDigits as default, twoDigits };
|
|
13457
13477
|
export type { ConfigNames, OptionsOverrides, OptionsTypeScriptWithTypes, OptionsWithDrizzle, OptionsWithFiles, OptionsWithIgnores, OptionsWithReact, OptionsWithStorybook, Rules, TypedFlatConfigItem };
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{renamePluginsInRules as x,renamePluginsInConfigs as N,FlatConfigComposer as R}from"eslint-flat-config-utils";import{findUp as $}from"find-up";import{isPackageExists as c}from"local-pkg";import M from"eslint-config-flat-gitignore";import B from"@eslint/js";import U from"@stylistic/eslint-plugin";import j from"globals";import D from"eslint-plugin-de-morgan";import A from"eslint-plugin-n";import G from"@eslint-community/eslint-plugin-eslint-comments";import J from"@eslint-community/eslint-plugin-eslint-comments/configs";import V from"eslint-plugin-jsdoc";import P from"eslint-plugin-unicorn";import W from"eslint-plugin-sonarjs";import _ from"eslint-plugin-regexp";import K from"eslint-plugin-antfu";import H,{configs as b}from"eslint-plugin-jsonc";import X from"jsonc-eslint-parser";import q from"@eslint/css";import{tailwindSyntax as Q}from"@eslint/css/syntax";import Y from"eslint-plugin-yml";import Z from"yaml-eslint-parser";import z from"@eslint/markdown";import{mergeProcessors as ee,processorPassThrough as re}from"eslint-merge-processors";import{fixupPluginRules as S}from"@eslint/compat";const i="**/*.?([cm])[jt]s?(x)",L="**/*.?([cm])ts",I="**/*.?([cm])tsx",oe="**/*.stories.tsx",ne="**/*.json",se="**/*.json5",te="**/*.jsonc",ie="**/*.css",ae="**/*.y?(a)ml",E="**/*.md",le="**/*.md/*.md",h=`${E}/${i}`,ce=["**/node_modules","**/dist","**/package-lock.json","**/yarn.lock","**/pnpm-lock.yaml","**/bun.lockb","**/bun.lock","**/output","**/coverage","**/temp","**/.temp","**/tmp","**/.tmp","**/.history","**/.vitepress/cache","**/.nuxt","**/.next","**/.vercel","**/.changeset","**/.idea","**/.cache","**/.output","**/.vite-inspect","**/.yarn","**/CHANGELOG*.md","**/*.min.*","**/LICENSE*","**/__snapshots__","**/auto-import?(s).d.ts","**/components.d.ts"];function pe(){return[{files:[i],name:"2digits:antfu",plugins:{antfu:K},rules:{"antfu/if-newline":"error","antfu/top-level-function":"error"}}]}function ue(){return[{files:[i],name:"2digits:boolean",plugins:{boolean:D},rules:{...D.configs.recommended.rules}}]}const g={"@next/next":"next","@eslint-react/naming-convention":"react-naming-convention","@eslint-react/hooks-extra":"react-hooks-extra","@eslint-react/dom":"react-dom","@eslint-react/web-api":"react-web-api","@eslint-react":"react-extra","react-hooks":"react-hooks","react-compiler":"react-compiler","@stylistic/eslint-plugin":"stylistic","@typescript-eslint":"ts",node:"node","@eslint-community/eslint-comments":"comments",storybook:"storybook",turbo:"turbo",jsdoc:"jsdoc",unicorn:"unicorn",tailwindcss:"tailwindcss","@tanstack/query":"tanstack","@2digits":"@2digits","@graphql-eslint":"gql",sonarjs:"sonar",drizzle:"drizzle","de-morgan":"boolean"},me=x(J.recommended.rules,g);function de(){return[{files:[i],name:"2digits:comments",plugins:{comments:G},rules:{...me,"comments/no-unused-disable":"error","comments/disable-enable-pair":["error",{allowWholeFile:!0}]}}]}function fe(){return[{name:"2digits:css",files:[ie],language:"css/css",plugins:{css:q},languageOptions:{tolerant:!0,customSyntax:Q},rules:{...q.configs.recommended.rules}}]}async function s(e){const o=await e;return o.default||o}async function ge(e={}){const{overrides:o={},drizzleObjectName:n=["drizzle","db"]}=e,r=await s(import("eslint-plugin-drizzle"));return[{files:[i],name:"2digits:drizzle",plugins:{drizzle:S(r)},rules:{"drizzle/enforce-update-with-where":["error",{drizzleObjectName:n}],"drizzle/enforce-delete-with-where":["error",{drizzleObjectName:n}],...o}}]}async function ye(e={}){const{overrides:o={},files:n=["**/*.graphql","**/*.gql"]}=e,[r,a]=await Promise.all([s(import("@graphql-eslint/eslint-plugin")),import("graphql-config").then(({loadConfig:d})=>d({throwOnEmpty:!1,throwOnMissing:!1}).then(f=>f?.getDefault().schema))]),t=r.configs["flat/operations-recommended"].rules;let l={};if(a)l=t;else for(const d of Object.keys(t)){const f=d.replace("@graphql-eslint/","");f in r.rules&&(r.rules[f].meta.docs?.requiresSchema||r.rules[f].meta.docs?.requiresSiblings)||(l[d]=t[d])}const m=x(l,g);return[{name:"2digits:graphql",plugins:{gql:r},languageOptions:{parser:r.parser},files:n,rules:{...m,"gql/naming-convention":["error",{allowLeadingUnderscore:!0}],...o}}]}function be(e={}){const{gitIgnore:o,ignores:n=[]}=e;return[{ignores:[ce,n].flat(),name:"2digits:ignores"},M({strict:!1,...o,name:"2digits:gitignore"})]}function we(e={}){const{overrides:o={}}=e;return[{files:[i],name:"2digits:javascript",plugins:{stylistic:U},languageOptions:{ecmaVersion:2022,globals:{...j.browser,...j.es2021,...j.node,document:"readonly",navigator:"readonly",window:"readonly"},parserOptions:{ecmaFeatures:{jsx:!0},ecmaVersion:2022,sourceType:"module"},sourceType:"module"},linterOptions:{reportUnusedDisableDirectives:!0},rules:{...B.configs.recommended.rules,"accessor-pairs":["error",{enforceForClassMembers:!0,setWithoutGet:!0}],"array-callback-return":"error","block-scoped-var":"error","constructor-super":"error","default-case-last":"error","dot-notation":["error",{allowKeywords:!0}],eqeqeq:["error","smart"],"new-cap":["error",{capIsNew:!1,newIsCap:!0,properties:!0}],"no-alert":"error","no-array-constructor":"error","no-async-promise-executor":"error","no-caller":"error","no-case-declarations":"error","no-class-assign":"error","no-compare-neg-zero":"error","no-cond-assign":["error","always"],"no-const-assign":"error","no-control-regex":"error","no-debugger":"error","no-delete-var":"error","no-dupe-args":"error","no-dupe-class-members":"error","no-dupe-keys":"error","no-duplicate-case":"error","no-empty":["error",{allowEmptyCatch:!0}],"no-empty-character-class":"error","no-empty-pattern":"error","no-eval":"error","no-ex-assign":"error","no-extend-native":"error","no-extra-bind":"error","no-extra-boolean-cast":"error","no-fallthrough":"error","no-func-assign":"error","no-global-assign":"error","no-implied-eval":"error","no-import-assign":"error","no-invalid-regexp":"error","no-irregular-whitespace":"error","no-iterator":"error","no-labels":["error",{allowLoop:!1,allowSwitch:!1}],"no-lone-blocks":"error","no-loss-of-precision":"error","no-misleading-character-class":"error","no-multi-str":"error","no-new":"error","no-new-func":"error","no-new-native-nonconstructor":"error","no-new-wrappers":"error","no-obj-calls":"error","no-octal":"error","no-octal-escape":"error","no-proto":"error","no-prototype-builtins":"error","no-redeclare":["error",{builtinGlobals:!1}],"no-regex-spaces":"error","no-restricted-globals":["error",{message:"Use `globalThis` instead.",name:"global"},{message:"Use `globalThis` instead.",name:"self"}],"no-restricted-properties":["error",{message:"Use `Object.getPrototypeOf` or `Object.setPrototypeOf` instead.",property:"__proto__"},{message:"Use `Object.defineProperty` instead.",property:"__defineGetter__"},{message:"Use `Object.defineProperty` instead.",property:"__defineSetter__"},{message:"Use `Object.getOwnPropertyDescriptor` instead.",property:"__lookupGetter__"},{message:"Use `Object.getOwnPropertyDescriptor` instead.",property:"__lookupSetter__"}],"no-restricted-syntax":["error","DebuggerStatement","LabeledStatement","WithStatement","TSEnumDeclaration","TSExportAssignment"],"no-self-assign":["error",{props:!0}],"no-self-compare":"error","no-sequences":"error","no-shadow-restricted-names":"error","no-sparse-arrays":"error","no-template-curly-in-string":"error","no-this-before-super":"error","no-throw-literal":"error","no-undef":"error","no-undef-init":"error","no-unexpected-multiline":"error","no-unmodified-loop-condition":"error","no-unneeded-ternary":["error",{defaultAssignment:!1}],"no-unreachable":"error","no-unreachable-loop":"error","no-unsafe-finally":"error","no-unsafe-negation":"error","no-unused-expressions":["error",{allowShortCircuit:!0,allowTaggedTemplates:!0,allowTernary:!0}],"no-unused-vars":["error",{args:"none",caughtErrors:"none",ignoreRestSiblings:!0,vars:"all"}],"no-useless-backreference":"error","no-useless-call":"error","no-useless-catch":"error","no-useless-computed-key":"error","no-useless-constructor":"error","no-useless-rename":"error","no-var":"error","no-with":"error","object-shorthand":["error","always",{avoidQuotes:!0,ignoreConstructors:!1}],"one-var":["error",{initialized:"never"}],"prefer-arrow-callback":["error",{allowNamedFunctions:!0,allowUnboundThis:!0}],"prefer-const":["error",{destructuring:"all",ignoreReadBeforeAssign:!0}],"prefer-exponentiation-operator":"error","prefer-promise-reject-errors":"error","prefer-regex-literals":["error",{disallowRedundantWrapping:!0}],"prefer-rest-params":"error","prefer-spread":"error","prefer-template":"error","symbol-description":"error","unicode-bom":["error","never"],"use-isnan":["error",{enforceForIndexOf:!0,enforceForSwitchCase:!0}],"valid-typeof":["error",{requireStringLiterals:!0}],"vars-on-top":"error",yoda:["error","never"],"stylistic/padding-line-between-statements":["error",{blankLine:"always",prev:["const","let"],next:"*"},{blankLine:"any",prev:["const","let"],next:["const","let"]},{blankLine:"always",prev:"*",next:"return"}],...o}}]}function ke(){return[{files:[i],name:"2digits:jsdoc",plugins:{jsdoc:V},rules:{"jsdoc/check-access":"error","jsdoc/check-param-names":"error","jsdoc/check-property-names":"error","jsdoc/check-types":"error","jsdoc/empty-tags":"error","jsdoc/implements-on-classes":"error","jsdoc/no-defaults":"error","jsdoc/no-multi-asterisks":"error","jsdoc/require-param-name":"error","jsdoc/require-property":"error","jsdoc/require-property-description":"error","jsdoc/require-property-name":"error","jsdoc/require-returns-check":"error","jsdoc/require-returns-description":"error","jsdoc/require-yields-check":"error"}}]}function he(){return[...b["flat/base"].map(e=>({...e,name:"2digits:jsonc/base"})),{name:"2digits:jsonc/json",files:[ne],...w,rules:{...v(b["flat/recommended-with-json"])}},{name:"2digits:jsonc/jsonc",files:[te],...w,rules:{...v(b["flat/recommended-with-jsonc"])}},{name:"2digits:jsonc/json5",files:[se],...w,rules:{...v(b["flat/recommended-with-json5"])}},{name:"2digits:jsonc/package.json",...w,files:["**/package.json"],rules:{"jsonc/sort-array-values":["error",{order:{type:"asc"},pathPattern:"^files$"}],"jsonc/sort-keys":["error",{order:["$schema","publisher","name","displayName","version","private","description","funding","homepage","repository","bugs","categories","type","main","module","types","typesVersions","bin","files","exports","icon","unpkg","jsdelivr","sideEffects","activationEvents","contributes","scripts","keywords","author","license","workspaces","dependencies","devDependencies","peerDependencies","peerDependenciesMeta","optionalDependencies","packageManager","engines","pnpm","overrides","resolutions","husky","simple-git-hooks","lint-staged","eslintConfig","prettier"],pathPattern:"^$"},{order:{type:"asc"},pathPattern:"^(?:dev|peer|optional|bundled)?[Dd]ependencies(Meta)?$"},{order:["types","import","module","require","default"],pathPattern:"^exports.*$"}]}},{name:"2digits:jsonc/tsconfig.json",...w,files:["**/tsconfig.json","**/tsconfig.*.json","**/tsconfig-*.json","**/jsconfig.json","**/jsconfig.*.json","**/jsconfig-*.json"],rules:{"jsonc/sort-keys":["error",{order:["$schema","extends","compilerOptions","references","files","include","exclude"],pathPattern:"^$"},{order:["incremental","composite","tsBuildInfoFile","disableSourceOfProjectReferenceRedirect","disableSolutionSearching","disableReferencedProjectLoad","target","lib","jsx","experimentalDecorators","emitDecoratorMetadata","jsxFactory","jsxFragmentFactory","jsxImportSource","reactNamespace","noLib","useDefineForClassFields","moduleDetection","module","rootDir","moduleResolution","baseUrl","paths","rootDirs","typeRoots","types","allowUmdGlobalAccess","moduleSuffixes","allowImportingTsExtensions","resolvePackageJsonExports","resolvePackageJsonImports","customConditions","resolveJsonModule","allowArbitraryExtensions","noResolve","allowJs","checkJs","maxNodeModuleJsDepth","declaration","declarationMap","emitDeclarationOnly","sourceMap","inlineSourceMap","outFile","outDir","removeComments","noEmit","importHelpers","importsNotUsedAsValues","downlevelIteration","sourceRoot","mapRoot","inlineSources","emitBOM","newLine","stripInternal","noEmitHelpers","noEmitOnError","preserveConstEnums","declarationDir","preserveValueImports","isolatedModules","verbatimModuleSyntax","allowSyntheticDefaultImports","esModuleInterop","preserveSymlinks","forceConsistentCasingInFileNames","strict","strictBindCallApply","strictFunctionTypes","strictNullChecks","strictPropertyInitialization","allowUnreachableCode","allowUnusedLabels","alwaysStrict","exactOptionalPropertyTypes","noFallthroughCasesInSwitch","noImplicitAny","noImplicitOverride","noImplicitReturns","noImplicitThis","noPropertyAccessFromIndexSignature","noUncheckedIndexedAccess","noUnusedLocals","noUnusedParameters","useUnknownInCatchVariables","skipDefaultLibCheck","skipLibCheck"],pathPattern:"^compilerOptions$"}]}},...b["flat/prettier"].map(e=>({...e,name:"2digits:jsonc/prettier"}))]}const w={languageOptions:{parser:X},plugins:{jsonc:H}};function v(e){return Object.fromEntries(e.flatMap(({rules:o})=>Object.entries(o??{})))}const O=[E];function xe(){return[{name:"2digits:markdown/setup",plugins:{markdown:z}},{name:"2digits:markdown/processor",files:O,language:"markdown/gfm",ignores:[le],processor:ee([z.processors.markdown,re])},{name:"2digits:markdown/parser",files:O,language:"markdown/gfm",languageOptions:{parser:je}},{name:"2digits:markdown/rules",files:O,language:"markdown/gfm",rules:{"markdown/fenced-code-language":"error","markdown/heading-increment":"error","markdown/no-empty-links":"error","markdown/no-invalid-label-refs":"error","markdown/no-missing-label-refs":"error"}},{name:"2digits:markdown/disables",files:[h],languageOptions:{parserOptions:{ecmaFeatures:{impliedStrict:!0}}},rules:{"no-alert":"off","no-console":"off","no-labels":"off","no-lone-blocks":"off","no-restricted-syntax":"off","no-undef":"off","no-unused-expressions":"off","no-unused-labels":"off","no-unused-vars":"off","node/prefer-global/process":"off","ts/consistent-type-imports":"off","ts/explicit-function-return-type":"off","ts/no-namespace":"off","ts/no-redeclare":"off","ts/no-require-imports":"off","ts/no-unused-expressions":"off","ts/no-unused-vars":"off","ts/no-use-before-define":"off","unicode-bom":"off"}}]}const je={meta:{name:"parser-plain"},parseForESLint:e=>({ast:{body:[],comments:[],loc:{end:e.length,start:0},range:[0,e.length],tokens:[],type:"Program"},scopeManager:null,services:{isPlain:!0},visitorKeys:{Program:[]}})};async function ve(e={}){const{files:o=[L,I],overrides:n={},parserOptions:r}=e,[a,t]=await Promise.all([s(import("@next/eslint-plugin-next")),s(import("@typescript-eslint/parser"))]),l=x({...a.configs.recommended.rules,...a.configs["core-web-vitals"].rules},g);return[{name:"2digits:next/setup",plugins:{next:S(a)}},{name:"2digits:next/rules",files:o,languageOptions:{parser:t,parserOptions:{ecmaFeatures:{jsx:!0},projectService:!0,...r},sourceType:"module"},rules:{...l,"next/no-html-link-for-pages":"off",...n}}]}function Oe(){return[{files:[i],name:"2digits:node",settings:{node:{version:">= 22.0.0"}},plugins:{node:A},rules:{"node/handle-callback-err":["error","^(err|error)$"],"node/no-deprecated-api":"error","node/no-exports-assign":"error","node/no-new-require":"error","node/no-path-concat":"error","node/no-unsupported-features/node-builtins":["error",{allowExperimental:!0}],"node/prefer-global/buffer":"error","node/prefer-global/process":"error","node/prefer-global/text-encoder":"error","node/prefer-global/url":"error","node/prefer-global/console":"error","node/prefer-global/url-search-params":"error","node/prefer-global/text-decoder":"error","node/process-exit-as-throw":"error"}}]}async function Se(){const e=await s(import("eslint-plugin-pnpm"));return[{name:"2digits:pnpm/package-json",files:["**/package.json"],languageOptions:{parser:await s(import("jsonc-eslint-parser"))},plugins:{pnpm:e},rules:{"pnpm/json-enforce-catalog":"error","pnpm/json-prefer-workspace-settings":"error","pnpm/json-valid-catalog":"error"}},{name:"2digits:pnpm/pnpm-workspace-yaml",files:["pnpm-workspace.yaml"],languageOptions:{parser:await s(import("yaml-eslint-parser"))},plugins:{pnpm:e},rules:{"pnpm/yaml-no-duplicate-catalog-item":"error","pnpm/yaml-no-unused-catalog-item":"error"}}]}async function De(){const[e,o]=await Promise.all([s(import("eslint-config-prettier")),s(import("@stylistic/eslint-plugin"))]);return[{name:"2digits:prettier",plugins:{stylistic:o},rules:{...e.rules,"tailwindcss/classnames-order":"off","stylistic/jsx-newline":["error",{prevent:!1}]}}]}async function Pe(e={}){const{files:o=[L,I],overrides:n={},parserOptions:r,tsconfigRootDir:a,reactCompiler:t=!0}=e,[l,m,d,f,F]=await Promise.all([s(import("@eslint-react/eslint-plugin")),s(import("eslint-plugin-react-hooks")),s(import("@typescript-eslint/parser")),t?s(import("eslint-plugin-react-compiler")):void 0,s(import("@stylistic/eslint-plugin"))]),y=l.configs.all.plugins,T=x({...m.configs["recommended-latest"].rules,...l.configs["recommended-type-checked"].rules},g);return[{name:"2digits:react/setup",plugins:{stylistic:F,"react-dom":y["@eslint-react/dom"],"react-web-api":y["@eslint-react/web-api"],"react-extra":y["@eslint-react"],"react-hooks":m,"react-hooks-extra":y["@eslint-react/hooks-extra"],"react-naming-convention":y["@eslint-react/naming-convention"],...t?{"react-compiler":f}:{}},settings:{react:{version:"detect"}}},{name:"2digits:react/rules",files:o,languageOptions:{parser:d,parserOptions:{ecmaFeatures:{jsx:!0},tsconfigRootDir:a,projectService:!0,...r},sourceType:"module"},rules:{...T,...t?{"react-compiler/react-compiler":"error"}:{},"react-hooks-extra/no-unnecessary-use-callback":"error","react-hooks-extra/prefer-use-state-lazy-initialization":"error","react-hooks-extra/no-redundant-custom-hook":"error","react-hooks-extra/no-unnecessary-use-memo":"error","react-extra/no-useless-fragment":"off","react-extra/prefer-read-only-props":"off","react-extra/prefer-shorthand-boolean":"error","react-extra/prefer-shorthand-fragment":"error","react-extra/prefer-react-namespace-import":"error","react-naming-convention/use-state":"error","stylistic/jsx-curly-newline":"off","stylistic/jsx-newline":["error",{prevent:!1}],"stylistic/jsx-self-closing-comp":"error",...n}}]}function _e(){return[{files:[i],name:"2digits:regexp",plugins:{regexp:_},rules:{..._.configs["flat/recommended"].rules}}]}function qe(){return[{files:[i],name:"2digits:sonar",plugins:{sonar:W},rules:{"sonar/code-eval":"error","sonar/cognitive-complexity":"error","sonar/comma-or-logical-or-case":"error","sonar/concise-regex":"error","sonar/confidential-information-logging":"error","sonar/constructor-for-side-effects":"error","sonar/content-length":"error","sonar/content-security-policy":"error","sonar/cookie-no-httponly":"error","sonar/cors":"error","sonar/csrf":"error","sonar/max-switch-cases":"error","sonar/no-all-duplicated-branches":"error","sonar/no-collapsible-if":"error","sonar/no-collection-size-mischeck":"error","sonar/no-duplicate-string":["error",{threshold:5}],"sonar/no-duplicated-branches":"error","sonar/no-element-overwrite":"error","sonar/no-empty-collection":"error","sonar/no-extra-arguments":"error","sonar/no-for-in-iterable":"error","sonar/no-gratuitous-expressions":"error","sonar/no-identical-conditions":"error","sonar/no-identical-expressions":"error","sonar/no-identical-functions":"error","sonar/no-ignored-return":"error","sonar/no-inverted-boolean-check":"error","sonar/no-nested-switch":"error","sonar/no-nested-template-literals":"error","sonar/no-one-iteration-loop":"error","sonar/no-redundant-boolean":"error","sonar/no-same-line-conditional":"error","sonar/no-small-switch":"error","sonar/no-unused-collection":"error","sonar/no-use-of-empty-return-value":"error","sonar/no-useless-catch":"error","sonar/non-existent-operator":"error","sonar/prefer-immediate-return":"error","sonar/prefer-object-literal":"error","sonar/prefer-single-boolean-return":"error","sonar/prefer-while":"error","sonar/elseif-without-else":"off","sonar/no-redundant-jump":"off"}}]}async function ze(e={}){const{files:o=[oe],overrides:n={},parserOptions:r,storybookDirectory:a=".storybook"}=e,[t,l]=await Promise.all([s(import("eslint-plugin-storybook")),s(import("@typescript-eslint/parser"))]),m={parser:l,parserOptions:{ecmaFeatures:{jsx:!0},projectService:!0,...r},sourceType:"module"};return[{name:"2digits:storybook/setup",plugins:{storybook:S(t)}},{name:"2digits:storybook/rules",files:o,languageOptions:m,rules:{"storybook/await-interactions":"error","storybook/context-in-play-function":"error","storybook/csf-component":"error","storybook/default-exports":"error","storybook/hierarchy-separator":"error","storybook/meta-inline-properties":"error","storybook/no-redundant-story-name":"error","storybook/no-stories-of":"error","storybook/no-title-property-in-meta":"error","storybook/no-uninstalled-addons":"error","storybook/prefer-pascal-case":"error","storybook/story-exports":"error","storybook/use-storybook-expect":"error","storybook/use-storybook-testing-library":"error","storybook/meta-satisfies-type":"error",...n}},{name:"2digits:storybook/disables",files:o,rules:{"react-hooks/rules-of-hooks":"off","react/display-name":"off","sonar/no-duplicate-string":"off"}},{name:"2digits:storybook/config",files:[`${a}/main.@(js|cjs|mjs|ts)`],languageOptions:m,rules:{"storybook/no-uninstalled-addons":"error"}}]}async function Ce(e={}){const{overrides:o={}}=e,[n,{tailwindFunctions:r},a]=await Promise.all([s(import("eslint-plugin-tailwindcss")),s(import("@2digits/constants")),$(["tailwind.config.ts","tailwind.config.js"])]);return[{files:[i],name:"2digits:tailwind",plugins:{tailwindcss:n},settings:{tailwindcss:{callees:r,config:a}},rules:{...n.configs.recommended.rules,...o}}]}async function $e(e={}){const{overrides:o={}}=e,n=await s(import("@tanstack/eslint-plugin-query")),r=x(n.configs["flat/recommended"].at(0)?.rules??{},g);return[{files:[i],name:"2digits:tanstack",plugins:{tanstack:n},rules:{...r,...o}}]}async function Le(e={}){const{overrides:o={}}=e,n=await s(import("eslint-plugin-turbo"));return[{files:[i],name:"2digits:turbo",plugins:{turbo:n},rules:{"turbo/no-undeclared-env-vars":"error",...o}}]}async function Ie(e={}){const{overrides:o={},parserOptions:n={}}=e,[{plugin:r,configs:a,parser:t},l]=await Promise.all([s(import("typescript-eslint")),s(import("@2digits/eslint-plugin"))]),m=N(a.strictTypeChecked,g),d=Object.fromEntries(m.flatMap(({rules:f})=>Object.entries(f??{})));return[{name:"2digits:typescript/setup",plugins:{ts:r,"@2digits":l}},{name:"2digits:typescript/rules",files:[i],ignores:[h],languageOptions:{parser:t,parserOptions:{tsconfigRootDir:process.cwd(),projectService:!0,warnOnUnsupportedTypeScriptVersion:!1,...n},sourceType:"module"},rules:{...d,"ts/restrict-template-expressions":["error",{allowNumber:!0}],"ts/ban-ts-comment":["error",{"ts-ignore":"allow-with-description"}],"ts/consistent-type-exports":["error"],"ts/consistent-type-imports":["error",{prefer:"type-imports",disallowTypeAnnotations:!1,fixStyle:"inline-type-imports"}],"ts/no-empty-object-type":["error",{allowInterfaces:"with-single-extends",allowObjectTypes:"never"}],"ts/no-explicit-any":["error"],"ts/no-import-type-side-effects":["error"],"ts/no-misused-promises":"off","ts/no-confusing-void-expression":"off","ts/no-unused-vars":["error",{ignoreRestSiblings:!0,argsIgnorePattern:"^_",varsIgnorePattern:"^_"}],"ts/unbound-method":"off",...l.configs.recommended.rules,...o}},{name:"2digits:typescript/disables/dts",files:["**/*.d.ts"],ignores:[h],rules:{"unicorn/no-abusive-eslint-disable":"off","no-duplicate-imports":"off","no-restricted-syntax":"off","ts/no-unused-vars":"off"}},{name:"2digits:typescript/disables/test",files:["**/*.{test,spec}.ts?(x)"],ignores:[h],rules:{"no-unused-expressions":"off"}},{name:"2digits:typescript/disables/cjs",files:["**/*.js","**/*.cjs","**/*.cts"],ignores:[h],rules:{"ts/no-require-imports":"off","ts/no-var-requires":"off"}}]}function Ee(){return[{files:[i],name:"2digits:unicorn",plugins:{unicorn:P},rules:{...P.configs.recommended.rules,"unicorn/filename-case":["off"],"unicorn/prefer-module":["off"],"unicorn/prevent-abbreviations":["off"],"unicorn/prefer-ternary":["error","only-single-line"],"unicorn/no-useless-undefined":["error",{checkArguments:!1,checkArrowFunctionBody:!1}],"unicorn/prefer-top-level-await":["off"]}}]}function Fe(){return[{name:"2digits:yaml/setup",plugins:{yml:Y}},{name:"2digits:yaml/base",...k,rules:{"no-irregular-whitespace":"off","no-unused-vars":"off","spaced-comment":"off"}},{name:"2digits:yaml/recommended",...k,rules:{"yml/no-empty-document":"error","yml/no-empty-key":"error","yml/no-empty-mapping-value":"error","yml/no-empty-sequence-entry":"error","yml/no-irregular-whitespace":"error","yml/no-tab-indent":"error","yml/vue-custom-block/no-parsing-error":"error"}},{name:"2digits:yaml/standard",...k,rules:{"yml/block-mapping":"error","yml/block-sequence":"error","yml/plain-scalar":"error","yml/spaced-comment":"error"}},{name:"2digits:yaml/pnpm-workspace",...k,files:["pnpm-workspace.yaml"],rules:{"yml/sort-keys":["error",{order:["packages","overrides","patchedDependencies","hoistPattern","catalog","catalogs","allowedDeprecatedVersions","allowNonAppliedPatches","configDependencies","ignoredBuiltDependencies","ignoredOptionalDependencies","neverBuiltDependencies","onlyBuiltDependencies","onlyBuiltDependenciesFile","packageExtensions","peerDependencyRules","supportedArchitectures"],pathPattern:"^$"},{order:{type:"asc"},pathPattern:".*"}]}},{name:"2digits:yaml/prettier",...k,rules:{"yml/block-mapping-colon-indicator-newline":"off","yml/block-mapping-question-indicator-newline":"off","yml/block-sequence-hyphen-indicator-newline":"off","yml/flow-mapping-curly-newline":"off","yml/flow-mapping-curly-spacing":"off","yml/flow-sequence-bracket-newline":"off","yml/flow-sequence-bracket-spacing":"off","yml/indent":"off","yml/key-spacing":"off","yml/no-multiple-empty-lines":"off","yml/no-trailing-zeros":"off","yml/quotes":"off"}}]}const k={files:[ae],languageOptions:{parser:Z}};function p(e,o){return typeof e=="boolean"?e:e?.enable??o??!1}function u(e){if(typeof e=="boolean"||e===void 0)return{};const{enable:o,...n}=e;return n}async function C(e={},...o){let n;e.pnpm===void 0&&(n=$("pnpm-workspace.yaml"));let r=new R(be(e.ignores),we(e.js),ue(),Oe(),de(),ke(),Ee(),qe(),_e(),pe(),he(),fe(),Fe(),xe());p(e.turbo,c("turbo"))&&(r=r.append(Le(u(e.turbo))));const{overrides:a,...t}=u(e.ts);return p(e.ts,c("typescript"))&&(r=r.append(Ie(u(e.ts)))),p(e.react,c("react"))&&(r=r.append(Pe({...u(e.react),...t}))),p(e.next,c("next"))&&(r=r.append(ve({...u(e.next),...t}))),p(e.storybook,c("storybook"))&&(r=r.append(ze({...u(e.storybook),...t}))),p(e.tailwind,c("tailwindcss"))&&(r=r.append(Ce(u(e.tailwind)))),p(e.tanstack,c("react-query")||c("@tanstack/react-query")||c("@tanstack/react-query-devtools"))&&(r=r.append($e(u(e.tanstack)))),p(e.drizzle,c("drizzle-kit")||c("drizzle-orm"))&&(r=r.append(ge(u(e.drizzle)))),p(e.graphql,c("graphql"))&&(r=r.append(ye(u(e.graphql)))),p(e.pnpm,!!await n)&&(r=r.append(Se())),r=r.append(...o),c("prettier")&&(r=r.append(De())),r.renamePlugins(g).toConfigs()}export{C as default,C as twoDigits};
|
|
1
|
+
import{renamePluginsInRules as x,renamePluginsInConfigs as N,FlatConfigComposer as R}from"eslint-flat-config-utils";import{findUp as $}from"find-up";import{isPackageExists as c}from"local-pkg";import M from"eslint-config-flat-gitignore";import B from"@eslint/js";import U from"@stylistic/eslint-plugin";import j from"globals";import D from"eslint-plugin-de-morgan";import A from"eslint-plugin-n";import G from"@eslint-community/eslint-plugin-eslint-comments";import J from"@eslint-community/eslint-plugin-eslint-comments/configs";import V from"eslint-plugin-jsdoc";import P from"eslint-plugin-unicorn";import W from"eslint-plugin-sonarjs";import _ from"eslint-plugin-regexp";import K from"eslint-plugin-antfu";import H,{configs as b}from"eslint-plugin-jsonc";import X from"jsonc-eslint-parser";import q from"@eslint/css";import{tailwindSyntax as Q}from"@eslint/css/syntax";import Y from"eslint-plugin-yml";import Z from"yaml-eslint-parser";import z from"@eslint/markdown";import{mergeProcessors as ee,processorPassThrough as re}from"eslint-merge-processors";import{fixupPluginRules as S}from"@eslint/compat";const i="**/*.?([cm])[jt]s?(x)",L="**/*.?([cm])ts",I="**/*.?([cm])tsx",oe="**/*.stories.tsx",ne="**/*.json",se="**/*.json5",te="**/*.jsonc",ie="**/*.css",ae="**/*.y?(a)ml",E="**/*.md",le="**/*.md/*.md",h=`${E}/${i}`,ce=["**/node_modules","**/dist","**/package-lock.json","**/yarn.lock","**/pnpm-lock.yaml","**/bun.lockb","**/bun.lock","**/output","**/coverage","**/temp","**/.temp","**/tmp","**/.tmp","**/.history","**/.vitepress/cache","**/.nuxt","**/.next","**/.vercel","**/.changeset","**/.idea","**/.cache","**/.output","**/.vite-inspect","**/.yarn","**/CHANGELOG*.md","**/*.min.*","**/LICENSE*","**/__snapshots__","**/auto-import?(s).d.ts","**/components.d.ts"];function pe(){return[{files:[i],name:"2digits:antfu",plugins:{antfu:K},rules:{"antfu/if-newline":"error","antfu/top-level-function":"error"}}]}function ue(){return[{files:[i],name:"2digits:boolean",plugins:{boolean:D},rules:{...D.configs.recommended.rules}}]}const g={"@next/next":"next","@eslint-react/naming-convention":"react-naming-convention","@eslint-react/hooks-extra":"react-hooks-extra","@eslint-react/dom":"react-dom","@eslint-react/web-api":"react-web-api","@eslint-react":"react-extra","react-hooks":"react-hooks","react-compiler":"react-compiler","@stylistic/eslint-plugin":"stylistic","@typescript-eslint":"ts",node:"node","@eslint-community/eslint-comments":"comments",storybook:"storybook",turbo:"turbo",jsdoc:"jsdoc",unicorn:"unicorn",tailwindcss:"tailwindcss","@tanstack/query":"tanstack","@2digits":"@2digits","@graphql-eslint":"gql",sonarjs:"sonar",drizzle:"drizzle","de-morgan":"boolean"},me=x(J.recommended.rules,g);function de(){return[{files:[i],name:"2digits:comments",plugins:{comments:G},rules:{...me,"comments/no-unused-disable":"error","comments/disable-enable-pair":["error",{allowWholeFile:!0}]}}]}function fe(){return[{name:"2digits:css",files:[ie],language:"css/css",plugins:{css:q},languageOptions:{tolerant:!0,customSyntax:Q},rules:{...q.configs.recommended.rules}}]}async function s(e){const o=await e;return o.default||o}async function ge(e={}){const{overrides:o={},drizzleObjectName:n=["drizzle","db"]}=e,r=await s(import("eslint-plugin-drizzle"));return[{files:[i],name:"2digits:drizzle",plugins:{drizzle:S(r)},rules:{"drizzle/enforce-update-with-where":["error",{drizzleObjectName:n}],"drizzle/enforce-delete-with-where":["error",{drizzleObjectName:n}],...o}}]}async function ye(e={}){const{overrides:o={},files:n=["**/*.graphql","**/*.gql"]}=e,[r,a]=await Promise.all([s(import("@graphql-eslint/eslint-plugin")),import("graphql-config").then(({loadConfig:d})=>d({throwOnEmpty:!1,throwOnMissing:!1}).then(f=>f?.getDefault().schema))]),t=r.configs["flat/operations-recommended"].rules;let l={};if(a)l=t;else for(const d of Object.keys(t)){const f=d.replace("@graphql-eslint/","");f in r.rules&&(r.rules[f].meta.docs?.requiresSchema||r.rules[f].meta.docs?.requiresSiblings)||(l[d]=t[d])}const m=x(l,g);return[{name:"2digits:graphql",plugins:{gql:r},languageOptions:{parser:r.parser},files:n,rules:{...m,"gql/naming-convention":["error",{allowLeadingUnderscore:!0}],...o}}]}function be(e={}){const{gitIgnore:o,ignores:n=[]}=e;return[{ignores:[ce,n].flat(),name:"2digits:ignores"},M({strict:!1,...o,name:"2digits:gitignore"})]}function we(e={}){const{overrides:o={}}=e;return[{files:[i],name:"2digits:javascript",plugins:{stylistic:U},languageOptions:{ecmaVersion:2022,globals:{...j.browser,...j.es2021,...j.node,document:"readonly",navigator:"readonly",window:"readonly"},parserOptions:{ecmaFeatures:{jsx:!0},ecmaVersion:2022,sourceType:"module"},sourceType:"module"},linterOptions:{reportUnusedDisableDirectives:!0},rules:{...B.configs.recommended.rules,"accessor-pairs":["error",{enforceForClassMembers:!0,setWithoutGet:!0}],"array-callback-return":"error","block-scoped-var":"error","constructor-super":"error","default-case-last":"error","dot-notation":["error",{allowKeywords:!0}],eqeqeq:["error","smart"],"new-cap":["error",{capIsNew:!1,newIsCap:!0,properties:!0}],"no-alert":"error","no-array-constructor":"error","no-async-promise-executor":"error","no-caller":"error","no-case-declarations":"error","no-class-assign":"error","no-compare-neg-zero":"error","no-cond-assign":["error","always"],"no-const-assign":"error","no-control-regex":"error","no-debugger":"error","no-delete-var":"error","no-dupe-args":"error","no-dupe-class-members":"error","no-dupe-keys":"error","no-duplicate-case":"error","no-empty":["error",{allowEmptyCatch:!0}],"no-empty-character-class":"error","no-empty-pattern":"error","no-eval":"error","no-ex-assign":"error","no-extend-native":"error","no-extra-bind":"error","no-extra-boolean-cast":"error","no-fallthrough":"error","no-func-assign":"error","no-global-assign":"error","no-implied-eval":"error","no-import-assign":"error","no-invalid-regexp":"error","no-irregular-whitespace":"error","no-iterator":"error","no-labels":["error",{allowLoop:!1,allowSwitch:!1}],"no-lone-blocks":"error","no-loss-of-precision":"error","no-misleading-character-class":"error","no-multi-str":"error","no-new":"error","no-new-func":"error","no-new-native-nonconstructor":"error","no-new-wrappers":"error","no-obj-calls":"error","no-octal":"error","no-octal-escape":"error","no-proto":"error","no-prototype-builtins":"error","no-redeclare":["error",{builtinGlobals:!1}],"no-regex-spaces":"error","no-restricted-globals":["error",{message:"Use `globalThis` instead.",name:"global"},{message:"Use `globalThis` instead.",name:"self"}],"no-restricted-properties":["error",{message:"Use `Object.getPrototypeOf` or `Object.setPrototypeOf` instead.",property:"__proto__"},{message:"Use `Object.defineProperty` instead.",property:"__defineGetter__"},{message:"Use `Object.defineProperty` instead.",property:"__defineSetter__"},{message:"Use `Object.getOwnPropertyDescriptor` instead.",property:"__lookupGetter__"},{message:"Use `Object.getOwnPropertyDescriptor` instead.",property:"__lookupSetter__"}],"no-restricted-syntax":["error","DebuggerStatement","LabeledStatement","WithStatement","TSEnumDeclaration","TSExportAssignment"],"no-self-assign":["error",{props:!0}],"no-self-compare":"error","no-sequences":"error","no-shadow-restricted-names":"error","no-sparse-arrays":"error","no-template-curly-in-string":"error","no-this-before-super":"error","no-throw-literal":"error","no-undef":"error","no-undef-init":"error","no-unexpected-multiline":"error","no-unmodified-loop-condition":"error","no-unneeded-ternary":["error",{defaultAssignment:!1}],"no-unreachable":"error","no-unreachable-loop":"error","no-unsafe-finally":"error","no-unsafe-negation":"error","no-unused-expressions":["error",{allowShortCircuit:!0,allowTaggedTemplates:!0,allowTernary:!0}],"no-unused-vars":["error",{args:"none",caughtErrors:"none",ignoreRestSiblings:!0,vars:"all"}],"no-useless-backreference":"error","no-useless-call":"error","no-useless-catch":"error","no-useless-computed-key":"error","no-useless-constructor":"error","no-useless-rename":"error","no-var":"error","no-with":"error","object-shorthand":["error","always",{avoidQuotes:!0,ignoreConstructors:!1}],"one-var":["error",{initialized:"never"}],"prefer-arrow-callback":["error",{allowNamedFunctions:!0,allowUnboundThis:!0}],"prefer-const":["error",{destructuring:"all",ignoreReadBeforeAssign:!0}],"prefer-exponentiation-operator":"error","prefer-promise-reject-errors":"error","prefer-regex-literals":["error",{disallowRedundantWrapping:!0}],"prefer-rest-params":"error","prefer-spread":"error","prefer-template":"error","symbol-description":"error","unicode-bom":["error","never"],"use-isnan":["error",{enforceForIndexOf:!0,enforceForSwitchCase:!0}],"valid-typeof":["error",{requireStringLiterals:!0}],"vars-on-top":"error",yoda:["error","never"],"stylistic/padding-line-between-statements":["error",{blankLine:"always",prev:["const","let"],next:"*"},{blankLine:"any",prev:["const","let"],next:["const","let"]},{blankLine:"always",prev:"*",next:"return"}],...o}}]}function ke(){return[{files:[i],name:"2digits:jsdoc",plugins:{jsdoc:V},rules:{"jsdoc/check-access":"error","jsdoc/check-param-names":"error","jsdoc/check-property-names":"error","jsdoc/check-types":"error","jsdoc/empty-tags":"error","jsdoc/implements-on-classes":"error","jsdoc/no-defaults":"error","jsdoc/no-multi-asterisks":"error","jsdoc/require-param-name":"error","jsdoc/require-property":"error","jsdoc/require-property-description":"error","jsdoc/require-property-name":"error","jsdoc/require-returns-check":"error","jsdoc/require-returns-description":"error","jsdoc/require-yields-check":"error"}}]}function he(){return[...b["flat/base"].map(e=>({...e,name:"2digits:jsonc/base"})),{name:"2digits:jsonc/json",files:[ne],...w,rules:{...v(b["flat/recommended-with-json"])}},{name:"2digits:jsonc/jsonc",files:[te],...w,rules:{...v(b["flat/recommended-with-jsonc"])}},{name:"2digits:jsonc/json5",files:[se],...w,rules:{...v(b["flat/recommended-with-json5"])}},{name:"2digits:jsonc/package.json",...w,files:["**/package.json"],rules:{"jsonc/sort-array-values":["error",{order:{type:"asc"},pathPattern:"^files$"}],"jsonc/sort-keys":["error",{order:["$schema","publisher","name","displayName","version","private","description","funding","homepage","repository","bugs","categories","type","main","module","types","typesVersions","bin","files","exports","icon","unpkg","jsdelivr","sideEffects","activationEvents","contributes","scripts","keywords","author","license","workspaces","dependencies","devDependencies","peerDependencies","peerDependenciesMeta","optionalDependencies","packageManager","engines","pnpm","overrides","resolutions","husky","simple-git-hooks","lint-staged","eslintConfig","prettier"],pathPattern:"^$"},{order:{type:"asc"},pathPattern:"^(?:dev|peer|optional|bundled)?[Dd]ependencies(Meta)?$"},{order:["types","import","module","require","default"],pathPattern:"^exports.*$"}]}},{name:"2digits:jsonc/tsconfig.json",...w,files:["**/tsconfig.json","**/tsconfig.*.json","**/tsconfig-*.json","**/jsconfig.json","**/jsconfig.*.json","**/jsconfig-*.json"],rules:{"jsonc/sort-keys":["error",{order:["$schema","extends","compilerOptions","references","files","include","exclude"],pathPattern:"^$"},{order:["incremental","composite","tsBuildInfoFile","disableSourceOfProjectReferenceRedirect","disableSolutionSearching","disableReferencedProjectLoad","target","lib","jsx","experimentalDecorators","emitDecoratorMetadata","jsxFactory","jsxFragmentFactory","jsxImportSource","reactNamespace","noLib","useDefineForClassFields","moduleDetection","module","rootDir","moduleResolution","baseUrl","paths","rootDirs","typeRoots","types","allowUmdGlobalAccess","moduleSuffixes","allowImportingTsExtensions","resolvePackageJsonExports","resolvePackageJsonImports","customConditions","resolveJsonModule","allowArbitraryExtensions","noResolve","allowJs","checkJs","maxNodeModuleJsDepth","declaration","declarationMap","emitDeclarationOnly","sourceMap","inlineSourceMap","outFile","outDir","removeComments","noEmit","importHelpers","importsNotUsedAsValues","downlevelIteration","sourceRoot","mapRoot","inlineSources","emitBOM","newLine","stripInternal","noEmitHelpers","noEmitOnError","preserveConstEnums","declarationDir","preserveValueImports","isolatedModules","verbatimModuleSyntax","allowSyntheticDefaultImports","esModuleInterop","preserveSymlinks","forceConsistentCasingInFileNames","strict","strictBindCallApply","strictFunctionTypes","strictNullChecks","strictPropertyInitialization","allowUnreachableCode","allowUnusedLabels","alwaysStrict","exactOptionalPropertyTypes","noFallthroughCasesInSwitch","noImplicitAny","noImplicitOverride","noImplicitReturns","noImplicitThis","noPropertyAccessFromIndexSignature","noUncheckedIndexedAccess","noUnusedLocals","noUnusedParameters","useUnknownInCatchVariables","skipDefaultLibCheck","skipLibCheck"],pathPattern:"^compilerOptions$"}]}},...b["flat/prettier"].map(e=>({...e,name:"2digits:jsonc/prettier"}))]}const w={languageOptions:{parser:X},plugins:{jsonc:H}};function v(e){return Object.fromEntries(e.flatMap(({rules:o})=>Object.entries(o??{})))}const O=[E];function xe(){return[{name:"2digits:markdown/setup",plugins:{markdown:z}},{name:"2digits:markdown/processor",files:O,language:"markdown/gfm",ignores:[le],processor:ee([z.processors.markdown,re])},{name:"2digits:markdown/parser",files:O,language:"markdown/gfm",languageOptions:{parser:je}},{name:"2digits:markdown/rules",files:O,language:"markdown/gfm",rules:{"markdown/fenced-code-language":"error","markdown/heading-increment":"error","markdown/no-empty-links":"error","markdown/no-invalid-label-refs":"error","markdown/no-missing-label-refs":"error"}},{name:"2digits:markdown/disables",files:[h],languageOptions:{parserOptions:{ecmaFeatures:{impliedStrict:!0}}},rules:{"no-alert":"off","no-console":"off","no-labels":"off","no-lone-blocks":"off","no-restricted-syntax":"off","no-undef":"off","no-unused-expressions":"off","no-unused-labels":"off","no-unused-vars":"off","node/prefer-global/process":"off","ts/consistent-type-imports":"off","ts/explicit-function-return-type":"off","ts/no-namespace":"off","ts/no-redeclare":"off","ts/no-require-imports":"off","ts/no-unused-expressions":"off","ts/no-unused-vars":"off","ts/no-use-before-define":"off","unicode-bom":"off"}}]}const je={meta:{name:"parser-plain"},parseForESLint:e=>({ast:{body:[],comments:[],loc:{end:e.length,start:0},range:[0,e.length],tokens:[],type:"Program"},scopeManager:null,services:{isPlain:!0},visitorKeys:{Program:[]}})};async function ve(e={}){const{files:o=[L,I],overrides:n={},parserOptions:r}=e,[a,t]=await Promise.all([s(import("@next/eslint-plugin-next")),s(import("@typescript-eslint/parser"))]),l=x({...a.configs.recommended.rules,...a.configs["core-web-vitals"].rules},g);return[{name:"2digits:next/setup",plugins:{next:S(a)}},{name:"2digits:next/rules",files:o,languageOptions:{parser:t,parserOptions:{ecmaFeatures:{jsx:!0},projectService:!0,...r},sourceType:"module"},rules:{...l,"next/no-html-link-for-pages":"off",...n}}]}function Oe(){return[{files:[i],name:"2digits:node",settings:{node:{version:">= 22.0.0"}},plugins:{node:A},rules:{"node/handle-callback-err":["error","^(err|error)$"],"node/no-deprecated-api":"error","node/no-exports-assign":"error","node/no-new-require":"error","node/no-path-concat":"error","node/no-unsupported-features/node-builtins":["error",{allowExperimental:!0}],"node/prefer-global/buffer":"error","node/prefer-global/process":"error","node/prefer-global/text-encoder":"error","node/prefer-global/url":"error","node/prefer-global/console":"error","node/prefer-global/url-search-params":"error","node/prefer-global/text-decoder":"error","node/process-exit-as-throw":"error"}}]}async function Se(){const e=await s(import("eslint-plugin-pnpm"));return[{name:"2digits:pnpm/package-json",files:["**/package.json"],languageOptions:{parser:await s(import("jsonc-eslint-parser"))},plugins:{pnpm:e},rules:{"pnpm/json-enforce-catalog":"error","pnpm/json-prefer-workspace-settings":"error","pnpm/json-valid-catalog":"error"}},{name:"2digits:pnpm/pnpm-workspace-yaml",files:["pnpm-workspace.yaml"],languageOptions:{parser:await s(import("yaml-eslint-parser"))},plugins:{pnpm:e},rules:{"pnpm/yaml-no-duplicate-catalog-item":"error","pnpm/yaml-no-unused-catalog-item":"error"}}]}async function De(){const[e,o]=await Promise.all([s(import("eslint-config-prettier")),s(import("@stylistic/eslint-plugin"))]);return[{name:"2digits:prettier",plugins:{stylistic:o},rules:{...e.rules,"tailwindcss/classnames-order":"off","stylistic/jsx-newline":["error",{prevent:!1}]}}]}async function Pe(e={}){const{files:o=[L,I],overrides:n={},parserOptions:r,tsconfigRootDir:a,reactCompiler:t=!0}=e,[l,m,d,f,F]=await Promise.all([s(import("@eslint-react/eslint-plugin")),s(import("eslint-plugin-react-hooks")),s(import("@typescript-eslint/parser")),t?s(import("eslint-plugin-react-compiler")):void 0,s(import("@stylistic/eslint-plugin"))]),y=l.configs.all.plugins,T=x({...m.configs["recommended-latest"].rules,...l.configs["recommended-type-checked"].rules},g);return[{name:"2digits:react/setup",plugins:{stylistic:F,"react-dom":y["@eslint-react/dom"],"react-web-api":y["@eslint-react/web-api"],"react-extra":y["@eslint-react"],"react-hooks":m,"react-hooks-extra":y["@eslint-react/hooks-extra"],"react-naming-convention":y["@eslint-react/naming-convention"],...t?{"react-compiler":f}:{}},settings:{react:{version:"detect"}}},{name:"2digits:react/rules",files:o,languageOptions:{parser:d,parserOptions:{ecmaFeatures:{jsx:!0},tsconfigRootDir:a,projectService:!0,...r},sourceType:"module"},rules:{...T,...t?{"react-compiler/react-compiler":"error"}:{},"react-hooks-extra/no-unnecessary-use-callback":"error","react-hooks-extra/prefer-use-state-lazy-initialization":"error","react-hooks-extra/no-redundant-custom-hook":"error","react-hooks-extra/no-unnecessary-use-memo":"error","react-extra/no-useless-fragment":"off","react-extra/prefer-read-only-props":"off","react-extra/prefer-shorthand-boolean":"error","react-extra/prefer-shorthand-fragment":"error","react-extra/prefer-react-namespace-import":"error","react-naming-convention/use-state":"error","stylistic/jsx-curly-newline":"off","stylistic/jsx-newline":["error",{prevent:!1}],"stylistic/jsx-self-closing-comp":"error",...n}}]}function _e(){return[{files:[i],name:"2digits:regexp",plugins:{regexp:_},rules:{..._.configs["flat/recommended"].rules}}]}function qe(){return[{files:[i],name:"2digits:sonar",plugins:{sonar:W},rules:{"sonar/code-eval":"error","sonar/cognitive-complexity":"error","sonar/comma-or-logical-or-case":"error","sonar/concise-regex":"error","sonar/confidential-information-logging":"error","sonar/constructor-for-side-effects":"error","sonar/content-length":"error","sonar/content-security-policy":"error","sonar/cookie-no-httponly":"error","sonar/cors":"error","sonar/csrf":"error","sonar/max-switch-cases":"error","sonar/no-all-duplicated-branches":"error","sonar/no-collapsible-if":"error","sonar/no-collection-size-mischeck":"error","sonar/no-duplicate-string":["error",{threshold:5}],"sonar/no-duplicated-branches":"error","sonar/no-element-overwrite":"error","sonar/no-empty-collection":"error","sonar/no-extra-arguments":"error","sonar/no-for-in-iterable":"error","sonar/no-gratuitous-expressions":"error","sonar/no-identical-conditions":"error","sonar/no-identical-expressions":"error","sonar/no-identical-functions":"error","sonar/no-ignored-return":"error","sonar/no-inverted-boolean-check":"error","sonar/no-nested-switch":"error","sonar/no-nested-template-literals":"error","sonar/no-one-iteration-loop":"error","sonar/no-redundant-boolean":"error","sonar/no-same-line-conditional":"error","sonar/no-small-switch":"error","sonar/no-unused-collection":"error","sonar/no-use-of-empty-return-value":"error","sonar/no-useless-catch":"error","sonar/non-existent-operator":"error","sonar/prefer-immediate-return":"error","sonar/prefer-object-literal":"error","sonar/prefer-single-boolean-return":"error","sonar/prefer-while":"error","sonar/elseif-without-else":"off","sonar/no-redundant-jump":"off"}}]}async function ze(e={}){const{files:o=[oe],overrides:n={},parserOptions:r,storybookDirectory:a=".storybook"}=e,[t,l]=await Promise.all([s(import("eslint-plugin-storybook")),s(import("@typescript-eslint/parser"))]),m={parser:l,parserOptions:{ecmaFeatures:{jsx:!0},projectService:!0,...r},sourceType:"module"};return[{name:"2digits:storybook/setup",plugins:{storybook:S(t)}},{name:"2digits:storybook/rules",files:o,languageOptions:m,rules:{"storybook/await-interactions":"error","storybook/context-in-play-function":"error","storybook/csf-component":"error","storybook/default-exports":"error","storybook/hierarchy-separator":"error","storybook/meta-inline-properties":"error","storybook/no-redundant-story-name":"error","storybook/no-stories-of":"error","storybook/no-title-property-in-meta":"error","storybook/no-uninstalled-addons":"error","storybook/prefer-pascal-case":"error","storybook/story-exports":"error","storybook/use-storybook-expect":"error","storybook/use-storybook-testing-library":"error","storybook/meta-satisfies-type":"error",...n}},{name:"2digits:storybook/disables",files:o,rules:{"react-hooks/rules-of-hooks":"off","react/display-name":"off","sonar/no-duplicate-string":"off"}},{name:"2digits:storybook/config",files:[`${a}/main.@(js|cjs|mjs|ts)`],languageOptions:m,rules:{"storybook/no-uninstalled-addons":"error"}}]}async function Ce(e={}){const{overrides:o={}}=e,[n,{tailwindFunctions:r},a]=await Promise.all([s(import("eslint-plugin-tailwindcss")),s(import("@2digits/constants")),$(["tailwind.config.ts","tailwind.config.js"])]);return[{files:[i],name:"2digits:tailwind",plugins:{tailwindcss:n},settings:{tailwindcss:{callees:r,config:a}},rules:{...n.configs.recommended.rules,...o}}]}async function $e(e={}){const{overrides:o={}}=e,n=await s(import("@tanstack/eslint-plugin-query")),r=x(n.configs["flat/recommended"].at(0)?.rules??{},g);return[{files:[i],name:"2digits:tanstack",plugins:{tanstack:n},rules:{...r,...o}}]}async function Le(e={}){const{overrides:o={}}=e,n=await s(import("eslint-plugin-turbo"));return[{files:[i],name:"2digits:turbo",plugins:{turbo:n},rules:{"turbo/no-undeclared-env-vars":"error",...o}}]}async function Ie(e={}){const{overrides:o={},parserOptions:n={}}=e,[{plugin:r,configs:a,parser:t},l]=await Promise.all([s(import("typescript-eslint")),s(import("@2digits/eslint-plugin"))]),m=N(a.strictTypeChecked,g),d=Object.fromEntries(m.flatMap(({rules:f})=>Object.entries(f??{})));return[{name:"2digits:typescript/setup",plugins:{ts:r,"@2digits":l}},{name:"2digits:typescript/rules",files:[i],ignores:[h],languageOptions:{parser:t,parserOptions:{tsconfigRootDir:process.cwd(),projectService:!0,warnOnUnsupportedTypeScriptVersion:!1,...n},sourceType:"module"},rules:{...d,"ts/array-type":["error",{default:"generic",readonly:"generic"}],"ts/restrict-template-expressions":["error",{allowNumber:!0}],"ts/ban-ts-comment":["error",{"ts-ignore":"allow-with-description"}],"ts/consistent-type-exports":["error"],"ts/consistent-type-imports":["error",{prefer:"type-imports",disallowTypeAnnotations:!1,fixStyle:"inline-type-imports"}],"ts/no-empty-object-type":["error",{allowInterfaces:"with-single-extends",allowObjectTypes:"never"}],"ts/no-explicit-any":["error"],"ts/no-import-type-side-effects":["error"],"ts/no-misused-promises":"off","ts/no-confusing-void-expression":"off","ts/no-unused-vars":["error",{ignoreRestSiblings:!0,argsIgnorePattern:"^_",varsIgnorePattern:"^_"}],"ts/unbound-method":"off",...l.configs.recommended.rules,...o}},{name:"2digits:typescript/disables/dts",files:["**/*.d.ts"],ignores:[h],rules:{"unicorn/no-abusive-eslint-disable":"off","no-duplicate-imports":"off","no-restricted-syntax":"off","ts/no-unused-vars":"off"}},{name:"2digits:typescript/disables/test",files:["**/*.{test,spec}.ts?(x)"],ignores:[h],rules:{"no-unused-expressions":"off"}},{name:"2digits:typescript/disables/cjs",files:["**/*.js","**/*.cjs","**/*.cts"],ignores:[h],rules:{"ts/no-require-imports":"off","ts/no-var-requires":"off"}}]}function Ee(){return[{files:[i],name:"2digits:unicorn",plugins:{unicorn:P},rules:{...P.configs.recommended.rules,"unicorn/filename-case":["off"],"unicorn/prefer-module":["off"],"unicorn/prevent-abbreviations":["off"],"unicorn/prefer-ternary":["error","only-single-line"],"unicorn/no-useless-undefined":["error",{checkArguments:!1,checkArrowFunctionBody:!1}],"unicorn/prefer-top-level-await":["off"]}}]}function Fe(){return[{name:"2digits:yaml/setup",plugins:{yml:Y}},{name:"2digits:yaml/base",...k,rules:{"no-irregular-whitespace":"off","no-unused-vars":"off","spaced-comment":"off"}},{name:"2digits:yaml/recommended",...k,rules:{"yml/no-empty-document":"error","yml/no-empty-key":"error","yml/no-empty-mapping-value":"error","yml/no-empty-sequence-entry":"error","yml/no-irregular-whitespace":"error","yml/no-tab-indent":"error","yml/vue-custom-block/no-parsing-error":"error"}},{name:"2digits:yaml/standard",...k,rules:{"yml/block-mapping":"error","yml/block-sequence":"error","yml/plain-scalar":"error","yml/spaced-comment":"error"}},{name:"2digits:yaml/pnpm-workspace",...k,files:["pnpm-workspace.yaml"],rules:{"yml/sort-keys":["error",{order:["packages","overrides","patchedDependencies","hoistPattern","catalog","catalogs","allowedDeprecatedVersions","allowNonAppliedPatches","configDependencies","ignoredBuiltDependencies","ignoredOptionalDependencies","neverBuiltDependencies","onlyBuiltDependencies","onlyBuiltDependenciesFile","packageExtensions","peerDependencyRules","supportedArchitectures"],pathPattern:"^$"},{order:{type:"asc"},pathPattern:".*"}]}},{name:"2digits:yaml/prettier",...k,rules:{"yml/block-mapping-colon-indicator-newline":"off","yml/block-mapping-question-indicator-newline":"off","yml/block-sequence-hyphen-indicator-newline":"off","yml/flow-mapping-curly-newline":"off","yml/flow-mapping-curly-spacing":"off","yml/flow-sequence-bracket-newline":"off","yml/flow-sequence-bracket-spacing":"off","yml/indent":"off","yml/key-spacing":"off","yml/no-multiple-empty-lines":"off","yml/no-trailing-zeros":"off","yml/quotes":"off"}}]}const k={files:[ae],languageOptions:{parser:Z}};function p(e,o){return typeof e=="boolean"?e:e?.enable??o??!1}function u(e){if(typeof e=="boolean"||e===void 0)return{};const{enable:o,...n}=e;return n}async function C(e={},...o){let n;e.pnpm===void 0&&(n=$("pnpm-workspace.yaml"));let r=new R(be(e.ignores),we(e.js),ue(),Oe(),de(),ke(),Ee(),qe(),_e(),pe(),he(),fe(),Fe(),xe());p(e.turbo,c("turbo"))&&(r=r.append(Le(u(e.turbo))));const{overrides:a,...t}=u(e.ts);return p(e.ts,c("typescript"))&&(r=r.append(Ie(u(e.ts)))),p(e.react,c("react"))&&(r=r.append(Pe({...u(e.react),...t}))),p(e.next,c("next"))&&(r=r.append(ve({...u(e.next),...t}))),p(e.storybook,c("storybook"))&&(r=r.append(ze({...u(e.storybook),...t}))),p(e.tailwind,c("tailwindcss"))&&(r=r.append(Ce(u(e.tailwind)))),p(e.tanstack,c("react-query")||c("@tanstack/react-query")||c("@tanstack/react-query-devtools"))&&(r=r.append($e(u(e.tanstack)))),p(e.drizzle,c("drizzle-kit")||c("drizzle-orm"))&&(r=r.append(ge(u(e.drizzle)))),p(e.graphql,c("graphql"))&&(r=r.append(ye(u(e.graphql)))),p(e.pnpm,!!await n)&&(r=r.append(Se())),r=r.append(...o),c("prettier")&&(r=r.append(De())),r.renamePlugins(g).toConfigs()}export{C as default,C as twoDigits};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@2digits/eslint-config",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.5.1",
|
|
4
4
|
"description": "Effortlessly enforce best practices and catch errors with this comprehensive ESLint configuration for TypeScript, featuring popular plugins like @typescript-eslint, eslint-plugin-react, and eslint-plugin-unicorn.",
|
|
5
5
|
"homepage": "https://2d-configs.vercel.app/",
|
|
6
6
|
"repository": {
|
|
@@ -31,15 +31,15 @@
|
|
|
31
31
|
"@eslint-community/eslint-plugin-eslint-comments": "4.5.0",
|
|
32
32
|
"@eslint-react/eslint-plugin": "1.49.0",
|
|
33
33
|
"@eslint/compat": "1.2.9",
|
|
34
|
-
"@eslint/css": "0.
|
|
35
|
-
"@eslint/js": "9.
|
|
34
|
+
"@eslint/css": "0.8.1",
|
|
35
|
+
"@eslint/js": "9.27.0",
|
|
36
36
|
"@eslint/markdown": "6.4.0",
|
|
37
37
|
"@graphql-eslint/eslint-plugin": "4.4.0",
|
|
38
38
|
"@next/eslint-plugin-next": "15.3.2",
|
|
39
39
|
"@stylistic/eslint-plugin": "4.2.0",
|
|
40
40
|
"@tanstack/eslint-plugin-query": "5.74.7",
|
|
41
|
-
"@typescript-eslint/parser": "8.32.
|
|
42
|
-
"@typescript-eslint/utils": "8.32.
|
|
41
|
+
"@typescript-eslint/parser": "8.32.1",
|
|
42
|
+
"@typescript-eslint/utils": "8.32.1",
|
|
43
43
|
"eslint-config-flat-gitignore": "2.1.0",
|
|
44
44
|
"eslint-config-prettier": "10.1.5",
|
|
45
45
|
"eslint-flat-config-utils": "2.0.1",
|
|
@@ -47,11 +47,11 @@
|
|
|
47
47
|
"eslint-plugin-antfu": "3.1.1",
|
|
48
48
|
"eslint-plugin-de-morgan": "1.2.1",
|
|
49
49
|
"eslint-plugin-drizzle": "0.2.3",
|
|
50
|
-
"eslint-plugin-jsdoc": "50.6.
|
|
50
|
+
"eslint-plugin-jsdoc": "50.6.17",
|
|
51
51
|
"eslint-plugin-jsonc": "2.20.0",
|
|
52
52
|
"eslint-plugin-n": "17.18.0",
|
|
53
53
|
"eslint-plugin-pnpm": "0.3.1",
|
|
54
|
-
"eslint-plugin-react-compiler": "19.1.0-rc.
|
|
54
|
+
"eslint-plugin-react-compiler": "19.1.0-rc.2",
|
|
55
55
|
"eslint-plugin-react-hooks": "5.2.0",
|
|
56
56
|
"eslint-plugin-regexp": "2.7.0",
|
|
57
57
|
"eslint-plugin-sonarjs": "3.0.2",
|
|
@@ -65,18 +65,18 @@
|
|
|
65
65
|
"graphql-config": "5.1.5",
|
|
66
66
|
"jsonc-eslint-parser": "2.4.0",
|
|
67
67
|
"local-pkg": "1.1.1",
|
|
68
|
-
"typescript-eslint": "8.32.
|
|
68
|
+
"typescript-eslint": "8.32.1",
|
|
69
69
|
"yaml-eslint-parser": "1.3.0",
|
|
70
70
|
"@2digits/constants": "1.0.0",
|
|
71
|
-
"@2digits/eslint-plugin": "3.0.
|
|
71
|
+
"@2digits/eslint-plugin": "3.0.8"
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
74
|
"@eslint/config-inspector": "1.0.2",
|
|
75
|
-
"@types/node": "22.15.
|
|
76
|
-
"@types/react": "19.1.
|
|
75
|
+
"@types/node": "22.15.18",
|
|
76
|
+
"@types/react": "19.1.4",
|
|
77
77
|
"dedent": "1.6.0",
|
|
78
|
-
"eslint": "9.
|
|
79
|
-
"eslint-typegen": "2.
|
|
78
|
+
"eslint": "9.27.0",
|
|
79
|
+
"eslint-typegen": "2.2.0",
|
|
80
80
|
"execa": "9.5.3",
|
|
81
81
|
"react": "19.1.0",
|
|
82
82
|
"tinyglobby": "0.2.13",
|