@ncontiero/eslint-config 6.3.0-beta.12 → 6.3.0-beta.14
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/README.md +3 -2
- package/dist/index.d.ts +388 -1
- package/dist/index.js +1 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -12,7 +12,7 @@ Nicolas's ESLint config preset for JavaScript, TypeScript, and Prettier.
|
|
|
12
12
|
- Sort imports, `package.json`, `tsconfig.json`...
|
|
13
13
|
- Reasonable defaults, best practices, only one line of config.
|
|
14
14
|
- Designed to work with TypeScript out-of-box.
|
|
15
|
-
- Support JSON(5), YAML, TOML, Markdown...
|
|
15
|
+
- Support JSON(5), YAML, TOML, Markdown, HTML with [HTML Eslint](https://html-eslint.org/)...
|
|
16
16
|
- [ESLint Flat config](https://eslint.org/docs/latest/use/configure/configuration-files-new), compose easily!
|
|
17
17
|
- Ignores common files like `dist`, `node_modules`, `coverage`, and files in `.gitignore`.
|
|
18
18
|
- Optional [React](https://react.dev/), [NextJs](https://nextjs.org/), [TailwindCSS](https://tailwindcss.com/), [TanStack Query](https://tanstack.com/query/) support.
|
|
@@ -42,7 +42,7 @@ export default ncontiero(
|
|
|
42
42
|
react: true, // auto detection
|
|
43
43
|
nextjs: false, // auto detection
|
|
44
44
|
tailwindcss: false, // auto detection
|
|
45
|
-
reactQuery: false,
|
|
45
|
+
reactQuery: false, // auto detection
|
|
46
46
|
},
|
|
47
47
|
{
|
|
48
48
|
/* your custom config */
|
|
@@ -189,6 +189,7 @@ export default ncontiero({
|
|
|
189
189
|
### Optional Configs
|
|
190
190
|
|
|
191
191
|
We provide some optional configs for specific use cases, that we don't include their dependencies by default.
|
|
192
|
+
|
|
192
193
|
> React, Next.js and Tailwind CSS have their dependencies by default.
|
|
193
194
|
|
|
194
195
|
#### TanStack Query
|
package/dist/index.d.ts
CHANGED
|
@@ -1061,6 +1061,279 @@ interface RuleOptions {
|
|
|
1061
1061
|
* @deprecated
|
|
1062
1062
|
*/
|
|
1063
1063
|
'handle-callback-err'?: Linter.RuleEntry<HandleCallbackErr>
|
|
1064
|
+
/**
|
|
1065
|
+
* Enforce newline between attributes
|
|
1066
|
+
* @see https://html-eslint.org/docs/rules/attrs-newline
|
|
1067
|
+
*/
|
|
1068
|
+
'html/attrs-newline'?: Linter.RuleEntry<HtmlAttrsNewline>
|
|
1069
|
+
/**
|
|
1070
|
+
* Enforce newline between elements.
|
|
1071
|
+
* @see https://html-eslint.org/docs/rules/element-newline
|
|
1072
|
+
*/
|
|
1073
|
+
'html/element-newline'?: Linter.RuleEntry<HtmlElementNewline>
|
|
1074
|
+
/**
|
|
1075
|
+
* Enforce consistent naming of id attributes
|
|
1076
|
+
* @see https://html-eslint.org/docs/rules/id-naming-convention
|
|
1077
|
+
*/
|
|
1078
|
+
'html/id-naming-convention'?: Linter.RuleEntry<HtmlIdNamingConvention>
|
|
1079
|
+
/**
|
|
1080
|
+
* Enforce consistent indentation
|
|
1081
|
+
*/
|
|
1082
|
+
'html/indent'?: Linter.RuleEntry<HtmlIndent>
|
|
1083
|
+
/**
|
|
1084
|
+
* Enforce use of lowercase for tag and attribute names.
|
|
1085
|
+
* @see https://html-eslint.org/docs/rules/lowercase
|
|
1086
|
+
*/
|
|
1087
|
+
'html/lowercase'?: Linter.RuleEntry<[]>
|
|
1088
|
+
/**
|
|
1089
|
+
* Enforce maximum element depth
|
|
1090
|
+
* @see https://html-eslint.org/docs/rules/max-element-depth
|
|
1091
|
+
*/
|
|
1092
|
+
'html/max-element-depth'?: Linter.RuleEntry<HtmlMaxElementDepth>
|
|
1093
|
+
/**
|
|
1094
|
+
* Disallow use of abstract roles
|
|
1095
|
+
* @see https://html-eslint.org/docs/rules/no-abstract-roles
|
|
1096
|
+
*/
|
|
1097
|
+
'html/no-abstract-roles'?: Linter.RuleEntry<[]>
|
|
1098
|
+
/**
|
|
1099
|
+
* Disallow use of accesskey attribute
|
|
1100
|
+
* @see https://html-eslint.org/docs/rules/no-accesskey-attrs
|
|
1101
|
+
*/
|
|
1102
|
+
'html/no-accesskey-attrs'?: Linter.RuleEntry<[]>
|
|
1103
|
+
/**
|
|
1104
|
+
* Disallow use of aria-hidden attributes on the `body` element.
|
|
1105
|
+
* @see https://html-eslint.org/docs/rules/no-aria-hidden-body
|
|
1106
|
+
*/
|
|
1107
|
+
'html/no-aria-hidden-body'?: Linter.RuleEntry<[]>
|
|
1108
|
+
/**
|
|
1109
|
+
* Disallow aria-hidden="true" on focusable elements
|
|
1110
|
+
* @see https://html-eslint.org/docs/rules/no-aria-hidden-on-focusable
|
|
1111
|
+
*/
|
|
1112
|
+
'html/no-aria-hidden-on-focusable'?: Linter.RuleEntry<[]>
|
|
1113
|
+
/**
|
|
1114
|
+
* Disallow duplicate attributes
|
|
1115
|
+
* @see https://html-eslint.org/docs/rules/no-duplicate-attrs
|
|
1116
|
+
*/
|
|
1117
|
+
'html/no-duplicate-attrs'?: Linter.RuleEntry<[]>
|
|
1118
|
+
/**
|
|
1119
|
+
* Disallow duplicate class names
|
|
1120
|
+
* @see https://html-eslint.org/docs/rules/no-duplicate-class
|
|
1121
|
+
*/
|
|
1122
|
+
'html/no-duplicate-class'?: Linter.RuleEntry<[]>
|
|
1123
|
+
/**
|
|
1124
|
+
* Disallow duplicate id attributes
|
|
1125
|
+
* @see https://html-eslint.org/docs/rules/no-duplicate-id
|
|
1126
|
+
*/
|
|
1127
|
+
'html/no-duplicate-id'?: Linter.RuleEntry<[]>
|
|
1128
|
+
/**
|
|
1129
|
+
* Disallow duplicate tags in `<head>`
|
|
1130
|
+
* @see https://html-eslint.org/docs/rules/no-duplicate-in-head
|
|
1131
|
+
*/
|
|
1132
|
+
'html/no-duplicate-in-head'?: Linter.RuleEntry<[]>
|
|
1133
|
+
/**
|
|
1134
|
+
* Disallow empty or inaccessible headings.
|
|
1135
|
+
* @see https://html-eslint.org/docs/rules/no-empty-headings
|
|
1136
|
+
*/
|
|
1137
|
+
'html/no-empty-headings'?: Linter.RuleEntry<[]>
|
|
1138
|
+
/**
|
|
1139
|
+
* Disallow extra spacing around attributes
|
|
1140
|
+
* @see https://html-eslint.org/docs/rules/no-extra-spacing-attrs
|
|
1141
|
+
*/
|
|
1142
|
+
'html/no-extra-spacing-attrs'?: Linter.RuleEntry<HtmlNoExtraSpacingAttrs>
|
|
1143
|
+
/**
|
|
1144
|
+
* Disallow unnecessary consecutive spaces
|
|
1145
|
+
* @see https://html-eslint.org/docs/rules/no-extra-spacing-text
|
|
1146
|
+
*/
|
|
1147
|
+
'html/no-extra-spacing-text'?: Linter.RuleEntry<HtmlNoExtraSpacingText>
|
|
1148
|
+
/**
|
|
1149
|
+
* Disallows the use of heading elements inside <button>.
|
|
1150
|
+
* @see https://html-eslint.org/docs/rules/no-heading-inside-button
|
|
1151
|
+
*/
|
|
1152
|
+
'html/no-heading-inside-button'?: Linter.RuleEntry<[]>
|
|
1153
|
+
/**
|
|
1154
|
+
* Disallow HTML attributes that have no effect in their context
|
|
1155
|
+
*/
|
|
1156
|
+
'html/no-ineffective-attrs'?: Linter.RuleEntry<[]>
|
|
1157
|
+
/**
|
|
1158
|
+
* Disallow using inline style
|
|
1159
|
+
* @see https://html-eslint.org/docs/rules/no-inline-styles
|
|
1160
|
+
*/
|
|
1161
|
+
'html/no-inline-styles'?: Linter.RuleEntry<[]>
|
|
1162
|
+
/**
|
|
1163
|
+
* Disallows the use of invalid HTML entities
|
|
1164
|
+
* @see https://html-eslint.org/docs/rules/no-invalid-entity
|
|
1165
|
+
*/
|
|
1166
|
+
'html/no-invalid-entity'?: Linter.RuleEntry<[]>
|
|
1167
|
+
/**
|
|
1168
|
+
* Disallows use of invalid role.
|
|
1169
|
+
* @see https://html-eslint.org/docs/rules/no-invalid-role
|
|
1170
|
+
*/
|
|
1171
|
+
'html/no-invalid-role'?: Linter.RuleEntry<[]>
|
|
1172
|
+
/**
|
|
1173
|
+
* Disallow multiple empty lines
|
|
1174
|
+
* @see https://html-eslint.org/docs/rules/no-multiple-empty-lines
|
|
1175
|
+
*/
|
|
1176
|
+
'html/no-multiple-empty-lines'?: Linter.RuleEntry<HtmlNoMultipleEmptyLines>
|
|
1177
|
+
/**
|
|
1178
|
+
* Disallow multiple `<h1></h1>`.
|
|
1179
|
+
* @see https://html-eslint.org/docs/rules/no-multiple-h1
|
|
1180
|
+
*/
|
|
1181
|
+
'html/no-multiple-h1'?: Linter.RuleEntry<[]>
|
|
1182
|
+
/**
|
|
1183
|
+
* Disallows nested interactive elements
|
|
1184
|
+
* @see https://html-eslint.org/docs/rules/no-nested-interactive
|
|
1185
|
+
*/
|
|
1186
|
+
'html/no-nested-interactive'?: Linter.RuleEntry<[]>
|
|
1187
|
+
/**
|
|
1188
|
+
* Disallow use of `user-scalable=no` in `<meta name="viewport">`.
|
|
1189
|
+
* @see https://html-eslint.org/docs/rules/no-non-scalable-viewport
|
|
1190
|
+
*/
|
|
1191
|
+
'html/no-non-scalable-viewport'?: Linter.RuleEntry<[]>
|
|
1192
|
+
/**
|
|
1193
|
+
* Disallow use of obsolete elements in HTML5
|
|
1194
|
+
* @see https://html-eslint.org/docs/rules/no-obsolete-tags
|
|
1195
|
+
*/
|
|
1196
|
+
'html/no-obsolete-tags'?: Linter.RuleEntry<[]>
|
|
1197
|
+
/**
|
|
1198
|
+
* Disallow use of positive `tabindex`.
|
|
1199
|
+
* @see https://html-eslint.org/docs/rules/no-positive-tabindex
|
|
1200
|
+
*/
|
|
1201
|
+
'html/no-positive-tabindex'?: Linter.RuleEntry<[]>
|
|
1202
|
+
/**
|
|
1203
|
+
* Disallow specified attributes
|
|
1204
|
+
* @see https://html-eslint.org/docs/rules/no-restricted-attr-values
|
|
1205
|
+
*/
|
|
1206
|
+
'html/no-restricted-attr-values'?: Linter.RuleEntry<HtmlNoRestrictedAttrValues>
|
|
1207
|
+
/**
|
|
1208
|
+
* Disallow specified attributes
|
|
1209
|
+
* @see https://html-eslint.org/docs/rules/no-restricted-attrs
|
|
1210
|
+
*/
|
|
1211
|
+
'html/no-restricted-attrs'?: Linter.RuleEntry<HtmlNoRestrictedAttrs>
|
|
1212
|
+
/**
|
|
1213
|
+
* Disallow specified tags
|
|
1214
|
+
* @see https://html-eslint.org/docs/rules/no-restricted-tags
|
|
1215
|
+
*/
|
|
1216
|
+
'html/no-restricted-tags'?: Linter.RuleEntry<HtmlNoRestrictedTags>
|
|
1217
|
+
/**
|
|
1218
|
+
* Enforce to omit type attributes for style sheets and scripts
|
|
1219
|
+
* @see https://html-eslint.org/docs/rules/no-script-style-type
|
|
1220
|
+
*/
|
|
1221
|
+
'html/no-script-style-type'?: Linter.RuleEntry<[]>
|
|
1222
|
+
/**
|
|
1223
|
+
* Disallow skipping heading levels
|
|
1224
|
+
* @see https://html-eslint.org/docs/rules/no-skip-heading-levels
|
|
1225
|
+
*/
|
|
1226
|
+
'html/no-skip-heading-levels'?: Linter.RuleEntry<[]>
|
|
1227
|
+
/**
|
|
1228
|
+
* Disallow usage of unsafe `target='_blank'`
|
|
1229
|
+
* @see https://html-eslint.org/docs/rules/no-target-blank
|
|
1230
|
+
*/
|
|
1231
|
+
'html/no-target-blank'?: Linter.RuleEntry<[]>
|
|
1232
|
+
/**
|
|
1233
|
+
* Disallow trailing whitespace at the end of lines
|
|
1234
|
+
* @see https://html-eslint.org/docs/rules/no-trailing-spaces
|
|
1235
|
+
*/
|
|
1236
|
+
'html/no-trailing-spaces'?: Linter.RuleEntry<[]>
|
|
1237
|
+
/**
|
|
1238
|
+
* Prefer to use HTTPS for embedded resources
|
|
1239
|
+
* @see https://html-eslint.org/docs/rules/prefer-https
|
|
1240
|
+
*/
|
|
1241
|
+
'html/prefer-https'?: Linter.RuleEntry<[]>
|
|
1242
|
+
/**
|
|
1243
|
+
* Enforce consistent quoting attributes with double(") or single(')
|
|
1244
|
+
* @see https://html-eslint.org/docs/rules/quotes
|
|
1245
|
+
*/
|
|
1246
|
+
'html/quotes'?: Linter.RuleEntry<HtmlQuotes>
|
|
1247
|
+
/**
|
|
1248
|
+
* Require specified attributes
|
|
1249
|
+
* @see https://html-eslint.org/docs/rules/require-attrs
|
|
1250
|
+
*/
|
|
1251
|
+
'html/require-attrs'?: Linter.RuleEntry<HtmlRequireAttrs>
|
|
1252
|
+
/**
|
|
1253
|
+
* Require use of the button element with a valid type attribute.
|
|
1254
|
+
* @see https://html-eslint.org/docs/rules/require-button-type
|
|
1255
|
+
*/
|
|
1256
|
+
'html/require-button-type'?: Linter.RuleEntry<[]>
|
|
1257
|
+
/**
|
|
1258
|
+
* Require closing tags.
|
|
1259
|
+
* @see https://html-eslint.org/docs/rules/require-closing-tags
|
|
1260
|
+
*/
|
|
1261
|
+
'html/require-closing-tags'?: Linter.RuleEntry<HtmlRequireClosingTags>
|
|
1262
|
+
/**
|
|
1263
|
+
* Require `<!DOCTYPE HTML>` in HTML
|
|
1264
|
+
* @see https://html-eslint.org/docs/rules/require-doctype
|
|
1265
|
+
*/
|
|
1266
|
+
'html/require-doctype'?: Linter.RuleEntry<[]>
|
|
1267
|
+
/**
|
|
1268
|
+
* Enforces that some elements (img, iframe) have explicitly defined width and height attributes.
|
|
1269
|
+
* @see https://html-eslint.org/docs/rules/require-explicit-size
|
|
1270
|
+
*/
|
|
1271
|
+
'html/require-explicit-size'?: Linter.RuleEntry<HtmlRequireExplicitSize>
|
|
1272
|
+
/**
|
|
1273
|
+
* Require `method` attribute in `<form>`
|
|
1274
|
+
* @see https://html-eslint.org/docs/rules/require-form-method
|
|
1275
|
+
*/
|
|
1276
|
+
'html/require-form-method'?: Linter.RuleEntry<[]>
|
|
1277
|
+
/**
|
|
1278
|
+
* Require `title` in `<frame>`, `<iframe>`
|
|
1279
|
+
* @see https://html-eslint.org/docs/rules/require-frame-title
|
|
1280
|
+
*/
|
|
1281
|
+
'html/require-frame-title'?: Linter.RuleEntry<[]>
|
|
1282
|
+
/**
|
|
1283
|
+
* Require `alt` attribute on `<img>` tag
|
|
1284
|
+
* @see https://html-eslint.org/docs/rules/require-img-alt
|
|
1285
|
+
*/
|
|
1286
|
+
'html/require-img-alt'?: Linter.RuleEntry<HtmlRequireImgAlt>
|
|
1287
|
+
/**
|
|
1288
|
+
* Enforces use of label for form elements(`input`, `textarea`, `select`)
|
|
1289
|
+
* @see https://html-eslint.org/docs/rules/require-input-label
|
|
1290
|
+
*/
|
|
1291
|
+
'html/require-input-label'?: Linter.RuleEntry<[]>
|
|
1292
|
+
/**
|
|
1293
|
+
* Require `lang` attribute on `<html>` tag
|
|
1294
|
+
* @see https://html-eslint.org/docs/rules/require-lang
|
|
1295
|
+
*/
|
|
1296
|
+
'html/require-lang'?: Linter.RuleEntry<[]>
|
|
1297
|
+
/**
|
|
1298
|
+
* Enforce `<li>` to be in `<ul>`, `<ol>` or `<menu>`.
|
|
1299
|
+
* @see https://html-eslint.org/docs/rules/require-li-container
|
|
1300
|
+
*/
|
|
1301
|
+
'html/require-li-container'?: Linter.RuleEntry<[]>
|
|
1302
|
+
/**
|
|
1303
|
+
* Enforce use of `<meta charset="...">` in `<head>`
|
|
1304
|
+
* @see https://html-eslint.org/docs/rules/require-meta-charset
|
|
1305
|
+
*/
|
|
1306
|
+
'html/require-meta-charset'?: Linter.RuleEntry<[]>
|
|
1307
|
+
/**
|
|
1308
|
+
* Require use of `<meta name="description">` in `<head>`
|
|
1309
|
+
* @see https://html-eslint.org/docs/rules/require-meta-description
|
|
1310
|
+
*/
|
|
1311
|
+
'html/require-meta-description'?: Linter.RuleEntry<[]>
|
|
1312
|
+
/**
|
|
1313
|
+
* Enforce use of `<meta name="viewport">` in `<head>`
|
|
1314
|
+
* @see https://html-eslint.org/docs/rules/require-meta-viewport
|
|
1315
|
+
*/
|
|
1316
|
+
'html/require-meta-viewport'?: Linter.RuleEntry<[]>
|
|
1317
|
+
/**
|
|
1318
|
+
* Enforce use of specified meta tags for open graph protocol.
|
|
1319
|
+
* @see https://html-eslint.org/docs/rules/require-open-graph-protocol
|
|
1320
|
+
*/
|
|
1321
|
+
'html/require-open-graph-protocol'?: Linter.RuleEntry<HtmlRequireOpenGraphProtocol>
|
|
1322
|
+
/**
|
|
1323
|
+
* Require `<title>` in the `<head>`
|
|
1324
|
+
* @see https://html-eslint.org/docs/rules/require-title
|
|
1325
|
+
*/
|
|
1326
|
+
'html/require-title'?: Linter.RuleEntry<[]>
|
|
1327
|
+
/**
|
|
1328
|
+
* Enforce priority and alphabetical sorting of attributes
|
|
1329
|
+
* @see https://html-eslint.org/docs/rules/sort-attrs
|
|
1330
|
+
*/
|
|
1331
|
+
'html/sort-attrs'?: Linter.RuleEntry<HtmlSortAttrs>
|
|
1332
|
+
/**
|
|
1333
|
+
* Enforce the use of baseline features.
|
|
1334
|
+
* @see https://html-eslint.org/docs/rules/use-baseline
|
|
1335
|
+
*/
|
|
1336
|
+
'html/use-baseline'?: Linter.RuleEntry<HtmlUseBaseline>
|
|
1064
1337
|
/**
|
|
1065
1338
|
* Disallow specified identifiers
|
|
1066
1339
|
* @see https://eslint.org/docs/latest/rules/id-blacklist
|
|
@@ -7469,6 +7742,101 @@ type GroupedAccessorPairs = []|[("anyOrder" | "getBeforeSet" | "setBeforeGet")]|
|
|
|
7469
7742
|
}]
|
|
7470
7743
|
// ----- handle-callback-err -----
|
|
7471
7744
|
type HandleCallbackErr = []|[string]
|
|
7745
|
+
// ----- html/attrs-newline -----
|
|
7746
|
+
type HtmlAttrsNewline = []|[{
|
|
7747
|
+
closeStyle?: ("newline" | "sameline")
|
|
7748
|
+
ifAttrsMoreThan?: number
|
|
7749
|
+
}]
|
|
7750
|
+
// ----- html/element-newline -----
|
|
7751
|
+
type HtmlElementNewline = []|[{
|
|
7752
|
+
inline?: string[]
|
|
7753
|
+
skip?: string[]
|
|
7754
|
+
}]
|
|
7755
|
+
// ----- html/id-naming-convention -----
|
|
7756
|
+
type HtmlIdNamingConvention = []|[("camelCase" | "snake_case" | "PascalCase" | "kebab-case" | "regex")]|[("camelCase" | "snake_case" | "PascalCase" | "kebab-case" | "regex"), {
|
|
7757
|
+
pattern?: string
|
|
7758
|
+
flags?: string
|
|
7759
|
+
}]
|
|
7760
|
+
// ----- html/indent -----
|
|
7761
|
+
type HtmlIndent = []|[("tab" | number)]|[("tab" | number), {
|
|
7762
|
+
Attribute?: number
|
|
7763
|
+
tagChildrenIndent?: {
|
|
7764
|
+
[k: string]: number
|
|
7765
|
+
}
|
|
7766
|
+
}]
|
|
7767
|
+
// ----- html/max-element-depth -----
|
|
7768
|
+
type HtmlMaxElementDepth = []|[{
|
|
7769
|
+
max: number
|
|
7770
|
+
}]
|
|
7771
|
+
// ----- html/no-extra-spacing-attrs -----
|
|
7772
|
+
type HtmlNoExtraSpacingAttrs = []|[{
|
|
7773
|
+
disallowInAssignment?: boolean
|
|
7774
|
+
disallowMissing?: boolean
|
|
7775
|
+
disallowTabs?: boolean
|
|
7776
|
+
enforceBeforeSelfClose?: boolean
|
|
7777
|
+
}]
|
|
7778
|
+
// ----- html/no-extra-spacing-text -----
|
|
7779
|
+
type HtmlNoExtraSpacingText = []|[{
|
|
7780
|
+
skip?: string[]
|
|
7781
|
+
}]
|
|
7782
|
+
// ----- html/no-multiple-empty-lines -----
|
|
7783
|
+
type HtmlNoMultipleEmptyLines = []|[{
|
|
7784
|
+
max: number
|
|
7785
|
+
}]
|
|
7786
|
+
// ----- html/no-restricted-attr-values -----
|
|
7787
|
+
type HtmlNoRestrictedAttrValues = {
|
|
7788
|
+
attrPatterns: string[]
|
|
7789
|
+
attrValuePatterns: string[]
|
|
7790
|
+
message?: string
|
|
7791
|
+
}[]
|
|
7792
|
+
// ----- html/no-restricted-attrs -----
|
|
7793
|
+
type HtmlNoRestrictedAttrs = {
|
|
7794
|
+
tagPatterns: string[]
|
|
7795
|
+
attrPatterns: string[]
|
|
7796
|
+
message?: string
|
|
7797
|
+
}[]
|
|
7798
|
+
// ----- html/no-restricted-tags -----
|
|
7799
|
+
type HtmlNoRestrictedTags = {
|
|
7800
|
+
tagPatterns: string[]
|
|
7801
|
+
message?: string
|
|
7802
|
+
}[]
|
|
7803
|
+
// ----- html/quotes -----
|
|
7804
|
+
type HtmlQuotes = []|[("single" | "double")]|[("single" | "double"), {
|
|
7805
|
+
enforceTemplatedAttrValue?: boolean
|
|
7806
|
+
}]
|
|
7807
|
+
// ----- html/require-attrs -----
|
|
7808
|
+
type HtmlRequireAttrs = {
|
|
7809
|
+
tag: string
|
|
7810
|
+
attr: string
|
|
7811
|
+
value?: string
|
|
7812
|
+
message?: string
|
|
7813
|
+
}[]
|
|
7814
|
+
// ----- html/require-closing-tags -----
|
|
7815
|
+
type HtmlRequireClosingTags = []|[{
|
|
7816
|
+
selfClosing?: ("always" | "never")
|
|
7817
|
+
selfClosingCustomPatterns?: string[]
|
|
7818
|
+
}]
|
|
7819
|
+
// ----- html/require-explicit-size -----
|
|
7820
|
+
type HtmlRequireExplicitSize = []|[{
|
|
7821
|
+
allowClass?: string[]
|
|
7822
|
+
allowId?: string[]
|
|
7823
|
+
}]
|
|
7824
|
+
// ----- html/require-img-alt -----
|
|
7825
|
+
type HtmlRequireImgAlt = []|[{
|
|
7826
|
+
substitute?: string[]
|
|
7827
|
+
}]
|
|
7828
|
+
// ----- html/require-open-graph-protocol -----
|
|
7829
|
+
type HtmlRequireOpenGraphProtocol = []|[string[]]
|
|
7830
|
+
// ----- html/sort-attrs -----
|
|
7831
|
+
type HtmlSortAttrs = []|[{
|
|
7832
|
+
priority?: (string | {
|
|
7833
|
+
pattern: string
|
|
7834
|
+
})[]
|
|
7835
|
+
}]
|
|
7836
|
+
// ----- html/use-baseline -----
|
|
7837
|
+
type HtmlUseBaseline = []|[{
|
|
7838
|
+
available?: (("widely" | "newly") | number)
|
|
7839
|
+
}]
|
|
7472
7840
|
// ----- id-blacklist -----
|
|
7473
7841
|
type IdBlacklist = string[]
|
|
7474
7842
|
// ----- id-denylist -----
|
|
@@ -15783,6 +16151,16 @@ interface OptionsUnicorn extends OptionsOverrides {
|
|
|
15783
16151
|
*/
|
|
15784
16152
|
allRecommended?: boolean;
|
|
15785
16153
|
}
|
|
16154
|
+
interface HTMLOptions extends OptionsOverrides {
|
|
16155
|
+
/**
|
|
16156
|
+
* Custom template engine syntax to be recognized by the HTML parser.
|
|
16157
|
+
* This allows the parser to correctly handle template delimiters like `{{...}}` or `{%...%}`.
|
|
16158
|
+
*
|
|
16159
|
+
* @see https://html-eslint.org/docs/integrating-template-engine
|
|
16160
|
+
* @default { "{{": "}}", "{%": "%}" }
|
|
16161
|
+
*/
|
|
16162
|
+
templateEngineSyntax?: Record<string, string>;
|
|
16163
|
+
}
|
|
15786
16164
|
interface OptionsTailwindCSS extends OptionsOverrides {
|
|
15787
16165
|
/**
|
|
15788
16166
|
* Path to the Tailwind CSS config file.
|
|
@@ -15854,6 +16232,13 @@ interface OptionsConfig {
|
|
|
15854
16232
|
* @default true
|
|
15855
16233
|
*/
|
|
15856
16234
|
regexp?: boolean | OptionsOverrides;
|
|
16235
|
+
/**
|
|
16236
|
+
* Enable HTML linting.
|
|
16237
|
+
*
|
|
16238
|
+
* @see https://html-eslint.org/
|
|
16239
|
+
* @default true
|
|
16240
|
+
*/
|
|
16241
|
+
html?: boolean | HTMLOptions;
|
|
15857
16242
|
/**
|
|
15858
16243
|
* Enable Prettier support.
|
|
15859
16244
|
*
|
|
@@ -15899,6 +16284,8 @@ declare function comments(): FlatConfigItem[];
|
|
|
15899
16284
|
|
|
15900
16285
|
declare function deMorgan(): FlatConfigItem[];
|
|
15901
16286
|
|
|
16287
|
+
declare function html(options: HTMLOptions): Promise<FlatConfigItem[]>;
|
|
16288
|
+
|
|
15902
16289
|
declare function ignores(userIgnores?: string[]): FlatConfigItem[];
|
|
15903
16290
|
|
|
15904
16291
|
declare function imports(options?: OptionsHasNextJs): FlatConfigItem[];
|
|
@@ -16027,4 +16414,4 @@ declare function ensurePackages(packages: (string | undefined)[]): void;
|
|
|
16027
16414
|
declare function composer(...items: Awaitable<FlatConfigItem[]>[]): Promise<FlatConfigItem[]>;
|
|
16028
16415
|
declare function toArray<T>(value: T | T[]): T[];
|
|
16029
16416
|
|
|
16030
|
-
export { type Awaitable, type FlatConfigItem, GLOB_ALL_SRC, GLOB_CSS, GLOB_DIST, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_LOCKFILE, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_NODE_MODULES, GLOB_POSTCSS, GLOB_REACT, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_YAML, type OptionsConfig, type OptionsFiles, type OptionsHasNextJs, type OptionsHasRegexp, type OptionsHasTanStackReactQuery, type OptionsHasTypeScript, type OptionsIsInEditor, type OptionsOverrides, type OptionsTailwindCSS, type OptionsTypeScriptParserOptions, type OptionsTypescript, type OptionsUnicorn, type ResolvedOptions, type Rules, type StyleConfig, type StyleOptions, combine, command, comments, composer, deMorgan, ensurePackages, getOverrides, hasNextJs, hasReact, hasTailwind, hasTanStackReactQuery, hasTypeScript, ignores, imports, interopDefault, isInEditorEnv, javascript, jsdoc, jsonc, markdown, ncontiero, nextJs, node, parserPlain, perfectionist, prettier, promise, react, regexp, resolveSubOptions, restrictedSyntaxJs, sortPackageJson, sortTsconfig, tailwindcss, toArray, toml, typescript, unicorn, yml };
|
|
16417
|
+
export { type Awaitable, type FlatConfigItem, GLOB_ALL_SRC, GLOB_CSS, GLOB_DIST, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_LOCKFILE, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_NODE_MODULES, GLOB_POSTCSS, GLOB_REACT, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_YAML, type HTMLOptions, type OptionsConfig, type OptionsFiles, type OptionsHasNextJs, type OptionsHasRegexp, type OptionsHasTanStackReactQuery, type OptionsHasTypeScript, type OptionsIsInEditor, type OptionsOverrides, type OptionsTailwindCSS, type OptionsTypeScriptParserOptions, type OptionsTypescript, type OptionsUnicorn, type ResolvedOptions, type Rules, type StyleConfig, type StyleOptions, combine, command, comments, composer, deMorgan, ensurePackages, getOverrides, hasNextJs, hasReact, hasTailwind, hasTanStackReactQuery, hasTypeScript, html, ignores, imports, interopDefault, isInEditorEnv, javascript, jsdoc, jsonc, markdown, ncontiero, nextJs, node, parserPlain, perfectionist, prettier, promise, react, regexp, resolveSubOptions, restrictedSyntaxJs, sortPackageJson, sortTsconfig, tailwindcss, toArray, toml, typescript, unicorn, yml };
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import Pe from"eslint-plugin-command/config";function E(){return[{...Pe(),name:"ncontiero/command/rules"}]}import{default as A}from"@eslint-community/eslint-plugin-eslint-comments";import{default as v}from"eslint-plugin-antfu";import{default as N}from"eslint-plugin-de-morgan";import{default as M}from"eslint-plugin-import-x";import{default as q}from"eslint-plugin-n";import{default as J}from"eslint-plugin-perfectionist";import{default as F}from"eslint-plugin-unicorn";import{default as U}from"eslint-plugin-unused-imports";function K(){return[{name:"ncontiero/comments/rules",plugins:{"eslint-comments":A},rules:{"eslint-comments/disable-enable-pair":["error",{allowWholeFile:!0}],"eslint-comments/no-aggregating-enable":"error","eslint-comments/no-duplicate-disable":"error","eslint-comments/no-unlimited-disable":"error","eslint-comments/no-unused-enable":"error"}}]}function $(){return[{...N.configs.recommended,name:"ncontiero/de-morgan"}]}var x="?([cm])[jt]s?(x)",l="**/*.?([cm])[jt]s?(x)",H="**/*.?([cm])js",tr="**/*.?([cm])jsx",w="**/*.?([cm])ts",O="**/*.?([cm])tsx",j="**/*.?([cm])?(j|t)sx",Fe="**/*.{c,le,sc}ss",nr="**/*.css",sr="**/*.{p,post}css",ir="**/*.less",ar="**/*.scss",L="**/*.json",T="**/*.json5",W="**/*.jsonc",d="**/*.md",Q="**/*.md/*.md",R="**/*.y?(a)ml",V="**/*.toml",k="**/*.htm?(l)",X=`${d}/${l}`,pr=[l,Fe,L,T,d,R,k],Le="**/node_modules",Te="**/dist",Re=["**/package-lock.json","**/yarn.lock","**/pnpm-lock.yaml","**/bun.lockb"],Y=[Le,Te,...Re,"**/output","**/coverage","**/temp","**/.temp","**/tmp","**/.tmp","**/.history","**/fixtures","**/.git","**/.vitepress/cache","**/.nuxt","**/.next","**/.vercel","**/.contentlayer","**/.changeset","**/.idea","**/.cache","**/.output","**/.vite-inspect","**/.yarn","**/next-env.d.ts","**/.nitro","**/CHANGELOG*.md","**/*.min.*","**/LICENSE*","**/__snapshots__","**/auto-import?(s).d.ts","**/components.d.ts"];function z(e=[]){return[{ignores:[...Y,...e],name:"ncontiero/global-ignores"}]}function Z(e={}){let{nextJs:r=!1}=e;return[{name:"ncontiero/imports/rules",plugins:{antfu:v,import:M},rules:{"antfu/import-dedupe":"error","import/first":"error","import/newline-after-import":["error",{count:1}],"import/no-default-export":"error","import/no-duplicates":"error","import/no-mutable-exports":"error","import/no-named-default":"error","import/no-self-import":"error","import/no-webpack-loader-syntax":"error"}},{files:[`**/*config*.${x}`,`**/{views,pages,routes,middleware,plugins,api,app}/${l}`,r?"{,src/}middleware.{ts,js}":"","**/{index,vite,esbuild,rollup,rolldown,webpack,rspack}.ts","**/*.d.ts",`${d}/**`,"**/.prettierrc*"],name:"ncontiero/imports/allow-default-export",rules:{"import/no-default-export":"off"}}]}import D from"globals";var C=["ForInStatement","LabeledStatement","WithStatement"];function ee(e={}){let{overrides:r={}}=e;return[{languageOptions:{ecmaVersion:"latest",globals:{...D.browser,...D.es2026,...D.node,document:"readonly",navigator:"readonly",window:"readonly"},parserOptions:{ecmaFeatures:{jsx:!0},ecmaVersion:"latest",sourceType:"module"},sourceType:"module"},linterOptions:{reportUnusedDisableDirectives:!0},name:"ncontiero/javascript/rules",plugins:{antfu:v,"unused-imports":U},rules:{"array-callback-return":"error","block-scoped-var":"error","constructor-super":"error","dot-notation":"warn",eqeqeq:["error","smart"],"for-direction":"error","getter-return":"error","no-alert":"warn","no-async-promise-executor":"error","no-case-declarations":"error","no-class-assign":"error","no-compare-neg-zero":"error","no-cond-assign":"error","no-console":["warn",{allow:["warn","error"]}],"no-const-assign":"error","no-constant-condition":"error","no-control-regex":"error","no-debugger":"warn","no-delete-var":"error","no-dupe-args":"error","no-dupe-class-members":"error","no-dupe-else-if":"error","no-dupe-keys":"error","no-duplicate-case":"error","no-duplicate-imports":"error","no-empty":["error",{allowEmptyCatch:!0}],"no-empty-character-class":"error","no-empty-pattern":"error","no-ex-assign":"error","no-extra-boolean-cast":"error","no-fallthrough":["warn",{commentPattern:"break[\\s\\w]*omitted"}],"no-func-assign":"error","no-global-assign":"error","no-import-assign":"error","no-inner-declarations":"error","no-invalid-regexp":"error","no-irregular-whitespace":"error","no-lonely-if":"error","no-loss-of-precision":"error","no-misleading-character-class":"error","no-multi-str":"error","no-new-native-nonconstructor":"error","no-nonoctal-decimal-escape":"error","no-obj-calls":"error","no-octal":"error","no-prototype-builtins":"error","no-redeclare":"error","no-regex-spaces":"error","no-restricted-syntax":["error",...C],"no-self-assign":"error","no-setter-return":"error","no-shadow-restricted-names":"error","no-sparse-arrays":"error","no-this-before-super":"error","no-undef":"error","no-unexpected-multiline":"error","no-unreachable":"error","no-unsafe-finally":"error","no-unsafe-negation":"error","no-unsafe-optional-chaining":"error","no-unused-expressions":["error",{allowShortCircuit:!0,allowTaggedTemplates:!0,allowTernary:!0}],"no-unused-labels":"error","no-unused-vars":"off","no-useless-backreference":"error","no-useless-catch":"error","no-useless-computed-key":"error","no-useless-constructor":"error","no-useless-escape":"error","no-useless-rename":"error","no-var":"error","no-void":"error","no-with":"error","object-shorthand":["error","always",{avoidQuotes:!0,ignoreConstructors:!1}],"prefer-arrow-callback":["error",{allowNamedFunctions:!1,allowUnboundThis:!0}],"prefer-const":["warn",{destructuring:"all",ignoreReadBeforeAssign:!0}],"prefer-exponentiation-operator":"error","prefer-regex-literals":["error",{disallowRedundantWrapping:!0}],"prefer-rest-params":"error","prefer-spread":"error","prefer-template":"error","require-await":"error","require-yield":"error","unicode-bom":["error","never"],"unused-imports/no-unused-imports":"warn","unused-imports/no-unused-vars":["error",{args:"after-used",ignoreRestSiblings:!0}],"use-isnan":["error",{enforceForIndexOf:!0,enforceForSwitchCase:!0}],"valid-typeof":["error",{requireStringLiterals:!0}],"vars-on-top":"error",...r}},{files:[`**/{scripts,cli}/${l}`,`**/cli.${x}`],name:"ncontiero/javascript/cli-rules",rules:{"no-console":"off"}},{files:[`**/*.{test,spec}.${x}`],name:"ncontiero/javascript/test-rules",rules:{"no-unused-expressions":"off","unicorn/consistent-function-scoping":"off"}}]}import{isPackageExists as re}from"local-pkg";var De=re("@ncontiero/eslint-config"),oe={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 br(...e){return(await Promise.all(e)).flat()}async function o(e){let r=await e;return r.default||r}function te(e){if(process.env.CI||!process.stdout.isTTY||!De)return;let r=e.filter(t=>t&&!re(t));if(r.length!==0)throw new Error(`This package(s) are required for this config: ${r.join(", ")}. Please install them.`)}async function ne(...e){let r=[],n=(await Promise.all(e)).flat();return r=[...r,...n],r}function hr(e){return Array.isArray(e)?e:[e]}async function se(){return[{name:"ncontiero/jsdoc/rules",plugins:{jsdoc:await o(import("eslint-plugin-jsdoc"))},rules:{"jsdoc/check-access":"warn","jsdoc/check-param-names":"warn","jsdoc/check-property-names":"warn","jsdoc/check-types":"warn","jsdoc/empty-tags":"warn","jsdoc/implements-on-classes":"warn","jsdoc/no-defaults":"warn","jsdoc/no-multi-asterisks":"warn","jsdoc/require-param-name":"warn","jsdoc/require-property":"warn","jsdoc/require-property-description":"warn","jsdoc/require-property-name":"warn","jsdoc/require-returns-check":"warn","jsdoc/require-returns-description":"warn","jsdoc/require-yields-check":"warn"}}]}async function ie(e={}){let{files:r=[L,T,W],overrides:t={},style:n=!0}=e,{indent:s=2}=typeof n=="boolean"?{}:n,[a,c]=await Promise.all([o(import("eslint-plugin-jsonc")),o(import("jsonc-eslint-parser"))]);return[{name:"ncontiero/jsonc/setup",plugins:{jsonc:a}},{files:r,languageOptions:{parser:c},name:"ncontiero/jsonc/rules",rules:{...a.configs["recommended-with-jsonc"].rules,"jsonc/array-bracket-spacing":["error","never"],"jsonc/comma-style":["error","last"],"jsonc/indent":["error",s],"jsonc/key-spacing":["error",{afterColon:!0,beforeColon:!1}],"jsonc/object-curly-newline":["error",{consistent:!0,multiline:!0}],"jsonc/object-curly-spacing":["error","always"],"jsonc/object-property-newline":["error",{allowAllPropertiesOnSameLine:!0}],"jsonc/quote-props":"off","jsonc/quotes":"off",...t}}]}import{mergeProcessors as _e,processorPassThrough as Be}from"eslint-merge-processors";async function ae(e={}){let{files:r=[d],overrides:t={}}=e,n=await o(import("@eslint/markdown"));return[{name:"ncontiero/markdown/setup",plugins:{markdown:n}},{files:r,ignores:[Q],name:"ncontiero/markdown/processor",processor:_e([n.processors.markdown,Be])},{files:r,languageOptions:{parser:oe},name:"ncontiero/markdown/parser"},{files:[X],languageOptions:{parserOptions:{ecmaFeatures:{impliedStrict:!0}}},name:"ncontiero/markdown/rules",rules:{"@typescript-eslint/comma-dangle":"off","@typescript-eslint/consistent-type-imports":"off","@typescript-eslint/no-extraneous-class":"off","@typescript-eslint/no-namespace":"off","@typescript-eslint/no-redeclare":"off","@typescript-eslint/no-require-imports":"off","@typescript-eslint/no-unused-expressions":"off","@typescript-eslint/no-unused-vars":"off","@typescript-eslint/no-use-before-define":"off","import/newline-after-import":"off","no-alert":"off","no-console":"off","no-restricted-imports":"off","no-undef":"off","no-unused-expressions":"off","no-unused-vars":"off","node/prefer-global/buffer":"off","node/prefer-global/process":"off","unused-imports/no-unused-imports":"off","unused-imports/no-unused-vars":"off",...t}}]}async function pe(e={}){let{files:r=[j],overrides:t={}}=e,n=await o(import("@next/eslint-plugin-next"));return[{files:r,name:"ncontiero/nextjs/rules",plugins:{nextjs:n},rules:{"nextjs/google-font-display":["warn"],"nextjs/google-font-preconnect":["warn"],"nextjs/inline-script-id":["error"],"nextjs/next-script-for-ga":["warn"],"nextjs/no-assign-module-variable":["error"],"nextjs/no-async-client-component":"warn","nextjs/no-before-interactive-script-outside-document":["warn"],"nextjs/no-css-tags":["warn"],"nextjs/no-document-import-in-page":["error"],"nextjs/no-duplicate-head":["error"],"nextjs/no-head-element":["warn"],"nextjs/no-head-import-in-document":["error"],"nextjs/no-html-link-for-pages":["warn"],"nextjs/no-img-element":["warn"],"nextjs/no-page-custom-font":["warn"],"nextjs/no-script-component-in-head":["error"],"nextjs/no-styled-jsx-in-document":["warn"],"nextjs/no-sync-scripts":["warn"],"nextjs/no-title-in-document-head":["warn"],"nextjs/no-typos":["warn"],"nextjs/no-unwanted-polyfillio":["warn"],...t}}]}function ce(){return[{name:"ncontiero/node/rules",plugins:{node:q},rules:{"node/handle-callback-err":["error","^(err|error)$"],"node/no-deprecated-api":"error","node/no-exports-assign":"error","node/no-new-require":"error","node/no-path-concat":"error","node/no-unsupported-features/es-builtins":"error","node/no-unsupported-features/es-syntax":"error","node/no-unsupported-features/node-builtins":"error","node/prefer-global/console":["error","always"],"node/prefer-global/process":["error","always"],"node/prefer-global/url":["error","always"],"node/prefer-global/url-search-params":["error","always"],"node/process-exit-as-throw":"error"}}]}function le(){return[{name:"ncontiero/perfectionist/rules",plugins:{perfectionist:J},rules:{"perfectionist/sort-exports":["warn",{type:"natural"}],"perfectionist/sort-imports":["warn",{customGroups:{type:{react:["^react$","^react-(?!.*.css$).+"]},value:{react:["^react$","^react-(?!.*.css$).+"]}},groups:["side-effect-style","style","type","internal-type",["parent-type","sibling-type","index-type"],"builtin","react","external","internal",["parent","sibling","index"],"object","unknown"],internalPattern:["^[~@#]/.*"],newlinesBetween:"ignore",type:"natural"}],"perfectionist/sort-named-exports":["warn",{groupKind:"types-first"}],"perfectionist/sort-named-imports":["warn",{groupKind:"types-first"}]}}]}async function me(e={}){return[{name:"ncontiero/prettier/setup",plugins:{prettier:await o(import("eslint-plugin-prettier"))}},{files:[l],name:"ncontiero/prettier/disables",rules:{"antfu/consistent-list-newline":"off","arrow-body-style":"off",curly:"off","no-unexpected-multiline":"off","prefer-arrow-callback":"off","unicorn/empty-brace-spaces":"off","unicorn/no-nested-ternary":"off","unicorn/number-literal-case":"off","unicorn/template-indent":"off"}},{files:[l],name:"ncontiero/prettier/rules",rules:{"prettier/prettier":["warn",e]}}]}async function ue(){return[{...(await o(import("eslint-plugin-promise"))).configs["flat/recommended"],name:"ncontiero/promise/setup"},{name:"ncontiero/promise/rules",rules:{"promise/always-return":["error",{ignoreLastCallback:!0}],"promise/no-multiple-resolved":"warn"}}]}import{isPackageExists as _}from"local-pkg";var Ge=["vite"],Ee=["@react-router/node","@react-router/react","@react-router/serve","@react-router/dev"],Ae=["next"];async function fe(e={}){let{files:r=[j],overrides:t={},reactQuery:n,typescript:s}=e;n&&te(["@tanstack/eslint-plugin-query"]);let[a,c,p,I]=await Promise.all([o(import("eslint-plugin-jsx-a11y")),o(import("eslint-plugin-react")),o(import("eslint-plugin-react-hooks")),o(import("eslint-plugin-react-refresh"))]),y=Ge.some(m=>_(m)),g=Ee.some(m=>_(m)),h=Ae.some(m=>_(m));return[{files:r,name:"ncontiero/react/setup",plugins:{"jsx-a11y":a,react:c,"react-hooks":p,"react-refresh":I},settings:{react:{version:"detect"}}},n?{...(await o(import("@tanstack/eslint-plugin-query"))).configs["flat/recommended"][0],name:"ncontiero/tanstack-query"}:{},{files:r,languageOptions:{parserOptions:{ecmaFeatures:{jsx:!0}}},name:"ncontiero/react/rules",rules:{"react-hooks/component-hook-factories":"warn","react-hooks/error-boundaries":"warn","react-hooks/exhaustive-deps":"warn","react-hooks/globals":"warn","react-hooks/immutability":"warn","react-hooks/incompatible-library":"warn","react-hooks/preserve-manual-memoization":"warn","react-hooks/purity":"warn","react-hooks/refs":"warn","react-hooks/rules-of-hooks":"error","react-hooks/set-state-in-effect":"warn","react-hooks/set-state-in-render":"warn","react-hooks/static-components":"warn","react-hooks/unsupported-syntax":"warn","react-hooks/use-memo":"warn","react-refresh/only-export-components":["warn",{allowConstantExport:y,allowExportNames:[...h?["experimental_ppr","dynamic","dynamicParams","revalidate","fetchCache","runtime","preferredRegion","maxDuration","generateStaticParams","metadata","generateMetadata","viewport","generateViewport"]:[],...g?["meta","links","headers","loader","action","clientLoader","clientAction","handle","shouldRevalidate"]:[]]}],"react/boolean-prop-naming":["off",{rule:"^(is|has|are|can|should|did|will)[A-Z]([A-Za-z0-9])+",validateNested:!0}],"react/button-has-type":["error",{button:!0,reset:!1,submit:!0}],"react/display-name":["error",{ignoreTranspilerName:!1}],"react/hook-use-state":["error"],"react/iframe-missing-sandbox":["error"],"react/jsx-boolean-value":["error","never"],"react/jsx-filename-extension":["warn",{extensions:[".tsx"]}],"react/jsx-fragments":["error","syntax"],"react/jsx-handler-names":["error",{eventHandlerPrefix:"handle",eventHandlerPropPrefix:"on"}],"react/jsx-key":["error",{checkFragmentShorthand:!0,checkKeyMustBeforeSpread:!0,warnOnDuplicates:!0}],"react/jsx-no-bind":["error",{allowArrowFunctions:!0}],"react/jsx-no-comment-textnodes":"error","react/jsx-no-constructed-context-values":"error","react/jsx-no-duplicate-props":["error"],"react/jsx-no-leaked-render":["error"],"react/jsx-no-script-url":["error",[{name:"Link",props:["to"]}]],"react/jsx-no-target-blank":["error",{forms:!0,links:!0,warnOnSpreadAttributes:!0}],"react/jsx-no-undef":"error","react/jsx-no-useless-fragment":"error","react/jsx-uses-react":"error","react/jsx-uses-vars":"error","react/no-access-state-in-setstate":"error","react/no-array-index-key":"error","react/no-arrow-function-lifecycle":"error","react/no-children-prop":"error","react/no-danger":"error","react/no-danger-with-children":"error","react/no-deprecated":"error","react/no-did-update-set-state":"error","react/no-direct-mutation-state":"error","react/no-find-dom-node":"error","react/no-invalid-html-attribute":"error","react/no-is-mounted":"error","react/no-namespace":"error","react/no-object-type-as-default-prop":"error","react/no-redundant-should-component-update":"error","react/no-render-return-value":"error","react/no-string-refs":["error",{noTemplateLiterals:!0}],"react/no-this-in-sfc":["error"],"react/no-typos":["error"],"react/no-unescaped-entities":"error","react/no-unknown-property":"error","react/no-unstable-nested-components":["error"],"react/no-unused-class-component-methods":["error"],"react/no-unused-prop-types":["error",{customValidators:[],skipShapeProps:!0}],"react/no-unused-state":["error"],"react/no-will-update-set-state":["error"],"react/prefer-es6-class":["error","always"],"react/prefer-exact-props":["error"],"react/prefer-read-only-props":["error"],"react/prefer-stateless-function":["error",{ignorePureComponents:!0}],"react/prop-types":["error",{customValidators:[],ignore:[],skipUndeclared:!1}],"react/react-in-jsx-scope":"off","react/require-render-return":"error","react/self-closing-comp":["error",{component:!0,html:!0}],"react/sort-default-props":["error"],"react/state-in-constructor":["error","never"],"react/static-property-placement":["error","property assignment"],"react/style-prop-object":["error",{allow:["FormattedNumber"]}],"react/void-dom-elements-no-children":["error"],...s?{"react/jsx-no-undef":"off","react/prop-types":"off"}:{},"jsx-a11y/alt-text":["warn",{area:[],elements:["img","object","area",'input[type="image"]'],img:[],'input[type="image"]':[],object:[]}],"jsx-a11y/anchor-has-content":["warn",{components:[]}],"jsx-a11y/anchor-is-valid":["warn",{aspects:["noHref","invalidHref","preferButton"],components:["Link"],specialLink:["to"]}],"jsx-a11y/aria-activedescendant-has-tabindex":["warn"],"jsx-a11y/aria-props":["warn"],"jsx-a11y/aria-proptypes":["warn"],"jsx-a11y/aria-role":["warn",{ignoreNonDOM:!1}],"jsx-a11y/aria-unsupported-elements":["warn"],"jsx-a11y/autocomplete-valid":["off",{inputComponents:[]}],"jsx-a11y/click-events-have-key-events":["warn"],"jsx-a11y/control-has-associated-label":["warn",{controlComponents:[],depth:5,ignoreElements:["audio","canvas","embed","input","textarea","tr","video"],ignoreRoles:["grid","listbox","menu","menubar","radiogroup","row","tablist","toolbar","tree","treegrid"],labelAttributes:["label"]}],"jsx-a11y/heading-has-content":["warn",{components:[""]}],"jsx-a11y/html-has-lang":["warn"],"jsx-a11y/iframe-has-title":["warn"],"jsx-a11y/img-redundant-alt":["warn"],"jsx-a11y/interactive-supports-focus":["warn"],"jsx-a11y/label-has-associated-control":"warn","jsx-a11y/lang":["warn"],"jsx-a11y/media-has-caption":["warn",{audio:[],track:[],video:[]}],"jsx-a11y/mouse-events-have-key-events":["warn"],"jsx-a11y/no-access-key":["warn"],"jsx-a11y/no-autofocus":["warn",{ignoreNonDOM:!0}],"jsx-a11y/no-distracting-elements":["warn",{elements:["marquee","blink"]}],"jsx-a11y/no-interactive-element-to-noninteractive-role":["warn",{tr:["none","presentation"]}],"jsx-a11y/no-noninteractive-element-interactions":["warn",{handlers:["onClick","onMouseDown","onMouseUp","onKeyPress","onKeyDown","onKeyUp"]}],"jsx-a11y/no-noninteractive-element-to-interactive-role":["warn",{li:["menuitem","option","row","tab","treeitem"],ol:["listbox","menu","menubar","radiogroup","tablist","tree","treegrid"],table:["grid"],td:["gridcell"],ul:["listbox","menu","menubar","radiogroup","tablist","tree","treegrid"]}],"jsx-a11y/no-noninteractive-tabindex":["warn",{roles:["tabpanel"],tags:[]}],"jsx-a11y/no-redundant-roles":["warn"],"jsx-a11y/no-static-element-interactions":["off",{handlers:["onClick","onMouseDown","onMouseUp","onKeyPress","onKeyDown","onKeyUp"]}],"jsx-a11y/role-has-required-aria-props":["warn"],"jsx-a11y/role-supports-aria-props":["warn"],"jsx-a11y/scope":["warn"],"jsx-a11y/tabindex-no-positive":["warn"],...t}}]}import{configs as Ne}from"eslint-plugin-regexp";function de(e={}){let r=Ne["flat/recommended"],t={...r.rules,...e.overrides};return[{...r,name:"ncontiero/regexp/rules",rules:t}]}function ye(){return[{files:["**/package.json"],name:"ncontiero/sort/package-json",rules:{"jsonc/sort-array-values":["error",{order:{type:"asc"},pathPattern:"^files$"}],"jsonc/sort-keys":["error",{order:["publisher","name","displayName","type","version","private","packageManager","description","author","contributors","license","funding","homepage","repository","bugs","keywords","categories","sideEffects","imports","exports","main","module","unpkg","jsdelivr","browser","types","typesVersions","bin","icon","files","directories","publishConfig","scripts","peerDependencies","peerDependenciesMeta","optionalDependencies","dependencies","devDependencies","engines","prisma","config","pnpm","overrides","resolutions","husky","lint-staged","eslintConfig","prettier"],pathPattern:"^$"},{order:{type:"asc"},pathPattern:"^(?:dev|peer|optional|bundled)?[Dd]ependencies(Meta)?$"},{order:["types","require","import","default"],pathPattern:"^exports.*$"},{order:{type:"asc"},pathPattern:"^(?:resolutions|overrides|pnpm.overrides)$"},{order:{type:"asc"},pathPattern:"^workspaces\\.catalog$"},{order:{type:"asc"},pathPattern:"^workspaces\\.catalogs\\.[^.]+$"}]}}]}function ge(){return[{files:["**/[jt]sconfig.json","**/[jt]sconfig.*.json"],name:"ncontiero/sort/tsconfig",rules:{"jsonc/sort-keys":["error",{order:["extends","compilerOptions","references","files","include","exclude"],pathPattern:"^$"},{order:["incremental","composite","tsBuildInfoFile","disableSourceOfProjectReferenceRedirect","disableSolutionSearching","disableReferencedProjectLoad","target","jsx","jsxFactory","jsxFragmentFactory","jsxImportSource","lib","moduleDetection","noLib","reactNamespace","useDefineForClassFields","emitDecoratorMetadata","experimentalDecorators","libReplacement","baseUrl","rootDir","rootDirs","customConditions","module","moduleResolution","moduleSuffixes","noResolve","paths","resolveJsonModule","resolvePackageJsonExports","resolvePackageJsonImports","typeRoots","types","allowArbitraryExtensions","allowImportingTsExtensions","allowUmdGlobalAccess","allowJs","checkJs","maxNodeModuleJsDepth","strict","strictBindCallApply","strictFunctionTypes","strictNullChecks","strictPropertyInitialization","allowUnreachableCode","allowUnusedLabels","alwaysStrict","exactOptionalPropertyTypes","noFallthroughCasesInSwitch","noImplicitAny","noImplicitOverride","noImplicitReturns","noImplicitThis","noPropertyAccessFromIndexSignature","noUncheckedIndexedAccess","noUnusedLocals","noUnusedParameters","useUnknownInCatchVariables","declaration","declarationDir","declarationMap","downlevelIteration","emitBOM","emitDeclarationOnly","importHelpers","importsNotUsedAsValues","inlineSourceMap","inlineSources","isolatedDeclarations","mapRoot","newLine","noEmit","noEmitHelpers","noEmitOnError","outDir","outFile","preserveConstEnums","preserveValueImports","removeComments","sourceMap","sourceRoot","stripInternal","allowSyntheticDefaultImports","esModuleInterop","forceConsistentCasingInFileNames","isolatedModules","preserveSymlinks","verbatimModuleSyntax","erasableSyntaxOnly","skipDefaultLibCheck","skipLibCheck"],pathPattern:"^compilerOptions$"}]}}]}import S from"path";async function xe(e={}){let{overrides:r={}}=e,t=p=>S.isAbsolute(p)?p:S.resolve(process.cwd(),p),n=t(e.cssGlobalPath??S.join("src","app","globals.css")),s=t(e.configPath??S.join("tailwind.config.ts")),a=await o(import("eslint-plugin-better-tailwindcss")),c=await o(import("@html-eslint/parser"));return[{files:[k],languageOptions:{parser:c}},{name:"ncontiero/tailwindcss/setup",plugins:{tailwindcss:a},settings:{tailwindcss:{entryPoint:n,tailwindConfig:s}}},{files:[l,k],name:"ncontiero/tailwindcss/rules",rules:{"tailwindcss/enforce-consistent-class-order":"warn","tailwindcss/enforce-consistent-important-position":"warn","tailwindcss/enforce-consistent-line-wrapping":["warn",{group:"never",preferSingleLine:!0,printWidth:120}],"tailwindcss/enforce-consistent-variable-syntax":"error","tailwindcss/enforce-shorthand-classes":"warn","tailwindcss/no-conflicting-classes":"error","tailwindcss/no-deprecated-classes":"error","tailwindcss/no-duplicate-classes":"error","tailwindcss/no-restricted-classes":"error","tailwindcss/no-unknown-classes":"warn","tailwindcss/no-unnecessary-whitespace":"warn",...r}}]}async function we(e={}){let{files:r=[V],overrides:t={},style:n=!0}=e,{indent:s=2}=typeof n=="boolean"?{}:n,[a,c]=await Promise.all([o(import("eslint-plugin-toml")),o(import("toml-eslint-parser"))]);return[{name:"ncontiero/toml/setup",plugins:{toml:a}},{files:r,languageOptions:{parser:c},name:"ncontiero/toml/rules",rules:{"toml/array-bracket-newline":"error","toml/array-bracket-spacing":"error","toml/array-element-newline":"off","toml/comma-style":"error","toml/indent":["error",s],"toml/inline-table-curly-spacing":"error","toml/key-spacing":"error","toml/keys-order":"error","toml/no-space-dots":"error","toml/no-unreadable-number-separator":"error","toml/padding-line-between-pairs":"error","toml/padding-line-between-tables":"error","toml/precision-of-fractional-seconds":"error","toml/precision-of-integer":"error","toml/quoted-keys":"error","toml/spaced-comment":"error","toml/table-bracket-spacing":"error","toml/tables-order":"error","toml/vue-custom-block/no-parsing-error":"error","unicorn/filename-case":"off",...t}}]}async function Oe(e={}){let{files:r=[w,O],overrides:t={},parserOptions:n={}}=e,[s,a]=await Promise.all([o(import("@typescript-eslint/eslint-plugin")),o(import("@typescript-eslint/parser"))]);return[{name:"ncontiero/typescript/setup",plugins:{"@typescript-eslint":s}},{files:r,languageOptions:{parser:a,parserOptions:{sourceType:"module",...n}},name:"ncontiero/typescript/parser"},{files:r,name:"ncontiero/typescript/rules",rules:{...s.configs["eslint-recommended"].overrides[0].rules,...s.configs.recommended.rules,"@typescript-eslint/ban-ts-comment":["error",{"ts-ignore":"allow-with-description"}],"@typescript-eslint/consistent-type-assertions":["error",{assertionStyle:"as",objectLiteralTypeAssertions:"allow-as-parameter"}],"@typescript-eslint/consistent-type-imports":["error",{disallowTypeAnnotations:!1,fixStyle:"inline-type-imports"}],"@typescript-eslint/method-signature-style":["error","property"],"@typescript-eslint/no-empty-object-type":["error",{allowInterfaces:"always"}],"@typescript-eslint/no-explicit-any":"off","@typescript-eslint/no-import-type-side-effects":"error","@typescript-eslint/no-non-null-assertion":"off","@typescript-eslint/no-redeclare":"error","@typescript-eslint/no-unused-expressions":["error",{allowShortCircuit:!0,allowTaggedTemplates:!1,allowTernary:!0,enforceForJSX:!0}],"@typescript-eslint/no-unused-vars":"off","@typescript-eslint/no-useless-constructor":"error","@typescript-eslint/no-wrapper-object-types":"error","@typescript-eslint/prefer-as-const":"warn","@typescript-eslint/prefer-literal-enum-member":["error",{allowBitwiseExpressions:!0}],"no-restricted-syntax":["error",...C,"TSEnumDeclaration[const=true]"],...t}},{files:["**/*.d.ts"],name:"ncontiero/typescript/dts-rules",rules:{"eslint-comments/no-unlimited-disable":"off","import/no-duplicates":"off","no-restricted-syntax":["error",...C],"unused-imports/no-unused-vars":"off"}},{files:[H,"**/*.cjs"],name:"ncontiero/typescript/cjs-rules",rules:{"@typescript-eslint/no-require-imports":"off"}}]}function be(e={}){let{allRecommended:r,overrides:t={},regexp:n=!1}=e;return[{name:"ncontiero/unicorn/rules",plugins:{unicorn:F},rules:{...r?F.configs.recommended.rules:{"unicorn/better-regex":n?"off":"error","unicorn/catch-error-name":"error","unicorn/consistent-date-clone":"error","unicorn/consistent-empty-array-spread":"error","unicorn/consistent-existence-index-check":"error","unicorn/consistent-function-scoping":"error","unicorn/custom-error-definition":"error","unicorn/error-message":"error","unicorn/escape-case":"error","unicorn/explicit-length-check":"error","unicorn/new-for-builtins":"error","unicorn/no-array-callback-reference":"error","unicorn/no-array-method-this-argument":"error","unicorn/no-await-in-promise-methods":"error","unicorn/no-console-spaces":"error","unicorn/no-for-loop":"error","unicorn/no-hex-escape":"error","unicorn/no-instanceof-builtins":"error","unicorn/no-invalid-remove-event-listener":"error","unicorn/no-lonely-if":"error","unicorn/no-negation-in-equality-check":"error","unicorn/no-new-array":"error","unicorn/no-new-buffer":"error","unicorn/no-single-promise-in-promise-methods":"error","unicorn/no-static-only-class":"error","unicorn/no-unnecessary-array-flat-depth":"error","unicorn/no-unnecessary-array-splice-count":"error","unicorn/no-unnecessary-await":"error","unicorn/no-unnecessary-slice-end":"error","unicorn/no-zero-fractions":"error","unicorn/number-literal-case":"error","unicorn/prefer-add-event-listener":"error","unicorn/prefer-array-find":"error","unicorn/prefer-array-flat-map":"error","unicorn/prefer-array-index-of":"error","unicorn/prefer-array-some":"error","unicorn/prefer-at":"error","unicorn/prefer-blob-reading-methods":"error","unicorn/prefer-class-fields":"error","unicorn/prefer-date-now":"error","unicorn/prefer-dom-node-append":"error","unicorn/prefer-dom-node-dataset":"error","unicorn/prefer-dom-node-remove":"error","unicorn/prefer-dom-node-text-content":"error","unicorn/prefer-includes":"error","unicorn/prefer-keyboard-event-key":"error","unicorn/prefer-math-min-max":"error","unicorn/prefer-math-trunc":"error","unicorn/prefer-modern-dom-apis":"error","unicorn/prefer-modern-math-apis":"error","unicorn/prefer-negative-index":"error","unicorn/prefer-node-protocol":"error","unicorn/prefer-number-properties":"error","unicorn/prefer-optional-catch-binding":"error","unicorn/prefer-prototype-methods":"error","unicorn/prefer-query-selector":"error","unicorn/prefer-reflect-apply":"error","unicorn/prefer-regexp-test":"error","unicorn/prefer-single-call":"error","unicorn/prefer-string-replace-all":"error","unicorn/prefer-string-slice":"error","unicorn/prefer-string-starts-ends-with":"error","unicorn/prefer-string-trim-start-end":"error","unicorn/prefer-type-error":"error","unicorn/throw-new-error":"error"},...t}}]}async function he(e={}){let{files:r=[R],overrides:t={},style:n=!0}=e,{indent:s=2,quotes:a="double"}=typeof n=="boolean"?{}:n,[c,p]=await Promise.all([o(import("eslint-plugin-yml")),o(import("yaml-eslint-parser"))]);return[{name:"ncontiero/yml/setup",plugins:{yml:c}},{files:r,languageOptions:{parser:p},name:"ncontiero/yml/rules",rules:{"yml/block-mapping":"error","yml/block-mapping-question-indicator-newline":"error","yml/block-sequence":"error","yml/block-sequence-hyphen-indicator-newline":"error","yml/flow-mapping-curly-newline":"error","yml/flow-mapping-curly-spacing":"error","yml/flow-sequence-bracket-newline":"error","yml/flow-sequence-bracket-spacing":"error","yml/indent":["error",s],"yml/key-spacing":"error","yml/no-empty-document":"error","yml/no-empty-key":"error","yml/no-empty-sequence-entry":"error","yml/no-irregular-whitespace":"error","yml/no-tab-indent":"error","yml/plain-scalar":"error","yml/quotes":["error",{avoidEscape:!1,prefer:a}],"yml/spaced-comment":"error","yml/vue-custom-block/no-parsing-error":"error",...t}},{files:["pnpm-workspace.yaml"],name:"ncontiero/yml/pnpm-workspace",rules:{"yml/sort-keys":["error",{order:["packages","overrides","patchedDependencies","hoistPattern","catalog","catalogs","allowedDeprecatedVersions","allowNonAppliedPatches","allowUnusedPatches","configDependencies","ignoredBuiltDependencies","ignoredOptionalDependencies","ignorePatchFailures","neverBuiltDependencies","onlyBuiltDependencies","onlyBuiltDependenciesFile","packageExtensions","peerDependencyRules","supportedArchitectures"],pathPattern:"^$"},{order:{type:"asc"},pathPattern:".*"}]}}]}import{isPackageExists as b}from"local-pkg";var ve=!!((process.env.VSCODE_PID||process.env.VSCODE_CWD||process.env.NVIM||process.env.JETBRAINS_IDE||process.env.VIM)&&!process.env.CI),je=b("typescript"),ke=b("react"),Ce=b("next"),Se=b("tailwindcss"),Ie=b("@tanstack/react-query");var Me=["name","languageOptions","linterOptions","processor","plugins","rules","settings"];function B(e,r){return typeof e[r]=="boolean"?{}:e[r]||{}}function u(e,r){let t=B(e,r);return{...("overrides"in e?e.overrides:{})?.[r],..."overrides"in t?t.overrides:{}}}function qe(e){return"tabWidth"in e||"singleQuote"in e||"semi"in e?{indent:e.tabWidth||2,quotes:e.singleQuote?"single":"double",semi:e.semi??!0}:!1}function Uo(e={},...r){let{gitignore:t=!0,isInEditor:n=ve,nextjs:s=Ce,react:a=ke,reactQuery:c=Ie,regexp:p=!0,tailwindcss:I=Se,typescript:y=je,unicorn:g=!0}=e,h=typeof e.prettier=="object"?e.prettier:{},m=qe(h),i=[];if(t&&(typeof t!="boolean"?i.push(o(import("eslint-config-flat-gitignore")).then(f=>[f({name:"ncontiero/gitignore",...t})])):i.push(o(import("eslint-config-flat-gitignore")).then(f=>[f({name:"ncontiero/gitignore",strict:!1})]))),y||(e.ignores?e.ignores.push(w,O):e.ignores=[w,O]),i.push(z(e.ignores),ee({overrides:u(e,"javascript")}),K(),se(),Z({nextJs:!!s}),ce(),ue(),E(),le(),$()),g&&i.push(be(g===!0?{regexp:!!p}:g)),y&&i.push(Oe({...B(e,"typescript"),overrides:u(e,"typescript")})),(e.jsonc??!0)&&i.push(ie({overrides:u(e,"jsonc"),style:m}),ye(),ge()),(e.yaml??!0)&&i.push(he({overrides:u(e,"yaml"),style:m})),(e.toml??!0)&&i.push(we({overrides:u(e,"toml"),style:m})),(e.markdown??!0)&&i.push(ae({overrides:u(e,"markdown")})),p&&i.push(de(typeof p=="boolean"?{}:p)),a&&i.push(fe({overrides:u(e,"react"),reactQuery:!!c,typescript:!!y})),s&&i.push(pe({overrides:u(e,"nextjs")})),I&&i.push(xe({isInEditor:n,...B(e,"tailwindcss"),overrides:u(e,"tailwindcss")})),(e.prettier??!0)&&i.push(me(h)),"files"in e)throw new Error('[@ncontiero/eslint-config] The first argument should not contain the "files" property as the options are supposed to be global. Place it in the second or later config instead.');let G=Me.reduce((f,P)=>(P in e&&(f[P]=e[P]),f),{});return Object.keys(G).length>0&&i.push([G]),ne(...i,...r)}export{pr as GLOB_ALL_SRC,nr as GLOB_CSS,Te as GLOB_DIST,Y as GLOB_EXCLUDE,k as GLOB_HTML,H as GLOB_JS,L as GLOB_JSON,T as GLOB_JSON5,W as GLOB_JSONC,tr as GLOB_JSX,ir as GLOB_LESS,Re as GLOB_LOCKFILE,d as GLOB_MARKDOWN,X as GLOB_MARKDOWN_CODE,Q as GLOB_MARKDOWN_IN_MARKDOWN,Le as GLOB_NODE_MODULES,sr as GLOB_POSTCSS,j as GLOB_REACT,ar as GLOB_SCSS,l as GLOB_SRC,x as GLOB_SRC_EXT,Fe as GLOB_STYLE,V as GLOB_TOML,w as GLOB_TS,O as GLOB_TSX,R as GLOB_YAML,br as combine,E as command,K as comments,ne as composer,$ as deMorgan,te as ensurePackages,u as getOverrides,Ce as hasNextJs,ke as hasReact,Se as hasTailwind,Ie as hasTanStackReactQuery,je as hasTypeScript,z as ignores,Z as imports,o as interopDefault,ve as isInEditorEnv,ee as javascript,se as jsdoc,ie as jsonc,ae as markdown,Uo as ncontiero,pe as nextJs,ce as node,oe as parserPlain,le as perfectionist,me as prettier,ue as promise,fe as react,de as regexp,B as resolveSubOptions,C as restrictedSyntaxJs,ye as sortPackageJson,ge as sortTsconfig,xe as tailwindcss,hr as toArray,we as toml,Oe as typescript,be as unicorn,he as yml};
|
|
1
|
+
import De from"eslint-plugin-command/config";function A(){return[{...De(),name:"ncontiero/command/rules"}]}import{default as M}from"@eslint-community/eslint-plugin-eslint-comments";import{default as C}from"eslint-plugin-antfu";import{default as q}from"eslint-plugin-de-morgan";import{default as N}from"eslint-plugin-import-x";import{default as J}from"eslint-plugin-n";import{default as U}from"eslint-plugin-perfectionist";import{default as T}from"eslint-plugin-unicorn";import{default as H}from"eslint-plugin-unused-imports";function K(){return[{name:"ncontiero/comments/rules",plugins:{"eslint-comments":M},rules:{"eslint-comments/disable-enable-pair":["error",{allowWholeFile:!0}],"eslint-comments/no-aggregating-enable":"error","eslint-comments/no-duplicate-disable":"error","eslint-comments/no-unlimited-disable":"error","eslint-comments/no-unused-enable":"error"}}]}function $(){return[{...q.configs.recommended,name:"ncontiero/de-morgan"}]}var h="?([cm])[jt]s?(x)",m="**/*.?([cm])[jt]s?(x)",W="**/*.?([cm])js",pr="**/*.?([cm])jsx",O="**/*.?([cm])ts",b="**/*.?([cm])tsx",g="**/*.?([cm])?(j|t)sx",_e="**/*.{c,le,sc}ss",Q="**/*.css",V="**/*.{p,post}css",X="**/*.less",Y="**/*.scss",R="**/*.json",D="**/*.json5",z="**/*.jsonc",f="**/*.md",Z="**/*.md/*.md",_="**/*.y?(a)ml",ee="**/*.toml",y="**/*.htm?(l)",re=`${f}/${m}`,lr=[m,_e,R,D,f,_,y],Be="**/node_modules",Ge="**/dist",Ee=["**/package-lock.json","**/yarn.lock","**/pnpm-lock.yaml","**/bun.lockb"],oe=[Be,Ge,...Ee,"**/output","**/coverage","**/temp","**/.temp","**/tmp","**/.tmp","**/.history","**/fixtures","**/.git","**/.vitepress/cache","**/.nuxt","**/.next","**/.vercel","**/.contentlayer","**/.changeset","**/.idea","**/.cache","**/.output","**/.vite-inspect","**/.yarn","**/next-env.d.ts","**/.nitro","**/CHANGELOG*.md","**/*.min.*","**/LICENSE*","**/__snapshots__","**/auto-import?(s).d.ts","**/components.d.ts"];import{isPackageExists as te}from"local-pkg";var Ae=te("@ncontiero/eslint-config"),v={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 ur(...e){return(await Promise.all(e)).flat()}async function o(e){let r=await e;return r.default||r}function ne(e){if(process.env.CI||!process.stdout.isTTY||!Ae)return;let r=e.filter(t=>t&&!te(t));if(r.length!==0)throw new Error(`This package(s) are required for this config: ${r.join(", ")}. Please install them.`)}async function se(...e){let r=[],n=(await Promise.all(e)).flat();return r=[...r,...n],r}function fr(e){return Array.isArray(e)?e:[e]}async function ie(e){let{overrides:r={}}=e,[t,n]=await Promise.all([o(import("@html-eslint/parser")),o(import("@html-eslint/eslint-plugin"))]),s=e.templateEngineSyntax??{"{{":"}}","{%":"%}"};return[{files:[y],languageOptions:{parser:t,parserOptions:{templateEngineSyntax:s}},name:"ncontiero/html/setup",plugins:{html:n}},{files:[y],name:"ncontiero/html/rules",rules:{"html/attrs-newline":["warn",{ifAttrsMoreThan:5}],"html/element-newline":["warn",{inline:["$inline"]}],"html/indent":["warn",2],"html/lowercase":"warn","html/no-aria-hidden-body":"error","html/no-aria-hidden-on-focusable":"warn","html/no-duplicate-attrs":"error","html/no-duplicate-class":"warn","html/no-duplicate-id":"error","html/no-duplicate-in-head":"error","html/no-empty-headings":"warn","html/no-extra-spacing-attrs":["warn",{disallowInAssignment:!0,disallowMissing:!0,enforceBeforeSelfClose:!0}],"html/no-extra-spacing-text":"warn","html/no-heading-inside-button":"warn","html/no-ineffective-attrs":"warn","html/no-invalid-entity":"warn","html/no-invalid-role":"warn","html/no-multiple-empty-lines":["warn",{max:1}],"html/no-multiple-h1":"error","html/no-nested-interactive":"error","html/no-non-scalable-viewport":"warn","html/no-obsolete-tags":"error","html/no-script-style-type":"warn","html/no-target-blank":"error","html/no-trailing-spaces":"warn","html/quotes":"warn","html/require-button-type":"warn","html/require-closing-tags":["warn",{selfClosing:"always"}],"html/require-doctype":"error","html/require-form-method":"warn","html/require-img-alt":"warn","html/require-lang":"warn","html/require-li-container":"warn","html/require-meta-charset":"warn","html/require-meta-viewport":"warn","html/require-title":"warn","html/sort-attrs":["warn",{priority:["name","content","id","type",{pattern:"data-.*"},"class","style"]}],"html/use-baseline":"error",...r}}]}function ae(e=[]){return[{ignores:[...oe,...e],name:"ncontiero/global-ignores"}]}function pe(e={}){let{nextJs:r=!1}=e;return[{name:"ncontiero/imports/rules",plugins:{antfu:C,import:N},rules:{"antfu/import-dedupe":"error","import/first":"error","import/newline-after-import":["error",{count:1}],"import/no-default-export":"error","import/no-duplicates":"error","import/no-mutable-exports":"error","import/no-named-default":"error","import/no-self-import":"error","import/no-webpack-loader-syntax":"error"}},{files:[`**/*config*.${h}`,`**/{views,pages,routes,middleware,plugins,api,app}/${m}`,r?"{,src/}middleware.{ts,js}":"","**/{index,vite,esbuild,rollup,rolldown,webpack,rspack}.ts","**/*.d.ts",`${f}/**`,"**/.prettierrc*"],name:"ncontiero/imports/allow-default-export",rules:{"import/no-default-export":"off"}}]}import B from"globals";var S=["ForInStatement","LabeledStatement","WithStatement"];function le(e={}){let{overrides:r={}}=e;return[{languageOptions:{ecmaVersion:"latest",globals:{...B.browser,...B.es2026,...B.node,document:"readonly",navigator:"readonly",window:"readonly"},parserOptions:{ecmaFeatures:{jsx:!0},ecmaVersion:"latest",sourceType:"module"},sourceType:"module"},linterOptions:{reportUnusedDisableDirectives:!0},name:"ncontiero/javascript/rules",plugins:{antfu:C,"unused-imports":H},rules:{"array-callback-return":"error","block-scoped-var":"error","constructor-super":"error","dot-notation":"warn",eqeqeq:["error","smart"],"for-direction":"error","getter-return":"error","no-alert":"warn","no-async-promise-executor":"error","no-case-declarations":"error","no-class-assign":"error","no-compare-neg-zero":"error","no-cond-assign":"error","no-console":["warn",{allow:["warn","error"]}],"no-const-assign":"error","no-constant-condition":"error","no-control-regex":"error","no-debugger":"warn","no-delete-var":"error","no-dupe-args":"error","no-dupe-class-members":"error","no-dupe-else-if":"error","no-dupe-keys":"error","no-duplicate-case":"error","no-duplicate-imports":"error","no-empty":["error",{allowEmptyCatch:!0}],"no-empty-character-class":"error","no-empty-pattern":"error","no-ex-assign":"error","no-extra-boolean-cast":"error","no-fallthrough":["warn",{commentPattern:"break[\\s\\w]*omitted"}],"no-func-assign":"error","no-global-assign":"error","no-import-assign":"error","no-inner-declarations":"error","no-invalid-regexp":"error","no-irregular-whitespace":"error","no-lonely-if":"error","no-loss-of-precision":"error","no-misleading-character-class":"error","no-multi-str":"error","no-new-native-nonconstructor":"error","no-nonoctal-decimal-escape":"error","no-obj-calls":"error","no-octal":"error","no-prototype-builtins":"error","no-redeclare":"error","no-regex-spaces":"error","no-restricted-syntax":["error",...S],"no-self-assign":"error","no-setter-return":"error","no-shadow-restricted-names":"error","no-sparse-arrays":"error","no-this-before-super":"error","no-undef":"error","no-unexpected-multiline":"error","no-unreachable":"error","no-unsafe-finally":"error","no-unsafe-negation":"error","no-unsafe-optional-chaining":"error","no-unused-expressions":["error",{allowShortCircuit:!0,allowTaggedTemplates:!0,allowTernary:!0}],"no-unused-labels":"error","no-unused-vars":"off","no-useless-backreference":"error","no-useless-catch":"error","no-useless-computed-key":"error","no-useless-constructor":"error","no-useless-escape":"error","no-useless-rename":"error","no-var":"error","no-void":"error","no-with":"error","object-shorthand":["error","always",{avoidQuotes:!0,ignoreConstructors:!1}],"prefer-arrow-callback":["error",{allowNamedFunctions:!1,allowUnboundThis:!0}],"prefer-const":["warn",{destructuring:"all",ignoreReadBeforeAssign:!0}],"prefer-exponentiation-operator":"error","prefer-regex-literals":["error",{disallowRedundantWrapping:!0}],"prefer-rest-params":"error","prefer-spread":"error","prefer-template":"error","require-await":"error","require-yield":"error","unicode-bom":["error","never"],"unused-imports/no-unused-imports":"warn","unused-imports/no-unused-vars":["error",{args:"after-used",ignoreRestSiblings:!0}],"use-isnan":["error",{enforceForIndexOf:!0,enforceForSwitchCase:!0}],"valid-typeof":["error",{requireStringLiterals:!0}],"vars-on-top":"error",...r}},{files:[`**/{scripts,cli}/${m}`,`**/cli.${h}`],name:"ncontiero/javascript/cli-rules",rules:{"no-console":"off"}},{files:[`**/*.{test,spec}.${h}`],name:"ncontiero/javascript/test-rules",rules:{"no-unused-expressions":"off","unicorn/consistent-function-scoping":"off"}}]}async function ce(){return[{name:"ncontiero/jsdoc/rules",plugins:{jsdoc:await o(import("eslint-plugin-jsdoc"))},rules:{"jsdoc/check-access":"warn","jsdoc/check-param-names":"warn","jsdoc/check-property-names":"warn","jsdoc/check-types":"warn","jsdoc/empty-tags":"warn","jsdoc/implements-on-classes":"warn","jsdoc/no-defaults":"warn","jsdoc/no-multi-asterisks":"warn","jsdoc/require-param-name":"warn","jsdoc/require-property":"warn","jsdoc/require-property-description":"warn","jsdoc/require-property-name":"warn","jsdoc/require-returns-check":"warn","jsdoc/require-returns-description":"warn","jsdoc/require-yields-check":"warn"}}]}async function me(e={}){let{files:r=[R,D,z],overrides:t={},style:n=!0}=e,{indent:s=2}=typeof n=="boolean"?{}:n,[a,p]=await Promise.all([o(import("eslint-plugin-jsonc")),o(import("jsonc-eslint-parser"))]);return[{name:"ncontiero/jsonc/setup",plugins:{jsonc:a}},{files:r,languageOptions:{parser:p},name:"ncontiero/jsonc/rules",rules:{...a.configs["recommended-with-jsonc"].rules,"jsonc/array-bracket-spacing":["error","never"],"jsonc/comma-style":["error","last"],"jsonc/indent":["error",s],"jsonc/key-spacing":["error",{afterColon:!0,beforeColon:!1}],"jsonc/object-curly-newline":["error",{consistent:!0,multiline:!0}],"jsonc/object-curly-spacing":["error","always"],"jsonc/object-property-newline":["error",{allowAllPropertiesOnSameLine:!0}],"jsonc/quote-props":"off","jsonc/quotes":"off",...t}}]}import{mergeProcessors as Me,processorPassThrough as qe}from"eslint-merge-processors";async function ue(e={}){let{files:r=[f],overrides:t={}}=e,n=await o(import("@eslint/markdown"));return[{name:"ncontiero/markdown/setup",plugins:{markdown:n}},{files:r,ignores:[Z],name:"ncontiero/markdown/processor",processor:Me([n.processors.markdown,qe])},{files:r,languageOptions:{parser:v},name:"ncontiero/markdown/parser"},{files:[re],languageOptions:{parserOptions:{ecmaFeatures:{impliedStrict:!0}}},name:"ncontiero/markdown/rules",rules:{"@typescript-eslint/comma-dangle":"off","@typescript-eslint/consistent-type-imports":"off","@typescript-eslint/no-extraneous-class":"off","@typescript-eslint/no-namespace":"off","@typescript-eslint/no-redeclare":"off","@typescript-eslint/no-require-imports":"off","@typescript-eslint/no-unused-expressions":"off","@typescript-eslint/no-unused-vars":"off","@typescript-eslint/no-use-before-define":"off","import/newline-after-import":"off","no-alert":"off","no-console":"off","no-restricted-imports":"off","no-undef":"off","no-unused-expressions":"off","no-unused-vars":"off","node/prefer-global/buffer":"off","node/prefer-global/process":"off","unused-imports/no-unused-imports":"off","unused-imports/no-unused-vars":"off",...t}}]}async function fe(e={}){let{files:r=[g],overrides:t={}}=e,n=await o(import("@next/eslint-plugin-next"));return[{files:r,name:"ncontiero/nextjs/rules",plugins:{nextjs:n},rules:{"nextjs/google-font-display":["warn"],"nextjs/google-font-preconnect":["warn"],"nextjs/inline-script-id":["error"],"nextjs/next-script-for-ga":["warn"],"nextjs/no-assign-module-variable":["error"],"nextjs/no-async-client-component":"warn","nextjs/no-before-interactive-script-outside-document":["warn"],"nextjs/no-css-tags":["warn"],"nextjs/no-document-import-in-page":["error"],"nextjs/no-duplicate-head":["error"],"nextjs/no-head-element":["warn"],"nextjs/no-head-import-in-document":["error"],"nextjs/no-html-link-for-pages":["warn"],"nextjs/no-img-element":["warn"],"nextjs/no-page-custom-font":["warn"],"nextjs/no-script-component-in-head":["error"],"nextjs/no-styled-jsx-in-document":["warn"],"nextjs/no-sync-scripts":["warn"],"nextjs/no-title-in-document-head":["warn"],"nextjs/no-typos":["warn"],"nextjs/no-unwanted-polyfillio":["warn"],...t}}]}function de(){return[{name:"ncontiero/node/rules",plugins:{node:J},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/es-builtins":"error","node/no-unsupported-features/es-syntax":"error","node/no-unsupported-features/node-builtins":"error","node/prefer-global/console":["error","always"],"node/prefer-global/process":["error","always"],"node/prefer-global/url":["error","always"],"node/prefer-global/url-search-params":["error","always"],"node/process-exit-as-throw":"error"}}]}function ge(){return[{name:"ncontiero/perfectionist/rules",plugins:{perfectionist:U},rules:{"perfectionist/sort-exports":["warn",{type:"natural"}],"perfectionist/sort-imports":["warn",{customGroups:{type:{react:["^react$","^react-(?!.*.css$).+"]},value:{react:["^react$","^react-(?!.*.css$).+"]}},groups:["side-effect-style","style","type","internal-type",["parent-type","sibling-type","index-type"],"builtin","react","external","internal",["parent","sibling","index"],"object","unknown"],internalPattern:["^[~@#]/.*"],newlinesBetween:"ignore",type:"natural"}],"perfectionist/sort-named-exports":["warn",{groupKind:"types-first"}],"perfectionist/sort-named-imports":["warn",{groupKind:"types-first"}]}}]}async function ye(e={}){return[{name:"ncontiero/prettier/setup",plugins:{prettier:await o(import("eslint-plugin-prettier"))}},{files:[m],name:"ncontiero/prettier/disables",rules:{"antfu/consistent-list-newline":"off","arrow-body-style":"off",curly:"off","no-unexpected-multiline":"off","prefer-arrow-callback":"off","unicorn/empty-brace-spaces":"off","unicorn/no-nested-ternary":"off","unicorn/number-literal-case":"off","unicorn/template-indent":"off"}},{files:[m],name:"ncontiero/prettier/rules",rules:{"prettier/prettier":["warn",e]}},{files:[f],languageOptions:{parser:v},name:"ncontiero/prettier/markdown",rules:{"prettier/prettier":["warn",{...e,parser:"markdown"}]}},{files:[Q,V],languageOptions:{parser:v},name:"ncontiero/prettier/css",rules:{"prettier/prettier":["warn",{...e,parser:"css"}]}},{files:[Y],name:"ncontiero/prettier/scss",rules:{"prettier/prettier":["warn",{...e,parser:"scss"}]}},{files:[X],name:"ncontiero/prettier/less",rules:{"prettier/prettier":["warn",{...e,parser:"less"}]}}]}async function xe(){return[{...(await o(import("eslint-plugin-promise"))).configs["flat/recommended"],name:"ncontiero/promise/setup"},{name:"ncontiero/promise/rules",rules:{"promise/always-return":["error",{ignoreLastCallback:!0}],"promise/no-multiple-resolved":"warn"}}]}import{isPackageExists as G}from"local-pkg";var Ne=["vite"],Je=["@react-router/node","@react-router/react","@react-router/serve","@react-router/dev"],Ue=["next"];async function we(e={}){let{files:r=[g],overrides:t={},reactQuery:n,typescript:s}=e;n&&ne(["@tanstack/eslint-plugin-query"]);let[a,p,u,L]=await Promise.all([o(import("eslint-plugin-jsx-a11y")),o(import("eslint-plugin-react")),o(import("eslint-plugin-react-hooks")),o(import("eslint-plugin-react-refresh"))]),x=Ne.some(c=>G(c)),w=Je.some(c=>G(c)),k=Ue.some(c=>G(c));return[{files:r,name:"ncontiero/react/setup",plugins:{"jsx-a11y":a,react:p,"react-hooks":u,"react-refresh":L},settings:{react:{version:"detect"}}},n?{...(await o(import("@tanstack/eslint-plugin-query"))).configs["flat/recommended"][0],name:"ncontiero/tanstack-query"}:{},{files:r,languageOptions:{parserOptions:{ecmaFeatures:{jsx:!0}}},name:"ncontiero/react/rules",rules:{"react-hooks/component-hook-factories":"warn","react-hooks/error-boundaries":"warn","react-hooks/exhaustive-deps":"warn","react-hooks/globals":"warn","react-hooks/immutability":"warn","react-hooks/incompatible-library":"warn","react-hooks/preserve-manual-memoization":"warn","react-hooks/purity":"warn","react-hooks/refs":"warn","react-hooks/rules-of-hooks":"error","react-hooks/set-state-in-effect":"warn","react-hooks/set-state-in-render":"warn","react-hooks/static-components":"warn","react-hooks/unsupported-syntax":"warn","react-hooks/use-memo":"warn","react-refresh/only-export-components":["warn",{allowConstantExport:x,allowExportNames:[...k?["experimental_ppr","dynamic","dynamicParams","revalidate","fetchCache","runtime","preferredRegion","maxDuration","generateStaticParams","metadata","generateMetadata","viewport","generateViewport"]:[],...w?["meta","links","headers","loader","action","clientLoader","clientAction","handle","shouldRevalidate"]:[]]}],"react/boolean-prop-naming":["off",{rule:"^(is|has|are|can|should|did|will)[A-Z]([A-Za-z0-9])+",validateNested:!0}],"react/button-has-type":["error",{button:!0,reset:!1,submit:!0}],"react/display-name":["error",{ignoreTranspilerName:!1}],"react/hook-use-state":["error"],"react/iframe-missing-sandbox":["error"],"react/jsx-boolean-value":["error","never"],"react/jsx-filename-extension":["warn",{extensions:[".tsx"]}],"react/jsx-fragments":["error","syntax"],"react/jsx-handler-names":["error",{eventHandlerPrefix:"handle",eventHandlerPropPrefix:"on"}],"react/jsx-key":["error",{checkFragmentShorthand:!0,checkKeyMustBeforeSpread:!0,warnOnDuplicates:!0}],"react/jsx-no-bind":["error",{allowArrowFunctions:!0}],"react/jsx-no-comment-textnodes":"error","react/jsx-no-constructed-context-values":"error","react/jsx-no-duplicate-props":["error"],"react/jsx-no-leaked-render":["error"],"react/jsx-no-script-url":["error",[{name:"Link",props:["to"]}]],"react/jsx-no-target-blank":["error",{forms:!0,links:!0,warnOnSpreadAttributes:!0}],"react/jsx-no-undef":"error","react/jsx-no-useless-fragment":"error","react/jsx-uses-react":"error","react/jsx-uses-vars":"error","react/no-access-state-in-setstate":"error","react/no-array-index-key":"error","react/no-arrow-function-lifecycle":"error","react/no-children-prop":"error","react/no-danger":"error","react/no-danger-with-children":"error","react/no-deprecated":"error","react/no-did-update-set-state":"error","react/no-direct-mutation-state":"error","react/no-find-dom-node":"error","react/no-invalid-html-attribute":"error","react/no-is-mounted":"error","react/no-namespace":"error","react/no-object-type-as-default-prop":"error","react/no-redundant-should-component-update":"error","react/no-render-return-value":"error","react/no-string-refs":["error",{noTemplateLiterals:!0}],"react/no-this-in-sfc":["error"],"react/no-typos":["error"],"react/no-unescaped-entities":"error","react/no-unknown-property":"error","react/no-unstable-nested-components":["error"],"react/no-unused-class-component-methods":["error"],"react/no-unused-prop-types":["error",{customValidators:[],skipShapeProps:!0}],"react/no-unused-state":["error"],"react/no-will-update-set-state":["error"],"react/prefer-es6-class":["error","always"],"react/prefer-exact-props":["error"],"react/prefer-read-only-props":["error"],"react/prefer-stateless-function":["error",{ignorePureComponents:!0}],"react/prop-types":["error",{customValidators:[],ignore:[],skipUndeclared:!1}],"react/react-in-jsx-scope":"off","react/require-render-return":"error","react/self-closing-comp":["error",{component:!0,html:!0}],"react/sort-default-props":["error"],"react/state-in-constructor":["error","never"],"react/static-property-placement":["error","property assignment"],"react/style-prop-object":["error",{allow:["FormattedNumber"]}],"react/void-dom-elements-no-children":["error"],...s?{"react/jsx-no-undef":"off","react/prop-types":"off"}:{},"jsx-a11y/alt-text":["warn",{area:[],elements:["img","object","area",'input[type="image"]'],img:[],'input[type="image"]':[],object:[]}],"jsx-a11y/anchor-has-content":["warn",{components:[]}],"jsx-a11y/anchor-is-valid":["warn",{aspects:["noHref","invalidHref","preferButton"],components:["Link"],specialLink:["to"]}],"jsx-a11y/aria-activedescendant-has-tabindex":["warn"],"jsx-a11y/aria-props":["warn"],"jsx-a11y/aria-proptypes":["warn"],"jsx-a11y/aria-role":["warn",{ignoreNonDOM:!1}],"jsx-a11y/aria-unsupported-elements":["warn"],"jsx-a11y/autocomplete-valid":["off",{inputComponents:[]}],"jsx-a11y/click-events-have-key-events":["warn"],"jsx-a11y/control-has-associated-label":["warn",{controlComponents:[],depth:5,ignoreElements:["audio","canvas","embed","input","textarea","tr","video"],ignoreRoles:["grid","listbox","menu","menubar","radiogroup","row","tablist","toolbar","tree","treegrid"],labelAttributes:["label"]}],"jsx-a11y/heading-has-content":["warn",{components:[""]}],"jsx-a11y/html-has-lang":["warn"],"jsx-a11y/iframe-has-title":["warn"],"jsx-a11y/img-redundant-alt":["warn"],"jsx-a11y/interactive-supports-focus":["warn"],"jsx-a11y/label-has-associated-control":"warn","jsx-a11y/lang":["warn"],"jsx-a11y/media-has-caption":["warn",{audio:[],track:[],video:[]}],"jsx-a11y/mouse-events-have-key-events":["warn"],"jsx-a11y/no-access-key":["warn"],"jsx-a11y/no-autofocus":["warn",{ignoreNonDOM:!0}],"jsx-a11y/no-distracting-elements":["warn",{elements:["marquee","blink"]}],"jsx-a11y/no-interactive-element-to-noninteractive-role":["warn",{tr:["none","presentation"]}],"jsx-a11y/no-noninteractive-element-interactions":["warn",{handlers:["onClick","onMouseDown","onMouseUp","onKeyPress","onKeyDown","onKeyUp"]}],"jsx-a11y/no-noninteractive-element-to-interactive-role":["warn",{li:["menuitem","option","row","tab","treeitem"],ol:["listbox","menu","menubar","radiogroup","tablist","tree","treegrid"],table:["grid"],td:["gridcell"],ul:["listbox","menu","menubar","radiogroup","tablist","tree","treegrid"]}],"jsx-a11y/no-noninteractive-tabindex":["warn",{roles:["tabpanel"],tags:[]}],"jsx-a11y/no-redundant-roles":["warn"],"jsx-a11y/no-static-element-interactions":["off",{handlers:["onClick","onMouseDown","onMouseUp","onKeyPress","onKeyDown","onKeyUp"]}],"jsx-a11y/role-has-required-aria-props":["warn"],"jsx-a11y/role-supports-aria-props":["warn"],"jsx-a11y/scope":["warn"],"jsx-a11y/tabindex-no-positive":["warn"],...t}}]}import{configs as He}from"eslint-plugin-regexp";function he(e={}){let r=He["flat/recommended"],t={...r.rules,...e.overrides};return[{...r,name:"ncontiero/regexp/rules",rules:t}]}function Oe(){return[{files:["**/package.json"],name:"ncontiero/sort/package-json",rules:{"jsonc/sort-array-values":["error",{order:{type:"asc"},pathPattern:"^files$"}],"jsonc/sort-keys":["error",{order:["publisher","name","displayName","type","version","private","packageManager","description","author","contributors","license","funding","homepage","repository","bugs","keywords","categories","sideEffects","imports","exports","main","module","unpkg","jsdelivr","browser","types","typesVersions","bin","icon","files","directories","publishConfig","scripts","peerDependencies","peerDependenciesMeta","optionalDependencies","dependencies","devDependencies","engines","prisma","config","pnpm","overrides","resolutions","husky","lint-staged","eslintConfig","prettier"],pathPattern:"^$"},{order:{type:"asc"},pathPattern:"^(?:dev|peer|optional|bundled)?[Dd]ependencies(Meta)?$"},{order:["types","require","import","default"],pathPattern:"^exports.*$"},{order:{type:"asc"},pathPattern:"^(?:resolutions|overrides|pnpm.overrides)$"},{order:{type:"asc"},pathPattern:"^workspaces\\.catalog$"},{order:{type:"asc"},pathPattern:"^workspaces\\.catalogs\\.[^.]+$"}]}}]}function be(){return[{files:["**/[jt]sconfig.json","**/[jt]sconfig.*.json"],name:"ncontiero/sort/tsconfig",rules:{"jsonc/sort-keys":["error",{order:["extends","compilerOptions","references","files","include","exclude"],pathPattern:"^$"},{order:["incremental","composite","tsBuildInfoFile","disableSourceOfProjectReferenceRedirect","disableSolutionSearching","disableReferencedProjectLoad","target","jsx","jsxFactory","jsxFragmentFactory","jsxImportSource","lib","moduleDetection","noLib","reactNamespace","useDefineForClassFields","emitDecoratorMetadata","experimentalDecorators","libReplacement","baseUrl","rootDir","rootDirs","customConditions","module","moduleResolution","moduleSuffixes","noResolve","paths","resolveJsonModule","resolvePackageJsonExports","resolvePackageJsonImports","typeRoots","types","allowArbitraryExtensions","allowImportingTsExtensions","allowUmdGlobalAccess","allowJs","checkJs","maxNodeModuleJsDepth","strict","strictBindCallApply","strictFunctionTypes","strictNullChecks","strictPropertyInitialization","allowUnreachableCode","allowUnusedLabels","alwaysStrict","exactOptionalPropertyTypes","noFallthroughCasesInSwitch","noImplicitAny","noImplicitOverride","noImplicitReturns","noImplicitThis","noPropertyAccessFromIndexSignature","noUncheckedIndexedAccess","noUnusedLocals","noUnusedParameters","useUnknownInCatchVariables","declaration","declarationDir","declarationMap","downlevelIteration","emitBOM","emitDeclarationOnly","importHelpers","importsNotUsedAsValues","inlineSourceMap","inlineSources","isolatedDeclarations","mapRoot","newLine","noEmit","noEmitHelpers","noEmitOnError","outDir","outFile","preserveConstEnums","preserveValueImports","removeComments","sourceMap","sourceRoot","stripInternal","allowSyntheticDefaultImports","esModuleInterop","forceConsistentCasingInFileNames","isolatedModules","preserveSymlinks","verbatimModuleSyntax","erasableSyntaxOnly","skipDefaultLibCheck","skipLibCheck"],pathPattern:"^compilerOptions$"}]}}]}import I from"path";async function ve(e={}){let{overrides:r={}}=e,t=p=>I.isAbsolute(p)?p:I.resolve(process.cwd(),p),n=t(e.cssGlobalPath??I.join("src","app","globals.css")),s=t(e.configPath??I.join("tailwind.config.ts"));return[{name:"ncontiero/tailwindcss/setup",plugins:{tailwindcss:await o(import("eslint-plugin-better-tailwindcss"))},settings:{tailwindcss:{entryPoint:n,tailwindConfig:s}}},{files:[g,y],name:"ncontiero/tailwindcss/rules",rules:{"tailwindcss/enforce-consistent-class-order":"warn","tailwindcss/enforce-consistent-important-position":"warn","tailwindcss/enforce-consistent-line-wrapping":["warn",{group:"never",preferSingleLine:!0,printWidth:120}],"tailwindcss/enforce-consistent-variable-syntax":"error","tailwindcss/enforce-shorthand-classes":"warn","tailwindcss/no-conflicting-classes":"error","tailwindcss/no-deprecated-classes":"error","tailwindcss/no-duplicate-classes":"error","tailwindcss/no-restricted-classes":"error","tailwindcss/no-unknown-classes":"warn","tailwindcss/no-unnecessary-whitespace":"warn",...r}}]}async function je(e={}){let{files:r=[ee],overrides:t={},style:n=!0}=e,{indent:s=2}=typeof n=="boolean"?{}:n,[a,p]=await Promise.all([o(import("eslint-plugin-toml")),o(import("toml-eslint-parser"))]);return[{name:"ncontiero/toml/setup",plugins:{toml:a}},{files:r,languageOptions:{parser:p},name:"ncontiero/toml/rules",rules:{"toml/array-bracket-newline":"error","toml/array-bracket-spacing":"error","toml/array-element-newline":"off","toml/comma-style":"error","toml/indent":["error",s],"toml/inline-table-curly-spacing":"error","toml/key-spacing":"error","toml/keys-order":"error","toml/no-space-dots":"error","toml/no-unreadable-number-separator":"error","toml/padding-line-between-pairs":"error","toml/padding-line-between-tables":"error","toml/precision-of-fractional-seconds":"error","toml/precision-of-integer":"error","toml/quoted-keys":"error","toml/spaced-comment":"error","toml/table-bracket-spacing":"error","toml/tables-order":"error","toml/vue-custom-block/no-parsing-error":"error","unicorn/filename-case":"off",...t}}]}async function ke(e={}){let{files:r=[O,b],overrides:t={},parserOptions:n={}}=e,[s,a]=await Promise.all([o(import("@typescript-eslint/eslint-plugin")),o(import("@typescript-eslint/parser"))]);return[{name:"ncontiero/typescript/setup",plugins:{"@typescript-eslint":s}},{files:r,languageOptions:{parser:a,parserOptions:{sourceType:"module",...n}},name:"ncontiero/typescript/parser"},{files:r,name:"ncontiero/typescript/rules",rules:{...s.configs["eslint-recommended"].overrides[0].rules,...s.configs.recommended.rules,"@typescript-eslint/ban-ts-comment":["error",{"ts-ignore":"allow-with-description"}],"@typescript-eslint/consistent-type-assertions":["error",{assertionStyle:"as",objectLiteralTypeAssertions:"allow-as-parameter"}],"@typescript-eslint/consistent-type-imports":["error",{disallowTypeAnnotations:!1,fixStyle:"inline-type-imports"}],"@typescript-eslint/method-signature-style":["error","property"],"@typescript-eslint/no-empty-object-type":["error",{allowInterfaces:"always"}],"@typescript-eslint/no-explicit-any":"off","@typescript-eslint/no-import-type-side-effects":"error","@typescript-eslint/no-non-null-assertion":"off","@typescript-eslint/no-redeclare":"error","@typescript-eslint/no-unused-expressions":["error",{allowShortCircuit:!0,allowTaggedTemplates:!1,allowTernary:!0,enforceForJSX:!0}],"@typescript-eslint/no-unused-vars":"off","@typescript-eslint/no-useless-constructor":"error","@typescript-eslint/no-wrapper-object-types":"error","@typescript-eslint/prefer-as-const":"warn","@typescript-eslint/prefer-literal-enum-member":["error",{allowBitwiseExpressions:!0}],"no-restricted-syntax":["error",...S,"TSEnumDeclaration[const=true]"],...t}},{files:["**/*.d.ts"],name:"ncontiero/typescript/dts-rules",rules:{"eslint-comments/no-unlimited-disable":"off","import/no-duplicates":"off","no-restricted-syntax":["error",...S],"unused-imports/no-unused-vars":"off"}},{files:[W,"**/*.cjs"],name:"ncontiero/typescript/cjs-rules",rules:{"@typescript-eslint/no-require-imports":"off"}}]}function Ce(e={}){let{allRecommended:r,overrides:t={},regexp:n=!1}=e;return[{name:"ncontiero/unicorn/rules",plugins:{unicorn:T},rules:{...r?T.configs.recommended.rules:{"unicorn/better-regex":n?"off":"error","unicorn/catch-error-name":"error","unicorn/consistent-date-clone":"error","unicorn/consistent-empty-array-spread":"error","unicorn/consistent-existence-index-check":"error","unicorn/consistent-function-scoping":"error","unicorn/custom-error-definition":"error","unicorn/error-message":"error","unicorn/escape-case":"error","unicorn/explicit-length-check":"error","unicorn/new-for-builtins":"error","unicorn/no-array-callback-reference":"error","unicorn/no-array-method-this-argument":"error","unicorn/no-await-in-promise-methods":"error","unicorn/no-console-spaces":"error","unicorn/no-for-loop":"error","unicorn/no-hex-escape":"error","unicorn/no-instanceof-builtins":"error","unicorn/no-invalid-remove-event-listener":"error","unicorn/no-lonely-if":"error","unicorn/no-negation-in-equality-check":"error","unicorn/no-new-array":"error","unicorn/no-new-buffer":"error","unicorn/no-single-promise-in-promise-methods":"error","unicorn/no-static-only-class":"error","unicorn/no-unnecessary-array-flat-depth":"error","unicorn/no-unnecessary-array-splice-count":"error","unicorn/no-unnecessary-await":"error","unicorn/no-unnecessary-slice-end":"error","unicorn/no-zero-fractions":"error","unicorn/number-literal-case":"error","unicorn/prefer-add-event-listener":"error","unicorn/prefer-array-find":"error","unicorn/prefer-array-flat-map":"error","unicorn/prefer-array-index-of":"error","unicorn/prefer-array-some":"error","unicorn/prefer-at":"error","unicorn/prefer-blob-reading-methods":"error","unicorn/prefer-class-fields":"error","unicorn/prefer-date-now":"error","unicorn/prefer-dom-node-append":"error","unicorn/prefer-dom-node-dataset":"error","unicorn/prefer-dom-node-remove":"error","unicorn/prefer-dom-node-text-content":"error","unicorn/prefer-includes":"error","unicorn/prefer-keyboard-event-key":"error","unicorn/prefer-math-min-max":"error","unicorn/prefer-math-trunc":"error","unicorn/prefer-modern-dom-apis":"error","unicorn/prefer-modern-math-apis":"error","unicorn/prefer-negative-index":"error","unicorn/prefer-node-protocol":"error","unicorn/prefer-number-properties":"error","unicorn/prefer-optional-catch-binding":"error","unicorn/prefer-prototype-methods":"error","unicorn/prefer-query-selector":"error","unicorn/prefer-reflect-apply":"error","unicorn/prefer-regexp-test":"error","unicorn/prefer-single-call":"error","unicorn/prefer-string-replace-all":"error","unicorn/prefer-string-slice":"error","unicorn/prefer-string-starts-ends-with":"error","unicorn/prefer-string-trim-start-end":"error","unicorn/prefer-type-error":"error","unicorn/throw-new-error":"error"},...t}}]}async function Se(e={}){let{files:r=[_],overrides:t={},style:n=!0}=e,{indent:s=2,quotes:a="double"}=typeof n=="boolean"?{}:n,[p,u]=await Promise.all([o(import("eslint-plugin-yml")),o(import("yaml-eslint-parser"))]);return[{name:"ncontiero/yml/setup",plugins:{yml:p}},{files:r,languageOptions:{parser:u},name:"ncontiero/yml/rules",rules:{"yml/block-mapping":"error","yml/block-mapping-question-indicator-newline":"error","yml/block-sequence":"error","yml/block-sequence-hyphen-indicator-newline":"error","yml/flow-mapping-curly-newline":"error","yml/flow-mapping-curly-spacing":"error","yml/flow-sequence-bracket-newline":"error","yml/flow-sequence-bracket-spacing":"error","yml/indent":["error",s],"yml/key-spacing":"error","yml/no-empty-document":"error","yml/no-empty-key":"error","yml/no-empty-sequence-entry":"error","yml/no-irregular-whitespace":"error","yml/no-tab-indent":"error","yml/plain-scalar":"error","yml/quotes":["error",{avoidEscape:!1,prefer:a}],"yml/spaced-comment":"error","yml/vue-custom-block/no-parsing-error":"error",...t}},{files:["pnpm-workspace.yaml"],name:"ncontiero/yml/pnpm-workspace",rules:{"yml/sort-keys":["error",{order:["packages","overrides","patchedDependencies","hoistPattern","catalog","catalogs","allowedDeprecatedVersions","allowNonAppliedPatches","allowUnusedPatches","configDependencies","ignoredBuiltDependencies","ignoredOptionalDependencies","ignorePatchFailures","neverBuiltDependencies","onlyBuiltDependencies","onlyBuiltDependenciesFile","packageExtensions","peerDependencyRules","supportedArchitectures"],pathPattern:"^$"},{order:{type:"asc"},pathPattern:".*"}]}}]}import{isPackageExists as j}from"local-pkg";var Ie=!!((process.env.VSCODE_PID||process.env.VSCODE_CWD||process.env.NVIM||process.env.JETBRAINS_IDE||process.env.VIM)&&!process.env.CI),Pe=j("typescript"),Le=j("react"),Fe=j("next"),Te=j("tailwindcss"),Re=j("@tanstack/react-query");var Ke=["name","languageOptions","linterOptions","processor","plugins","rules","settings"];function P(e,r){return typeof e[r]=="boolean"?{}:e[r]||{}}function l(e,r){let t=P(e,r);return{...("overrides"in e?e.overrides:{})?.[r],..."overrides"in t?t.overrides:{}}}function $e(e){return"tabWidth"in e||"singleQuote"in e||"semi"in e?{indent:e.tabWidth||2,quotes:e.singleQuote?"single":"double",semi:e.semi??!0}:!1}function Qo(e={},...r){let{gitignore:t=!0,isInEditor:n=Ie,nextjs:s=Fe,react:a=Le,reactQuery:p=Re,regexp:u=!0,tailwindcss:L=Te,typescript:x=Pe,unicorn:w=!0}=e,k=typeof e.prettier=="object"?e.prettier:{},c=$e(k),i=[];if(t&&(typeof t!="boolean"?i.push(o(import("eslint-config-flat-gitignore")).then(d=>[d({name:"ncontiero/gitignore",...t})])):i.push(o(import("eslint-config-flat-gitignore")).then(d=>[d({name:"ncontiero/gitignore",strict:!1})]))),x||(e.ignores?e.ignores.push(O,b):e.ignores=[O,b]),i.push(ae(e.ignores),le({overrides:l(e,"javascript")}),K(),ce(),pe({nextJs:!!s}),de(),xe(),A(),ge(),$()),w&&i.push(Ce(w===!0?{regexp:!!u}:w)),x&&i.push(ke({...P(e,"typescript"),overrides:l(e,"typescript")})),(e.jsonc??!0)&&i.push(me({overrides:l(e,"jsonc"),style:c}),Oe(),be()),(e.yaml??!0)&&i.push(Se({overrides:l(e,"yaml"),style:c})),(e.toml??!0)&&i.push(je({overrides:l(e,"toml"),style:c})),(e.markdown??!0)&&i.push(ue({overrides:l(e,"markdown")})),u&&i.push(he(typeof u=="boolean"?{}:u)),a&&i.push(we({overrides:l(e,"react"),reactQuery:!!p,typescript:!!x})),s&&i.push(fe({overrides:l(e,"nextjs")})),(e.html??!0)&&i.push(ie({...P(e,"html"),overrides:l(e,"html")})),L&&i.push(ve({isInEditor:n,...P(e,"tailwindcss"),overrides:l(e,"tailwindcss")})),(e.prettier??!0)&&i.push(ye(k)),"files"in e)throw new Error('[@ncontiero/eslint-config] The first argument should not contain the "files" property as the options are supposed to be global. Place it in the second or later config instead.');let E=Ke.reduce((d,F)=>(F in e&&(d[F]=e[F]),d),{});return Object.keys(E).length>0&&i.push([E]),se(...i,...r)}export{lr as GLOB_ALL_SRC,Q as GLOB_CSS,Ge as GLOB_DIST,oe as GLOB_EXCLUDE,y as GLOB_HTML,W as GLOB_JS,R as GLOB_JSON,D as GLOB_JSON5,z as GLOB_JSONC,pr as GLOB_JSX,X as GLOB_LESS,Ee as GLOB_LOCKFILE,f as GLOB_MARKDOWN,re as GLOB_MARKDOWN_CODE,Z as GLOB_MARKDOWN_IN_MARKDOWN,Be as GLOB_NODE_MODULES,V as GLOB_POSTCSS,g as GLOB_REACT,Y as GLOB_SCSS,m as GLOB_SRC,h as GLOB_SRC_EXT,_e as GLOB_STYLE,ee as GLOB_TOML,O as GLOB_TS,b as GLOB_TSX,_ as GLOB_YAML,ur as combine,A as command,K as comments,se as composer,$ as deMorgan,ne as ensurePackages,l as getOverrides,Fe as hasNextJs,Le as hasReact,Te as hasTailwind,Re as hasTanStackReactQuery,Pe as hasTypeScript,ie as html,ae as ignores,pe as imports,o as interopDefault,Ie as isInEditorEnv,le as javascript,ce as jsdoc,me as jsonc,ue as markdown,Qo as ncontiero,fe as nextJs,de as node,v as parserPlain,ge as perfectionist,ye as prettier,xe as promise,we as react,he as regexp,P as resolveSubOptions,S as restrictedSyntaxJs,Oe as sortPackageJson,be as sortTsconfig,ve as tailwindcss,fr as toArray,je as toml,ke as typescript,Ce as unicorn,Se as yml};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ncontiero/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "6.3.0-beta.
|
|
4
|
+
"version": "6.3.0-beta.14",
|
|
5
5
|
"packageManager": "pnpm@10.18.0",
|
|
6
6
|
"description": "Nicolas's ESLint config.",
|
|
7
7
|
"author": {
|
|
@@ -52,6 +52,7 @@
|
|
|
52
52
|
"dependencies": {
|
|
53
53
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.5.0",
|
|
54
54
|
"@eslint/markdown": "^7.3.0",
|
|
55
|
+
"@html-eslint/eslint-plugin": "^0.47.0",
|
|
55
56
|
"@html-eslint/parser": "^0.47.0",
|
|
56
57
|
"@next/eslint-plugin-next": "^15.5.4",
|
|
57
58
|
"@typescript-eslint/eslint-plugin": "^8.45.0",
|