@2digits/eslint-config 4.8.6 → 4.8.8

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 CHANGED
@@ -940,7 +940,7 @@ interface RuleOptions {
940
940
  */
941
941
  'jsdoc/check-alignment'?: Linter.RuleEntry<JsdocCheckAlignment>;
942
942
  /**
943
- * Ensures that (JavaScript) examples within JSDoc adhere to ESLint rules.
943
+ * @deprecated - Use `getJsdocProcessorPlugin` processor; ensures that (JavaScript) samples within `@example` tags adhere to ESLint rules.
944
944
  * @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/check-examples.md#repos-sticky-header
945
945
  */
946
946
  'jsdoc/check-examples'?: Linter.RuleEntry<JsdocCheckExamples>;
@@ -955,7 +955,7 @@ interface RuleOptions {
955
955
  */
956
956
  'jsdoc/check-line-alignment'?: Linter.RuleEntry<JsdocCheckLineAlignment>;
957
957
  /**
958
- * Ensures that parameter names in JSDoc match those in the function declaration.
958
+ * Checks for dupe `@param` names, that nested param names have roots, and that parameter names in function declarations match JSDoc param names.
959
959
  * @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/check-param-names.md#repos-sticky-header
960
960
  */
961
961
  'jsdoc/check-param-names'?: Linter.RuleEntry<JsdocCheckParamNames>;
@@ -980,7 +980,7 @@ interface RuleOptions {
980
980
  */
981
981
  'jsdoc/check-template-names'?: Linter.RuleEntry<[]>;
982
982
  /**
983
- * Reports invalid types.
983
+ * Reports types deemed invalid (customizable and with defaults, for preventing and/or recommending replacements).
984
984
  * @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/check-types.md#repos-sticky-header
985
985
  */
986
986
  'jsdoc/check-types'?: Linter.RuleEntry<JsdocCheckTypes>;
@@ -995,12 +995,12 @@ interface RuleOptions {
995
995
  */
996
996
  'jsdoc/convert-to-jsdoc-comments'?: Linter.RuleEntry<JsdocConvertToJsdocComments>;
997
997
  /**
998
- * Expects specific tags to be empty of any content.
998
+ * Checks tags that are expected to be empty (e.g., `@abstract` or `@async`), reporting if they have content
999
999
  * @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/empty-tags.md#repos-sticky-header
1000
1000
  */
1001
1001
  'jsdoc/empty-tags'?: Linter.RuleEntry<JsdocEmptyTags>;
1002
1002
  /**
1003
- * Reports an issue with any non-constructor function using `@implements`.
1003
+ * Prohibits use of `@implements` on non-constructor functions (to enforce the tag only being used on classes/constructors).
1004
1004
  * @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/implements-on-classes.md#repos-sticky-header
1005
1005
  */
1006
1006
  'jsdoc/implements-on-classes'?: Linter.RuleEntry<JsdocImplementsOnClasses>;
@@ -1030,17 +1030,17 @@ interface RuleOptions {
1030
1030
  */
1031
1031
  'jsdoc/match-name'?: Linter.RuleEntry<JsdocMatchName>;
1032
1032
  /**
1033
- * Controls how and whether jsdoc blocks can be expressed as single or multiple line blocks.
1033
+ * Controls how and whether JSDoc blocks can be expressed as single or multiple line blocks.
1034
1034
  * @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/multiline-blocks.md#repos-sticky-header
1035
1035
  */
1036
1036
  'jsdoc/multiline-blocks'?: Linter.RuleEntry<JsdocMultilineBlocks>;
1037
1037
  /**
1038
- * This rule checks for multi-line-style comments which fail to meet the criteria of a jsdoc block.
1038
+ * This rule checks for multi-line-style comments which fail to meet the criteria of a JSDoc block.
1039
1039
  * @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/no-bad-blocks.md#repos-sticky-header
1040
1040
  */
1041
1041
  'jsdoc/no-bad-blocks'?: Linter.RuleEntry<JsdocNoBadBlocks>;
1042
1042
  /**
1043
- * Detects and removes extra lines of a blank block description
1043
+ * If tags are present, this rule will prevent empty lines in the block description. If no tags are present, this rule will prevent extra empty lines in the block description.
1044
1044
  * @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/no-blank-block-descriptions.md#repos-sticky-header
1045
1045
  */
1046
1046
  'jsdoc/no-blank-block-descriptions'?: Linter.RuleEntry<[]>;
@@ -1070,15 +1070,20 @@ interface RuleOptions {
1070
1070
  */
1071
1071
  'jsdoc/no-restricted-syntax'?: Linter.RuleEntry<JsdocNoRestrictedSyntax>;
1072
1072
  /**
1073
- * This rule reports types being used on `@param` or `@returns`.
1073
+ * This rule reports types being used on `@param` or `@returns` (redundant with TypeScript).
1074
1074
  * @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/no-types.md#repos-sticky-header
1075
1075
  */
1076
1076
  'jsdoc/no-types'?: Linter.RuleEntry<JsdocNoTypes>;
1077
1077
  /**
1078
- * Checks that types in jsdoc comments are defined.
1078
+ * Besides some expected built-in types, prohibits any types not specified as globals or within `@typedef`.
1079
1079
  * @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/no-undefined-types.md#repos-sticky-header
1080
1080
  */
1081
1081
  'jsdoc/no-undefined-types'?: Linter.RuleEntry<JsdocNoUndefinedTypes>;
1082
+ /**
1083
+ * Prefer `@import` tags to inline `import()` statements.
1084
+ * @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/prefer-import-tag.md#repos-sticky-header
1085
+ */
1086
+ 'jsdoc/prefer-import-tag'?: Linter.RuleEntry<JsdocPreferImportTag>;
1082
1087
  /**
1083
1088
  * Reports use of `any` or `*` type
1084
1089
  * @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/reject-any-type.md#repos-sticky-header
@@ -1095,7 +1100,7 @@ interface RuleOptions {
1095
1100
  */
1096
1101
  'jsdoc/require-asterisk-prefix'?: Linter.RuleEntry<JsdocRequireAsteriskPrefix>;
1097
1102
  /**
1098
- * Requires that all functions have a description.
1103
+ * Requires that all functions (and potentially other contexts) have a description.
1099
1104
  * @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-description.md#repos-sticky-header
1100
1105
  */
1101
1106
  'jsdoc/require-description'?: Linter.RuleEntry<JsdocRequireDescription>;
@@ -1105,7 +1110,7 @@ interface RuleOptions {
1105
1110
  */
1106
1111
  'jsdoc/require-description-complete-sentence'?: Linter.RuleEntry<JsdocRequireDescriptionCompleteSentence>;
1107
1112
  /**
1108
- * Requires that all functions have examples.
1113
+ * Requires that all functions (and potentially other contexts) have examples.
1109
1114
  * @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-example.md#repos-sticky-header
1110
1115
  */
1111
1116
  'jsdoc/require-example'?: Linter.RuleEntry<JsdocRequireExample>;
@@ -1115,22 +1120,27 @@ interface RuleOptions {
1115
1120
  */
1116
1121
  'jsdoc/require-file-overview'?: Linter.RuleEntry<JsdocRequireFileOverview>;
1117
1122
  /**
1118
- * Requires a hyphen before the `@param` description.
1123
+ * Requires a hyphen before the `@param` description (and optionally before `@property` descriptions).
1119
1124
  * @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-hyphen-before-param-description.md#repos-sticky-header
1120
1125
  */
1121
1126
  'jsdoc/require-hyphen-before-param-description'?: Linter.RuleEntry<JsdocRequireHyphenBeforeParamDescription>;
1122
1127
  /**
1123
- * Require JSDoc comments
1128
+ * Checks for presence of JSDoc comments, on functions and potentially other contexts (optionally limited to exports).
1124
1129
  * @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-jsdoc.md#repos-sticky-header
1125
1130
  */
1126
1131
  'jsdoc/require-jsdoc'?: Linter.RuleEntry<JsdocRequireJsdoc>;
1132
+ /**
1133
+ * Requires a description for `@next` tags
1134
+ * @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-next-description.md#repos-sticky-header
1135
+ */
1136
+ 'jsdoc/require-next-description'?: Linter.RuleEntry<[]>;
1127
1137
  /**
1128
1138
  * Requires a type for `@next` tags
1129
1139
  * @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-next-type.md#repos-sticky-header
1130
1140
  */
1131
1141
  'jsdoc/require-next-type'?: Linter.RuleEntry<[]>;
1132
1142
  /**
1133
- * Requires that all function parameters are documented.
1143
+ * Requires that all function parameters are documented with a `@param` tag.
1134
1144
  * @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-param.md#repos-sticky-header
1135
1145
  */
1136
1146
  'jsdoc/require-param'?: Linter.RuleEntry<JsdocRequireParam>;
@@ -1140,12 +1150,12 @@ interface RuleOptions {
1140
1150
  */
1141
1151
  'jsdoc/require-param-description'?: Linter.RuleEntry<JsdocRequireParamDescription>;
1142
1152
  /**
1143
- * Requires that all function parameters have names.
1153
+ * Requires that all `@param` tags have names.
1144
1154
  * @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-param-name.md#repos-sticky-header
1145
1155
  */
1146
1156
  'jsdoc/require-param-name'?: Linter.RuleEntry<JsdocRequireParamName>;
1147
1157
  /**
1148
- * Requires that each `@param` tag has a `type` value.
1158
+ * Requires that each `@param` tag has a type value (in curly brackets).
1149
1159
  * @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-param-type.md#repos-sticky-header
1150
1160
  */
1151
1161
  'jsdoc/require-param-type'?: Linter.RuleEntry<JsdocRequireParamType>;
@@ -1160,72 +1170,92 @@ interface RuleOptions {
1160
1170
  */
1161
1171
  'jsdoc/require-property-description'?: Linter.RuleEntry<[]>;
1162
1172
  /**
1163
- * Requires that all function `@property` tags have names.
1173
+ * Requires that all `@property` tags have names.
1164
1174
  * @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-property-name.md#repos-sticky-header
1165
1175
  */
1166
1176
  'jsdoc/require-property-name'?: Linter.RuleEntry<[]>;
1167
1177
  /**
1168
- * Requires that each `@property` tag has a `type` value.
1178
+ * Requires that each `@property` tag has a type value (in curly brackets).
1169
1179
  * @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-property-type.md#repos-sticky-header
1170
1180
  */
1171
1181
  'jsdoc/require-property-type'?: Linter.RuleEntry<[]>;
1172
1182
  /**
1173
- * Requires that returns are documented.
1183
+ * Requires that returns are documented with `@returns`.
1174
1184
  * @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-returns.md#repos-sticky-header
1175
1185
  */
1176
1186
  'jsdoc/require-returns'?: Linter.RuleEntry<JsdocRequireReturns>;
1177
1187
  /**
1178
- * Requires a return statement in function body if a `@returns` tag is specified in jsdoc comment.
1188
+ * Requires a return statement in function body if a `@returns` tag is specified in JSDoc comment(and reports if multiple `@returns` tags are present).
1179
1189
  * @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-returns-check.md#repos-sticky-header
1180
1190
  */
1181
1191
  'jsdoc/require-returns-check'?: Linter.RuleEntry<JsdocRequireReturnsCheck>;
1182
1192
  /**
1183
- * Requires that the `@returns` tag has a `description` value.
1193
+ * Requires that the `@returns` tag has a `description` value (not including `void`/`undefined` type returns).
1184
1194
  * @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-returns-description.md#repos-sticky-header
1185
1195
  */
1186
1196
  'jsdoc/require-returns-description'?: Linter.RuleEntry<JsdocRequireReturnsDescription>;
1187
1197
  /**
1188
- * Requires that `@returns` tag has `type` value.
1198
+ * Requires that `@returns` tag has type value (in curly brackets).
1189
1199
  * @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-returns-type.md#repos-sticky-header
1190
1200
  */
1191
1201
  'jsdoc/require-returns-type'?: Linter.RuleEntry<JsdocRequireReturnsType>;
1192
1202
  /**
1193
- * Requires template tags for each generic type parameter
1203
+ * Requires tags be present, optionally for specific contexts
1204
+ * @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-tags.md#repos-sticky-header
1205
+ */
1206
+ 'jsdoc/require-tags'?: Linter.RuleEntry<JsdocRequireTags>;
1207
+ /**
1208
+ * Requires `@template` tags be present when type parameters are used.
1194
1209
  * @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-template.md#repos-sticky-header
1195
1210
  */
1196
1211
  'jsdoc/require-template'?: Linter.RuleEntry<JsdocRequireTemplate>;
1197
1212
  /**
1198
- * Requires that throw statements are documented.
1213
+ * Requires a description for `@template` tags
1214
+ * @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-template-description.md#repos-sticky-header
1215
+ */
1216
+ 'jsdoc/require-template-description'?: Linter.RuleEntry<[]>;
1217
+ /**
1218
+ * Requires that throw statements are documented with `@throws` tags.
1199
1219
  * @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-throws.md#repos-sticky-header
1200
1220
  */
1201
1221
  'jsdoc/require-throws'?: Linter.RuleEntry<JsdocRequireThrows>;
1222
+ /**
1223
+ * Requires a description for `@throws` tags
1224
+ * @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-throws-description.md#repos-sticky-header
1225
+ */
1226
+ 'jsdoc/require-throws-description'?: Linter.RuleEntry<[]>;
1202
1227
  /**
1203
1228
  * Requires a type for `@throws` tags
1204
1229
  * @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-throws-type.md#repos-sticky-header
1205
1230
  */
1206
1231
  'jsdoc/require-throws-type'?: Linter.RuleEntry<[]>;
1207
1232
  /**
1208
- * Requires yields are documented.
1233
+ * Requires yields are documented with `@yields` tags.
1209
1234
  * @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-yields.md#repos-sticky-header
1210
1235
  */
1211
1236
  'jsdoc/require-yields'?: Linter.RuleEntry<JsdocRequireYields>;
1212
1237
  /**
1213
- * Requires a yield statement in function body if a `@yields` tag is specified in jsdoc comment.
1238
+ * Ensures that if a `@yields` is present that a `yield` (or `yield` with a value) is present in the function body (or that if a `@next` is present that there is a yield with a return value present).
1214
1239
  * @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-yields-check.md#repos-sticky-header
1215
1240
  */
1216
1241
  'jsdoc/require-yields-check'?: Linter.RuleEntry<JsdocRequireYieldsCheck>;
1242
+ /**
1243
+ * Requires a description for `@yields` tags
1244
+ * @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-yields-description.md#repos-sticky-header
1245
+ */
1246
+ 'jsdoc/require-yields-description'?: Linter.RuleEntry<[]>;
1217
1247
  /**
1218
1248
  * Requires a type for `@yields` tags
1219
1249
  * @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-yields-type.md#repos-sticky-header
1220
1250
  */
1221
1251
  'jsdoc/require-yields-type'?: Linter.RuleEntry<[]>;
1222
1252
  /**
1223
- * Sorts tags by a specified sequence according to tag name.
1253
+ * Sorts tags by a specified sequence according to tag name, optionally adding line breaks between tag groups.
1224
1254
  * @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/sort-tags.md#repos-sticky-header
1225
1255
  */
1226
1256
  'jsdoc/sort-tags'?: Linter.RuleEntry<JsdocSortTags>;
1227
1257
  /**
1228
- * Enforces lines (or no lines) between tags.
1258
+ * Enforces lines (or no lines) before, after, or between tags.
1229
1259
  * @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/tag-lines.md#repos-sticky-header
1230
1260
  */
1231
1261
  'jsdoc/tag-lines'?: Linter.RuleEntry<JsdocTagLines>;
@@ -1240,7 +1270,7 @@ interface RuleOptions {
1240
1270
  */
1241
1271
  'jsdoc/type-formatting'?: Linter.RuleEntry<JsdocTypeFormatting>;
1242
1272
  /**
1243
- * Requires all types to be valid JSDoc or Closure compiler types without syntax errors.
1273
+ * Requires all types/namepaths to be valid JSDoc, Closure compiler, or TypeScript types (configurable in settings).
1244
1274
  * @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/valid-types.md#repos-sticky-header
1245
1275
  */
1246
1276
  'jsdoc/valid-types'?: Linter.RuleEntry<JsdocValidTypes>;
@@ -1576,7 +1606,7 @@ interface RuleOptions {
1576
1606
  * Disallow missing label references
1577
1607
  * @see https://github.com/eslint/markdown/blob/main/docs/rules/no-missing-label-refs.md
1578
1608
  */
1579
- 'markdown/no-missing-label-refs'?: Linter.RuleEntry<[]>;
1609
+ 'markdown/no-missing-label-refs'?: Linter.RuleEntry<MarkdownNoMissingLabelRefs>;
1580
1610
  /**
1581
1611
  * Disallow link fragments that do not reference valid headings
1582
1612
  * @see https://github.com/eslint/markdown/blob/main/docs/rules/no-missing-link-fragments.md
@@ -1587,6 +1617,11 @@ interface RuleOptions {
1587
1617
  * @see https://github.com/eslint/markdown/blob/main/docs/rules/no-multiple-h1.md
1588
1618
  */
1589
1619
  'markdown/no-multiple-h1'?: Linter.RuleEntry<MarkdownNoMultipleH1>;
1620
+ /**
1621
+ * Disallow URLs that match defined reference identifiers
1622
+ * @see https://github.com/eslint/markdown/blob/main/docs/rules/no-reference-like-urls.md
1623
+ */
1624
+ 'markdown/no-reference-like-urls'?: Linter.RuleEntry<[]>;
1590
1625
  /**
1591
1626
  * Disallow reversed link and image syntax
1592
1627
  * @see https://github.com/eslint/markdown/blob/main/docs/rules/no-reversed-media-syntax.md
@@ -2672,12 +2707,12 @@ interface RuleOptions {
2672
2707
  */
2673
2708
  'node/no-hide-core-modules'?: Linter.RuleEntry<NodeNoHideCoreModules>;
2674
2709
  /**
2675
- * disallow `import` declarations which import non-existence modules
2710
+ * disallow `import` declarations which import missing modules
2676
2711
  * @see https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/no-missing-import.md
2677
2712
  */
2678
2713
  'node/no-missing-import'?: Linter.RuleEntry<NodeNoMissingImport>;
2679
2714
  /**
2680
- * disallow `require()` expressions which import non-existence modules
2715
+ * disallow `require()` expressions which import missing modules
2681
2716
  * @see https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/no-missing-require.md
2682
2717
  */
2683
2718
  'node/no-missing-require'?: Linter.RuleEntry<NodeNoMissingRequire>;
@@ -3002,11 +3037,6 @@ interface RuleOptions {
3002
3037
  * Surfaces diagnostics from React Forget
3003
3038
  */
3004
3039
  'react-compiler/react-compiler'?: Linter.RuleEntry<ReactCompilerReactCompiler>;
3005
- /**
3006
- * Disallow `children` in void DOM elements.
3007
- * @see https://eslint-react.xyz/docs/rules/dom-no-void-elements-with-children
3008
- */
3009
- 'react-dom/no-children-in-void-dom-elements'?: Linter.RuleEntry<[]>;
3010
3040
  /**
3011
3041
  * Disallow `dangerouslySetInnerHTML`.
3012
3042
  * @see https://eslint-react.xyz/docs/rules/dom-no-dangerously-set-innerhtml
@@ -3062,6 +3092,11 @@ interface RuleOptions {
3062
3092
  * @see https://eslint-react.xyz/docs/rules/dom-no-script-url
3063
3093
  */
3064
3094
  'react-dom/no-script-url'?: Linter.RuleEntry<[]>;
3095
+ /**
3096
+ * Disallows the use of string style prop.
3097
+ * @see https://eslint-react.xyz/docs/rules/dom-no-string-style-prop
3098
+ */
3099
+ 'react-dom/no-string-style-prop'?: Linter.RuleEntry<[]>;
3065
3100
  /**
3066
3101
  * Disallow unknown `DOM` property.
3067
3102
  * @see https://eslint-react.xyz/docs/rules/dom-no-unknown-property
@@ -3087,26 +3122,16 @@ interface RuleOptions {
3087
3122
  * @see https://eslint-react.xyz/docs/rules/dom-no-void-elements-with-children
3088
3123
  */
3089
3124
  'react-dom/no-void-elements-with-children'?: Linter.RuleEntry<[]>;
3090
- /**
3091
- * Enforces explicit boolean values for boolean attributes.
3092
- * @see https://eslint-react.xyz/docs/rules/avoid-shorthand-boolean
3093
- */
3094
- 'react-extra/avoid-shorthand-boolean'?: Linter.RuleEntry<[]>;
3095
- /**
3096
- * Enforces explicit `<Fragment>` components instead of the shorthand `<>` or `</>` syntax.
3097
- * @see https://eslint-react.xyz/docs/rules/avoid-shorthand-fragment
3098
- */
3099
- 'react-extra/avoid-shorthand-fragment'?: Linter.RuleEntry<[]>;
3100
- /**
3101
- * Disallow useless `forwardRef` calls on components that don't use `ref`s.
3102
- * @see https://eslint-react.xyz/docs/rules/no-useless-forward-ref
3103
- */
3104
- 'react-extra/ensure-forward-ref-using-ref'?: Linter.RuleEntry<[]>;
3105
3125
  /**
3106
3126
  * Enforces that the 'key' attribute is placed before the spread attribute in JSX elements.
3107
3127
  * @see https://eslint-react.xyz/docs/rules/jsx-key-before-spread
3108
3128
  */
3109
3129
  'react-extra/jsx-key-before-spread'?: Linter.RuleEntry<[]>;
3130
+ /**
3131
+ * Prevents comments from being inserted as text nodes.
3132
+ * @see https://eslint-react.xyz/docs/rules/jsx-no-comment-textnodes
3133
+ */
3134
+ 'react-extra/jsx-no-comment-textnodes'?: Linter.RuleEntry<[]>;
3110
3135
  /**
3111
3136
  * Disallow duplicate props in JSX elements.
3112
3137
  * @see https://eslint-react.xyz/docs/rules/jsx-no-duplicate-props
@@ -3122,6 +3147,16 @@ interface RuleOptions {
3122
3147
  * @see https://eslint-react.xyz/docs/rules/jsx-no-undef
3123
3148
  */
3124
3149
  'react-extra/jsx-no-undef'?: Linter.RuleEntry<[]>;
3150
+ /**
3151
+ * Enforces shorthand syntax for boolean attributes.
3152
+ * @see https://eslint-react.xyz/docs/rules/jsx-shorthand-boolean
3153
+ */
3154
+ 'react-extra/jsx-shorthand-boolean'?: Linter.RuleEntry<ReactExtraJsxShorthandBoolean>;
3155
+ /**
3156
+ * Enforces shorthand syntax for fragments.
3157
+ * @see https://eslint-react.xyz/docs/rules/jsx-shorthand-fragment
3158
+ */
3159
+ 'react-extra/jsx-shorthand-fragment'?: Linter.RuleEntry<ReactExtraJsxShorthandFragment>;
3125
3160
  /**
3126
3161
  * Marks React variables as used when JSX is used.
3127
3162
  * @see https://eslint-react.xyz/docs/rules/jsx-uses-react
@@ -3182,21 +3217,6 @@ interface RuleOptions {
3182
3217
  * @see https://eslint-react.xyz/docs/rules/no-clone-element
3183
3218
  */
3184
3219
  'react-extra/no-clone-element'?: Linter.RuleEntry<[]>;
3185
- /**
3186
- * Prevents comments from being inserted as text nodes.
3187
- * @see https://eslint-react.xyz/docs/rules/no-comment-textnodes
3188
- */
3189
- 'react-extra/no-comment-textnodes'?: Linter.RuleEntry<[]>;
3190
- /**
3191
- * Disallow complex conditional rendering in JSX expressions.
3192
- * @see https://eslint-react.xyz/docs/rules/no-complex-conditional-rendering
3193
- */
3194
- 'react-extra/no-complex-conditional-rendering'?: Linter.RuleEntry<[]>;
3195
- /**
3196
- * Disallow complex conditional rendering in JSX expressions.
3197
- * @see https://eslint-react.xyz/docs/rules/no-complex-conditional-rendering
3198
- */
3199
- 'react-extra/no-complicated-conditional-rendering'?: Linter.RuleEntry<[]>;
3200
3220
  /**
3201
3221
  * Replace usages of `componentWillMount` with `UNSAFE_componentWillMount`.
3202
3222
  * @see https://eslint-react.xyz/docs/rules/no-component-will-mount
@@ -3232,16 +3252,16 @@ interface RuleOptions {
3232
3252
  * @see https://eslint-react.xyz/docs/rules/no-direct-mutation-state
3233
3253
  */
3234
3254
  'react-extra/no-direct-mutation-state'?: Linter.RuleEntry<[]>;
3235
- /**
3236
- * Disallow duplicate props in JSX elements.
3237
- * @see https://eslint-react.xyz/docs/rules/jsx-no-duplicate-props
3238
- */
3239
- 'react-extra/no-duplicate-jsx-props'?: Linter.RuleEntry<[]>;
3240
3255
  /**
3241
3256
  * Disallow duplicate `key` on elements in the same array or a list of `children`.
3242
3257
  * @see https://eslint-react.xyz/docs/rules/no-duplicate-key
3243
3258
  */
3244
3259
  'react-extra/no-duplicate-key'?: Linter.RuleEntry<[]>;
3260
+ /**
3261
+ * Disallow certain props on components.
3262
+ * @see https://eslint-react.xyz/docs/rules/no-forbidden-props
3263
+ */
3264
+ 'react-extra/no-forbidden-props'?: Linter.RuleEntry<ReactExtraNoForbiddenProps>;
3245
3265
  /**
3246
3266
  * Replaces usages of `forwardRef` with passing `ref` as a prop.
3247
3267
  * @see https://eslint-react.xyz/docs/rules/no-forward-ref
@@ -3282,11 +3302,6 @@ interface RuleOptions {
3282
3302
  * @see https://eslint-react.xyz/docs/rules/no-nested-component-definitions
3283
3303
  */
3284
3304
  'react-extra/no-nested-component-definitions'?: Linter.RuleEntry<[]>;
3285
- /**
3286
- * Disallow nesting component definitions inside other components.
3287
- * @see https://eslint-react.xyz/docs/rules/no-nested-component-definitions
3288
- */
3289
- 'react-extra/no-nested-components'?: Linter.RuleEntry<[]>;
3290
3305
  /**
3291
3306
  * Disallow nesting lazy component declarations inside other components.
3292
3307
  * @see https://eslint-react.xyz/docs/rules/no-nested-lazy-component-declarations
@@ -3322,6 +3337,26 @@ interface RuleOptions {
3322
3337
  * @see https://eslint-react.xyz/docs/rules/no-string-refs
3323
3338
  */
3324
3339
  'react-extra/no-string-refs'?: Linter.RuleEntry<[]>;
3340
+ /**
3341
+ * Prevents the use of unnecessary `key` props on JSX elements when rendering lists.
3342
+ * @see https://eslint-react.xyz/docs/rules/no-unnecessary-key
3343
+ */
3344
+ 'react-extra/no-unnecessary-key'?: Linter.RuleEntry<[]>;
3345
+ /**
3346
+ * Disallow unnecessary usage of `useCallback`.
3347
+ * @see https://eslint-react.xyz/docs/rules/no-unnecessary-use-callback
3348
+ */
3349
+ 'react-extra/no-unnecessary-use-callback'?: Linter.RuleEntry<[]>;
3350
+ /**
3351
+ * Disallow unnecessary usage of `useMemo`.
3352
+ * @see https://eslint-react.xyz/docs/rules/no-unnecessary-use-memo
3353
+ */
3354
+ 'react-extra/no-unnecessary-use-memo'?: Linter.RuleEntry<[]>;
3355
+ /**
3356
+ * Enforces that a function with the `use` prefix should use at least one Hook inside of it.
3357
+ * @see https://eslint-react.xyz/docs/rules/no-unnecessary-use-prefix
3358
+ */
3359
+ 'react-extra/no-unnecessary-use-prefix'?: Linter.RuleEntry<[]>;
3325
3360
  /**
3326
3361
  * Warns the usage of `UNSAFE_componentWillMount` in class components.
3327
3362
  * @see https://eslint-react.xyz/docs/rules/no-unsafe-component-will-mount
@@ -3352,6 +3387,11 @@ interface RuleOptions {
3352
3387
  * @see https://eslint-react.xyz/docs/rules/no-unused-class-component-members
3353
3388
  */
3354
3389
  'react-extra/no-unused-class-component-members'?: Linter.RuleEntry<[]>;
3390
+ /**
3391
+ * Warns about unused component prop declarations.
3392
+ * @see https://eslint-react.xyz/docs/rules/no-unused-props
3393
+ */
3394
+ 'react-extra/no-unused-props'?: Linter.RuleEntry<[]>;
3355
3395
  /**
3356
3396
  * Warns unused class component state.
3357
3397
  * @see https://eslint-react.xyz/docs/rules/no-unused-state
@@ -3379,84 +3419,24 @@ interface RuleOptions {
3379
3419
  'react-extra/prefer-destructuring-assignment'?: Linter.RuleEntry<[]>;
3380
3420
  /**
3381
3421
  * Enforces React is imported via a namespace import.
3382
- * @see https://eslint-react.xyz/docs/rules/prefer-react-namespace-import
3422
+ * @see https://eslint-react.xyz/docs/rules/prefer-namespace-import
3383
3423
  */
3384
- 'react-extra/prefer-react-namespace-import'?: Linter.RuleEntry<[]>;
3424
+ 'react-extra/prefer-namespace-import'?: Linter.RuleEntry<[]>;
3385
3425
  /**
3386
3426
  * Enforces read-only props in components.
3387
3427
  * @see https://eslint-react.xyz/docs/rules/prefer-read-only-props
3388
3428
  */
3389
3429
  'react-extra/prefer-read-only-props'?: Linter.RuleEntry<[]>;
3390
3430
  /**
3391
- * Enforces shorthand syntax for boolean attributes.
3392
- * @see https://eslint-react.xyz/docs/rules/prefer-shorthand-boolean
3393
- */
3394
- 'react-extra/prefer-shorthand-boolean'?: Linter.RuleEntry<[]>;
3395
- /**
3396
- * Enforces shorthand syntax for fragments.
3397
- * @see https://eslint-react.xyz/docs/rules/prefer-shorthand-fragment
3398
- */
3399
- 'react-extra/prefer-shorthand-fragment'?: Linter.RuleEntry<[]>;
3400
- /**
3401
- * Marks variables used in JSX elements as used.
3402
- * @see https://eslint-react.xyz/docs/rules/jsx-uses-vars
3403
- */
3404
- 'react-extra/use-jsx-vars'?: Linter.RuleEntry<[]>;
3405
- /**
3406
- * Enforces that a function with the `use` prefix should use at least one Hook inside of it.
3407
- * @see https://eslint-react.xyz/docs/rules/hooks-extra-no-unnecessary-use-prefix
3408
- */
3409
- 'react-hooks-extra/ensure-custom-hooks-using-other-hooks'?: Linter.RuleEntry<[]>;
3410
- /**
3411
- * Disallow unnecessary usage of `useCallback`.
3412
- * @see https://eslint-react.xyz/docs/rules/hooks-extra-no-unnecessary-use-callback
3413
- */
3414
- 'react-hooks-extra/ensure-use-callback-has-non-empty-deps'?: Linter.RuleEntry<[]>;
3415
- /**
3416
- * Disallow unnecessary usage of `useMemo`.
3417
- * @see https://eslint-react.xyz/docs/rules/hooks-extra-no-unnecessary-use-memo
3431
+ * Enforces function calls made inside `useState` to be wrapped in an `initializer function`.
3432
+ * @see https://eslint-react.xyz/docs/rules/prefer-use-state-lazy-initialization
3418
3433
  */
3419
- 'react-hooks-extra/ensure-use-memo-has-non-empty-deps'?: Linter.RuleEntry<[]>;
3434
+ 'react-extra/prefer-use-state-lazy-initialization'?: Linter.RuleEntry<[]>;
3420
3435
  /**
3421
3436
  * Disallow direct calls to the `set` function of `useState` in `useEffect`.
3422
3437
  * @see https://eslint-react.xyz/docs/rules/hooks-extra-no-direct-set-state-in-use-effect
3423
3438
  */
3424
3439
  'react-hooks-extra/no-direct-set-state-in-use-effect'?: Linter.RuleEntry<[]>;
3425
- /**
3426
- * Disallow direct calls to the `set` function of `useState` in `useLayoutEffect`.
3427
- * @see https://eslint-react.xyz/docs/rules/hooks-extra-no-direct-set-state-in-use-layout-effect
3428
- */
3429
- 'react-hooks-extra/no-direct-set-state-in-use-layout-effect'?: Linter.RuleEntry<[]>;
3430
- /**
3431
- * Enforces that a function with the `use` prefix should use at least one Hook inside of it.
3432
- * @see https://eslint-react.xyz/docs/rules/hooks-extra-no-unnecessary-use-prefix
3433
- */
3434
- 'react-hooks-extra/no-redundant-custom-hook'?: Linter.RuleEntry<[]>;
3435
- /**
3436
- * Disallow unnecessary usage of `useCallback`.
3437
- * @see https://eslint-react.xyz/docs/rules/hooks-extra-no-unnecessary-use-callback
3438
- */
3439
- 'react-hooks-extra/no-unnecessary-use-callback'?: Linter.RuleEntry<[]>;
3440
- /**
3441
- * Disallow unnecessary usage of `useMemo`.
3442
- * @see https://eslint-react.xyz/docs/rules/hooks-extra-no-unnecessary-use-memo
3443
- */
3444
- 'react-hooks-extra/no-unnecessary-use-memo'?: Linter.RuleEntry<[]>;
3445
- /**
3446
- * Enforces that a function with the `use` prefix should use at least one Hook inside of it.
3447
- * @see https://eslint-react.xyz/docs/rules/hooks-extra-no-unnecessary-use-prefix
3448
- */
3449
- 'react-hooks-extra/no-unnecessary-use-prefix'?: Linter.RuleEntry<[]>;
3450
- /**
3451
- * Enforces that a function with the `use` prefix should use at least one Hook inside of it.
3452
- * @see https://eslint-react.xyz/docs/rules/hooks-extra-no-unnecessary-use-prefix
3453
- */
3454
- 'react-hooks-extra/no-useless-custom-hooks'?: Linter.RuleEntry<[]>;
3455
- /**
3456
- * Enforces function calls made inside `useState` to be wrapped in an `initializer function`.
3457
- * @see https://eslint-react.xyz/docs/rules/hooks-extra-prefer-use-state-lazy-initialization
3458
- */
3459
- 'react-hooks-extra/prefer-use-state-lazy-initialization'?: Linter.RuleEntry<[]>;
3460
3440
  /**
3461
3441
  * verifies the list of dependencies for Hooks like useEffect and similar
3462
3442
  * @see https://github.com/facebook/react/issues/14920
@@ -8206,6 +8186,7 @@ type JsdocCheckPropertyNames = [] | [{
8206
8186
  type JsdocCheckTagNames = [] | [{
8207
8187
  definedTags?: string[];
8208
8188
  enableFixer?: boolean;
8189
+ inlineTags?: string[];
8209
8190
  jsxTags?: boolean;
8210
8191
  typed?: boolean;
8211
8192
  }];
@@ -8364,10 +8345,17 @@ type JsdocNoTypes = [] | [{
8364
8345
  }];
8365
8346
  // ----- jsdoc/no-undefined-types -----
8366
8347
  type JsdocNoUndefinedTypes = [] | [{
8348
+ checkUsedTypedefs?: boolean;
8367
8349
  definedTypes?: string[];
8368
8350
  disableReporting?: boolean;
8369
8351
  markVariablesAsUsed?: boolean;
8370
8352
  }];
8353
+ // ----- jsdoc/prefer-import-tag -----
8354
+ type JsdocPreferImportTag = [] | [{
8355
+ enableFixer?: boolean;
8356
+ exemptTypedefs?: boolean;
8357
+ outputType?: ("named-import" | "namespaced-import");
8358
+ }];
8371
8359
  // ----- jsdoc/require-asterisk-prefix -----
8372
8360
  type JsdocRequireAsteriskPrefix = [] | [("always" | "never" | "any")] | [("always" | "never" | "any"), {
8373
8361
  tags?: {
@@ -8543,6 +8531,14 @@ type JsdocRequireReturnsType = [] | [{
8543
8531
  context?: string;
8544
8532
  })[];
8545
8533
  }];
8534
+ // ----- jsdoc/require-tags -----
8535
+ type JsdocRequireTags = [] | [{
8536
+ tags?: (string | {
8537
+ context?: string;
8538
+ tag?: string;
8539
+ [k: string]: unknown | undefined;
8540
+ })[];
8541
+ }];
8546
8542
  // ----- jsdoc/require-template -----
8547
8543
  type JsdocRequireTemplate = [] | [{
8548
8544
  exemptedBy?: string[];
@@ -8576,7 +8572,6 @@ type JsdocRequireYieldsCheck = [] | [{
8576
8572
  comment?: string;
8577
8573
  context?: string;
8578
8574
  })[];
8579
- exemptedBy?: string[];
8580
8575
  next?: boolean;
8581
8576
  }];
8582
8577
  // ----- jsdoc/sort-tags -----
@@ -8594,6 +8589,7 @@ type JsdocTagLines = [] | [("always" | "any" | "never")] | [("always" | "any" |
8594
8589
  applyToEndTag?: boolean;
8595
8590
  count?: number;
8596
8591
  endLines?: (number | null);
8592
+ maxBlockLines?: (number | null);
8597
8593
  startLines?: (number | null);
8598
8594
  tags?: {
8599
8595
  [k: string]: {
@@ -9310,6 +9306,10 @@ type MarkdownNoHtml = [] | [{
9310
9306
  type MarkdownNoMissingAtxHeadingSpace = [] | [{
9311
9307
  checkClosedHeadings?: boolean;
9312
9308
  }];
9309
+ // ----- markdown/no-missing-label-refs -----
9310
+ type MarkdownNoMissingLabelRefs = [] | [{
9311
+ allowLabels?: string[];
9312
+ }];
9313
9313
  // ----- markdown/no-missing-link-fragments -----
9314
9314
  type MarkdownNoMissingLinkFragments = [] | [{
9315
9315
  ignoreCase?: boolean;
@@ -10228,6 +10228,7 @@ type PnpmJsonEnforceCatalog = [] | [{
10228
10228
  reuseExistingCatalog?: boolean;
10229
10229
  conflicts?: ("new-catalog" | "overrides" | "error");
10230
10230
  fields?: string[];
10231
+ ignores?: string[];
10231
10232
  }];
10232
10233
  // ----- pnpm/json-prefer-workspace-settings -----
10233
10234
  type PnpmJsonPreferWorkspaceSettings = [] | [{
@@ -10321,6 +10322,21 @@ type ReactDomNoUnknownProperty = [] | [{
10321
10322
  ignore?: string[];
10322
10323
  requireDataLowercase?: boolean;
10323
10324
  }];
10325
+ // ----- react-extra/jsx-shorthand-boolean -----
10326
+ type ReactExtraJsxShorthandBoolean = [] | [(-1 | 1)];
10327
+ // ----- react-extra/jsx-shorthand-fragment -----
10328
+ type ReactExtraJsxShorthandFragment = [] | [(-1 | 1)];
10329
+ // ----- react-extra/no-forbidden-props -----
10330
+ type ReactExtraNoForbiddenProps = [] | [{
10331
+ forbid?: (string | {
10332
+ excludedNodes?: string[];
10333
+ prop: string;
10334
+ } | {
10335
+ includedNodes?: string[];
10336
+ prop: string;
10337
+ })[];
10338
+ [k: string]: unknown | undefined;
10339
+ }];
10324
10340
  // ----- react-extra/no-useless-fragment -----
10325
10341
  type ReactExtraNoUselessFragment = [] | [{
10326
10342
  allowExpressions?: boolean;
@@ -10885,6 +10901,10 @@ type StylisticGeneratorStarSpacing = [] | [(("before" | "after" | "both" | "neit
10885
10901
  before?: boolean;
10886
10902
  after?: boolean;
10887
10903
  });
10904
+ shorthand?: (("before" | "after" | "both" | "neither") | {
10905
+ before?: boolean;
10906
+ after?: boolean;
10907
+ });
10888
10908
  })];
10889
10909
  // ----- stylistic/implicit-arrow-linebreak -----
10890
10910
  type StylisticImplicitArrowLinebreak = [] | [("beside" | "below")];
@@ -11130,22 +11150,6 @@ type StylisticKeywordSpacing = [] | [{
11130
11150
  before?: boolean;
11131
11151
  after?: boolean;
11132
11152
  };
11133
- arguments?: {
11134
- before?: boolean;
11135
- after?: boolean;
11136
- };
11137
- as?: {
11138
- before?: boolean;
11139
- after?: boolean;
11140
- };
11141
- async?: {
11142
- before?: boolean;
11143
- after?: boolean;
11144
- };
11145
- await?: {
11146
- before?: boolean;
11147
- after?: boolean;
11148
- };
11149
11153
  boolean?: {
11150
11154
  before?: boolean;
11151
11155
  after?: boolean;
@@ -11210,10 +11214,6 @@ type StylisticKeywordSpacing = [] | [{
11210
11214
  before?: boolean;
11211
11215
  after?: boolean;
11212
11216
  };
11213
- eval?: {
11214
- before?: boolean;
11215
- after?: boolean;
11216
- };
11217
11217
  export?: {
11218
11218
  before?: boolean;
11219
11219
  after?: boolean;
@@ -11242,18 +11242,10 @@ type StylisticKeywordSpacing = [] | [{
11242
11242
  before?: boolean;
11243
11243
  after?: boolean;
11244
11244
  };
11245
- from?: {
11246
- before?: boolean;
11247
- after?: boolean;
11248
- };
11249
11245
  function?: {
11250
11246
  before?: boolean;
11251
11247
  after?: boolean;
11252
11248
  };
11253
- get?: {
11254
- before?: boolean;
11255
- after?: boolean;
11256
- };
11257
11249
  goto?: {
11258
11250
  before?: boolean;
11259
11251
  after?: boolean;
@@ -11286,10 +11278,6 @@ type StylisticKeywordSpacing = [] | [{
11286
11278
  before?: boolean;
11287
11279
  after?: boolean;
11288
11280
  };
11289
- let?: {
11290
- before?: boolean;
11291
- after?: boolean;
11292
- };
11293
11281
  long?: {
11294
11282
  before?: boolean;
11295
11283
  after?: boolean;
@@ -11306,10 +11294,6 @@ type StylisticKeywordSpacing = [] | [{
11306
11294
  before?: boolean;
11307
11295
  after?: boolean;
11308
11296
  };
11309
- of?: {
11310
- before?: boolean;
11311
- after?: boolean;
11312
- };
11313
11297
  package?: {
11314
11298
  before?: boolean;
11315
11299
  after?: boolean;
@@ -11330,10 +11314,6 @@ type StylisticKeywordSpacing = [] | [{
11330
11314
  before?: boolean;
11331
11315
  after?: boolean;
11332
11316
  };
11333
- set?: {
11334
- before?: boolean;
11335
- after?: boolean;
11336
- };
11337
11317
  short?: {
11338
11318
  before?: boolean;
11339
11319
  after?: boolean;
@@ -11378,18 +11358,10 @@ type StylisticKeywordSpacing = [] | [{
11378
11358
  before?: boolean;
11379
11359
  after?: boolean;
11380
11360
  };
11381
- type?: {
11382
- before?: boolean;
11383
- after?: boolean;
11384
- };
11385
11361
  typeof?: {
11386
11362
  before?: boolean;
11387
11363
  after?: boolean;
11388
11364
  };
11389
- using?: {
11390
- before?: boolean;
11391
- after?: boolean;
11392
- };
11393
11365
  var?: {
11394
11366
  before?: boolean;
11395
11367
  after?: boolean;
@@ -11410,6 +11382,54 @@ type StylisticKeywordSpacing = [] | [{
11410
11382
  before?: boolean;
11411
11383
  after?: boolean;
11412
11384
  };
11385
+ arguments?: {
11386
+ before?: boolean;
11387
+ after?: boolean;
11388
+ };
11389
+ as?: {
11390
+ before?: boolean;
11391
+ after?: boolean;
11392
+ };
11393
+ async?: {
11394
+ before?: boolean;
11395
+ after?: boolean;
11396
+ };
11397
+ await?: {
11398
+ before?: boolean;
11399
+ after?: boolean;
11400
+ };
11401
+ eval?: {
11402
+ before?: boolean;
11403
+ after?: boolean;
11404
+ };
11405
+ from?: {
11406
+ before?: boolean;
11407
+ after?: boolean;
11408
+ };
11409
+ get?: {
11410
+ before?: boolean;
11411
+ after?: boolean;
11412
+ };
11413
+ let?: {
11414
+ before?: boolean;
11415
+ after?: boolean;
11416
+ };
11417
+ of?: {
11418
+ before?: boolean;
11419
+ after?: boolean;
11420
+ };
11421
+ set?: {
11422
+ before?: boolean;
11423
+ after?: boolean;
11424
+ };
11425
+ type?: {
11426
+ before?: boolean;
11427
+ after?: boolean;
11428
+ };
11429
+ using?: {
11430
+ before?: boolean;
11431
+ after?: boolean;
11432
+ };
11413
11433
  yield?: {
11414
11434
  before?: boolean;
11415
11435
  after?: boolean;
@@ -11709,6 +11729,18 @@ type StylisticObjectCurlyNewline = [] | [((("always" | "never") | {
11709
11729
  type StylisticObjectCurlySpacing = [] | [("always" | "never")] | [("always" | "never"), {
11710
11730
  arraysInObjects?: boolean;
11711
11731
  objectsInObjects?: boolean;
11732
+ overrides?: {
11733
+ ObjectPattern?: ("always" | "never");
11734
+ ObjectExpression?: ("always" | "never");
11735
+ ImportDeclaration?: ("always" | "never");
11736
+ ImportAttributes?: ("always" | "never");
11737
+ ExportNamedDeclaration?: ("always" | "never");
11738
+ ExportAllDeclaration?: ("always" | "never");
11739
+ TSMappedType?: ("always" | "never");
11740
+ TSTypeLiteral?: ("always" | "never");
11741
+ TSInterfaceBody?: ("always" | "never");
11742
+ TSEnumBody?: ("always" | "never");
11743
+ };
11712
11744
  }];
11713
11745
  // ----- stylistic/object-property-newline -----
11714
11746
  type StylisticObjectPropertyNewline = [] | [{
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{getPackageInfo as i,isPackageExists as a}from"local-pkg";import o from"eslint-plugin-antfu";import s from"eslint-plugin-de-morgan";import c from"@eslint-community/eslint-plugin-eslint-comments";import l from"@eslint-community/eslint-plugin-eslint-comments/configs";import u from"@eslint/css";import{tailwind3 as d,tailwind4 as f}from"tailwind-csstree";import{fixupPluginRules as p}from"@eslint/compat";import m from"eslint-plugin-github-action";import h from"yaml-eslint-parser";import g from"eslint-config-flat-gitignore";import ee from"@eslint/js";import te from"@stylistic/eslint-plugin";import _ from"globals";import ne from"eslint-plugin-jsdoc";import re,{configs as v}from"eslint-plugin-jsonc";import ie from"jsonc-eslint-parser";import y from"@eslint/markdown";import{mergeProcessors as ae,processorPassThrough as oe}from"eslint-merge-processors";import b from"eslint-plugin-n";import x from"eslint-plugin-regexp";import se from"eslint-plugin-sonarjs";import S from"eslint-plugin-unicorn";import ce from"eslint-plugin-yml";const C=`**/*.?([cm])[jt]s?(x)`,w=`**/*.?([cm])ts`,T=`**/*.?([cm])tsx`,E=`.github/workflows/*.y?(a)ml`,D=`**/*.md`,O=`${D}/${C}`,k=`**/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 A(){return[{files:[C],name:`2digits:antfu`,plugins:{antfu:o},rules:{"antfu/if-newline":`error`,"antfu/top-level-function":`error`}}]}function j(){return[{files:[C],name:`2digits:boolean`,plugins:{boolean:s},rules:{...s.configs.recommended.rules}}]}const M={"@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`},N=n(l.recommended.rules,M);function P(){return[{files:[C],name:`2digits:comments`,plugins:{comments:c},rules:{...N,"comments/no-unused-disable":`error`,"comments/disable-enable-pair":[`error`,{allowWholeFile:!0}]}}]}async function F(e){if(e?.customSyntax)return e.customSyntax;if(e?.tailwindMajor===3)return d;if(e?.tailwindMajor===4)return f;try{let e=(await i(`tailwindcss`))?.version??``,t=Number.parseInt(e.split(`.`)[0]||`0`,10);if(Number.isFinite(t)&&t>=4)return f}catch{}return d}async function I(e={}){let t=await F(e);return[{name:`2digits:css`,files:[`**/*.css`],language:`css/css`,plugins:{css:u},languageOptions:{tolerant:!0,customSyntax:t},rules:{...u.configs.recommended.rules,...e.overrides}}]}async function L(e){let t=await e;return t.default||t}async function R(e={}){let{overrides:t={},drizzleObjectName:n=[`drizzle`,`db`]}=e,r=await L(import(`eslint-plugin-drizzle`));return[{files:[C],name:`2digits:drizzle`,plugins:{drizzle:p(r)},rules:{"drizzle/enforce-update-with-where":[`error`,{drizzleObjectName:n}],"drizzle/enforce-delete-with-where":[`error`,{drizzleObjectName:n}],...t}}]}const z=Object.fromEntries(m.configs.recommended.flatMap(({rules:e})=>Object.entries({...e})));function B(){return[{name:`2digits:github-actions/setup`,plugins:{"github-action":m}},{name:`2digits:github-actions/recommended`,files:[E],ignores:[`!**/${E}`],languageOptions:{parser:h},rules:{...z}}]}async function V(e={}){let{overrides:t={},files:r=[`**/*.graphql`,`**/*.gql`]}=e,[i,a]=await Promise.all([L(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,M);return[{name:`2digits:graphql`,plugins:{gql:i},languageOptions:{parser:i.parser},files:r,rules:{...c,"gql/naming-convention":[`error`,{allowLeadingUnderscore:!0}],...t}}]}function H(e={}){let{gitIgnore:t,ignores:n=[]}=e;return[{ignores:[k,n].flat(),name:`2digits:ignores`},g({strict:!1,...t,name:`2digits:gitignore`})]}function U(e={}){let{overrides:t={}}=e;return[{files:[C],name:`2digits:javascript`,plugins:{stylistic:te},languageOptions:{ecmaVersion:2022,globals:{..._.browser,..._.es2021,..._.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 W(){return[{files:[C],name:`2digits:jsdoc`,plugins:{jsdoc:ne},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 G(){return[...v[`flat/base`].map(e=>({...e,name:`2digits:jsonc/base`})),{name:`2digits:jsonc/json`,files:[`**/*.json`],...K,rules:{...q(v[`flat/recommended-with-json`])}},{name:`2digits:jsonc/jsonc`,files:[`**/*.jsonc`],...K,rules:{...q(v[`flat/recommended-with-jsonc`])}},{name:`2digits:jsonc/json5`,files:[`**/*.json5`],...K,rules:{...q(v[`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$`}]}},...v[`flat/prettier`].map(e=>({...e,name:`2digits:jsonc/prettier`}))]}const K={languageOptions:{parser:ie},plugins:{jsonc:re}};function q(e){return Object.fromEntries(e.flatMap(({rules:e})=>Object.entries(e??{})))}const J=[D];function le(){return[{name:`2digits:markdown/setup`,plugins:{markdown:y}},{name:`2digits:markdown/processor`,files:J,language:`markdown/gfm`,ignores:[`**/*.md/*.md`],processor:ae([y.processors.markdown,oe])},{name:`2digits:markdown/parser`,files:J,language:`markdown/gfm`,languageOptions:{parser:ue}},{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:[O],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 ue={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 de(e={}){let{files:t=[w,T],overrides:r={},parserOptions:i}=e,[a,o]=await Promise.all([L(import(`@next/eslint-plugin-next`)),L(import(`@typescript-eslint/parser`))]),s=n({...a.configs.recommended.rules,...a.configs[`core-web-vitals`].rules},M);return[{name:`2digits:next/setup`,plugins:{next:p(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 fe(){return[{files:[C],name:`2digits:node`,settings:{node:{version:`>= 22.0.0`}},plugins:{node:b},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 pe(){let e=await L(import(`eslint-plugin-pnpm`));return[{name:`2digits:pnpm/package-json`,files:[`**/package.json`],languageOptions:{parser:await L(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 L(import(`yaml-eslint-parser`))},plugins:{pnpm:e},rules:{"pnpm/yaml-no-duplicate-catalog-item":`error`,"pnpm/yaml-no-unused-catalog-item":`error`}}]}async function me(){let[e,t]=await Promise.all([L(import(`eslint-config-prettier`)),L(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 he(e={}){let{files:t=[w,T],overrides:r={},parserOptions:i,tsconfigRootDir:a,reactCompiler:o=!0}=e,[s,c,l,u,d]=await Promise.all([L(import(`@eslint-react/eslint-plugin`)),L(import(`eslint-plugin-react-hooks`)),L(import(`@typescript-eslint/parser`)),o?L(import(`eslint-plugin-react-compiler`)):Promise.resolve(void 0),L(import(`@stylistic/eslint-plugin`))]),f=s.configs.all.plugins,p=n({...c.configs[`recommended-latest`].rules,...s.configs[`recommended-type-checked`].rules},M);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 ge(){return[{files:[C],name:`2digits:regexp`,plugins:{regexp:x},rules:{...x.configs[`flat/recommended`].rules}}]}function _e(){return[{files:[C],name:`2digits:sonar`,plugins:{sonar:se},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-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 Y(e={}){let{files:t=[`**/*.stories.tsx`],overrides:n={},parserOptions:r,storybookDirectory:i=`.storybook`}=e,[a,o]=await Promise.all([L(import(`eslint-plugin-storybook`)),L(import(`@typescript-eslint/parser`))]),s={parser:o,parserOptions:{ecmaFeatures:{jsx:!0},projectService:!0,...r},sourceType:`module`};return[{name:`2digits:storybook/setup`,plugins:{storybook:p(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 ve(e={}){let{overrides:t={}}=e,[n,{tailwindFunctions:i},a]=await Promise.all([L(import(`eslint-plugin-tailwindcss`)),L(import(`@2digits/constants`)),r([`tailwind.config.ts`,`tailwind.config.js`])]);return[{files:[C],name:`2digits:tailwind`,plugins:{tailwindcss:n},settings:{tailwindcss:{callees:i,config:a}},rules:{...n.configs.recommended.rules,...t}}]}async function ye(e={}){let{overrides:t={}}=e,r=await L(import(`@tanstack/eslint-plugin-query`)),i=n(r.configs[`flat/recommended`].at(0)?.rules??{},M);return[{files:[C],name:`2digits:tanstack`,plugins:{tanstack:r},rules:{...i,...t}}]}async function be(e={}){let{overrides:t={}}=e,n=await L(import(`eslint-plugin-turbo`));return[{files:[C],name:`2digits:turbo`,plugins:{turbo:n},rules:{"turbo/no-undeclared-env-vars":`error`,...t}}]}async function xe(e={}){let{overrides:n={},parserOptions:r={}}=e,[{plugin:i,configs:a,parser:o},s]=await Promise.all([L(import(`typescript-eslint`)),L(import(`@2digits/eslint-plugin`))]),c=t(a.strictTypeChecked,M),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:[C],ignores:[O],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:[O],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:[O],rules:{"no-unused-expressions":`off`}},{name:`2digits:typescript/disables/cjs`,files:[`**/*.js`,`**/*.cjs`,`**/*.cts`],ignores:[O],rules:{"ts/no-require-imports":`off`,"ts/no-var-requires":`off`}}]}function Se(){return[{files:[C],name:`2digits:unicorn`,plugins:{unicorn:S},rules:{...S.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 Ce(){return[{name:`2digits:yaml/setup`,plugins:{yml:ce}},{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:[`**/*.y?(a)ml`],languageOptions:{parser:h}};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 i;t.pnpm===void 0&&(i=r(`pnpm-workspace.yaml`));let o=new e(H(t.ignores),U(t.js),j(),fe(),P(),W(),Se(),_e(),ge(),A(),G(),Ce(),le(),B());Z(t.css)&&(o=o.append(I(Q(t.css)))),Z(t.turbo,a(`turbo`))&&(o=o.append(be(Q(t.turbo))));let{overrides:s,...c}=Q(t.ts);return Z(t.ts,a(`typescript`))&&(o=o.append(xe(Q(t.ts)))),Z(t.react,a(`react`))&&(o=o.append(he({...Q(t.react),...c}))),Z(t.next,a(`next`))&&(o=o.append(de({...Q(t.next),...c}))),Z(t.storybook,a(`storybook`))&&(o=o.append(Y({...Q(t.storybook),...c}))),Z(t.tailwind,a(`tailwindcss`))&&(o=o.append(ve(Q(t.tailwind)))),Z(t.tanstack,a(`react-query`)||a(`@tanstack/react-query`)||a(`@tanstack/react-query-devtools`))&&(o=o.append(ye(Q(t.tanstack)))),Z(t.drizzle,a(`drizzle-kit`)||a(`drizzle-orm`))&&(o=o.append(R(Q(t.drizzle)))),Z(t.graphql,a(`graphql`))&&(o=o.append(V(Q(t.graphql)))),Z(t.pnpm,!!await i)&&(o=o.append(pe())),o=o.append(...n),a(`prettier`)&&(o=o.append(me())),o.renamePlugins(M).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{getPackageInfo as i,isPackageExists as a}from"local-pkg";import o from"eslint-plugin-antfu";import s from"eslint-plugin-de-morgan";import c from"@eslint-community/eslint-plugin-eslint-comments";import l from"@eslint-community/eslint-plugin-eslint-comments/configs";import u from"@eslint/css";import{tailwind3 as d,tailwind4 as f}from"tailwind-csstree";import{fixupPluginRules as p}from"@eslint/compat";import m from"eslint-plugin-github-action";import h from"yaml-eslint-parser";import g from"eslint-config-flat-gitignore";import ee from"@eslint/js";import te from"@stylistic/eslint-plugin";import _ from"globals";import ne from"eslint-plugin-jsdoc";import re,{configs as v}from"eslint-plugin-jsonc";import ie from"jsonc-eslint-parser";import y from"@eslint/markdown";import{mergeProcessors as ae,processorPassThrough as oe}from"eslint-merge-processors";import b from"eslint-plugin-n";import x from"eslint-plugin-regexp";import se from"eslint-plugin-sonarjs";import S from"eslint-plugin-unicorn";import ce from"eslint-plugin-yml";const C=`**/*.?([cm])[jt]s?(x)`,w=`**/*.?([cm])ts`,T=`**/*.?([cm])tsx`,E=`.github/workflows/*.y?(a)ml`,D=`**/*.md`,O=`${D}/${C}`,k=`**/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 A(){return[{files:[C],name:`2digits:antfu`,plugins:{antfu:o},rules:{"antfu/if-newline":`error`,"antfu/top-level-function":`error`}}]}function j(){return[{files:[C],name:`2digits:boolean`,plugins:{boolean:s},rules:{...s.configs.recommended.rules}}]}const M={"@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`},N=n(l.recommended.rules,M);function P(){return[{files:[C],name:`2digits:comments`,plugins:{comments:c},rules:{...N,"comments/no-unused-disable":`error`,"comments/disable-enable-pair":[`error`,{allowWholeFile:!0}]}}]}async function F(e){if(e?.customSyntax)return e.customSyntax;if(e?.tailwindMajor===3)return d;if(e?.tailwindMajor===4)return f;try{let e=(await i(`tailwindcss`))?.version??``,t=Number.parseInt(e.split(`.`)[0]||`0`,10);if(Number.isFinite(t)&&t>=4)return f}catch{}return d}async function I(e={}){let t=await F(e);return[{name:`2digits:css`,files:[`**/*.css`],language:`css/css`,plugins:{css:u},languageOptions:{tolerant:!0,customSyntax:t},rules:{...u.configs.recommended.rules,...e.overrides}}]}async function L(e){let t=await e;return t.default||t}async function R(e={}){let{overrides:t={},drizzleObjectName:n=[`drizzle`,`db`]}=e,r=await L(import(`eslint-plugin-drizzle`));return[{files:[C],name:`2digits:drizzle`,plugins:{drizzle:p(r)},rules:{"drizzle/enforce-update-with-where":[`error`,{drizzleObjectName:n}],"drizzle/enforce-delete-with-where":[`error`,{drizzleObjectName:n}],...t}}]}const z=Object.fromEntries(m.configs.recommended.flatMap(({rules:e})=>Object.entries({...e})));function B(){return[{name:`2digits:github-actions/setup`,plugins:{"github-action":m}},{name:`2digits:github-actions/recommended`,files:[E],ignores:[`!**/${E}`],languageOptions:{parser:h},rules:{...z}}]}async function V(e={}){let{overrides:t={},files:r=[`**/*.graphql`,`**/*.gql`]}=e,[i,a]=await Promise.all([L(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,M);return[{name:`2digits:graphql`,plugins:{gql:i},languageOptions:{parser:i.parser},files:r,rules:{...c,"gql/naming-convention":[`error`,{allowLeadingUnderscore:!0}],...t}}]}function H(e={}){let{gitIgnore:t,ignores:n=[]}=e;return[{ignores:[k,n].flat(),name:`2digits:ignores`},g({strict:!1,...t,name:`2digits:gitignore`})]}function U(e={}){let{overrides:t={}}=e;return[{files:[C],name:`2digits:javascript`,plugins:{stylistic:te},languageOptions:{ecmaVersion:2022,globals:{..._.browser,..._.es2021,..._.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 W(){return[{files:[C],name:`2digits:jsdoc`,plugins:{jsdoc:ne},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 G(){return[...v[`flat/base`].map(e=>({...e,name:`2digits:jsonc/base`})),{name:`2digits:jsonc/json`,files:[`**/*.json`],...K,rules:{...q(v[`flat/recommended-with-json`])}},{name:`2digits:jsonc/jsonc`,files:[`**/*.jsonc`],...K,rules:{...q(v[`flat/recommended-with-jsonc`])}},{name:`2digits:jsonc/json5`,files:[`**/*.json5`],...K,rules:{...q(v[`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$`}]}},...v[`flat/prettier`].map(e=>({...e,name:`2digits:jsonc/prettier`}))]}const K={languageOptions:{parser:ie},plugins:{jsonc:re}};function q(e){return Object.fromEntries(e.flatMap(({rules:e})=>Object.entries(e??{})))}const J=[D];function le(){return[{name:`2digits:markdown/setup`,plugins:{markdown:y}},{name:`2digits:markdown/processor`,files:J,language:`markdown/gfm`,ignores:[`**/*.md/*.md`],processor:ae([y.processors.markdown,oe])},{name:`2digits:markdown/parser`,files:J,language:`markdown/gfm`,languageOptions:{parser:ue}},{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:[O],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 ue={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 de(e={}){let{files:t=[w,T],overrides:r={},parserOptions:i}=e,[a,o]=await Promise.all([L(import(`@next/eslint-plugin-next`)),L(import(`@typescript-eslint/parser`))]),s=n({...a.configs.recommended.rules,...a.configs[`core-web-vitals`].rules},M);return[{name:`2digits:next/setup`,plugins:{next:p(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 fe(){return[{files:[C],name:`2digits:node`,settings:{node:{version:`>= 22.0.0`}},plugins:{node:b},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 pe(){let e=await L(import(`eslint-plugin-pnpm`));return[{name:`2digits:pnpm/package-json`,files:[`**/package.json`],languageOptions:{parser:await L(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 L(import(`yaml-eslint-parser`))},plugins:{pnpm:e},rules:{"pnpm/yaml-no-duplicate-catalog-item":`error`,"pnpm/yaml-no-unused-catalog-item":`error`}}]}async function me(){let[e,t]=await Promise.all([L(import(`eslint-config-prettier`)),L(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 he(e={}){let{files:t=[w,T],overrides:r={},parserOptions:i,tsconfigRootDir:a,reactCompiler:o=!0}=e,[s,c,l,u,d]=await Promise.all([L(import(`@eslint-react/eslint-plugin`)),L(import(`eslint-plugin-react-hooks`)),L(import(`@typescript-eslint/parser`)),o?L(import(`eslint-plugin-react-compiler`)):Promise.resolve(void 0),L(import(`@stylistic/eslint-plugin`))]),f=s.configs.all.plugins,p=n({...c.configs[`recommended-latest`].rules,...s.configs[`disable-conflict-eslint-plugin-react`].rules,...s.configs[`recommended-type-checked`].rules},M);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-extra/no-unnecessary-use-callback":`error`,"react-extra/prefer-use-state-lazy-initialization":`error`,"react-extra/no-unnecessary-use-prefix":`error`,"react-extra/no-unnecessary-use-memo":`error`,"react-hooks-extra/no-direct-set-state-in-use-effect":`error`,"react-extra/no-useless-fragment":`off`,"react-extra/prefer-read-only-props":`off`,"react-extra/jsx-shorthand-boolean":`error`,"react-extra/jsx-shorthand-fragment":`error`,"react-extra/prefer-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 ge(){return[{files:[C],name:`2digits:regexp`,plugins:{regexp:x},rules:{...x.configs[`flat/recommended`].rules}}]}function _e(){return[{files:[C],name:`2digits:sonar`,plugins:{sonar:se},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-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 Y(e={}){let{files:t=[`**/*.stories.tsx`],overrides:n={},parserOptions:r,storybookDirectory:i=`.storybook`}=e,[a,o]=await Promise.all([L(import(`eslint-plugin-storybook`)),L(import(`@typescript-eslint/parser`))]),s={parser:o,parserOptions:{ecmaFeatures:{jsx:!0},projectService:!0,...r},sourceType:`module`};return[{name:`2digits:storybook/setup`,plugins:{storybook:p(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 ve(e={}){let{overrides:t={}}=e,[n,{tailwindFunctions:i},a]=await Promise.all([L(import(`eslint-plugin-tailwindcss`)),L(import(`@2digits/constants`)),r([`tailwind.config.ts`,`tailwind.config.js`])]);return[{files:[C],name:`2digits:tailwind`,plugins:{tailwindcss:n},settings:{tailwindcss:{callees:i,config:a}},rules:{...n.configs.recommended.rules,...t}}]}async function ye(e={}){let{overrides:t={}}=e,r=await L(import(`@tanstack/eslint-plugin-query`)),i=n(r.configs[`flat/recommended`].at(0)?.rules??{},M);return[{files:[C],name:`2digits:tanstack`,plugins:{tanstack:r},rules:{...i,...t}}]}async function be(e={}){let{overrides:t={}}=e,n=await L(import(`eslint-plugin-turbo`));return[{files:[C],name:`2digits:turbo`,plugins:{turbo:n},rules:{"turbo/no-undeclared-env-vars":`error`,...t}}]}async function xe(e={}){let{overrides:n={},parserOptions:r={}}=e,[{plugin:i,configs:a,parser:o},s]=await Promise.all([L(import(`typescript-eslint`)),L(import(`@2digits/eslint-plugin`))]),c=t(a.strictTypeChecked,M),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:[C],ignores:[O],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:[O],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:[O],rules:{"no-unused-expressions":`off`}},{name:`2digits:typescript/disables/cjs`,files:[`**/*.js`,`**/*.cjs`,`**/*.cts`],ignores:[O],rules:{"ts/no-require-imports":`off`,"ts/no-var-requires":`off`}}]}function Se(){return[{files:[C],name:`2digits:unicorn`,plugins:{unicorn:S},rules:{...S.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 Ce(){return[{name:`2digits:yaml/setup`,plugins:{yml:ce}},{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:[`**/*.y?(a)ml`],languageOptions:{parser:h}};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 i;t.pnpm===void 0&&(i=r(`pnpm-workspace.yaml`));let o=new e(H(t.ignores),U(t.js),j(),fe(),P(),W(),Se(),_e(),ge(),A(),G(),Ce(),le(),B());Z(t.css)&&(o=o.append(I(Q(t.css)))),Z(t.turbo,a(`turbo`))&&(o=o.append(be(Q(t.turbo))));let{overrides:s,...c}=Q(t.ts);return Z(t.ts,a(`typescript`))&&(o=o.append(xe(Q(t.ts)))),Z(t.react,a(`react`))&&(o=o.append(he({...Q(t.react),...c}))),Z(t.next,a(`next`))&&(o=o.append(de({...Q(t.next),...c}))),Z(t.storybook,a(`storybook`))&&(o=o.append(Y({...Q(t.storybook),...c}))),Z(t.tailwind,a(`tailwindcss`))&&(o=o.append(ve(Q(t.tailwind)))),Z(t.tanstack,a(`react-query`)||a(`@tanstack/react-query`)||a(`@tanstack/react-query-devtools`))&&(o=o.append(ye(Q(t.tanstack)))),Z(t.drizzle,a(`drizzle-kit`)||a(`drizzle-orm`))&&(o=o.append(R(Q(t.drizzle)))),Z(t.graphql,a(`graphql`))&&(o=o.append(V(Q(t.graphql)))),Z(t.pnpm,!!await i)&&(o=o.append(pe())),o=o.append(...n),a(`prettier`)&&(o=o.append(me())),o.renamePlugins(M).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.8.6",
3
+ "version": "4.8.8",
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,59 +27,59 @@
27
27
  "public": true,
28
28
  "dependencies": {
29
29
  "@eslint-community/eslint-plugin-eslint-comments": "4.5.0",
30
- "@eslint-react/eslint-plugin": "1.53.1",
31
- "@eslint/compat": "1.3.2",
32
- "@eslint/css": "0.11.0",
33
- "@eslint/js": "9.35.0",
34
- "@eslint/markdown": "7.2.0",
30
+ "@eslint-react/eslint-plugin": "2.0.1",
31
+ "@eslint/compat": "1.4.0",
32
+ "@eslint/css": "0.11.1",
33
+ "@eslint/js": "9.36.0",
34
+ "@eslint/markdown": "7.3.0",
35
35
  "@graphql-eslint/eslint-plugin": "4.4.0",
36
- "@next/eslint-plugin-next": "15.5.3",
37
- "@stylistic/eslint-plugin": "5.3.1",
38
- "@tanstack/eslint-plugin-query": "5.89.0",
39
- "@typescript-eslint/parser": "8.44.0",
40
- "@typescript-eslint/utils": "8.44.0",
36
+ "@next/eslint-plugin-next": "15.5.4",
37
+ "@stylistic/eslint-plugin": "5.4.0",
38
+ "@tanstack/eslint-plugin-query": "5.91.0",
39
+ "@typescript-eslint/parser": "8.44.1",
40
+ "@typescript-eslint/utils": "8.44.1",
41
41
  "eslint-config-flat-gitignore": "2.1.0",
42
42
  "eslint-config-prettier": "10.1.8",
43
- "eslint-flat-config-utils": "2.1.1",
43
+ "eslint-flat-config-utils": "2.1.4",
44
44
  "eslint-merge-processors": "2.0.0",
45
45
  "eslint-plugin-antfu": "3.1.1",
46
46
  "eslint-plugin-de-morgan": "1.3.1",
47
47
  "eslint-plugin-drizzle": "0.2.3",
48
48
  "eslint-plugin-github-action": "0.0.16",
49
- "eslint-plugin-jsdoc": "58.1.1",
49
+ "eslint-plugin-jsdoc": "60.5.0",
50
50
  "eslint-plugin-jsonc": "2.20.1",
51
- "eslint-plugin-n": "17.23.0",
52
- "eslint-plugin-pnpm": "1.1.1",
51
+ "eslint-plugin-n": "17.23.1",
52
+ "eslint-plugin-pnpm": "1.1.2",
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.10.0",
56
56
  "eslint-plugin-sonarjs": "3.0.5",
57
- "eslint-plugin-storybook": "9.1.6",
57
+ "eslint-plugin-storybook": "9.1.8",
58
58
  "eslint-plugin-tailwindcss": "3.18.2",
59
- "eslint-plugin-turbo": "2.5.6",
59
+ "eslint-plugin-turbo": "2.5.8",
60
60
  "eslint-plugin-unicorn": "61.0.2",
61
61
  "eslint-plugin-yml": "1.18.0",
62
62
  "find-up": "8.0.0",
63
63
  "globals": "16.4.0",
64
64
  "graphql-config": "5.1.5",
65
- "jsonc-eslint-parser": "2.4.0",
65
+ "jsonc-eslint-parser": "2.4.1",
66
66
  "local-pkg": "1.1.2",
67
67
  "tailwind-csstree": "0.1.4",
68
- "typescript-eslint": "8.44.0",
68
+ "typescript-eslint": "8.44.1",
69
69
  "yaml-eslint-parser": "1.3.0",
70
70
  "@2digits/constants": "1.1.9",
71
- "@2digits/eslint-plugin": "3.1.20"
71
+ "@2digits/eslint-plugin": "3.1.22"
72
72
  },
73
73
  "devDependencies": {
74
- "@eslint/config-inspector": "1.2.0",
75
- "@types/react": "19.1.13",
74
+ "@eslint/config-inspector": "1.3.0",
75
+ "@types/react": "19.1.15",
76
76
  "dedent": "1.7.0",
77
- "eslint": "9.35.0",
77
+ "eslint": "9.36.0",
78
78
  "eslint-typegen": "2.3.0",
79
79
  "execa": "9.6.0",
80
80
  "react": "19.1.1",
81
81
  "tinyglobby": "0.2.15",
82
- "tsdown": "0.15.2",
82
+ "tsdown": "0.15.5",
83
83
  "typescript": "5.9.2",
84
84
  "vitest": "3.2.4",
85
85
  "@2digits/tsconfig": "0.8.2"