@2digits/eslint-config 2.7.0 → 2.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.cts CHANGED
@@ -10,7 +10,7 @@ import { FlatGitignoreOptions } from 'eslint-config-flat-gitignore';
10
10
  interface RuleOptions {
11
11
  /**
12
12
  * Enforce giving proper names to type parameters when there are two or more
13
- * @see https://github.com/2digits-agency/configs/blob/@2digits/eslint-plugin@2.3.0/packages/eslint/src/rules/type-param-names.ts
13
+ * @see https://github.com/2digits-agency/configs/blob/@2digits/eslint-plugin@2.3.2/packages/eslint/src/rules/type-param-names.ts
14
14
  */
15
15
  '@2digits/type-param-names'?: Linter.RuleEntry<[]>
16
16
  /**
@@ -114,6 +114,51 @@ interface RuleOptions {
114
114
  * @deprecated
115
115
  */
116
116
  'comma-style'?: Linter.RuleEntry<CommaStyle>
117
+ /**
118
+ * require a `eslint-enable` comment for every `eslint-disable` comment
119
+ * @see https://eslint-community.github.io/eslint-plugin-eslint-comments/rules/disable-enable-pair.html
120
+ */
121
+ 'comments/disable-enable-pair'?: Linter.RuleEntry<CommentsDisableEnablePair>
122
+ /**
123
+ * disallow a `eslint-enable` comment for multiple `eslint-disable` comments
124
+ * @see https://eslint-community.github.io/eslint-plugin-eslint-comments/rules/no-aggregating-enable.html
125
+ */
126
+ 'comments/no-aggregating-enable'?: Linter.RuleEntry<[]>
127
+ /**
128
+ * disallow duplicate `eslint-disable` comments
129
+ * @see https://eslint-community.github.io/eslint-plugin-eslint-comments/rules/no-duplicate-disable.html
130
+ */
131
+ 'comments/no-duplicate-disable'?: Linter.RuleEntry<[]>
132
+ /**
133
+ * disallow `eslint-disable` comments about specific rules
134
+ * @see https://eslint-community.github.io/eslint-plugin-eslint-comments/rules/no-restricted-disable.html
135
+ */
136
+ 'comments/no-restricted-disable'?: Linter.RuleEntry<CommentsNoRestrictedDisable>
137
+ /**
138
+ * disallow `eslint-disable` comments without rule names
139
+ * @see https://eslint-community.github.io/eslint-plugin-eslint-comments/rules/no-unlimited-disable.html
140
+ */
141
+ 'comments/no-unlimited-disable'?: Linter.RuleEntry<[]>
142
+ /**
143
+ * disallow unused `eslint-disable` comments
144
+ * @see https://eslint-community.github.io/eslint-plugin-eslint-comments/rules/no-unused-disable.html
145
+ */
146
+ 'comments/no-unused-disable'?: Linter.RuleEntry<[]>
147
+ /**
148
+ * disallow unused `eslint-enable` comments
149
+ * @see https://eslint-community.github.io/eslint-plugin-eslint-comments/rules/no-unused-enable.html
150
+ */
151
+ 'comments/no-unused-enable'?: Linter.RuleEntry<[]>
152
+ /**
153
+ * disallow ESLint directive-comments
154
+ * @see https://eslint-community.github.io/eslint-plugin-eslint-comments/rules/no-use.html
155
+ */
156
+ 'comments/no-use'?: Linter.RuleEntry<CommentsNoUse>
157
+ /**
158
+ * require include descriptions in ESLint directive-comments
159
+ * @see https://eslint-community.github.io/eslint-plugin-eslint-comments/rules/require-description.html
160
+ */
161
+ 'comments/require-description'?: Linter.RuleEntry<CommentsRequireDescription>
117
162
  /**
118
163
  * Enforce a maximum cyclomatic complexity allowed in a program
119
164
  * @see https://eslint.org/docs/latest/rules/complexity
@@ -182,51 +227,6 @@ interface RuleOptions {
182
227
  * @see https://eslint.org/docs/latest/rules/eqeqeq
183
228
  */
184
229
  'eqeqeq'?: Linter.RuleEntry<Eqeqeq>
185
- /**
186
- * require a `eslint-enable` comment for every `eslint-disable` comment
187
- * @see https://mysticatea.github.io/eslint-plugin-eslint-comments/rules/disable-enable-pair.html
188
- */
189
- 'eslint-comments/disable-enable-pair'?: Linter.RuleEntry<EslintCommentsDisableEnablePair>
190
- /**
191
- * disallow a `eslint-enable` comment for multiple `eslint-disable` comments
192
- * @see https://mysticatea.github.io/eslint-plugin-eslint-comments/rules/no-aggregating-enable.html
193
- */
194
- 'eslint-comments/no-aggregating-enable'?: Linter.RuleEntry<[]>
195
- /**
196
- * disallow duplicate `eslint-disable` comments
197
- * @see https://mysticatea.github.io/eslint-plugin-eslint-comments/rules/no-duplicate-disable.html
198
- */
199
- 'eslint-comments/no-duplicate-disable'?: Linter.RuleEntry<[]>
200
- /**
201
- * disallow `eslint-disable` comments about specific rules
202
- * @see https://mysticatea.github.io/eslint-plugin-eslint-comments/rules/no-restricted-disable.html
203
- */
204
- 'eslint-comments/no-restricted-disable'?: Linter.RuleEntry<EslintCommentsNoRestrictedDisable>
205
- /**
206
- * disallow `eslint-disable` comments without rule names
207
- * @see https://mysticatea.github.io/eslint-plugin-eslint-comments/rules/no-unlimited-disable.html
208
- */
209
- 'eslint-comments/no-unlimited-disable'?: Linter.RuleEntry<[]>
210
- /**
211
- * disallow unused `eslint-disable` comments
212
- * @see https://mysticatea.github.io/eslint-plugin-eslint-comments/rules/no-unused-disable.html
213
- */
214
- 'eslint-comments/no-unused-disable'?: Linter.RuleEntry<[]>
215
- /**
216
- * disallow unused `eslint-enable` comments
217
- * @see https://mysticatea.github.io/eslint-plugin-eslint-comments/rules/no-unused-enable.html
218
- */
219
- 'eslint-comments/no-unused-enable'?: Linter.RuleEntry<[]>
220
- /**
221
- * disallow ESLint directive-comments
222
- * @see https://mysticatea.github.io/eslint-plugin-eslint-comments/rules/no-use.html
223
- */
224
- 'eslint-comments/no-use'?: Linter.RuleEntry<EslintCommentsNoUse>
225
- /**
226
- * require include descriptions in ESLint directive-comments
227
- * @see https://mysticatea.github.io/eslint-plugin-eslint-comments/rules/require-description.html
228
- */
229
- 'eslint-comments/require-description'?: Linter.RuleEntry<EslintCommentsRequireDescription>
230
230
  /**
231
231
  * Enforce "for" loop update clause moving the counter in the right direction
232
232
  * @see https://eslint.org/docs/latest/rules/for-direction
@@ -2846,6 +2846,11 @@ Backward pagination arguments
2846
2846
  * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/forbid-prop-types.md
2847
2847
  */
2848
2848
  'react/forbid-prop-types'?: Linter.RuleEntry<ReactForbidPropTypes>
2849
+ /**
2850
+ * Require all forwardRef components include a ref parameter
2851
+ * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/forward-ref-uses-ref.md
2852
+ */
2853
+ 'react/forward-ref-uses-ref'?: Linter.RuleEntry<[]>
2849
2854
  /**
2850
2855
  * Enforce a specific function type for function components
2851
2856
  * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/function-component-definition.md
@@ -3689,13 +3694,18 @@ Backward pagination arguments
3689
3694
  * @see https://tanstack.com/query/latest/docs/eslint/exhaustive-deps
3690
3695
  */
3691
3696
  'tanstack/exhaustive-deps'?: Linter.RuleEntry<[]>
3697
+ /**
3698
+ * Ensure correct order of inference sensitive properties for infinite queries
3699
+ * @see https://tanstack.com/query/latest/docs/eslint/infinite-query-property-order
3700
+ */
3701
+ 'tanstack/infinite-query-property-order'?: Linter.RuleEntry<[]>
3692
3702
  /**
3693
3703
  * Disallows rest destructuring in queries
3694
3704
  * @see https://tanstack.com/query/latest/docs/eslint/no-rest-destructuring
3695
3705
  */
3696
3706
  'tanstack/no-rest-destructuring'?: Linter.RuleEntry<[]>
3697
3707
  /**
3698
- * Disallow putting the result of useMutation directly in a React hook dependency array
3708
+ * Disallow putting the result of query hooks directly in a React hook dependency array
3699
3709
  * @see https://tanstack.com/query/latest/docs/eslint/no-unstable-deps
3700
3710
  */
3701
3711
  'tanstack/no-unstable-deps'?: Linter.RuleEntry<[]>
@@ -5198,6 +5208,20 @@ type CommaStyle = []|[("first" | "last")]|[("first" | "last"), {
5198
5208
  [k: string]: boolean | undefined
5199
5209
  }
5200
5210
  }]
5211
+ // ----- comments/disable-enable-pair -----
5212
+ type CommentsDisableEnablePair = []|[{
5213
+ allowWholeFile?: boolean
5214
+ }]
5215
+ // ----- comments/no-restricted-disable -----
5216
+ type CommentsNoRestrictedDisable = string[]
5217
+ // ----- comments/no-use -----
5218
+ type CommentsNoUse = []|[{
5219
+ allow?: ("eslint" | "eslint-disable" | "eslint-disable-line" | "eslint-disable-next-line" | "eslint-enable" | "eslint-env" | "exported" | "global" | "globals")[]
5220
+ }]
5221
+ // ----- comments/require-description -----
5222
+ type CommentsRequireDescription = []|[{
5223
+ ignore?: ("eslint" | "eslint-disable" | "eslint-disable-line" | "eslint-disable-next-line" | "eslint-enable" | "eslint-env" | "exported" | "global" | "globals")[]
5224
+ }]
5201
5225
  // ----- complexity -----
5202
5226
  type Complexity = []|[(number | {
5203
5227
  maximum?: number
@@ -5232,20 +5256,6 @@ type EolLast = []|[("always" | "never" | "unix" | "windows")]
5232
5256
  type Eqeqeq = ([]|["always"]|["always", {
5233
5257
  null?: ("always" | "never" | "ignore")
5234
5258
  }] | []|[("smart" | "allow-null")])
5235
- // ----- eslint-comments/disable-enable-pair -----
5236
- type EslintCommentsDisableEnablePair = []|[{
5237
- allowWholeFile?: boolean
5238
- }]
5239
- // ----- eslint-comments/no-restricted-disable -----
5240
- type EslintCommentsNoRestrictedDisable = string[]
5241
- // ----- eslint-comments/no-use -----
5242
- type EslintCommentsNoUse = []|[{
5243
- allow?: ("eslint" | "eslint-disable" | "eslint-disable-line" | "eslint-disable-next-line" | "eslint-enable" | "eslint-env" | "exported" | "global" | "globals")[]
5244
- }]
5245
- // ----- eslint-comments/require-description -----
5246
- type EslintCommentsRequireDescription = []|[{
5247
- ignore?: ("eslint" | "eslint-disable" | "eslint-disable-line" | "eslint-disable-next-line" | "eslint-enable" | "eslint-env" | "exported" | "global" | "globals")[]
5248
- }]
5249
5259
  // ----- func-call-spacing -----
5250
5260
  type FuncCallSpacing = ([]|["never"] | []|["always"]|["always", {
5251
5261
  allowNewlines?: boolean
@@ -7600,6 +7610,16 @@ type ReactJsxNoLeakedRender = []|[{
7600
7610
  }]
7601
7611
  // ----- react/jsx-no-literals -----
7602
7612
  type ReactJsxNoLiterals = []|[{
7613
+ elementOverrides?: {
7614
+ [k: string]: {
7615
+ applyToNestedElements?: boolean
7616
+ noStrings?: boolean
7617
+ allowedStrings?: string[]
7618
+ ignoreProps?: boolean
7619
+ noAttributeStrings?: boolean
7620
+ [k: string]: unknown | undefined
7621
+ }
7622
+ }
7603
7623
  noStrings?: boolean
7604
7624
  allowedStrings?: string[]
7605
7625
  ignoreProps?: boolean
@@ -7652,6 +7672,7 @@ type ReactJsxPascalCase = []|[{
7652
7672
  type ReactJsxPropsNoSpreading = []|[({
7653
7673
  html?: ("enforce" | "ignore")
7654
7674
  custom?: ("enforce" | "ignore")
7675
+ explicitSpread?: ("enforce" | "ignore")
7655
7676
  exceptions?: string[]
7656
7677
  [k: string]: unknown | undefined
7657
7678
  } & {
@@ -9027,6 +9048,19 @@ type TsRestrictTemplateExpressions = []|[{
9027
9048
  allowRegExp?: boolean
9028
9049
 
9029
9050
  allowNever?: boolean
9051
+
9052
+ allow?: (string | {
9053
+ from: "file"
9054
+ name: (string | [string, ...(string)[]])
9055
+ path?: string
9056
+ } | {
9057
+ from: "lib"
9058
+ name: (string | [string, ...(string)[]])
9059
+ } | {
9060
+ from: "package"
9061
+ name: (string | [string, ...(string)[]])
9062
+ package: string
9063
+ })[]
9030
9064
  }]
9031
9065
  // ----- ts/return-await -----
9032
9066
  type TsReturnAwait = []|[(("always" | "error-handling-correctness-only" | "in-try-catch" | "never") & string)]
package/dist/index.d.ts CHANGED
@@ -10,7 +10,7 @@ import { FlatGitignoreOptions } from 'eslint-config-flat-gitignore';
10
10
  interface RuleOptions {
11
11
  /**
12
12
  * Enforce giving proper names to type parameters when there are two or more
13
- * @see https://github.com/2digits-agency/configs/blob/@2digits/eslint-plugin@2.3.0/packages/eslint/src/rules/type-param-names.ts
13
+ * @see https://github.com/2digits-agency/configs/blob/@2digits/eslint-plugin@2.3.2/packages/eslint/src/rules/type-param-names.ts
14
14
  */
15
15
  '@2digits/type-param-names'?: Linter.RuleEntry<[]>
16
16
  /**
@@ -114,6 +114,51 @@ interface RuleOptions {
114
114
  * @deprecated
115
115
  */
116
116
  'comma-style'?: Linter.RuleEntry<CommaStyle>
117
+ /**
118
+ * require a `eslint-enable` comment for every `eslint-disable` comment
119
+ * @see https://eslint-community.github.io/eslint-plugin-eslint-comments/rules/disable-enable-pair.html
120
+ */
121
+ 'comments/disable-enable-pair'?: Linter.RuleEntry<CommentsDisableEnablePair>
122
+ /**
123
+ * disallow a `eslint-enable` comment for multiple `eslint-disable` comments
124
+ * @see https://eslint-community.github.io/eslint-plugin-eslint-comments/rules/no-aggregating-enable.html
125
+ */
126
+ 'comments/no-aggregating-enable'?: Linter.RuleEntry<[]>
127
+ /**
128
+ * disallow duplicate `eslint-disable` comments
129
+ * @see https://eslint-community.github.io/eslint-plugin-eslint-comments/rules/no-duplicate-disable.html
130
+ */
131
+ 'comments/no-duplicate-disable'?: Linter.RuleEntry<[]>
132
+ /**
133
+ * disallow `eslint-disable` comments about specific rules
134
+ * @see https://eslint-community.github.io/eslint-plugin-eslint-comments/rules/no-restricted-disable.html
135
+ */
136
+ 'comments/no-restricted-disable'?: Linter.RuleEntry<CommentsNoRestrictedDisable>
137
+ /**
138
+ * disallow `eslint-disable` comments without rule names
139
+ * @see https://eslint-community.github.io/eslint-plugin-eslint-comments/rules/no-unlimited-disable.html
140
+ */
141
+ 'comments/no-unlimited-disable'?: Linter.RuleEntry<[]>
142
+ /**
143
+ * disallow unused `eslint-disable` comments
144
+ * @see https://eslint-community.github.io/eslint-plugin-eslint-comments/rules/no-unused-disable.html
145
+ */
146
+ 'comments/no-unused-disable'?: Linter.RuleEntry<[]>
147
+ /**
148
+ * disallow unused `eslint-enable` comments
149
+ * @see https://eslint-community.github.io/eslint-plugin-eslint-comments/rules/no-unused-enable.html
150
+ */
151
+ 'comments/no-unused-enable'?: Linter.RuleEntry<[]>
152
+ /**
153
+ * disallow ESLint directive-comments
154
+ * @see https://eslint-community.github.io/eslint-plugin-eslint-comments/rules/no-use.html
155
+ */
156
+ 'comments/no-use'?: Linter.RuleEntry<CommentsNoUse>
157
+ /**
158
+ * require include descriptions in ESLint directive-comments
159
+ * @see https://eslint-community.github.io/eslint-plugin-eslint-comments/rules/require-description.html
160
+ */
161
+ 'comments/require-description'?: Linter.RuleEntry<CommentsRequireDescription>
117
162
  /**
118
163
  * Enforce a maximum cyclomatic complexity allowed in a program
119
164
  * @see https://eslint.org/docs/latest/rules/complexity
@@ -182,51 +227,6 @@ interface RuleOptions {
182
227
  * @see https://eslint.org/docs/latest/rules/eqeqeq
183
228
  */
184
229
  'eqeqeq'?: Linter.RuleEntry<Eqeqeq>
185
- /**
186
- * require a `eslint-enable` comment for every `eslint-disable` comment
187
- * @see https://mysticatea.github.io/eslint-plugin-eslint-comments/rules/disable-enable-pair.html
188
- */
189
- 'eslint-comments/disable-enable-pair'?: Linter.RuleEntry<EslintCommentsDisableEnablePair>
190
- /**
191
- * disallow a `eslint-enable` comment for multiple `eslint-disable` comments
192
- * @see https://mysticatea.github.io/eslint-plugin-eslint-comments/rules/no-aggregating-enable.html
193
- */
194
- 'eslint-comments/no-aggregating-enable'?: Linter.RuleEntry<[]>
195
- /**
196
- * disallow duplicate `eslint-disable` comments
197
- * @see https://mysticatea.github.io/eslint-plugin-eslint-comments/rules/no-duplicate-disable.html
198
- */
199
- 'eslint-comments/no-duplicate-disable'?: Linter.RuleEntry<[]>
200
- /**
201
- * disallow `eslint-disable` comments about specific rules
202
- * @see https://mysticatea.github.io/eslint-plugin-eslint-comments/rules/no-restricted-disable.html
203
- */
204
- 'eslint-comments/no-restricted-disable'?: Linter.RuleEntry<EslintCommentsNoRestrictedDisable>
205
- /**
206
- * disallow `eslint-disable` comments without rule names
207
- * @see https://mysticatea.github.io/eslint-plugin-eslint-comments/rules/no-unlimited-disable.html
208
- */
209
- 'eslint-comments/no-unlimited-disable'?: Linter.RuleEntry<[]>
210
- /**
211
- * disallow unused `eslint-disable` comments
212
- * @see https://mysticatea.github.io/eslint-plugin-eslint-comments/rules/no-unused-disable.html
213
- */
214
- 'eslint-comments/no-unused-disable'?: Linter.RuleEntry<[]>
215
- /**
216
- * disallow unused `eslint-enable` comments
217
- * @see https://mysticatea.github.io/eslint-plugin-eslint-comments/rules/no-unused-enable.html
218
- */
219
- 'eslint-comments/no-unused-enable'?: Linter.RuleEntry<[]>
220
- /**
221
- * disallow ESLint directive-comments
222
- * @see https://mysticatea.github.io/eslint-plugin-eslint-comments/rules/no-use.html
223
- */
224
- 'eslint-comments/no-use'?: Linter.RuleEntry<EslintCommentsNoUse>
225
- /**
226
- * require include descriptions in ESLint directive-comments
227
- * @see https://mysticatea.github.io/eslint-plugin-eslint-comments/rules/require-description.html
228
- */
229
- 'eslint-comments/require-description'?: Linter.RuleEntry<EslintCommentsRequireDescription>
230
230
  /**
231
231
  * Enforce "for" loop update clause moving the counter in the right direction
232
232
  * @see https://eslint.org/docs/latest/rules/for-direction
@@ -2846,6 +2846,11 @@ Backward pagination arguments
2846
2846
  * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/forbid-prop-types.md
2847
2847
  */
2848
2848
  'react/forbid-prop-types'?: Linter.RuleEntry<ReactForbidPropTypes>
2849
+ /**
2850
+ * Require all forwardRef components include a ref parameter
2851
+ * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/forward-ref-uses-ref.md
2852
+ */
2853
+ 'react/forward-ref-uses-ref'?: Linter.RuleEntry<[]>
2849
2854
  /**
2850
2855
  * Enforce a specific function type for function components
2851
2856
  * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/function-component-definition.md
@@ -3689,13 +3694,18 @@ Backward pagination arguments
3689
3694
  * @see https://tanstack.com/query/latest/docs/eslint/exhaustive-deps
3690
3695
  */
3691
3696
  'tanstack/exhaustive-deps'?: Linter.RuleEntry<[]>
3697
+ /**
3698
+ * Ensure correct order of inference sensitive properties for infinite queries
3699
+ * @see https://tanstack.com/query/latest/docs/eslint/infinite-query-property-order
3700
+ */
3701
+ 'tanstack/infinite-query-property-order'?: Linter.RuleEntry<[]>
3692
3702
  /**
3693
3703
  * Disallows rest destructuring in queries
3694
3704
  * @see https://tanstack.com/query/latest/docs/eslint/no-rest-destructuring
3695
3705
  */
3696
3706
  'tanstack/no-rest-destructuring'?: Linter.RuleEntry<[]>
3697
3707
  /**
3698
- * Disallow putting the result of useMutation directly in a React hook dependency array
3708
+ * Disallow putting the result of query hooks directly in a React hook dependency array
3699
3709
  * @see https://tanstack.com/query/latest/docs/eslint/no-unstable-deps
3700
3710
  */
3701
3711
  'tanstack/no-unstable-deps'?: Linter.RuleEntry<[]>
@@ -5198,6 +5208,20 @@ type CommaStyle = []|[("first" | "last")]|[("first" | "last"), {
5198
5208
  [k: string]: boolean | undefined
5199
5209
  }
5200
5210
  }]
5211
+ // ----- comments/disable-enable-pair -----
5212
+ type CommentsDisableEnablePair = []|[{
5213
+ allowWholeFile?: boolean
5214
+ }]
5215
+ // ----- comments/no-restricted-disable -----
5216
+ type CommentsNoRestrictedDisable = string[]
5217
+ // ----- comments/no-use -----
5218
+ type CommentsNoUse = []|[{
5219
+ allow?: ("eslint" | "eslint-disable" | "eslint-disable-line" | "eslint-disable-next-line" | "eslint-enable" | "eslint-env" | "exported" | "global" | "globals")[]
5220
+ }]
5221
+ // ----- comments/require-description -----
5222
+ type CommentsRequireDescription = []|[{
5223
+ ignore?: ("eslint" | "eslint-disable" | "eslint-disable-line" | "eslint-disable-next-line" | "eslint-enable" | "eslint-env" | "exported" | "global" | "globals")[]
5224
+ }]
5201
5225
  // ----- complexity -----
5202
5226
  type Complexity = []|[(number | {
5203
5227
  maximum?: number
@@ -5232,20 +5256,6 @@ type EolLast = []|[("always" | "never" | "unix" | "windows")]
5232
5256
  type Eqeqeq = ([]|["always"]|["always", {
5233
5257
  null?: ("always" | "never" | "ignore")
5234
5258
  }] | []|[("smart" | "allow-null")])
5235
- // ----- eslint-comments/disable-enable-pair -----
5236
- type EslintCommentsDisableEnablePair = []|[{
5237
- allowWholeFile?: boolean
5238
- }]
5239
- // ----- eslint-comments/no-restricted-disable -----
5240
- type EslintCommentsNoRestrictedDisable = string[]
5241
- // ----- eslint-comments/no-use -----
5242
- type EslintCommentsNoUse = []|[{
5243
- allow?: ("eslint" | "eslint-disable" | "eslint-disable-line" | "eslint-disable-next-line" | "eslint-enable" | "eslint-env" | "exported" | "global" | "globals")[]
5244
- }]
5245
- // ----- eslint-comments/require-description -----
5246
- type EslintCommentsRequireDescription = []|[{
5247
- ignore?: ("eslint" | "eslint-disable" | "eslint-disable-line" | "eslint-disable-next-line" | "eslint-enable" | "eslint-env" | "exported" | "global" | "globals")[]
5248
- }]
5249
5259
  // ----- func-call-spacing -----
5250
5260
  type FuncCallSpacing = ([]|["never"] | []|["always"]|["always", {
5251
5261
  allowNewlines?: boolean
@@ -7600,6 +7610,16 @@ type ReactJsxNoLeakedRender = []|[{
7600
7610
  }]
7601
7611
  // ----- react/jsx-no-literals -----
7602
7612
  type ReactJsxNoLiterals = []|[{
7613
+ elementOverrides?: {
7614
+ [k: string]: {
7615
+ applyToNestedElements?: boolean
7616
+ noStrings?: boolean
7617
+ allowedStrings?: string[]
7618
+ ignoreProps?: boolean
7619
+ noAttributeStrings?: boolean
7620
+ [k: string]: unknown | undefined
7621
+ }
7622
+ }
7603
7623
  noStrings?: boolean
7604
7624
  allowedStrings?: string[]
7605
7625
  ignoreProps?: boolean
@@ -7652,6 +7672,7 @@ type ReactJsxPascalCase = []|[{
7652
7672
  type ReactJsxPropsNoSpreading = []|[({
7653
7673
  html?: ("enforce" | "ignore")
7654
7674
  custom?: ("enforce" | "ignore")
7675
+ explicitSpread?: ("enforce" | "ignore")
7655
7676
  exceptions?: string[]
7656
7677
  [k: string]: unknown | undefined
7657
7678
  } & {
@@ -9027,6 +9048,19 @@ type TsRestrictTemplateExpressions = []|[{
9027
9048
  allowRegExp?: boolean
9028
9049
 
9029
9050
  allowNever?: boolean
9051
+
9052
+ allow?: (string | {
9053
+ from: "file"
9054
+ name: (string | [string, ...(string)[]])
9055
+ path?: string
9056
+ } | {
9057
+ from: "lib"
9058
+ name: (string | [string, ...(string)[]])
9059
+ } | {
9060
+ from: "package"
9061
+ name: (string | [string, ...(string)[]])
9062
+ package: string
9063
+ })[]
9030
9064
  }]
9031
9065
  // ----- ts/return-await -----
9032
9066
  type TsReturnAwait = []|[(("always" | "error-handling-correctness-only" | "in-try-catch" | "never") & string)]
package/dist/index.js CHANGED
@@ -1,16 +1,17 @@
1
- import x from 'eslint-plugin-unicorn';
2
- import w from 'eslint-plugin-eslint-comments';
3
- import v from 'eslint-plugin-n';
4
- import k from 'eslint-plugin-sonarjs';
5
- import { fixupPluginRules } from '@eslint/compat';
1
+ import z from '@eslint-community/eslint-plugin-eslint-comments';
2
+ import V from '@eslint-community/eslint-plugin-eslint-comments/configs';
6
3
  import { renamePluginsInRules, composer, renamePluginsInConfigs, FlatConfigComposer } from 'eslint-flat-config-utils';
7
- import K from '@eslint/js';
8
- import T from 'globals';
4
+ import { fixupPluginRules } from '@eslint/compat';
5
+ import Y from '@eslint/js';
6
+ import x from 'globals';
7
+ import k from 'eslint-plugin-unicorn';
8
+ import q from 'eslint-plugin-n';
9
+ import T from 'eslint-plugin-sonarjs';
9
10
  import { findUp } from 'find-up';
10
11
  import { isPackageExists } from 'local-pkg';
11
12
 
12
- function C(){return [{name:"2digits:comments",plugins:{"eslint-comments":w},rules:{"eslint-comments/no-aggregating-enable":"error","eslint-comments/no-duplicate-disable":"error","eslint-comments/no-unlimited-disable":"error","eslint-comments/no-unused-enable":"error","eslint-comments/no-unused-disable":"error"}}]}var p={"@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",react:"react","@typescript-eslint":"ts",node:"node","eslint-comments":"eslint-comments",storybook:"storybook",turbo:"turbo",jsdoc:"jsdoc",unicorn:"unicorn",tailwindcss:"tailwindcss","@tanstack/query":"tanstack","@2digits":"@2digits","@graphql-eslint":"gql",sonarjs:"sonar"};async function o(e){let t=await e;return t.default||t}async function S(e={}){let{overrides:t={},files:r=["**/*.graphql","**/*.gql"]}=e,a=await o(import('@graphql-eslint/eslint-plugin')),i=renamePluginsInRules(a.flatConfigs["operations-recommended"].rules,p);return [{name:"2digits:graphql",plugins:{gql:fixupPluginRules(a)},languageOptions:{parser:{...a,meta:{name:"graphql"}}},files:r,rules:{...i,...t}}]}var j="**/*.?([cm])[jt]s?(x)",b="**/*.?([cm])ts",O="**/*.?([cm])tsx",F="**/*.stories.tsx",I=["**/node_modules","**/dist","**/package-lock.json","**/yarn.lock","**/pnpm-lock.yaml","**/bun.lockb","**/output","**/coverage","**/temp","**/.temp","**/tmp","**/.tmp","**/.history","**/.vitepress/cache","**/.nuxt","**/.next","**/.vercel","**/.changeset","**/.idea","**/.cache","**/.output","**/.vite-inspect","**/.yarn","**/CHANGELOG*.md","**/*.min.*","**/LICENSE*","**/__snapshots__","**/auto-import?(s).d.ts","**/components.d.ts"];async function P(e={}){let{gitIgnore:t,ignores:r=[]}=e;return composer({ignores:[I,r].flat(),name:"2digits:ignores"},o(import('eslint-config-flat-gitignore')).then(a=>a({strict:!1,...t,name:"2digits:gitignore"})))}function _(e={}){let{overrides:t={}}=e;return [{name:"2digits:javascript",languageOptions:{ecmaVersion:2022,globals:{...T.browser,...T.es2021,...T.node,document:"readonly",navigator:"readonly",window:"readonly"},parserOptions:{ecmaFeatures:{jsx:!0},ecmaVersion:2022,sourceType:"module"},sourceType:"module"},linterOptions:{reportUnusedDisableDirectives:!0},rules:{...K.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"],...t}}]}async function q(){return [{name:"2digits:jsdoc",plugins:{jsdoc:await o(import('eslint-plugin-jsdoc'))},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"}}]}async function W(e={}){let{files:t=[b,O],overrides:r={},parserOptions:a}=e,[i,c]=await Promise.all([o(import('@next/eslint-plugin-next')),o(import('@typescript-eslint/parser'))]),m=renamePluginsInRules({...i.configs.recommended.rules,...i.configs["core-web-vitals"].rules},p);return [{name:"2digits:next/setup",plugins:{next:fixupPluginRules(i)}},{name:"2digits:next/rules",files:t,languageOptions:{parser:c,parserOptions:{ecmaFeatures:{jsx:!0},projectService:!0,...a},sourceType:"module"},rules:{...m,"next/no-html-link-for-pages":"off",...r}}]}function D(){return [{name:"2digits:node",settings:{node:{version:">= 20.0.0"}},plugins:{node:v},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 R(){let[e,t]=await Promise.all([o(import('eslint-config-prettier')),o(import('eslint-plugin-react'))]);return [{name:"2digits:prettier",plugins:{react:t},rules:{...e.rules,"tailwindcss/classnames-order":"off","react/jsx-newline":["error",{prevent:!1}]}}]}async function L(e={}){let{files:t=[b,O],overrides:r={},parserOptions:a,tsconfigRootDir:i,reactCompiler:c=!0}=e,[m,f,g,h,X]=await Promise.all([o(import('@eslint-react/eslint-plugin')),o(import('eslint-plugin-react-hooks')),o(import('eslint-plugin-react')),o(import('@typescript-eslint/parser')),c?o(import('eslint-plugin-react-compiler')):void 0]),y=m.configs.all.plugins,z=renamePluginsInRules({...g.configs.recommended.rules,...g.configs["jsx-runtime"].rules,...f.configs.recommended.rules,...m.configs["recommended-type-checked"].rules},p);return [{name:"2digits:react/setup",plugins:{react:g,"react-dom":y["@eslint-react/dom"],"react-web-api":y["@eslint-react/web-api"],"react-extra":y["@eslint-react"],"react-hooks":fixupPluginRules(f),"react-hooks-extra":y["@eslint-react/hooks-extra"],"react-naming-convention":y["@eslint-react/naming-convention"],...c?{"react-compiler":X}:{}},settings:{react:{version:"detect"}}},{name:"2digits:react/rules",files:t,languageOptions:{parser:h,parserOptions:{ecmaFeatures:{jsx:!0},tsconfigRootDir:i,projectService:!0,...a},sourceType:"module"},rules:{...z,...c?{"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/jsx-curly-newline":"off","react/jsx-newline":["error",{prevent:!1}],"react/prop-types":"off",...r}}]}var re=renamePluginsInRules(k.configs.recommended.rules,p);function E(){return [{name:"2digits:sonar",plugins:{sonar:k},rules:{...re,"sonar/no-redundant-jump":"off"}}]}async function G(e={}){let{files:t=[F],overrides:r={},parserOptions:a,storybookDirectory:i=".storybook"}=e,[c,m]=await Promise.all([o(import('eslint-plugin-storybook')),o(import('@typescript-eslint/parser'))]),f={parser:m,parserOptions:{ecmaFeatures:{jsx:!0},projectService:!0,...a},sourceType:"module"};return [{name:"2digits:storybook/setup",plugins:{storybook:fixupPluginRules(c)}},{name:"2digits:storybook/rules",files:t,languageOptions:f,rules:{"storybook/await-interactions":"error","storybook/context-in-play-function":"error","storybook/csf-component":"error","storybook/default-exports":"error","storybook/hierarchy-separator":"error","storybook/no-redundant-story-name":"error","storybook/no-stories-of":"error","storybook/no-title-property-in-meta":"error","storybook/prefer-pascal-case":"error","storybook/story-exports":"error","storybook/use-storybook-expect":"error","storybook/use-storybook-testing-library":"error",...r}},{name:"2digits:storybook/disables",files:t,rules:{"react-hooks/rules-of-hooks":"off","react/display-name":"off"}},{name:"2digits:storybook/config",files:[`${i}/main.@(js|cjs|mjs|ts)`],languageOptions:f,rules:{"storybook/no-uninstalled-addons":"error"}}]}async function U(e={}){let{overrides:t={}}=e,[r,{tailwindFunctions:a},i]=await Promise.all([o(import('eslint-plugin-tailwindcss')),o(import('@2digits/constants')),findUp(["tailwind.config.ts","tailwind.config.js"])]);return [{name:"2digits:tailwind",plugins:{tailwindcss:r},settings:{tailwindcss:{callees:a,config:i}},rules:{...r.configs.recommended.rules,...t}}]}async function N(e={}){let{overrides:t={}}=e,r=await o(import('@tanstack/eslint-plugin-query'));return [{name:"2digits:tanstack",plugins:{tanstack:fixupPluginRules(r)},rules:{"tanstack/exhaustive-deps":"error","tanstack/stable-query-client":"error","tanstack/no-rest-destructuring":"error",...t}}]}async function B(e={}){let{overrides:t={}}=e;return [{name:"2digits:turbo",plugins:{turbo:await o(import('eslint-plugin-turbo'))},rules:{"turbo/no-undeclared-env-vars":"error",...t}}]}async function A(e={}){let{overrides:t={},parserOptions:r={}}=e,[{plugin:a,configs:i,parser:c},m]=await Promise.all([o(import('typescript-eslint')),o(import('@2digits/eslint-plugin'))]),f=renamePluginsInConfigs(i.strictTypeChecked,p),g=Object.fromEntries(f.flatMap(({rules:h})=>Object.entries(h??{})));return [{name:"2digits:typescript/setup",plugins:{ts:a,"@2digits":m},languageOptions:{parser:c,parserOptions:{tsconfigRootDir:process.cwd(),projectService:!0,warnOnUnsupportedTypeScriptVersion:!1,...r},sourceType:"module"}},{name:"2digits:typescript/rules",files:[j],rules:{...g,"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-interface":["error",{allowSingleExtends:!0}],"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",...m.configs.recommended.rules,...t}},{files:["**/*.d.ts"],name:"2digits:typescript/disables/dts",rules:{"unicorn/no-abusive-eslint-disable":"off","no-duplicate-imports":"off","no-restricted-syntax":"off","ts/no-unused-vars":"off"}},{files:["**/*.{test,spec}.ts?(x)"],name:"2digits:typescript/disables/test",rules:{"no-unused-expressions":"off"}},{files:["**/*.js","**/*.cjs","**/*.cts"],name:"2digits:typescript/disables/cjs",rules:{"ts/no-require-imports":"off","ts/no-var-requires":"off"}}]}function M(){return [{name:"2digits:unicorn",plugins:{unicorn:x},rules:{...x.configs["flat/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 d(e,t){return typeof e=="boolean"?e:e?.enable??t??!1}function u(e){if(typeof e=="boolean"||e===void 0)return {};let{enable:t,...r}=e;return r}function ae(e={},...t){let r=new FlatConfigComposer(P(e.ignores),_(e.js),D(),C(),q(),M(),E());d(e.turbo,isPackageExists("turbo"))&&(r=r.append(B(u(e.turbo))));let{overrides:a,...i}=u(e.ts);return d(e.ts,isPackageExists("typescript"))&&(r=r.append(A(u(e.ts)))),d(e.react,isPackageExists("react"))&&(r=r.append(L({...u(e.react),...i}))),d(e.next,isPackageExists("next"))&&(r=r.append(W({...u(e.next),...i}))),d(e.storybook,isPackageExists("storybook"))&&(r=r.append(G({...u(e.storybook),...i}))),d(e.tailwind,isPackageExists("tailwindcss"))&&(r=r.append(U(u(e.tailwind)))),d(e.tanstack,isPackageExists("react-query")||isPackageExists("@tanstack/react-query")||isPackageExists("@tanstack/react-query-devtools"))&&(r=r.append(N(u(e.tanstack)))),d(e.graphql,isPackageExists("graphql"))&&(r=r.append(S(u(e.graphql)))),r=r.append(...t),isPackageExists("prettier")&&(r=r.append(R())),r.renamePlugins(p).toConfigs()}
13
+ var p={"@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",react:"react","@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"};var $=renamePluginsInRules(V.recommended.rules,p);function w(){return [{name:"2digits:comments",plugins:{comments:z},rules:{...$,"comments/no-unused-disable":"error","comments/disable-enable-pair":["error",{allowWholeFile:!0}]}}]}async function o(e){let t=await e;return t.default||t}async function v(e={}){let{overrides:t={},files:r=["**/*.graphql","**/*.gql"]}=e,a=await o(import('@graphql-eslint/eslint-plugin')),i=renamePluginsInRules(a.flatConfigs["operations-recommended"].rules,p);return [{name:"2digits:graphql",plugins:{gql:fixupPluginRules(a)},languageOptions:{parser:{...a,meta:{name:"graphql"}}},files:r,rules:{...i,"gql/naming-convention":["error",{allowLeadingUnderscore:!0}],...t}}]}var C="**/*.?([cm])[jt]s?(x)",b="**/*.?([cm])ts",h="**/*.?([cm])tsx",S="**/*.stories.tsx",j=["**/node_modules","**/dist","**/package-lock.json","**/yarn.lock","**/pnpm-lock.yaml","**/bun.lockb","**/output","**/coverage","**/temp","**/.temp","**/tmp","**/.tmp","**/.history","**/.vitepress/cache","**/.nuxt","**/.next","**/.vercel","**/.changeset","**/.idea","**/.cache","**/.output","**/.vite-inspect","**/.yarn","**/CHANGELOG*.md","**/*.min.*","**/LICENSE*","**/__snapshots__","**/auto-import?(s).d.ts","**/components.d.ts"];async function F(e={}){let{gitIgnore:t,ignores:r=[]}=e;return composer({ignores:[j,r].flat(),name:"2digits:ignores"},o(import('eslint-config-flat-gitignore')).then(a=>a({strict:!1,...t,name:"2digits:gitignore"})))}function I(e={}){let{overrides:t={}}=e;return [{name:"2digits:javascript",languageOptions:{ecmaVersion:2022,globals:{...x.browser,...x.es2021,...x.node,document:"readonly",navigator:"readonly",window:"readonly"},parserOptions:{ecmaFeatures:{jsx:!0},ecmaVersion:2022,sourceType:"module"},sourceType:"module"},linterOptions:{reportUnusedDisableDirectives:!0},rules:{...Y.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"],...t}}]}async function P(){return [{name:"2digits:jsdoc",plugins:{jsdoc:await o(import('eslint-plugin-jsdoc'))},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"}}]}async function _(e={}){let{files:t=[b,h],overrides:r={},parserOptions:a}=e,[i,c]=await Promise.all([o(import('@next/eslint-plugin-next')),o(import('@typescript-eslint/parser'))]),m=renamePluginsInRules({...i.configs.recommended.rules,...i.configs["core-web-vitals"].rules},p);return [{name:"2digits:next/setup",plugins:{next:fixupPluginRules(i)}},{name:"2digits:next/rules",files:t,languageOptions:{parser:c,parserOptions:{ecmaFeatures:{jsx:!0},projectService:!0,...a},sourceType:"module"},rules:{...m,"next/no-html-link-for-pages":"off",...r}}]}function W(){return [{name:"2digits:node",settings:{node:{version:">= 20.0.0"}},plugins:{node:q},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 D(){let[e,t]=await Promise.all([o(import('eslint-config-prettier')),o(import('eslint-plugin-react'))]);return [{name:"2digits:prettier",plugins:{react:t},rules:{...e.rules,"tailwindcss/classnames-order":"off","react/jsx-newline":["error",{prevent:!1}]}}]}async function R(e={}){let{files:t=[b,h],overrides:r={},parserOptions:a,tsconfigRootDir:i,reactCompiler:c=!0}=e,[m,f,g,O,A]=await Promise.all([o(import('@eslint-react/eslint-plugin')),o(import('eslint-plugin-react-hooks')),o(import('eslint-plugin-react')),o(import('@typescript-eslint/parser')),c?o(import('eslint-plugin-react-compiler')):void 0]),y=m.configs.all.plugins,X=renamePluginsInRules({...g.configs.recommended.rules,...g.configs["jsx-runtime"].rules,...f.configs.recommended.rules,...m.configs["recommended-type-checked"].rules},p);return [{name:"2digits:react/setup",plugins:{react:g,"react-dom":y["@eslint-react/dom"],"react-web-api":y["@eslint-react/web-api"],"react-extra":y["@eslint-react"],"react-hooks":fixupPluginRules(f),"react-hooks-extra":y["@eslint-react/hooks-extra"],"react-naming-convention":y["@eslint-react/naming-convention"],...c?{"react-compiler":A}:{}},settings:{react:{version:"detect"}}},{name:"2digits:react/rules",files:t,languageOptions:{parser:O,parserOptions:{ecmaFeatures:{jsx:!0},tsconfigRootDir:i,projectService:!0,...a},sourceType:"module"},rules:{...X,...c?{"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/jsx-curly-newline":"off","react/jsx-newline":["error",{prevent:!1}],"react/prop-types":"off",...r}}]}var ne=renamePluginsInRules(T.configs.recommended.rules,p);function L(){return [{name:"2digits:sonar",plugins:{sonar:T},rules:{...ne,"sonar/no-redundant-jump":"off"}}]}async function E(e={}){let{files:t=[S],overrides:r={},parserOptions:a,storybookDirectory:i=".storybook"}=e,[c,m]=await Promise.all([o(import('eslint-plugin-storybook')),o(import('@typescript-eslint/parser'))]),f={parser:m,parserOptions:{ecmaFeatures:{jsx:!0},projectService:!0,...a},sourceType:"module"};return [{name:"2digits:storybook/setup",plugins:{storybook:fixupPluginRules(c)}},{name:"2digits:storybook/rules",files:t,languageOptions:f,rules:{"storybook/await-interactions":"error","storybook/context-in-play-function":"error","storybook/csf-component":"error","storybook/default-exports":"error","storybook/hierarchy-separator":"error","storybook/no-redundant-story-name":"error","storybook/no-stories-of":"error","storybook/no-title-property-in-meta":"error","storybook/prefer-pascal-case":"error","storybook/story-exports":"error","storybook/use-storybook-expect":"error","storybook/use-storybook-testing-library":"error",...r}},{name:"2digits:storybook/disables",files:t,rules:{"react-hooks/rules-of-hooks":"off","react/display-name":"off"}},{name:"2digits:storybook/config",files:[`${i}/main.@(js|cjs|mjs|ts)`],languageOptions:f,rules:{"storybook/no-uninstalled-addons":"error"}}]}async function G(e={}){let{overrides:t={}}=e,[r,{tailwindFunctions:a},i]=await Promise.all([o(import('eslint-plugin-tailwindcss')),o(import('@2digits/constants')),findUp(["tailwind.config.ts","tailwind.config.js"])]);return [{name:"2digits:tailwind",plugins:{tailwindcss:r},settings:{tailwindcss:{callees:a,config:i}},rules:{...r.configs.recommended.rules,...t}}]}async function U(e={}){let{overrides:t={}}=e,r=await o(import('@tanstack/eslint-plugin-query'));return [{name:"2digits:tanstack",plugins:{tanstack:fixupPluginRules(r)},rules:{"tanstack/exhaustive-deps":"error","tanstack/stable-query-client":"error","tanstack/no-rest-destructuring":"error",...t}}]}async function N(e={}){let{overrides:t={}}=e;return [{name:"2digits:turbo",plugins:{turbo:await o(import('eslint-plugin-turbo'))},rules:{"turbo/no-undeclared-env-vars":"error",...t}}]}async function B(e={}){let{overrides:t={},parserOptions:r={}}=e,[{plugin:a,configs:i,parser:c},m]=await Promise.all([o(import('typescript-eslint')),o(import('@2digits/eslint-plugin'))]),f=renamePluginsInConfigs(i.strictTypeChecked,p),g=Object.fromEntries(f.flatMap(({rules:O})=>Object.entries(O??{})));return [{name:"2digits:typescript/setup",plugins:{ts:a,"@2digits":m},languageOptions:{parser:c,parserOptions:{tsconfigRootDir:process.cwd(),projectService:!0,warnOnUnsupportedTypeScriptVersion:!1,...r},sourceType:"module"}},{name:"2digits:typescript/rules",files:[C],rules:{...g,"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-interface":["error",{allowSingleExtends:!0}],"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",...m.configs.recommended.rules,...t}},{files:["**/*.d.ts"],name:"2digits:typescript/disables/dts",rules:{"unicorn/no-abusive-eslint-disable":"off","no-duplicate-imports":"off","no-restricted-syntax":"off","ts/no-unused-vars":"off"}},{files:["**/*.{test,spec}.ts?(x)"],name:"2digits:typescript/disables/test",rules:{"no-unused-expressions":"off"}},{files:["**/*.js","**/*.cjs","**/*.cts"],name:"2digits:typescript/disables/cjs",rules:{"ts/no-require-imports":"off","ts/no-var-requires":"off"}}]}function M(){return [{name:"2digits:unicorn",plugins:{unicorn:k},rules:{...k.configs["flat/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 d(e,t){return typeof e=="boolean"?e:e?.enable??t??!1}function u(e){if(typeof e=="boolean"||e===void 0)return {};let{enable:t,...r}=e;return r}function ce(e={},...t){let r=new FlatConfigComposer(F(e.ignores),I(e.js),W(),w(),P(),M(),L());d(e.turbo,isPackageExists("turbo"))&&(r=r.append(N(u(e.turbo))));let{overrides:a,...i}=u(e.ts);return d(e.ts,isPackageExists("typescript"))&&(r=r.append(B(u(e.ts)))),d(e.react,isPackageExists("react"))&&(r=r.append(R({...u(e.react),...i}))),d(e.next,isPackageExists("next"))&&(r=r.append(_({...u(e.next),...i}))),d(e.storybook,isPackageExists("storybook"))&&(r=r.append(E({...u(e.storybook),...i}))),d(e.tailwind,isPackageExists("tailwindcss"))&&(r=r.append(G(u(e.tailwind)))),d(e.tanstack,isPackageExists("react-query")||isPackageExists("@tanstack/react-query")||isPackageExists("@tanstack/react-query-devtools"))&&(r=r.append(U(u(e.tanstack)))),d(e.graphql,isPackageExists("graphql"))&&(r=r.append(v(u(e.graphql)))),r=r.append(...t),isPackageExists("prettier")&&(r=r.append(D())),r.renamePlugins(p).toConfigs()}
13
14
 
14
- export { C as comments, ae as default, S as graphql, P as ignores, _ as javascript, q as jsdoc, W as next, D as node, R as prettier, L as react, E as sonar, G as storybook, U as tailwind, N as tanstack, B as turbo, ae as twoDigits, A as typescript, M as unicorn };
15
+ export { w as comments, ce as default, v as graphql, F as ignores, I as javascript, P as jsdoc, _ as next, W as node, D as prettier, R as react, L as sonar, E as storybook, G as tailwind, U as tanstack, N as turbo, ce as twoDigits, B as typescript, M as unicorn };
15
16
  //# sourceMappingURL=index.js.map
16
17
  //# sourceMappingURL=index.js.map