@2digits/eslint-config 4.7.0 → 4.7.2
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 +79 -26
- package/dist/index.mjs +1 -1
- package/package.json +19 -18
package/dist/index.d.mts
CHANGED
|
@@ -262,16 +262,26 @@ interface RuleOptions {
|
|
|
262
262
|
* @see https://github.com/eslint/css/blob/main/docs/rules/no-important.md
|
|
263
263
|
*/
|
|
264
264
|
'css/no-important'?: Linter.RuleEntry<[]>;
|
|
265
|
+
/**
|
|
266
|
+
* Disallow invalid placement of at-rules
|
|
267
|
+
* @see https://github.com/eslint/css/blob/main/docs/rules/no-invalid-at-rule-placement.md
|
|
268
|
+
*/
|
|
269
|
+
'css/no-invalid-at-rule-placement'?: Linter.RuleEntry<[]>;
|
|
265
270
|
/**
|
|
266
271
|
* Disallow invalid at-rules
|
|
267
272
|
* @see https://github.com/eslint/css/blob/main/docs/rules/no-invalid-at-rules.md
|
|
268
273
|
*/
|
|
269
274
|
'css/no-invalid-at-rules'?: Linter.RuleEntry<[]>;
|
|
275
|
+
/**
|
|
276
|
+
* Disallow invalid named grid areas
|
|
277
|
+
* @see https://github.com/eslint/css/blob/main/docs/rules/no-invalid-named-grid-areas.md
|
|
278
|
+
*/
|
|
279
|
+
'css/no-invalid-named-grid-areas'?: Linter.RuleEntry<[]>;
|
|
270
280
|
/**
|
|
271
281
|
* Disallow invalid properties
|
|
272
282
|
* @see https://github.com/eslint/css/blob/main/docs/rules/no-invalid-properties.md
|
|
273
283
|
*/
|
|
274
|
-
'css/no-invalid-properties'?: Linter.RuleEntry<
|
|
284
|
+
'css/no-invalid-properties'?: Linter.RuleEntry<CssNoInvalidProperties>;
|
|
275
285
|
/**
|
|
276
286
|
* Enforce the use of logical properties
|
|
277
287
|
* @see https://github.com/eslint/css/blob/main/docs/rules/prefer-logical-properties.md
|
|
@@ -1496,7 +1506,7 @@ interface RuleOptions {
|
|
|
1496
1506
|
* Disallow empty definitions
|
|
1497
1507
|
* @see https://github.com/eslint/markdown/blob/main/docs/rules/no-empty-definitions.md
|
|
1498
1508
|
*/
|
|
1499
|
-
'markdown/no-empty-definitions'?: Linter.RuleEntry<
|
|
1509
|
+
'markdown/no-empty-definitions'?: Linter.RuleEntry<MarkdownNoEmptyDefinitions>;
|
|
1500
1510
|
/**
|
|
1501
1511
|
* Disallow empty images
|
|
1502
1512
|
* @see https://github.com/eslint/markdown/blob/main/docs/rules/no-empty-images.md
|
|
@@ -1542,6 +1552,11 @@ interface RuleOptions {
|
|
|
1542
1552
|
* @see https://github.com/eslint/markdown/blob/main/docs/rules/no-reversed-media-syntax.md
|
|
1543
1553
|
*/
|
|
1544
1554
|
'markdown/no-reversed-media-syntax'?: Linter.RuleEntry<[]>;
|
|
1555
|
+
/**
|
|
1556
|
+
* Disallow unused definitions
|
|
1557
|
+
* @see https://github.com/eslint/markdown/blob/main/docs/rules/no-unused-definitions.md
|
|
1558
|
+
*/
|
|
1559
|
+
'markdown/no-unused-definitions'?: Linter.RuleEntry<MarkdownNoUnusedDefinitions>;
|
|
1545
1560
|
/**
|
|
1546
1561
|
* Require alternative text for images
|
|
1547
1562
|
* @see https://github.com/eslint/markdown/blob/main/docs/rules/require-alt-text.md
|
|
@@ -1666,7 +1681,7 @@ interface RuleOptions {
|
|
|
1666
1681
|
*/
|
|
1667
1682
|
'next/no-assign-module-variable'?: Linter.RuleEntry<[]>;
|
|
1668
1683
|
/**
|
|
1669
|
-
* Prevent
|
|
1684
|
+
* Prevent Client Components from being async functions.
|
|
1670
1685
|
* @see https://nextjs.org/docs/messages/no-async-client-component
|
|
1671
1686
|
*/
|
|
1672
1687
|
'next/no-async-client-component'?: Linter.RuleEntry<[]>;
|
|
@@ -1818,7 +1833,7 @@ interface RuleOptions {
|
|
|
1818
1833
|
*/
|
|
1819
1834
|
'no-console'?: Linter.RuleEntry<NoConsole>;
|
|
1820
1835
|
/**
|
|
1821
|
-
* Disallow reassigning `const` variables
|
|
1836
|
+
* Disallow reassigning `const`, `using`, and `await using` variables
|
|
1822
1837
|
* @see https://eslint.org/docs/latest/rules/no-const-assign
|
|
1823
1838
|
*/
|
|
1824
1839
|
'no-const-assign'?: Linter.RuleEntry<[]>;
|
|
@@ -7653,6 +7668,10 @@ type ConsistentReturn = [] | [{
|
|
|
7653
7668
|
}];
|
|
7654
7669
|
// ----- consistent-this -----
|
|
7655
7670
|
type ConsistentThis = string[];
|
|
7671
|
+
// ----- css/no-invalid-properties -----
|
|
7672
|
+
type CssNoInvalidProperties = [] | [{
|
|
7673
|
+
allowUnknownVariables?: boolean;
|
|
7674
|
+
}];
|
|
7656
7675
|
// ----- css/prefer-logical-properties -----
|
|
7657
7676
|
type CssPreferLogicalProperties = [] | [{
|
|
7658
7677
|
allowProperties?: string[];
|
|
@@ -8187,8 +8206,8 @@ type JsdocMatchName = [] | [{
|
|
|
8187
8206
|
context?: string;
|
|
8188
8207
|
disallowName?: string;
|
|
8189
8208
|
message?: string;
|
|
8209
|
+
replacement?: string;
|
|
8190
8210
|
tags?: string[];
|
|
8191
|
-
[k: string]: unknown | undefined;
|
|
8192
8211
|
}[];
|
|
8193
8212
|
}];
|
|
8194
8213
|
// ----- jsdoc/multiline-blocks -----
|
|
@@ -8262,7 +8281,6 @@ type JsdocRequireAsteriskPrefix = [] | [("always" | "never" | "any")] | [("alway
|
|
|
8262
8281
|
always?: string[];
|
|
8263
8282
|
any?: string[];
|
|
8264
8283
|
never?: string[];
|
|
8265
|
-
[k: string]: unknown | undefined;
|
|
8266
8284
|
};
|
|
8267
8285
|
}];
|
|
8268
8286
|
// ----- jsdoc/require-description -----
|
|
@@ -8472,7 +8490,6 @@ type JsdocSortTags = [] | [{
|
|
|
8472
8490
|
reportTagGroupSpacing?: boolean;
|
|
8473
8491
|
tagSequence?: {
|
|
8474
8492
|
tags?: string[];
|
|
8475
|
-
[k: string]: unknown | undefined;
|
|
8476
8493
|
}[];
|
|
8477
8494
|
}];
|
|
8478
8495
|
// ----- jsdoc/tag-lines -----
|
|
@@ -9162,6 +9179,12 @@ type MarkdownNoDuplicateDefinitions = [] | [{
|
|
|
9162
9179
|
type MarkdownNoDuplicateHeadings = [] | [{
|
|
9163
9180
|
checkSiblingsOnly?: boolean;
|
|
9164
9181
|
}];
|
|
9182
|
+
// ----- markdown/no-empty-definitions -----
|
|
9183
|
+
type MarkdownNoEmptyDefinitions = [] | [{
|
|
9184
|
+
allowDefinitions?: string[];
|
|
9185
|
+
allowFootnoteDefinitions?: string[];
|
|
9186
|
+
checkFootnoteDefinitions?: boolean;
|
|
9187
|
+
}];
|
|
9165
9188
|
// ----- markdown/no-html -----
|
|
9166
9189
|
type MarkdownNoHtml = [] | [{
|
|
9167
9190
|
allowed?: string[];
|
|
@@ -9175,6 +9198,11 @@ type MarkdownNoMissingLinkFragments = [] | [{
|
|
|
9175
9198
|
type MarkdownNoMultipleH1 = [] | [{
|
|
9176
9199
|
frontmatterTitle?: string;
|
|
9177
9200
|
}];
|
|
9201
|
+
// ----- markdown/no-unused-definitions -----
|
|
9202
|
+
type MarkdownNoUnusedDefinitions = [] | [{
|
|
9203
|
+
allowDefinitions?: string[];
|
|
9204
|
+
allowFootnoteDefinitions?: string[];
|
|
9205
|
+
}];
|
|
9178
9206
|
// ----- max-classes-per-file -----
|
|
9179
9207
|
type MaxClassesPerFile = [] | [(number | {
|
|
9180
9208
|
ignoreExpressions?: boolean;
|
|
@@ -10733,10 +10761,12 @@ type StylisticIndent = [] | [("tab" | number)] | [("tab" | number), {
|
|
|
10733
10761
|
FunctionDeclaration?: {
|
|
10734
10762
|
parameters?: (number | ("first" | "off"));
|
|
10735
10763
|
body?: number;
|
|
10764
|
+
returnType?: number;
|
|
10736
10765
|
};
|
|
10737
10766
|
FunctionExpression?: {
|
|
10738
10767
|
parameters?: (number | ("first" | "off"));
|
|
10739
10768
|
body?: number;
|
|
10769
|
+
returnType?: number;
|
|
10740
10770
|
};
|
|
10741
10771
|
StaticBlock?: {
|
|
10742
10772
|
body?: number;
|
|
@@ -10777,31 +10807,52 @@ type StylisticJsxCurlyNewline = [] | [(("consistent" | "never") | {
|
|
|
10777
10807
|
multiline?: ("consistent" | "require" | "forbid");
|
|
10778
10808
|
})];
|
|
10779
10809
|
// ----- stylistic/jsx-curly-spacing -----
|
|
10780
|
-
type StylisticJsxCurlySpacing = [] | [(
|
|
10781
|
-
|
|
10782
|
-
children?: _StylisticJsxCurlySpacingBasicConfigOrBoolean;
|
|
10783
|
-
[k: string]: unknown | undefined;
|
|
10784
|
-
}) | ("always" | "never"))] | [((_StylisticJsxCurlySpacing_BasicConfig & {
|
|
10785
|
-
attributes?: _StylisticJsxCurlySpacingBasicConfigOrBoolean;
|
|
10786
|
-
children?: _StylisticJsxCurlySpacingBasicConfigOrBoolean;
|
|
10787
|
-
[k: string]: unknown | undefined;
|
|
10788
|
-
}) | ("always" | "never")), {
|
|
10810
|
+
type StylisticJsxCurlySpacing = [] | [({
|
|
10811
|
+
when?: ("always" | "never");
|
|
10789
10812
|
allowMultiline?: boolean;
|
|
10790
10813
|
spacing?: {
|
|
10791
10814
|
objectLiterals?: ("always" | "never");
|
|
10792
|
-
[k: string]: unknown | undefined;
|
|
10793
10815
|
};
|
|
10794
|
-
|
|
10795
|
-
|
|
10796
|
-
|
|
10816
|
+
attributes?: ({
|
|
10817
|
+
when?: ("always" | "never");
|
|
10818
|
+
allowMultiline?: boolean;
|
|
10819
|
+
spacing?: {
|
|
10820
|
+
objectLiterals?: ("always" | "never");
|
|
10821
|
+
};
|
|
10822
|
+
} | boolean);
|
|
10823
|
+
children?: ({
|
|
10824
|
+
when?: ("always" | "never");
|
|
10825
|
+
allowMultiline?: boolean;
|
|
10826
|
+
spacing?: {
|
|
10827
|
+
objectLiterals?: ("always" | "never");
|
|
10828
|
+
};
|
|
10829
|
+
} | boolean);
|
|
10830
|
+
} | ("always" | "never"))] | [({
|
|
10797
10831
|
when?: ("always" | "never");
|
|
10798
10832
|
allowMultiline?: boolean;
|
|
10799
10833
|
spacing?: {
|
|
10800
10834
|
objectLiterals?: ("always" | "never");
|
|
10801
|
-
[k: string]: unknown | undefined;
|
|
10802
10835
|
};
|
|
10803
|
-
|
|
10804
|
-
|
|
10836
|
+
attributes?: ({
|
|
10837
|
+
when?: ("always" | "never");
|
|
10838
|
+
allowMultiline?: boolean;
|
|
10839
|
+
spacing?: {
|
|
10840
|
+
objectLiterals?: ("always" | "never");
|
|
10841
|
+
};
|
|
10842
|
+
} | boolean);
|
|
10843
|
+
children?: ({
|
|
10844
|
+
when?: ("always" | "never");
|
|
10845
|
+
allowMultiline?: boolean;
|
|
10846
|
+
spacing?: {
|
|
10847
|
+
objectLiterals?: ("always" | "never");
|
|
10848
|
+
};
|
|
10849
|
+
} | boolean);
|
|
10850
|
+
} | ("always" | "never")), {
|
|
10851
|
+
allowMultiline?: boolean;
|
|
10852
|
+
spacing?: {
|
|
10853
|
+
objectLiterals?: ("always" | "never");
|
|
10854
|
+
};
|
|
10855
|
+
}];
|
|
10805
10856
|
// ----- stylistic/jsx-equals-spacing -----
|
|
10806
10857
|
type StylisticJsxEqualsSpacing = [] | [("always" | "never")];
|
|
10807
10858
|
// ----- stylistic/jsx-first-prop-new-line -----
|
|
@@ -10817,14 +10868,12 @@ type StylisticJsxIndent = [] | [("tab" | number)] | [("tab" | number), {
|
|
|
10817
10868
|
type StylisticJsxIndentProps = [] | [(("tab" | "first") | number | {
|
|
10818
10869
|
indentMode?: (("tab" | "first") | number);
|
|
10819
10870
|
ignoreTernaryOperator?: boolean;
|
|
10820
|
-
[k: string]: unknown | undefined;
|
|
10821
10871
|
})];
|
|
10822
10872
|
// ----- stylistic/jsx-max-props-per-line -----
|
|
10823
10873
|
type StylisticJsxMaxPropsPerLine = [] | [({
|
|
10824
10874
|
maximum?: {
|
|
10825
10875
|
single?: number;
|
|
10826
10876
|
multi?: number;
|
|
10827
|
-
[k: string]: unknown | undefined;
|
|
10828
10877
|
};
|
|
10829
10878
|
} | {
|
|
10830
10879
|
maximum?: number;
|
|
@@ -11171,6 +11220,10 @@ type StylisticKeywordSpacing = [] | [{
|
|
|
11171
11220
|
before?: boolean;
|
|
11172
11221
|
after?: boolean;
|
|
11173
11222
|
};
|
|
11223
|
+
accessor?: {
|
|
11224
|
+
before?: boolean;
|
|
11225
|
+
after?: boolean;
|
|
11226
|
+
};
|
|
11174
11227
|
as?: {
|
|
11175
11228
|
before?: boolean;
|
|
11176
11229
|
after?: boolean;
|
|
@@ -11383,11 +11436,11 @@ interface _StylisticMemberDelimiterStyle_DelimiterConfig {
|
|
|
11383
11436
|
// ----- stylistic/multiline-comment-style -----
|
|
11384
11437
|
type StylisticMultilineCommentStyle = ([] | [("starred-block" | "bare-block")] | [] | ["separate-lines"] | ["separate-lines", {
|
|
11385
11438
|
checkJSDoc?: boolean;
|
|
11439
|
+
checkExclamation?: boolean;
|
|
11386
11440
|
}]);
|
|
11387
11441
|
// ----- stylistic/multiline-ternary -----
|
|
11388
11442
|
type StylisticMultilineTernary = [] | [("always" | "always-multiline" | "never")] | [("always" | "always-multiline" | "never"), {
|
|
11389
11443
|
ignoreJSX?: boolean;
|
|
11390
|
-
[k: string]: unknown | undefined;
|
|
11391
11444
|
}];
|
|
11392
11445
|
// ----- stylistic/new-parens -----
|
|
11393
11446
|
type StylisticNewParens = [] | [("always" | "never")];
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{FlatConfigComposer as e,renamePluginsInConfigs as t,renamePluginsInRules as n}from"eslint-flat-config-utils";import{findUp as r}from"find-up";import{isPackageExists as i}from"local-pkg";import a from"eslint-plugin-antfu";import o from"eslint-plugin-de-morgan";import s from"@eslint-community/eslint-plugin-eslint-comments";import c from"@eslint-community/eslint-plugin-eslint-comments/configs";import l from"@eslint/css";import{tailwindSyntax as u}from"@eslint/css/syntax";import{fixupPluginRules as d}from"@eslint/compat";import f from"yaml-eslint-parser";import p from"eslint-plugin-github-action";import m from"eslint-config-flat-gitignore";import ee from"@eslint/js";import h from"@stylistic/eslint-plugin";import g from"globals";import te from"eslint-plugin-jsdoc";import ne,{configs as _}from"eslint-plugin-jsonc";import re from"jsonc-eslint-parser";import v from"@eslint/markdown";import{mergeProcessors as y,processorPassThrough as b}from"eslint-merge-processors";import x from"eslint-plugin-n";import S from"eslint-plugin-regexp";import ie from"eslint-plugin-sonarjs";import C from"eslint-plugin-unicorn";import ae from"eslint-plugin-yml";const w=`**/*.?([cm])[jt]s?(x)`,T=`**/*.?([cm])ts`,E=`**/*.?([cm])tsx`,oe=`**/*.stories.tsx`,se=`**/*.json`,ce=`**/*.json5`,D=`**/*.jsonc`,O=`**/*.css`,k=`**/*.y?(a)ml`,A=`.github/workflows/*.y?(a)ml`,j=`**/*.md`,M=`**/*.md/*.md`,N=`${j}/${w}`,P=`**/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`.split(`,`);function F(){return[{files:[w],name:`2digits:antfu`,plugins:{antfu:a},rules:{"antfu/if-newline":`error`,"antfu/top-level-function":`error`}}]}function I(){return[{files:[w],name:`2digits:boolean`,plugins:{boolean:o},rules:{...o.configs.recommended.rules}}]}const L={"@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`},R=n(c.recommended.rules,L);function z(){return[{files:[w],name:`2digits:comments`,plugins:{comments:s},rules:{...R,"comments/no-unused-disable":`error`,"comments/disable-enable-pair":[`error`,{allowWholeFile:!0}]}}]}function B(){return[{name:`2digits:css`,files:[O],language:`css/css`,plugins:{css:l},languageOptions:{tolerant:!0,customSyntax:u},rules:{...l.configs.recommended.rules}}]}async function V(e){let t=await e;return t.default||t}async function H(e={}){let{overrides:t={},drizzleObjectName:n=[`drizzle`,`db`]}=e,r=await V(import(`eslint-plugin-drizzle`));return[{files:[w],name:`2digits:drizzle`,plugins:{drizzle:d(r)},rules:{"drizzle/enforce-update-with-where":[`error`,{drizzleObjectName:n}],"drizzle/enforce-delete-with-where":[`error`,{drizzleObjectName:n}],...t}}]}const U=Object.fromEntries(p.configs.recommended.flatMap(({rules:e})=>Object.entries({...e})));function W(){return[{name:`2digits:github-actions/setup`,plugins:{"github-action":p}},{name:`2digits:github-actions/recommended`,files:[A],ignores:[`!**/${A}`],languageOptions:{parser:f},rules:{...U}}]}async function G(e={}){let{overrides:t={},files:r=[`**/*.graphql`,`**/*.gql`]}=e,[i,a]=await Promise.all([V(import(`@graphql-eslint/eslint-plugin`)),import(`graphql-config`).then(({loadConfig:e})=>e({throwOnEmpty:!1,throwOnMissing:!1}).then(e=>e?.getDefault().schema))]),o=i.configs[`flat/operations-recommended`].rules,s={};if(a)s=o;else for(let e of Object.keys(o)){let t=e.replace(`@graphql-eslint/`,``);if(t in i.rules&&(i.rules[t].meta.docs?.requiresSchema||i.rules[t].meta.docs?.requiresSiblings))continue;s[e]=o[e]}let c=n(s,L);return[{name:`2digits:graphql`,plugins:{gql:i},languageOptions:{parser:i.parser},files:r,rules:{...c,"gql/naming-convention":[`error`,{allowLeadingUnderscore:!0}],...t}}]}function le(e={}){let{gitIgnore:t,ignores:n=[]}=e;return[{ignores:[P,n].flat(),name:`2digits:ignores`},m({strict:!1,...t,name:`2digits:gitignore`})]}function ue(e={}){let{overrides:t={}}=e;return[{files:[w],name:`2digits:javascript`,plugins:{stylistic:h},languageOptions:{ecmaVersion:2022,globals:{...g.browser,...g.es2021,...g.node,document:`readonly`,navigator:`readonly`,window:`readonly`},parserOptions:{ecmaFeatures:{jsx:!0},ecmaVersion:2022,sourceType:`module`},sourceType:`module`},linterOptions:{reportUnusedDisableDirectives:!0},rules:{...ee.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`}],...t}}]}function de(){return[{files:[w],name:`2digits:jsdoc`,plugins:{jsdoc:te},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 fe(){return[..._[`flat/base`].map(e=>({...e,name:`2digits:jsonc/base`})),{name:`2digits:jsonc/json`,files:[se],...K,rules:{...q(_[`flat/recommended-with-json`])}},{name:`2digits:jsonc/jsonc`,files:[D],...K,rules:{...q(_[`flat/recommended-with-jsonc`])}},{name:`2digits:jsonc/json5`,files:[ce],...K,rules:{...q(_[`flat/recommended-with-json5`])}},{name:`2digits:jsonc/package.json`,...K,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`.split(`.`),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`,...K,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`.split(`.`),pathPattern:`^compilerOptions$`}]}},..._[`flat/prettier`].map(e=>({...e,name:`2digits:jsonc/prettier`}))]}const K={languageOptions:{parser:re},plugins:{jsonc:ne}};function q(e){return Object.fromEntries(e.flatMap(({rules:e})=>Object.entries(e??{})))}const J=[j];function pe(){return[{name:`2digits:markdown/setup`,plugins:{markdown:v}},{name:`2digits:markdown/processor`,files:J,language:`markdown/gfm`,ignores:[M],processor:y([v.processors.markdown,b])},{name:`2digits:markdown/parser`,files:J,language:`markdown/gfm`,languageOptions:{parser:me}},{name:`2digits:markdown/rules`,files:J,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:[N],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 me={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 he(e={}){let{files:t=[T,E],overrides:r={},parserOptions:i}=e,[a,o]=await Promise.all([V(import(`@next/eslint-plugin-next`)),V(import(`@typescript-eslint/parser`))]),s=n({...a.configs.recommended.rules,...a.configs[`core-web-vitals`].rules},L);return[{name:`2digits:next/setup`,plugins:{next:d(a)}},{name:`2digits:next/rules`,files:t,languageOptions:{parser:o,parserOptions:{ecmaFeatures:{jsx:!0},projectService:!0,...i},sourceType:`module`},rules:{...s,"next/no-html-link-for-pages":`off`,...r}}]}function ge(){return[{files:[w],name:`2digits:node`,settings:{node:{version:`>= 22.0.0`}},plugins:{node:x},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 _e(){let e=await V(import(`eslint-plugin-pnpm`));return[{name:`2digits:pnpm/package-json`,files:[`**/package.json`],languageOptions:{parser:await V(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 V(import(`yaml-eslint-parser`))},plugins:{pnpm:e},rules:{"pnpm/yaml-no-duplicate-catalog-item":`error`,"pnpm/yaml-no-unused-catalog-item":`error`}}]}async function ve(){let[e,t]=await Promise.all([V(import(`eslint-config-prettier`)),V(import(`@stylistic/eslint-plugin`))]);return[{name:`2digits:prettier`,plugins:{stylistic:t},rules:{...e.rules,"tailwindcss/classnames-order":`off`,"stylistic/jsx-newline":[`error`,{prevent:!1}]}}]}async function ye(e={}){let{files:t=[T,E],overrides:r={},parserOptions:i,tsconfigRootDir:a,reactCompiler:o=!0}=e,[s,c,l,u,d]=await Promise.all([V(import(`@eslint-react/eslint-plugin`)),V(import(`eslint-plugin-react-hooks`)),V(import(`@typescript-eslint/parser`)),o?V(import(`eslint-plugin-react-compiler`)):void 0,V(import(`@stylistic/eslint-plugin`))]),f=s.configs.all.plugins,p=n({...c.configs[`recommended-latest`].rules,...s.configs[`recommended-type-checked`].rules},L);return[{name:`2digits:react/setup`,plugins:{stylistic:d,"react-dom":f[`@eslint-react/dom`],"react-web-api":f[`@eslint-react/web-api`],"react-extra":f[`@eslint-react`],"react-hooks":c,"react-hooks-extra":f[`@eslint-react/hooks-extra`],"react-naming-convention":f[`@eslint-react/naming-convention`],...o?{"react-compiler":u}:{}},settings:{react:{version:`detect`}}},{name:`2digits:react/rules`,files:t,languageOptions:{parser:l,parserOptions:{ecmaFeatures:{jsx:!0},tsconfigRootDir:a,projectService:!0,...i},sourceType:`module`},rules:{...p,...o?{"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`,...r}}]}function be(){return[{files:[w],name:`2digits:regexp`,plugins:{regexp:S},rules:{...S.configs[`flat/recommended`].rules}}]}function xe(){return[{files:[w],name:`2digits:sonar`,plugins:{sonar:ie},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 Se(e={}){let{files:t=[oe],overrides:n={},parserOptions:r,storybookDirectory:i=`.storybook`}=e,[a,o]=await Promise.all([V(import(`eslint-plugin-storybook`)),V(import(`@typescript-eslint/parser`))]),s={parser:o,parserOptions:{ecmaFeatures:{jsx:!0},projectService:!0,...r},sourceType:`module`};return[{name:`2digits:storybook/setup`,plugins:{storybook:d(a)}},{name:`2digits:storybook/rules`,files:t,languageOptions:s,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:t,rules:{"react-hooks/rules-of-hooks":`off`,"react/display-name":`off`,"sonar/no-duplicate-string":`off`}},{name:`2digits:storybook/config`,files:[`${i}/main.@(js|cjs|mjs|ts)`],languageOptions:s,rules:{"storybook/no-uninstalled-addons":`error`}}]}async function Ce(e={}){let{overrides:t={}}=e,[n,{tailwindFunctions:i},a]=await Promise.all([V(import(`eslint-plugin-tailwindcss`)),V(import(`@2digits/constants`)),r([`tailwind.config.ts`,`tailwind.config.js`])]);return[{files:[w],name:`2digits:tailwind`,plugins:{tailwindcss:n},settings:{tailwindcss:{callees:i,config:a}},rules:{...n.configs.recommended.rules,...t}}]}async function we(e={}){let{overrides:t={}}=e,r=await V(import(`@tanstack/eslint-plugin-query`)),i=n(r.configs[`flat/recommended`].at(0)?.rules??{},L);return[{files:[w],name:`2digits:tanstack`,plugins:{tanstack:r},rules:{...i,...t}}]}async function Y(e={}){let{overrides:t={}}=e,n=await V(import(`eslint-plugin-turbo`));return[{files:[w],name:`2digits:turbo`,plugins:{turbo:n},rules:{"turbo/no-undeclared-env-vars":`error`,...t}}]}async function Te(e={}){let{overrides:n={},parserOptions:r={}}=e,[{plugin:i,configs:a,parser:o},s]=await Promise.all([V(import(`typescript-eslint`)),V(import(`@2digits/eslint-plugin`))]),c=t(a.strictTypeChecked,L),l=Object.fromEntries(c.flatMap(({rules:e})=>Object.entries(e??{})));return[{name:`2digits:typescript/setup`,plugins:{ts:i,"@2digits":s}},{name:`2digits:typescript/rules`,files:[w],ignores:[N],languageOptions:{parser:o,parserOptions:{tsconfigRootDir:process.cwd(),projectService:!0,warnOnUnsupportedTypeScriptVersion:!1,...r},sourceType:`module`},rules:{...l,"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`,...s.configs.recommended.rules,...n}},{name:`2digits:typescript/disables/dts`,files:[`**/*.d.ts`],ignores:[N],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:[N],rules:{"no-unused-expressions":`off`}},{name:`2digits:typescript/disables/cjs`,files:[`**/*.js`,`**/*.cjs`,`**/*.cts`],ignores:[N],rules:{"ts/no-require-imports":`off`,"ts/no-var-requires":`off`}}]}function Ee(){return[{files:[w],name:`2digits:unicorn`,plugins:{unicorn:C},rules:{...C.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 De(){return[{name:`2digits:yaml/setup`,plugins:{yml:ae}},{name:`2digits:yaml/base`,...X,rules:{"no-irregular-whitespace":`off`,"no-unused-vars":`off`,"spaced-comment":`off`}},{name:`2digits:yaml/recommended`,...X,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`,...X,rules:{"yml/block-mapping":`error`,"yml/block-sequence":`error`,"yml/plain-scalar":`error`,"yml/spaced-comment":`error`}},{name:`2digits:yaml/prettier`,...X,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 X={files:[k],languageOptions:{parser:f}};function Z(e,t){return typeof e==`boolean`?e:e?.enable??t??!1}function Q(e){if(typeof e==`boolean`||e===void 0)return{};let{enable:t,...n}=e;return n}async function $(t={},...n){let a;t.pnpm===void 0&&(a=r(`pnpm-workspace.yaml`));let o=new e(le(t.ignores),ue(t.js),I(),ge(),z(),de(),Ee(),xe(),be(),F(),fe(),B(),De(),pe(),W());Z(t.turbo,i(`turbo`))&&(o=o.append(Y(Q(t.turbo))));let{overrides:s,...c}=Q(t.ts);return Z(t.ts,i(`typescript`))&&(o=o.append(Te(Q(t.ts)))),Z(t.react,i(`react`))&&(o=o.append(ye({...Q(t.react),...c}))),Z(t.next,i(`next`))&&(o=o.append(he({...Q(t.next),...c}))),Z(t.storybook,i(`storybook`))&&(o=o.append(Se({...Q(t.storybook),...c}))),Z(t.tailwind,i(`tailwindcss`))&&(o=o.append(Ce(Q(t.tailwind)))),Z(t.tanstack,i(`react-query`)||i(`@tanstack/react-query`)||i(`@tanstack/react-query-devtools`))&&(o=o.append(we(Q(t.tanstack)))),Z(t.drizzle,i(`drizzle-kit`)||i(`drizzle-orm`))&&(o=o.append(H(Q(t.drizzle)))),Z(t.graphql,i(`graphql`))&&(o=o.append(G(Q(t.graphql)))),Z(t.pnpm,!!await a)&&(o=o.append(_e())),o=o.append(...n),i(`prettier`)&&(o=o.append(ve())),o.renamePlugins(L).toConfigs()}export{$ as default,$ as twoDigits};
|
|
1
|
+
import{FlatConfigComposer as e,renamePluginsInConfigs as t,renamePluginsInRules as n}from"eslint-flat-config-utils";import{findUp as r}from"find-up";import{isPackageExists as i}from"local-pkg";import a from"eslint-plugin-antfu";import o from"eslint-plugin-de-morgan";import s from"@eslint-community/eslint-plugin-eslint-comments";import c from"@eslint-community/eslint-plugin-eslint-comments/configs";import l from"@eslint/css";import{tailwind3 as u}from"tailwind-csstree";import{fixupPluginRules as d}from"@eslint/compat";import f from"eslint-plugin-github-action";import p from"yaml-eslint-parser";import m from"eslint-config-flat-gitignore";import ee from"@eslint/js";import h from"@stylistic/eslint-plugin";import g from"globals";import te from"eslint-plugin-jsdoc";import ne,{configs as _}from"eslint-plugin-jsonc";import re from"jsonc-eslint-parser";import v from"@eslint/markdown";import{mergeProcessors as y,processorPassThrough as b}from"eslint-merge-processors";import x from"eslint-plugin-n";import S from"eslint-plugin-regexp";import ie from"eslint-plugin-sonarjs";import C from"eslint-plugin-unicorn";import ae from"eslint-plugin-yml";const w=`**/*.?([cm])[jt]s?(x)`,T=`**/*.?([cm])ts`,E=`**/*.?([cm])tsx`,oe=`**/*.stories.tsx`,se=`**/*.json`,ce=`**/*.json5`,D=`**/*.jsonc`,O=`**/*.css`,k=`**/*.y?(a)ml`,A=`.github/workflows/*.y?(a)ml`,j=`**/*.md`,M=`**/*.md/*.md`,N=`${j}/${w}`,P=`**/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`.split(`,`);function F(){return[{files:[w],name:`2digits:antfu`,plugins:{antfu:a},rules:{"antfu/if-newline":`error`,"antfu/top-level-function":`error`}}]}function I(){return[{files:[w],name:`2digits:boolean`,plugins:{boolean:o},rules:{...o.configs.recommended.rules}}]}const L={"@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`},R=n(c.recommended.rules,L);function z(){return[{files:[w],name:`2digits:comments`,plugins:{comments:s},rules:{...R,"comments/no-unused-disable":`error`,"comments/disable-enable-pair":[`error`,{allowWholeFile:!0}]}}]}function B(){return[{name:`2digits:css`,files:[O],language:`css/css`,plugins:{css:l},languageOptions:{tolerant:!0,customSyntax:u},rules:{...l.configs.recommended.rules}}]}async function V(e){let t=await e;return t.default||t}async function H(e={}){let{overrides:t={},drizzleObjectName:n=[`drizzle`,`db`]}=e,r=await V(import(`eslint-plugin-drizzle`));return[{files:[w],name:`2digits:drizzle`,plugins:{drizzle:d(r)},rules:{"drizzle/enforce-update-with-where":[`error`,{drizzleObjectName:n}],"drizzle/enforce-delete-with-where":[`error`,{drizzleObjectName:n}],...t}}]}const U=Object.fromEntries(f.configs.recommended.flatMap(({rules:e})=>Object.entries({...e})));function W(){return[{name:`2digits:github-actions/setup`,plugins:{"github-action":f}},{name:`2digits:github-actions/recommended`,files:[A],ignores:[`!**/${A}`],languageOptions:{parser:p},rules:{...U}}]}async function G(e={}){let{overrides:t={},files:r=[`**/*.graphql`,`**/*.gql`]}=e,[i,a]=await Promise.all([V(import(`@graphql-eslint/eslint-plugin`)),import(`graphql-config`).then(({loadConfig:e})=>e({throwOnEmpty:!1,throwOnMissing:!1}).then(e=>e?.getDefault().schema))]),o=i.configs[`flat/operations-recommended`].rules,s={};if(a)s=o;else for(let e of Object.keys(o)){let t=e.replace(`@graphql-eslint/`,``);if(t in i.rules&&(i.rules[t].meta.docs?.requiresSchema||i.rules[t].meta.docs?.requiresSiblings))continue;s[e]=o[e]}let c=n(s,L);return[{name:`2digits:graphql`,plugins:{gql:i},languageOptions:{parser:i.parser},files:r,rules:{...c,"gql/naming-convention":[`error`,{allowLeadingUnderscore:!0}],...t}}]}function le(e={}){let{gitIgnore:t,ignores:n=[]}=e;return[{ignores:[P,n].flat(),name:`2digits:ignores`},m({strict:!1,...t,name:`2digits:gitignore`})]}function ue(e={}){let{overrides:t={}}=e;return[{files:[w],name:`2digits:javascript`,plugins:{stylistic:h},languageOptions:{ecmaVersion:2022,globals:{...g.browser,...g.es2021,...g.node,document:`readonly`,navigator:`readonly`,window:`readonly`},parserOptions:{ecmaFeatures:{jsx:!0},ecmaVersion:2022,sourceType:`module`},sourceType:`module`},linterOptions:{reportUnusedDisableDirectives:!0},rules:{...ee.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`}],...t}}]}function de(){return[{files:[w],name:`2digits:jsdoc`,plugins:{jsdoc:te},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 fe(){return[..._[`flat/base`].map(e=>({...e,name:`2digits:jsonc/base`})),{name:`2digits:jsonc/json`,files:[se],...K,rules:{...q(_[`flat/recommended-with-json`])}},{name:`2digits:jsonc/jsonc`,files:[D],...K,rules:{...q(_[`flat/recommended-with-jsonc`])}},{name:`2digits:jsonc/json5`,files:[ce],...K,rules:{...q(_[`flat/recommended-with-json5`])}},{name:`2digits:jsonc/package.json`,...K,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`.split(`.`),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`,...K,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`.split(`.`),pathPattern:`^compilerOptions$`}]}},..._[`flat/prettier`].map(e=>({...e,name:`2digits:jsonc/prettier`}))]}const K={languageOptions:{parser:re},plugins:{jsonc:ne}};function q(e){return Object.fromEntries(e.flatMap(({rules:e})=>Object.entries(e??{})))}const J=[j];function pe(){return[{name:`2digits:markdown/setup`,plugins:{markdown:v}},{name:`2digits:markdown/processor`,files:J,language:`markdown/gfm`,ignores:[M],processor:y([v.processors.markdown,b])},{name:`2digits:markdown/parser`,files:J,language:`markdown/gfm`,languageOptions:{parser:me}},{name:`2digits:markdown/rules`,files:J,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:[N],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 me={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 he(e={}){let{files:t=[T,E],overrides:r={},parserOptions:i}=e,[a,o]=await Promise.all([V(import(`@next/eslint-plugin-next`)),V(import(`@typescript-eslint/parser`))]),s=n({...a.configs.recommended.rules,...a.configs[`core-web-vitals`].rules},L);return[{name:`2digits:next/setup`,plugins:{next:d(a)}},{name:`2digits:next/rules`,files:t,languageOptions:{parser:o,parserOptions:{ecmaFeatures:{jsx:!0},projectService:!0,...i},sourceType:`module`},rules:{...s,"next/no-html-link-for-pages":`off`,...r}}]}function ge(){return[{files:[w],name:`2digits:node`,settings:{node:{version:`>= 22.0.0`}},plugins:{node:x},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 _e(){let e=await V(import(`eslint-plugin-pnpm`));return[{name:`2digits:pnpm/package-json`,files:[`**/package.json`],languageOptions:{parser:await V(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 V(import(`yaml-eslint-parser`))},plugins:{pnpm:e},rules:{"pnpm/yaml-no-duplicate-catalog-item":`error`,"pnpm/yaml-no-unused-catalog-item":`error`}}]}async function ve(){let[e,t]=await Promise.all([V(import(`eslint-config-prettier`)),V(import(`@stylistic/eslint-plugin`))]);return[{name:`2digits:prettier`,plugins:{stylistic:t},rules:{...e.rules,"tailwindcss/classnames-order":`off`,"stylistic/jsx-newline":[`error`,{prevent:!1}]}}]}async function ye(e={}){let{files:t=[T,E],overrides:r={},parserOptions:i,tsconfigRootDir:a,reactCompiler:o=!0}=e,[s,c,l,u,d]=await Promise.all([V(import(`@eslint-react/eslint-plugin`)),V(import(`eslint-plugin-react-hooks`)),V(import(`@typescript-eslint/parser`)),o?V(import(`eslint-plugin-react-compiler`)):void 0,V(import(`@stylistic/eslint-plugin`))]),f=s.configs.all.plugins,p=n({...c.configs[`recommended-latest`].rules,...s.configs[`recommended-type-checked`].rules},L);return[{name:`2digits:react/setup`,plugins:{stylistic:d,"react-dom":f[`@eslint-react/dom`],"react-web-api":f[`@eslint-react/web-api`],"react-extra":f[`@eslint-react`],"react-hooks":c,"react-hooks-extra":f[`@eslint-react/hooks-extra`],"react-naming-convention":f[`@eslint-react/naming-convention`],...o?{"react-compiler":u}:{}},settings:{react:{version:`detect`}}},{name:`2digits:react/rules`,files:t,languageOptions:{parser:l,parserOptions:{ecmaFeatures:{jsx:!0},tsconfigRootDir:a,projectService:!0,...i},sourceType:`module`},rules:{...p,...o?{"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`,...r}}]}function be(){return[{files:[w],name:`2digits:regexp`,plugins:{regexp:S},rules:{...S.configs[`flat/recommended`].rules}}]}function xe(){return[{files:[w],name:`2digits:sonar`,plugins:{sonar:ie},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 Se(e={}){let{files:t=[oe],overrides:n={},parserOptions:r,storybookDirectory:i=`.storybook`}=e,[a,o]=await Promise.all([V(import(`eslint-plugin-storybook`)),V(import(`@typescript-eslint/parser`))]),s={parser:o,parserOptions:{ecmaFeatures:{jsx:!0},projectService:!0,...r},sourceType:`module`};return[{name:`2digits:storybook/setup`,plugins:{storybook:d(a)}},{name:`2digits:storybook/rules`,files:t,languageOptions:s,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:t,rules:{"react-hooks/rules-of-hooks":`off`,"react/display-name":`off`,"sonar/no-duplicate-string":`off`}},{name:`2digits:storybook/config`,files:[`${i}/main.@(js|cjs|mjs|ts)`],languageOptions:s,rules:{"storybook/no-uninstalled-addons":`error`}}]}async function Ce(e={}){let{overrides:t={}}=e,[n,{tailwindFunctions:i},a]=await Promise.all([V(import(`eslint-plugin-tailwindcss`)),V(import(`@2digits/constants`)),r([`tailwind.config.ts`,`tailwind.config.js`])]);return[{files:[w],name:`2digits:tailwind`,plugins:{tailwindcss:n},settings:{tailwindcss:{callees:i,config:a}},rules:{...n.configs.recommended.rules,...t}}]}async function we(e={}){let{overrides:t={}}=e,r=await V(import(`@tanstack/eslint-plugin-query`)),i=n(r.configs[`flat/recommended`].at(0)?.rules??{},L);return[{files:[w],name:`2digits:tanstack`,plugins:{tanstack:r},rules:{...i,...t}}]}async function Y(e={}){let{overrides:t={}}=e,n=await V(import(`eslint-plugin-turbo`));return[{files:[w],name:`2digits:turbo`,plugins:{turbo:n},rules:{"turbo/no-undeclared-env-vars":`error`,...t}}]}async function Te(e={}){let{overrides:n={},parserOptions:r={}}=e,[{plugin:i,configs:a,parser:o},s]=await Promise.all([V(import(`typescript-eslint`)),V(import(`@2digits/eslint-plugin`))]),c=t(a.strictTypeChecked,L),l=Object.fromEntries(c.flatMap(({rules:e})=>Object.entries(e??{})));return[{name:`2digits:typescript/setup`,plugins:{ts:i,"@2digits":s}},{name:`2digits:typescript/rules`,files:[w],ignores:[N],languageOptions:{parser:o,parserOptions:{tsconfigRootDir:process.cwd(),projectService:!0,warnOnUnsupportedTypeScriptVersion:!1,...r},sourceType:`module`},rules:{...l,"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`,...s.configs.recommended.rules,...n}},{name:`2digits:typescript/disables/dts`,files:[`**/*.d.ts`],ignores:[N],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:[N],rules:{"no-unused-expressions":`off`}},{name:`2digits:typescript/disables/cjs`,files:[`**/*.js`,`**/*.cjs`,`**/*.cts`],ignores:[N],rules:{"ts/no-require-imports":`off`,"ts/no-var-requires":`off`}}]}function Ee(){return[{files:[w],name:`2digits:unicorn`,plugins:{unicorn:C},rules:{...C.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 De(){return[{name:`2digits:yaml/setup`,plugins:{yml:ae}},{name:`2digits:yaml/base`,...X,rules:{"no-irregular-whitespace":`off`,"no-unused-vars":`off`,"spaced-comment":`off`}},{name:`2digits:yaml/recommended`,...X,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`,...X,rules:{"yml/block-mapping":`error`,"yml/block-sequence":`error`,"yml/plain-scalar":`error`,"yml/spaced-comment":`error`}},{name:`2digits:yaml/prettier`,...X,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 X={files:[k],languageOptions:{parser:p}};function Z(e,t){return typeof e==`boolean`?e:e?.enable??t??!1}function Q(e){if(typeof e==`boolean`||e===void 0)return{};let{enable:t,...n}=e;return n}async function $(t={},...n){let a;t.pnpm===void 0&&(a=r(`pnpm-workspace.yaml`));let o=new e(le(t.ignores),ue(t.js),I(),ge(),z(),de(),Ee(),xe(),be(),F(),fe(),B(),De(),pe(),W());Z(t.turbo,i(`turbo`))&&(o=o.append(Y(Q(t.turbo))));let{overrides:s,...c}=Q(t.ts);return Z(t.ts,i(`typescript`))&&(o=o.append(Te(Q(t.ts)))),Z(t.react,i(`react`))&&(o=o.append(ye({...Q(t.react),...c}))),Z(t.next,i(`next`))&&(o=o.append(he({...Q(t.next),...c}))),Z(t.storybook,i(`storybook`))&&(o=o.append(Se({...Q(t.storybook),...c}))),Z(t.tailwind,i(`tailwindcss`))&&(o=o.append(Ce(Q(t.tailwind)))),Z(t.tanstack,i(`react-query`)||i(`@tanstack/react-query`)||i(`@tanstack/react-query-devtools`))&&(o=o.append(we(Q(t.tanstack)))),Z(t.drizzle,i(`drizzle-kit`)||i(`drizzle-orm`))&&(o=o.append(H(Q(t.drizzle)))),Z(t.graphql,i(`graphql`))&&(o=o.append(G(Q(t.graphql)))),Z(t.pnpm,!!await a)&&(o=o.append(_e())),o=o.append(...n),i(`prettier`)&&(o=o.append(ve())),o.renamePlugins(L).toConfigs()}export{$ as default,$ as twoDigits};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@2digits/eslint-config",
|
|
3
|
-
"version": "4.7.
|
|
3
|
+
"version": "4.7.2",
|
|
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": {
|
|
@@ -27,17 +27,17 @@
|
|
|
27
27
|
"public": true,
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@eslint-community/eslint-plugin-eslint-comments": "4.5.0",
|
|
30
|
-
"@eslint-react/eslint-plugin": "1.52.
|
|
30
|
+
"@eslint-react/eslint-plugin": "1.52.3",
|
|
31
31
|
"@eslint/compat": "1.3.1",
|
|
32
|
-
"@eslint/css": "0.
|
|
33
|
-
"@eslint/js": "9.
|
|
34
|
-
"@eslint/markdown": "
|
|
32
|
+
"@eslint/css": "0.10.0",
|
|
33
|
+
"@eslint/js": "9.31.0",
|
|
34
|
+
"@eslint/markdown": "7.0.0",
|
|
35
35
|
"@graphql-eslint/eslint-plugin": "4.4.0",
|
|
36
|
-
"@next/eslint-plugin-next": "15.
|
|
37
|
-
"@stylistic/eslint-plugin": "5.
|
|
36
|
+
"@next/eslint-plugin-next": "15.4.1",
|
|
37
|
+
"@stylistic/eslint-plugin": "5.2.0",
|
|
38
38
|
"@tanstack/eslint-plugin-query": "5.81.2",
|
|
39
|
-
"@typescript-eslint/parser": "8.
|
|
40
|
-
"@typescript-eslint/utils": "8.
|
|
39
|
+
"@typescript-eslint/parser": "8.37.0",
|
|
40
|
+
"@typescript-eslint/utils": "8.37.0",
|
|
41
41
|
"eslint-config-flat-gitignore": "2.1.0",
|
|
42
42
|
"eslint-config-prettier": "10.1.5",
|
|
43
43
|
"eslint-flat-config-utils": "2.1.0",
|
|
@@ -46,17 +46,17 @@
|
|
|
46
46
|
"eslint-plugin-de-morgan": "1.3.0",
|
|
47
47
|
"eslint-plugin-drizzle": "0.2.3",
|
|
48
48
|
"eslint-plugin-github-action": "0.0.16",
|
|
49
|
-
"eslint-plugin-jsdoc": "51.
|
|
49
|
+
"eslint-plugin-jsdoc": "51.4.1",
|
|
50
50
|
"eslint-plugin-jsonc": "2.20.1",
|
|
51
|
-
"eslint-plugin-n": "17.
|
|
51
|
+
"eslint-plugin-n": "17.21.0",
|
|
52
52
|
"eslint-plugin-pnpm": "1.0.0",
|
|
53
53
|
"eslint-plugin-react-compiler": "19.1.0-rc.2",
|
|
54
54
|
"eslint-plugin-react-hooks": "5.2.0",
|
|
55
55
|
"eslint-plugin-regexp": "2.9.0",
|
|
56
56
|
"eslint-plugin-sonarjs": "3.0.4",
|
|
57
|
-
"eslint-plugin-storybook": "9.0.
|
|
58
|
-
"eslint-plugin-tailwindcss": "3.18.
|
|
59
|
-
"eslint-plugin-turbo": "2.5.
|
|
57
|
+
"eslint-plugin-storybook": "9.0.17",
|
|
58
|
+
"eslint-plugin-tailwindcss": "3.18.2",
|
|
59
|
+
"eslint-plugin-turbo": "2.5.5",
|
|
60
60
|
"eslint-plugin-unicorn": "59.0.1",
|
|
61
61
|
"eslint-plugin-yml": "1.18.0",
|
|
62
62
|
"find-up": "7.0.0",
|
|
@@ -64,16 +64,17 @@
|
|
|
64
64
|
"graphql-config": "5.1.5",
|
|
65
65
|
"jsonc-eslint-parser": "2.4.0",
|
|
66
66
|
"local-pkg": "1.1.1",
|
|
67
|
-
"
|
|
67
|
+
"tailwind-csstree": "0.1.1",
|
|
68
|
+
"typescript-eslint": "8.37.0",
|
|
68
69
|
"yaml-eslint-parser": "1.3.0",
|
|
69
|
-
"@2digits/
|
|
70
|
-
"@2digits/
|
|
70
|
+
"@2digits/eslint-plugin": "3.1.11",
|
|
71
|
+
"@2digits/constants": "1.1.3"
|
|
71
72
|
},
|
|
72
73
|
"devDependencies": {
|
|
73
74
|
"@eslint/config-inspector": "1.1.0",
|
|
74
75
|
"@types/react": "19.1.8",
|
|
75
76
|
"dedent": "1.6.0",
|
|
76
|
-
"eslint": "9.
|
|
77
|
+
"eslint": "9.31.0",
|
|
77
78
|
"eslint-typegen": "2.2.1",
|
|
78
79
|
"execa": "9.6.0",
|
|
79
80
|
"react": "19.1.0",
|