@ncontiero/eslint-config 5.1.0 → 5.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,8 +1,8 @@
1
- # @dkshs/eslint-config
1
+ # @ncontiero/eslint-config
2
2
 
3
3
  Nicolas's ESLint config preset for JavaScript, TypeScript, and Prettier.
4
4
 
5
- [![Version](https://img.shields.io/npm/v/@dkshs/eslint-config)](https://www.npmjs.com/package/@dkshs/eslint-config)
5
+ [![Version](https://img.shields.io/npm/v/@ncontiero/eslint-config)](https://www.npmjs.com/package/@ncontiero/eslint-config)
6
6
  [![License](https://img.shields.io/badge/licence-MIT-blue)](https://github.com/ncontiero/eslint-config/blob/master/LICENSE)
7
7
 
8
8
  ## Features
@@ -18,19 +18,12 @@ Nicolas's ESLint config preset for JavaScript, TypeScript, and Prettier.
18
18
  - Optional [React](https://react.dev/), [NextJs](https://nextjs.org/), [TailwindCSS](https://tailwindcss.com/), [TanStack Query](https://tanstack.com/query/) support.
19
19
  - Requires ESLint v9.20.0+.
20
20
 
21
- > [!IMPORTANT]
22
- > Since v2.2.0, this config is rewritten to the new [ESLint Flat config](https://eslint.org/docs/latest/use/configure/configuration-files-new), check the [release note](https://github.com/ncontiero/eslint-config/releases/tag/v2.2.0) for more details.
23
- >
24
- > Since v3.0.0, ESLint v9.5.0+ is now required.
25
- >
26
- > Since v4.2.0, ESLint v9.20.0+ is now required.
27
-
28
21
  ## Usage
29
22
 
30
23
  1. Install the dependencies:
31
24
 
32
25
  ```bash
33
- npm i -D eslint @dkshs/eslint-config
26
+ npm i -D eslint @ncontiero/eslint-config
34
27
  ```
35
28
 
36
29
  > Require Node.js >= 18.18, and ESLint >= 9.20.0.
@@ -39,7 +32,7 @@ npm i -D eslint @dkshs/eslint-config
39
32
 
40
33
  ```mjs
41
34
  // eslint.config.mjs
42
- import { ncontiero } from "@dkshs/eslint-config";
35
+ import { ncontiero } from "@ncontiero/eslint-config";
43
36
 
44
37
  export default ncontiero(
45
38
  // Features: it'll detect installed dependency and enable necessary features automatically
@@ -111,13 +104,11 @@ Add the following settings to your `.vscode/settings.json`:
111
104
 
112
105
  ## Customization
113
106
 
114
- Since v2.2, we migrated to [ESLint Flat config](https://eslint.org/docs/latest/use/configure/configuration-files-new). It provides much better organization and composition.
115
-
116
- Normally you only need to import the `dkshs` preset:
107
+ Normally you only need to import the `ncontiero` preset:
117
108
 
118
109
  ```js
119
110
  // eslint.config.js
120
- import { ncontiero } from "@dkshs/eslint-config";
111
+ import { ncontiero } from "@ncontiero/eslint-config";
121
112
 
122
113
  export default ncontiero();
123
114
  ```
@@ -126,7 +117,7 @@ And that's it! Or you can configure each integration individually, for example:
126
117
 
127
118
  ```js
128
119
  // eslint.config.js
129
- import { ncontiero } from "@dkshs/eslint-config";
120
+ import { ncontiero } from "@ncontiero/eslint-config";
130
121
 
131
122
  export default ncontiero({
132
123
  // TypeScript, React, NextJs, TailwindCSS and TanStack Query are auto-detected,
@@ -150,11 +141,11 @@ export default ncontiero({
150
141
  });
151
142
  ```
152
143
 
153
- The `dkshs` factory function also accepts any number of arbitrary custom config overrides:
144
+ The `ncontiero` factory function also accepts any number of arbitrary custom config overrides:
154
145
 
155
146
  ```js
156
147
  // eslint.config.js
157
- import { ncontiero } from "@dkshs/eslint-config";
148
+ import { ncontiero } from "@ncontiero/eslint-config";
158
149
 
159
150
  export default ncontiero(
160
151
  {
@@ -179,7 +170,7 @@ Certain rules would only be enabled in specific files, for example, `ts/*` rules
179
170
 
180
171
  ```js
181
172
  // eslint.config.js
182
- import { ncontiero } from "@dkshs/eslint-config";
173
+ import { ncontiero } from "@ncontiero/eslint-config";
183
174
 
184
175
  export default ncontiero({
185
176
  typescript: {
@@ -206,7 +197,7 @@ To enable TanStack Query support, you need to have the package installed or expl
206
197
 
207
198
  ```js
208
199
  // eslint.config.js
209
- import { ncontiero } from "@dkshs/eslint-config";
200
+ import { ncontiero } from "@ncontiero/eslint-config";
210
201
 
211
202
  export default ncontiero({
212
203
  reactQuery: true,
package/dist/index.d.ts CHANGED
@@ -1074,233 +1074,233 @@ interface RuleOptions {
1074
1074
  'implicit-arrow-linebreak'?: Linter.RuleEntry<ImplicitArrowLinebreak>
1075
1075
  /**
1076
1076
  * Enforce or ban the use of inline type-only markers for named imports.
1077
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.3/docs/rules/consistent-type-specifier-style.md
1077
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.4/docs/rules/consistent-type-specifier-style.md
1078
1078
  */
1079
1079
  'import/consistent-type-specifier-style'?: Linter.RuleEntry<ImportConsistentTypeSpecifierStyle>
1080
1080
  /**
1081
1081
  * Ensure a default export is present, given a default import.
1082
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.3/docs/rules/default.md
1082
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.4/docs/rules/default.md
1083
1083
  */
1084
1084
  'import/default'?: Linter.RuleEntry<[]>
1085
1085
  /**
1086
1086
  * Enforce a leading comment with the webpackChunkName for dynamic imports.
1087
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.3/docs/rules/dynamic-import-chunkname.md
1087
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.4/docs/rules/dynamic-import-chunkname.md
1088
1088
  */
1089
1089
  'import/dynamic-import-chunkname'?: Linter.RuleEntry<ImportDynamicImportChunkname>
1090
1090
  /**
1091
1091
  * Forbid any invalid exports, i.e. re-export of the same name.
1092
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.3/docs/rules/export.md
1092
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.4/docs/rules/export.md
1093
1093
  */
1094
1094
  'import/export'?: Linter.RuleEntry<[]>
1095
1095
  /**
1096
1096
  * Ensure all exports appear after other statements.
1097
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.3/docs/rules/exports-last.md
1097
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.4/docs/rules/exports-last.md
1098
1098
  */
1099
1099
  'import/exports-last'?: Linter.RuleEntry<[]>
1100
1100
  /**
1101
1101
  * Ensure consistent use of file extension within the import path.
1102
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.3/docs/rules/extensions.md
1102
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.4/docs/rules/extensions.md
1103
1103
  */
1104
1104
  'import/extensions'?: Linter.RuleEntry<ImportExtensions>
1105
1105
  /**
1106
1106
  * Ensure all imports appear before other statements.
1107
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.3/docs/rules/first.md
1107
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.4/docs/rules/first.md
1108
1108
  */
1109
1109
  'import/first'?: Linter.RuleEntry<ImportFirst>
1110
1110
  /**
1111
1111
  * Prefer named exports to be grouped together in a single export declaration.
1112
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.3/docs/rules/group-exports.md
1112
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.4/docs/rules/group-exports.md
1113
1113
  */
1114
1114
  'import/group-exports'?: Linter.RuleEntry<[]>
1115
1115
  /**
1116
1116
  * Replaced by `import-x/first`.
1117
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.3/docs/rules/imports-first.md
1117
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.4/docs/rules/imports-first.md
1118
1118
  * @deprecated
1119
1119
  */
1120
1120
  'import/imports-first'?: Linter.RuleEntry<ImportImportsFirst>
1121
1121
  /**
1122
1122
  * Enforce the maximum number of dependencies a module can have.
1123
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.3/docs/rules/max-dependencies.md
1123
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.4/docs/rules/max-dependencies.md
1124
1124
  */
1125
1125
  'import/max-dependencies'?: Linter.RuleEntry<ImportMaxDependencies>
1126
1126
  /**
1127
1127
  * Ensure named imports correspond to a named export in the remote file.
1128
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.3/docs/rules/named.md
1128
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.4/docs/rules/named.md
1129
1129
  */
1130
1130
  'import/named'?: Linter.RuleEntry<ImportNamed>
1131
1131
  /**
1132
1132
  * Ensure imported namespaces contain dereferenced properties as they are dereferenced.
1133
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.3/docs/rules/namespace.md
1133
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.4/docs/rules/namespace.md
1134
1134
  */
1135
1135
  'import/namespace'?: Linter.RuleEntry<ImportNamespace>
1136
1136
  /**
1137
1137
  * Enforce a newline after import statements.
1138
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.3/docs/rules/newline-after-import.md
1138
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.4/docs/rules/newline-after-import.md
1139
1139
  */
1140
1140
  'import/newline-after-import'?: Linter.RuleEntry<ImportNewlineAfterImport>
1141
1141
  /**
1142
1142
  * Forbid import of modules using absolute paths.
1143
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.3/docs/rules/no-absolute-path.md
1143
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.4/docs/rules/no-absolute-path.md
1144
1144
  */
1145
1145
  'import/no-absolute-path'?: Linter.RuleEntry<ImportNoAbsolutePath>
1146
1146
  /**
1147
1147
  * Forbid AMD `require` and `define` calls.
1148
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.3/docs/rules/no-amd.md
1148
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.4/docs/rules/no-amd.md
1149
1149
  */
1150
1150
  'import/no-amd'?: Linter.RuleEntry<[]>
1151
1151
  /**
1152
1152
  * Forbid anonymous values as default exports.
1153
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.3/docs/rules/no-anonymous-default-export.md
1153
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.4/docs/rules/no-anonymous-default-export.md
1154
1154
  */
1155
1155
  'import/no-anonymous-default-export'?: Linter.RuleEntry<ImportNoAnonymousDefaultExport>
1156
1156
  /**
1157
1157
  * Forbid CommonJS `require` calls and `module.exports` or `exports.*`.
1158
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.3/docs/rules/no-commonjs.md
1158
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.4/docs/rules/no-commonjs.md
1159
1159
  */
1160
1160
  'import/no-commonjs'?: Linter.RuleEntry<ImportNoCommonjs>
1161
1161
  /**
1162
1162
  * Forbid a module from importing a module with a dependency path back to itself.
1163
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.3/docs/rules/no-cycle.md
1163
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.4/docs/rules/no-cycle.md
1164
1164
  */
1165
1165
  'import/no-cycle'?: Linter.RuleEntry<ImportNoCycle>
1166
1166
  /**
1167
1167
  * Forbid default exports.
1168
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.3/docs/rules/no-default-export.md
1168
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.4/docs/rules/no-default-export.md
1169
1169
  */
1170
1170
  'import/no-default-export'?: Linter.RuleEntry<[]>
1171
1171
  /**
1172
1172
  * Forbid imported names marked with `@deprecated` documentation tag.
1173
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.3/docs/rules/no-deprecated.md
1173
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.4/docs/rules/no-deprecated.md
1174
1174
  */
1175
1175
  'import/no-deprecated'?: Linter.RuleEntry<[]>
1176
1176
  /**
1177
1177
  * Forbid repeated import of the same module in multiple places.
1178
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.3/docs/rules/no-duplicates.md
1178
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.4/docs/rules/no-duplicates.md
1179
1179
  */
1180
1180
  'import/no-duplicates'?: Linter.RuleEntry<ImportNoDuplicates>
1181
1181
  /**
1182
1182
  * Forbid `require()` calls with expressions.
1183
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.3/docs/rules/no-dynamic-require.md
1183
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.4/docs/rules/no-dynamic-require.md
1184
1184
  */
1185
1185
  'import/no-dynamic-require'?: Linter.RuleEntry<ImportNoDynamicRequire>
1186
1186
  /**
1187
1187
  * Forbid empty named import blocks.
1188
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.3/docs/rules/no-empty-named-blocks.md
1188
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.4/docs/rules/no-empty-named-blocks.md
1189
1189
  */
1190
1190
  'import/no-empty-named-blocks'?: Linter.RuleEntry<[]>
1191
1191
  /**
1192
1192
  * Forbid the use of extraneous packages.
1193
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.3/docs/rules/no-extraneous-dependencies.md
1193
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.4/docs/rules/no-extraneous-dependencies.md
1194
1194
  */
1195
1195
  'import/no-extraneous-dependencies'?: Linter.RuleEntry<ImportNoExtraneousDependencies>
1196
1196
  /**
1197
1197
  * Forbid import statements with CommonJS module.exports.
1198
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.3/docs/rules/no-import-module-exports.md
1198
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.4/docs/rules/no-import-module-exports.md
1199
1199
  */
1200
1200
  'import/no-import-module-exports'?: Linter.RuleEntry<ImportNoImportModuleExports>
1201
1201
  /**
1202
1202
  * Forbid importing the submodules of other modules.
1203
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.3/docs/rules/no-internal-modules.md
1203
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.4/docs/rules/no-internal-modules.md
1204
1204
  */
1205
1205
  'import/no-internal-modules'?: Linter.RuleEntry<ImportNoInternalModules>
1206
1206
  /**
1207
1207
  * Forbid the use of mutable exports with `var` or `let`.
1208
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.3/docs/rules/no-mutable-exports.md
1208
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.4/docs/rules/no-mutable-exports.md
1209
1209
  */
1210
1210
  'import/no-mutable-exports'?: Linter.RuleEntry<[]>
1211
1211
  /**
1212
1212
  * Forbid use of exported name as identifier of default export.
1213
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.3/docs/rules/no-named-as-default.md
1213
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.4/docs/rules/no-named-as-default.md
1214
1214
  */
1215
1215
  'import/no-named-as-default'?: Linter.RuleEntry<[]>
1216
1216
  /**
1217
1217
  * Forbid use of exported name as property of default export.
1218
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.3/docs/rules/no-named-as-default-member.md
1218
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.4/docs/rules/no-named-as-default-member.md
1219
1219
  */
1220
1220
  'import/no-named-as-default-member'?: Linter.RuleEntry<[]>
1221
1221
  /**
1222
1222
  * Forbid named default exports.
1223
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.3/docs/rules/no-named-default.md
1223
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.4/docs/rules/no-named-default.md
1224
1224
  */
1225
1225
  'import/no-named-default'?: Linter.RuleEntry<[]>
1226
1226
  /**
1227
1227
  * Forbid named exports.
1228
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.3/docs/rules/no-named-export.md
1228
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.4/docs/rules/no-named-export.md
1229
1229
  */
1230
1230
  'import/no-named-export'?: Linter.RuleEntry<[]>
1231
1231
  /**
1232
1232
  * Forbid namespace (a.k.a. "wildcard" `*`) imports.
1233
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.3/docs/rules/no-namespace.md
1233
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.4/docs/rules/no-namespace.md
1234
1234
  */
1235
1235
  'import/no-namespace'?: Linter.RuleEntry<ImportNoNamespace>
1236
1236
  /**
1237
1237
  * Forbid Node.js builtin modules.
1238
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.3/docs/rules/no-nodejs-modules.md
1238
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.4/docs/rules/no-nodejs-modules.md
1239
1239
  */
1240
1240
  'import/no-nodejs-modules'?: Linter.RuleEntry<ImportNoNodejsModules>
1241
1241
  /**
1242
1242
  * Forbid importing packages through relative paths.
1243
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.3/docs/rules/no-relative-packages.md
1243
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.4/docs/rules/no-relative-packages.md
1244
1244
  */
1245
1245
  'import/no-relative-packages'?: Linter.RuleEntry<ImportNoRelativePackages>
1246
1246
  /**
1247
1247
  * Forbid importing modules from parent directories.
1248
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.3/docs/rules/no-relative-parent-imports.md
1248
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.4/docs/rules/no-relative-parent-imports.md
1249
1249
  */
1250
1250
  'import/no-relative-parent-imports'?: Linter.RuleEntry<ImportNoRelativeParentImports>
1251
1251
  /**
1252
1252
  * Forbid importing a default export by a different name.
1253
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.3/docs/rules/no-rename-default.md
1253
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.4/docs/rules/no-rename-default.md
1254
1254
  */
1255
1255
  'import/no-rename-default'?: Linter.RuleEntry<ImportNoRenameDefault>
1256
1256
  /**
1257
1257
  * Enforce which files can be imported in a given folder.
1258
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.3/docs/rules/no-restricted-paths.md
1258
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.4/docs/rules/no-restricted-paths.md
1259
1259
  */
1260
1260
  'import/no-restricted-paths'?: Linter.RuleEntry<ImportNoRestrictedPaths>
1261
1261
  /**
1262
1262
  * Forbid a module from importing itself.
1263
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.3/docs/rules/no-self-import.md
1263
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.4/docs/rules/no-self-import.md
1264
1264
  */
1265
1265
  'import/no-self-import'?: Linter.RuleEntry<[]>
1266
1266
  /**
1267
1267
  * Forbid unassigned imports.
1268
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.3/docs/rules/no-unassigned-import.md
1268
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.4/docs/rules/no-unassigned-import.md
1269
1269
  */
1270
1270
  'import/no-unassigned-import'?: Linter.RuleEntry<ImportNoUnassignedImport>
1271
1271
  /**
1272
1272
  * Ensure imports point to a file/module that can be resolved.
1273
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.3/docs/rules/no-unresolved.md
1273
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.4/docs/rules/no-unresolved.md
1274
1274
  */
1275
1275
  'import/no-unresolved'?: Linter.RuleEntry<ImportNoUnresolved>
1276
1276
  /**
1277
1277
  * Forbid modules without exports, or exports without matching import in another module.
1278
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.3/docs/rules/no-unused-modules.md
1278
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.4/docs/rules/no-unused-modules.md
1279
1279
  */
1280
1280
  'import/no-unused-modules'?: Linter.RuleEntry<ImportNoUnusedModules>
1281
1281
  /**
1282
1282
  * Forbid unnecessary path segments in import and require statements.
1283
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.3/docs/rules/no-useless-path-segments.md
1283
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.4/docs/rules/no-useless-path-segments.md
1284
1284
  */
1285
1285
  'import/no-useless-path-segments'?: Linter.RuleEntry<ImportNoUselessPathSegments>
1286
1286
  /**
1287
1287
  * Forbid webpack loader syntax in imports.
1288
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.3/docs/rules/no-webpack-loader-syntax.md
1288
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.4/docs/rules/no-webpack-loader-syntax.md
1289
1289
  */
1290
1290
  'import/no-webpack-loader-syntax'?: Linter.RuleEntry<[]>
1291
1291
  /**
1292
1292
  * Enforce a convention in module import order.
1293
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.3/docs/rules/order.md
1293
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.4/docs/rules/order.md
1294
1294
  */
1295
1295
  'import/order'?: Linter.RuleEntry<ImportOrder>
1296
1296
  /**
1297
1297
  * Prefer a default export if module exports a single name or multiple names.
1298
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.3/docs/rules/prefer-default-export.md
1298
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.4/docs/rules/prefer-default-export.md
1299
1299
  */
1300
1300
  'import/prefer-default-export'?: Linter.RuleEntry<ImportPreferDefaultExport>
1301
1301
  /**
1302
1302
  * Forbid potentially ambiguous parse goal (`script` vs. `module`).
1303
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.3/docs/rules/unambiguous.md
1303
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.4/docs/rules/unambiguous.md
1304
1304
  */
1305
1305
  'import/unambiguous'?: Linter.RuleEntry<[]>
1306
1306
  /**
@@ -6629,6 +6629,8 @@ type TypescriptEslintPreferNullishCoalescing = []|[{
6629
6629
 
6630
6630
  ignoreConditionalTests?: boolean
6631
6631
 
6632
+ ignoreIfStatements?: boolean
6633
+
6632
6634
  ignoreMixedLogicalExpressions?: boolean
6633
6635
 
6634
6636
  ignorePrimitives?: ({
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import Se from"eslint-plugin-command/config";function _(){return[{...Se(),name:"ncontiero/command/rules"}]}import{default as E}from"@eslint-community/eslint-plugin-eslint-comments";import{default as v}from"eslint-plugin-antfu";import{default as B}from"eslint-plugin-de-morgan";import{default as G}from"eslint-plugin-import-x";import{default as A}from"eslint-plugin-n";import{default as N}from"eslint-plugin-perfectionist";import{default as S}from"eslint-plugin-unicorn";import{default as M}from"eslint-plugin-unused-imports";function q(){return[{name:"ncontiero/comments/rules",plugins:{"eslint-comments":E},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 J(){return[{...B.configs.recommended,name:"ncontiero/de-morgan"}]}var w="?([cm])[jt]s?(x)",c="**/*.?([cm])[jt]s?(x)",U="**/*.?([cm])js",tr="**/*.?([cm])jsx",O="**/*.?([cm])ts",b="**/*.?([cm])tsx",d="**/*.?([cm])?(j|t)sx",Fe="**/*.{c,le,sc}ss",nr="**/*.css",sr="**/*.{p,post}css",ir="**/*.less",ar="**/*.scss",F="**/*.json",P="**/*.json5",K="**/*.jsonc",y="**/*.md",H="**/*.md/*.md",L="**/*.y?(a)ml",$="**/*.toml",T="**/*.htm?(l)",W=`${y}/${c}`,pr=[c,Fe,F,P,y,L,T],Pe="**/node_modules",Le="**/dist",Te=["**/package-lock.json","**/yarn.lock","**/pnpm-lock.yaml","**/bun.lockb"],Q=[Pe,Le,...Te,"**/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 V(e=[]){return[{ignores:[...Q,...e],name:"ncontiero/global-ignores"}]}function X(e={}){let{nextJs:r=!1}=e;return[{name:"ncontiero/imports/rules",plugins:{antfu:v,import:G},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*.${w}`,`**/{views,pages,routes,middleware,plugins,api,app}/${c}`,r?"{,src/}middleware.{ts,js}":"","**/{index,vite,esbuild,rollup,rolldown,webpack,rspack}.ts","**/*.d.ts",`${y}/**`,"**/.prettierrc*"],name:"ncontiero/imports/allow-default-export",rules:{"import/no-default-export":"off"}}]}import R from"globals";var j=["ForInStatement","LabeledStatement","WithStatement"];function Y(e={}){let{isInEditor:r=!1,overrides:o={}}=e;return[{languageOptions:{ecmaVersion:2022,globals:{...R.browser,...R.es2021,...R.node,document:"readonly",navigator:"readonly",window:"readonly"},parserOptions:{ecmaFeatures:{jsx:!0},ecmaVersion:2022,sourceType:"module"},sourceType:"module"},linterOptions:{reportUnusedDisableDirectives:!0},name:"ncontiero/javascript/rules",plugins:{antfu:v,"unused-imports":M},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",...j],"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-escape":"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":r?"off":"error","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",...o}},{files:[`**/{scripts,cli}/${c}`,`**/cli.${w}`],name:"ncontiero/javascript/cli-rules",rules:{"no-console":"off"}},{files:[`**/*.{test,spec}.${w}`],name:"ncontiero/javascript/test-rules",rules:{"no-unused-expressions":"off","unicorn/consistent-function-scoping":"off"}}]}import{isPackageExists as z}from"local-pkg";var Re=z("@dkshs/eslint-config"),Z={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 t(e){let r=await e;return r.default||r}function ee(e){if(process.env.CI||!process.stdout.isTTY||!Re)return;let r=e.filter(o=>o&&!z(o));if(r.length!==0)throw new Error(`This package(s) are required for this config: ${r.join(", ")}. Please install them.`)}async function re(...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 oe(){return[{name:"ncontiero/jsdoc/rules",plugins:{jsdoc:await t(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 te(e={}){let{files:r=[F,P,K],overrides:o={},style:n=!0}=e,{indent:i=2}=typeof n=="boolean"?{}:n,[a,p]=await Promise.all([t(import("eslint-plugin-jsonc")),t(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",i],"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",{allowMultiplePropertiesPerLine:!0}],"jsonc/quote-props":"off","jsonc/quotes":"off",...o}}]}import{mergeProcessors as De,processorPassThrough as _e}from"eslint-merge-processors";async function ne(e={}){let{files:r=[y],overrides:o={}}=e,n=await t(import("@eslint/markdown"));return[{name:"ncontiero/markdown/setup",plugins:{markdown:n}},{files:r,ignores:[H],name:"ncontiero/markdown/processor",processor:De([n.processors.markdown,_e])},{files:r,languageOptions:{parser:Z},name:"ncontiero/markdown/parser"},{files:[W],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",...o}}]}async function se(e={}){let{files:r=[d],overrides:o={}}=e,n=await t(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"],"react-refresh/only-export-components":["off"],...o}}]}function ie(){return[{name:"ncontiero/node/rules",plugins:{node:A},rules:{"node/handle-callback-err":["error","^(err|error)$"],"node/no-deprecated-api":"error","node/no-exports-assign":"error","node/no-new-require":"error","node/no-path-concat":"error","node/no-unsupported-features/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 ae(){return[{name:"ncontiero/perfectionist/rules",plugins:{perfectionist:N},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 pe(e={}){return[{name:"ncontiero/prettier/setup",plugins:{prettier:await t(import("eslint-plugin-prettier"))}},{files:[c],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:[c],name:"ncontiero/prettier/rules",rules:{"prettier/prettier":["warn",e]}}]}async function ce(){return[{...(await t(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 le}from"local-pkg";var Ee=["vite"],Be=["@react-router/node","@react-router/react","@react-router/serve","@react-router/dev"];async function me(e={}){let{files:r=[d],overrides:o={},reactQuery:n,typescript:i}=e;n&&ee(["@tanstack/eslint-plugin-query"]);let[a,p,m,C]=await Promise.all([t(import("eslint-plugin-jsx-a11y")),t(import("eslint-plugin-react")),t(import("eslint-plugin-react-hooks")),t(import("eslint-plugin-react-refresh"))]),g=Ee.some(u=>le(u)),x=Be.some(u=>le(u));return[{files:r,name:"ncontiero/react/setup",plugins:{"jsx-a11y":a,react:p,"react-hooks":m,"react-refresh":C},settings:{react:{version:"detect"}}},n?{...(await t(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/exhaustive-deps":"warn","react-hooks/rules-of-hooks":"error","react-refresh/only-export-components":["warn",{allowConstantExport:g,allowExportNames:[...x?["meta","links","headers","loader","action"]:[]]}],"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"],...i?{"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"],...o}}]}import{configs as Ge}from"eslint-plugin-regexp";function ue(e={}){let r=Ge["flat/recommended"],o={...r.rules,...e.overrides};return[{...r,name:"ncontiero/regexp/rules",rules:o}]}function fe(){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","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)$"}]}}]}function de(){return[{files:["**/tsconfig.json","**/tsconfig.*.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","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","skipDefaultLibCheck","skipLibCheck"],pathPattern:"^compilerOptions$"}]}}]}import{getPackageInfoSync as Ae}from"local-pkg";async function ye(e={}){let{isInEditor:r=!1,overrides:o={}}=e;return Ae("tailwindcss")?.version?.startsWith("4")?(console.warn("[@dkshs/eslint-config] TailwindCSS v4 is not supported yet."),[]):[{name:"ncontiero/tailwindcss/setup",plugins:{tailwindcss:await t(import("eslint-plugin-tailwindcss"))},settings:{tailwindcss:{callees:["cn","classnames","clsx","cva"],config:"tailwind.config.ts",cssFiles:[],removeDuplicates:!0}}},{files:[d,T],name:"ncontiero/tailwindcss/rules",rules:{"tailwindcss/classnames-order":r?"off":"warn","tailwindcss/enforces-negative-arbitrary-values":["warn"],"tailwindcss/enforces-shorthand":["warn"],"tailwindcss/no-contradicting-classname":["error"],"tailwindcss/no-custom-classname":["warn"],...o}}]}async function ge(e={}){let{files:r=[$],overrides:o={},style:n=!0}=e,{indent:i=2}=typeof n=="boolean"?{}:n,[a,p]=await Promise.all([t(import("eslint-plugin-toml")),t(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",i],"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",...o}}]}async function Ne(e={}){let{files:r=[O,b],overrides:o={},parserOptions:n={}}=e,i=await t(import("typescript-eslint"));return i.config({extends:[...i.configs.recommended],files:r,languageOptions:{parser:i.parser,parserOptions:{sourceType:"module",...n}},name:"ncontiero/typescript/rules",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-wrapper-object-types":"error","@typescript-eslint/prefer-as-const":"warn","@typescript-eslint/prefer-literal-enum-member":["error",{allowBitwiseExpressions:!0}],"no-restricted-syntax":["error",...j,"TSEnumDeclaration[const=true]"],...o}})}async function xe(e={}){return[...await Ne(e),{files:["**/*.d.ts"],name:"ncontiero/typescript/dts-rules",rules:{"eslint-comments/no-unlimited-disable":"off","import/no-duplicates":"off","no-restricted-syntax":["error",...j],"unused-imports/no-unused-vars":"off"}},{files:[U,"**/*.cjs"],name:"ncontiero/typescript/cjs-rules",rules:{"@typescript-eslint/no-require-imports":"off"}}]}function we(e={}){let{allRecommended:r,overrides:o={},regexp:n=!1}=e;return[{name:"ncontiero/unicorn/rules",plugins:{unicorn:S},rules:{...r?S.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-array-push-push":"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-await":"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-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-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"},...o}}]}async function Oe(e={}){let{files:r=[L],overrides:o={},style:n=!0}=e,{indent:i=2,quotes:a="double"}=typeof n=="boolean"?{}:n,[p,m]=await Promise.all([t(import("eslint-plugin-yml")),t(import("yaml-eslint-parser"))]);return[{name:"ncontiero/yml/setup",plugins:{yml:p}},{files:r,languageOptions:{parser:m},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",i],"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",...o}},{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 h}from"local-pkg";var be=!!((process.env.VSCODE_PID||process.env.VSCODE_CWD||process.env.NVIM||process.env.JETBRAINS_IDE||process.env.VIM)&&!process.env.CI),he=h("typescript"),ve=h("react"),je=h("next"),Ce=h("tailwindcss"),ke=h("@tanstack/react-query");var Me=["name","languageOptions","linterOptions","processor","plugins","rules","settings"];function Ie(e,r){return typeof e[r]=="boolean"?{}:e[r]||{}}function l(e,r){let o=Ie(e,r);return{...("overrides"in e?e.overrides:{})?.[r],..."overrides"in o?o.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:o=!0,isInEditor:n=be,nextjs:i=je,react:a=ve,reactQuery:p=ke,regexp:m=!0,tailwindcss:C=Ce,typescript:g=he,unicorn:x=!0}=e,u=typeof e.prettier=="object"?e.prettier:{},k=qe(u),s=[];if(o&&(typeof o!="boolean"?s.push(t(import("eslint-config-flat-gitignore")).then(f=>[f({name:"ncontiero/gitignore",...o})])):s.push(t(import("eslint-config-flat-gitignore")).then(f=>[f({name:"ncontiero/gitignore",strict:!1})]))),g||(e.ignores?e.ignores.push(O,b):e.ignores=[O,b]),s.push(V(e.ignores),Y({isInEditor:n,overrides:l(e,"javascript")}),q(),oe(),X({nextJs:i===!0}),ie(),ce(),_(),ae(),J()),x&&s.push(we(x===!0?{regexp:!!m}:x)),g&&s.push(xe({...Ie(e,"typescript"),overrides:l(e,"typescript")})),(e.jsonc??!0)&&s.push(te({overrides:l(e,"jsonc"),style:k}),fe(),de()),(e.yaml??!0)&&s.push(Oe({overrides:l(e,"yaml"),style:k})),(e.toml??!0)&&s.push(ge({overrides:l(e,"toml"),style:k})),(e.markdown??!0)&&s.push(ne({overrides:l(e,"markdown")})),m&&s.push(ue(typeof m=="boolean"?{}:m)),a&&s.push(me({overrides:l(e,"react"),reactQuery:!!p,typescript:!!g})),i&&s.push(se({overrides:l(e,"nextjs")})),C&&s.push(ye({isInEditor:n,overrides:l(e,"tailwindcss")})),(e.prettier??!0)&&s.push(pe(u)),"files"in e)throw new Error('[@dkshs/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 D=Me.reduce((f,I)=>(I in e&&(f[I]=e[I]),f),{});return Object.keys(D).length>0&&s.push([D]),re(...s,...r)}export{pr as GLOB_ALL_SRC,nr as GLOB_CSS,Le as GLOB_DIST,Q as GLOB_EXCLUDE,T as GLOB_HTML,U as GLOB_JS,F as GLOB_JSON,P as GLOB_JSON5,K as GLOB_JSONC,tr as GLOB_JSX,ir as GLOB_LESS,Te as GLOB_LOCKFILE,y as GLOB_MARKDOWN,W as GLOB_MARKDOWN_CODE,H as GLOB_MARKDOWN_IN_MARKDOWN,Pe as GLOB_NODE_MODULES,sr as GLOB_POSTCSS,d as GLOB_REACT,ar as GLOB_SCSS,c as GLOB_SRC,w as GLOB_SRC_EXT,Fe as GLOB_STYLE,$ as GLOB_TOML,O as GLOB_TS,b as GLOB_TSX,L as GLOB_YAML,br as combine,_ as command,q as comments,re as composer,J as deMorgan,ee as ensurePackages,l as getOverrides,je as hasNextJs,ve as hasReact,Ce as hasTailwind,ke as hasTanStackReactQuery,he as hasTypeScript,V as ignores,X as imports,t as interopDefault,be as isInEditorEnv,Y as javascript,oe as jsdoc,te as jsonc,ne as markdown,Uo as ncontiero,se as nextJs,ie as node,Z as parserPlain,ae as perfectionist,pe as prettier,ce as promise,me as react,ue as regexp,Ie as resolveSubOptions,j as restrictedSyntaxJs,fe as sortPackageJson,de as sortTsconfig,ye as tailwindcss,hr as toArray,ge as toml,xe as typescript,Ne as typescriptCore,we as unicorn,Oe as yml};
1
+ import Se from"eslint-plugin-command/config";function _(){return[{...Se(),name:"ncontiero/command/rules"}]}import{default as E}from"@eslint-community/eslint-plugin-eslint-comments";import{default as v}from"eslint-plugin-antfu";import{default as B}from"eslint-plugin-de-morgan";import{default as G}from"eslint-plugin-import-x";import{default as A}from"eslint-plugin-n";import{default as N}from"eslint-plugin-perfectionist";import{default as S}from"eslint-plugin-unicorn";import{default as M}from"eslint-plugin-unused-imports";function q(){return[{name:"ncontiero/comments/rules",plugins:{"eslint-comments":E},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 J(){return[{...B.configs.recommended,name:"ncontiero/de-morgan"}]}var w="?([cm])[jt]s?(x)",c="**/*.?([cm])[jt]s?(x)",U="**/*.?([cm])js",tr="**/*.?([cm])jsx",O="**/*.?([cm])ts",b="**/*.?([cm])tsx",d="**/*.?([cm])?(j|t)sx",Fe="**/*.{c,le,sc}ss",nr="**/*.css",sr="**/*.{p,post}css",ir="**/*.less",ar="**/*.scss",F="**/*.json",P="**/*.json5",K="**/*.jsonc",y="**/*.md",H="**/*.md/*.md",L="**/*.y?(a)ml",$="**/*.toml",T="**/*.htm?(l)",W=`${y}/${c}`,pr=[c,Fe,F,P,y,L,T],Pe="**/node_modules",Le="**/dist",Te=["**/package-lock.json","**/yarn.lock","**/pnpm-lock.yaml","**/bun.lockb"],Q=[Pe,Le,...Te,"**/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 V(e=[]){return[{ignores:[...Q,...e],name:"ncontiero/global-ignores"}]}function X(e={}){let{nextJs:r=!1}=e;return[{name:"ncontiero/imports/rules",plugins:{antfu:v,import:G},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*.${w}`,`**/{views,pages,routes,middleware,plugins,api,app}/${c}`,r?"{,src/}middleware.{ts,js}":"","**/{index,vite,esbuild,rollup,rolldown,webpack,rspack}.ts","**/*.d.ts",`${y}/**`,"**/.prettierrc*"],name:"ncontiero/imports/allow-default-export",rules:{"import/no-default-export":"off"}}]}import R from"globals";var j=["ForInStatement","LabeledStatement","WithStatement"];function Y(e={}){let{isInEditor:r=!1,overrides:o={}}=e;return[{languageOptions:{ecmaVersion:2022,globals:{...R.browser,...R.es2021,...R.node,document:"readonly",navigator:"readonly",window:"readonly"},parserOptions:{ecmaFeatures:{jsx:!0},ecmaVersion:2022,sourceType:"module"},sourceType:"module"},linterOptions:{reportUnusedDisableDirectives:!0},name:"ncontiero/javascript/rules",plugins:{antfu:v,"unused-imports":M},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",...j],"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-escape":"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":r?"off":"error","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",...o}},{files:[`**/{scripts,cli}/${c}`,`**/cli.${w}`],name:"ncontiero/javascript/cli-rules",rules:{"no-console":"off"}},{files:[`**/*.{test,spec}.${w}`],name:"ncontiero/javascript/test-rules",rules:{"no-unused-expressions":"off","unicorn/consistent-function-scoping":"off"}}]}import{isPackageExists as z}from"local-pkg";var Re=z("@ncontiero/eslint-config"),Z={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 t(e){let r=await e;return r.default||r}function ee(e){if(process.env.CI||!process.stdout.isTTY||!Re)return;let r=e.filter(o=>o&&!z(o));if(r.length!==0)throw new Error(`This package(s) are required for this config: ${r.join(", ")}. Please install them.`)}async function re(...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 oe(){return[{name:"ncontiero/jsdoc/rules",plugins:{jsdoc:await t(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 te(e={}){let{files:r=[F,P,K],overrides:o={},style:n=!0}=e,{indent:i=2}=typeof n=="boolean"?{}:n,[a,p]=await Promise.all([t(import("eslint-plugin-jsonc")),t(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",i],"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",{allowMultiplePropertiesPerLine:!0}],"jsonc/quote-props":"off","jsonc/quotes":"off",...o}}]}import{mergeProcessors as De,processorPassThrough as _e}from"eslint-merge-processors";async function ne(e={}){let{files:r=[y],overrides:o={}}=e,n=await t(import("@eslint/markdown"));return[{name:"ncontiero/markdown/setup",plugins:{markdown:n}},{files:r,ignores:[H],name:"ncontiero/markdown/processor",processor:De([n.processors.markdown,_e])},{files:r,languageOptions:{parser:Z},name:"ncontiero/markdown/parser"},{files:[W],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",...o}}]}async function se(e={}){let{files:r=[d],overrides:o={}}=e,n=await t(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"],"react-refresh/only-export-components":["off"],...o}}]}function ie(){return[{name:"ncontiero/node/rules",plugins:{node:A},rules:{"node/handle-callback-err":["error","^(err|error)$"],"node/no-deprecated-api":"error","node/no-exports-assign":"error","node/no-new-require":"error","node/no-path-concat":"error","node/no-unsupported-features/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 ae(){return[{name:"ncontiero/perfectionist/rules",plugins:{perfectionist:N},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 pe(e={}){return[{name:"ncontiero/prettier/setup",plugins:{prettier:await t(import("eslint-plugin-prettier"))}},{files:[c],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:[c],name:"ncontiero/prettier/rules",rules:{"prettier/prettier":["warn",e]}}]}async function ce(){return[{...(await t(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 le}from"local-pkg";var Ee=["vite"],Be=["@react-router/node","@react-router/react","@react-router/serve","@react-router/dev"];async function me(e={}){let{files:r=[d],overrides:o={},reactQuery:n,typescript:i}=e;n&&ee(["@tanstack/eslint-plugin-query"]);let[a,p,m,C]=await Promise.all([t(import("eslint-plugin-jsx-a11y")),t(import("eslint-plugin-react")),t(import("eslint-plugin-react-hooks")),t(import("eslint-plugin-react-refresh"))]),g=Ee.some(u=>le(u)),x=Be.some(u=>le(u));return[{files:r,name:"ncontiero/react/setup",plugins:{"jsx-a11y":a,react:p,"react-hooks":m,"react-refresh":C},settings:{react:{version:"detect"}}},n?{...(await t(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/exhaustive-deps":"warn","react-hooks/rules-of-hooks":"error","react-refresh/only-export-components":["warn",{allowConstantExport:g,allowExportNames:[...x?["meta","links","headers","loader","action"]:[]]}],"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"],...i?{"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"],...o}}]}import{configs as Ge}from"eslint-plugin-regexp";function ue(e={}){let r=Ge["flat/recommended"],o={...r.rules,...e.overrides};return[{...r,name:"ncontiero/regexp/rules",rules:o}]}function fe(){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","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)$"}]}}]}function de(){return[{files:["**/tsconfig.json","**/tsconfig.*.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","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","skipDefaultLibCheck","skipLibCheck"],pathPattern:"^compilerOptions$"}]}}]}import{getPackageInfoSync as Ae}from"local-pkg";async function ye(e={}){let{isInEditor:r=!1,overrides:o={}}=e;return Ae("tailwindcss")?.version?.startsWith("4")?(console.warn("[@ncontiero/eslint-config] TailwindCSS v4 is not supported yet."),[]):[{name:"ncontiero/tailwindcss/setup",plugins:{tailwindcss:await t(import("eslint-plugin-tailwindcss"))},settings:{tailwindcss:{callees:["cn","classnames","clsx","cva"],config:"tailwind.config.ts",cssFiles:[],removeDuplicates:!0}}},{files:[d,T],name:"ncontiero/tailwindcss/rules",rules:{"tailwindcss/classnames-order":r?"off":"warn","tailwindcss/enforces-negative-arbitrary-values":["warn"],"tailwindcss/enforces-shorthand":["warn"],"tailwindcss/no-contradicting-classname":["error"],"tailwindcss/no-custom-classname":["warn"],...o}}]}async function ge(e={}){let{files:r=[$],overrides:o={},style:n=!0}=e,{indent:i=2}=typeof n=="boolean"?{}:n,[a,p]=await Promise.all([t(import("eslint-plugin-toml")),t(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",i],"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",...o}}]}async function Ne(e={}){let{files:r=[O,b],overrides:o={},parserOptions:n={}}=e,i=await t(import("typescript-eslint"));return i.config({extends:[...i.configs.recommended],files:r,languageOptions:{parser:i.parser,parserOptions:{sourceType:"module",...n}},name:"ncontiero/typescript/rules",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-wrapper-object-types":"error","@typescript-eslint/prefer-as-const":"warn","@typescript-eslint/prefer-literal-enum-member":["error",{allowBitwiseExpressions:!0}],"no-restricted-syntax":["error",...j,"TSEnumDeclaration[const=true]"],...o}})}async function xe(e={}){return[...await Ne(e),{files:["**/*.d.ts"],name:"ncontiero/typescript/dts-rules",rules:{"eslint-comments/no-unlimited-disable":"off","import/no-duplicates":"off","no-restricted-syntax":["error",...j],"unused-imports/no-unused-vars":"off"}},{files:[U,"**/*.cjs"],name:"ncontiero/typescript/cjs-rules",rules:{"@typescript-eslint/no-require-imports":"off"}}]}function we(e={}){let{allRecommended:r,overrides:o={},regexp:n=!1}=e;return[{name:"ncontiero/unicorn/rules",plugins:{unicorn:S},rules:{...r?S.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-array-push-push":"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-await":"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-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-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"},...o}}]}async function Oe(e={}){let{files:r=[L],overrides:o={},style:n=!0}=e,{indent:i=2,quotes:a="double"}=typeof n=="boolean"?{}:n,[p,m]=await Promise.all([t(import("eslint-plugin-yml")),t(import("yaml-eslint-parser"))]);return[{name:"ncontiero/yml/setup",plugins:{yml:p}},{files:r,languageOptions:{parser:m},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",i],"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",...o}},{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 h}from"local-pkg";var be=!!((process.env.VSCODE_PID||process.env.VSCODE_CWD||process.env.NVIM||process.env.JETBRAINS_IDE||process.env.VIM)&&!process.env.CI),he=h("typescript"),ve=h("react"),je=h("next"),Ce=h("tailwindcss"),ke=h("@tanstack/react-query");var Me=["name","languageOptions","linterOptions","processor","plugins","rules","settings"];function Ie(e,r){return typeof e[r]=="boolean"?{}:e[r]||{}}function l(e,r){let o=Ie(e,r);return{...("overrides"in e?e.overrides:{})?.[r],..."overrides"in o?o.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:o=!0,isInEditor:n=be,nextjs:i=je,react:a=ve,reactQuery:p=ke,regexp:m=!0,tailwindcss:C=Ce,typescript:g=he,unicorn:x=!0}=e,u=typeof e.prettier=="object"?e.prettier:{},k=qe(u),s=[];if(o&&(typeof o!="boolean"?s.push(t(import("eslint-config-flat-gitignore")).then(f=>[f({name:"ncontiero/gitignore",...o})])):s.push(t(import("eslint-config-flat-gitignore")).then(f=>[f({name:"ncontiero/gitignore",strict:!1})]))),g||(e.ignores?e.ignores.push(O,b):e.ignores=[O,b]),s.push(V(e.ignores),Y({isInEditor:n,overrides:l(e,"javascript")}),q(),oe(),X({nextJs:i===!0}),ie(),ce(),_(),ae(),J()),x&&s.push(we(x===!0?{regexp:!!m}:x)),g&&s.push(xe({...Ie(e,"typescript"),overrides:l(e,"typescript")})),(e.jsonc??!0)&&s.push(te({overrides:l(e,"jsonc"),style:k}),fe(),de()),(e.yaml??!0)&&s.push(Oe({overrides:l(e,"yaml"),style:k})),(e.toml??!0)&&s.push(ge({overrides:l(e,"toml"),style:k})),(e.markdown??!0)&&s.push(ne({overrides:l(e,"markdown")})),m&&s.push(ue(typeof m=="boolean"?{}:m)),a&&s.push(me({overrides:l(e,"react"),reactQuery:!!p,typescript:!!g})),i&&s.push(se({overrides:l(e,"nextjs")})),C&&s.push(ye({isInEditor:n,overrides:l(e,"tailwindcss")})),(e.prettier??!0)&&s.push(pe(u)),"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 D=Me.reduce((f,I)=>(I in e&&(f[I]=e[I]),f),{});return Object.keys(D).length>0&&s.push([D]),re(...s,...r)}export{pr as GLOB_ALL_SRC,nr as GLOB_CSS,Le as GLOB_DIST,Q as GLOB_EXCLUDE,T as GLOB_HTML,U as GLOB_JS,F as GLOB_JSON,P as GLOB_JSON5,K as GLOB_JSONC,tr as GLOB_JSX,ir as GLOB_LESS,Te as GLOB_LOCKFILE,y as GLOB_MARKDOWN,W as GLOB_MARKDOWN_CODE,H as GLOB_MARKDOWN_IN_MARKDOWN,Pe as GLOB_NODE_MODULES,sr as GLOB_POSTCSS,d as GLOB_REACT,ar as GLOB_SCSS,c as GLOB_SRC,w as GLOB_SRC_EXT,Fe as GLOB_STYLE,$ as GLOB_TOML,O as GLOB_TS,b as GLOB_TSX,L as GLOB_YAML,br as combine,_ as command,q as comments,re as composer,J as deMorgan,ee as ensurePackages,l as getOverrides,je as hasNextJs,ve as hasReact,Ce as hasTailwind,ke as hasTanStackReactQuery,he as hasTypeScript,V as ignores,X as imports,t as interopDefault,be as isInEditorEnv,Y as javascript,oe as jsdoc,te as jsonc,ne as markdown,Uo as ncontiero,se as nextJs,ie as node,Z as parserPlain,ae as perfectionist,pe as prettier,ce as promise,me as react,ue as regexp,Ie as resolveSubOptions,j as restrictedSyntaxJs,fe as sortPackageJson,de as sortTsconfig,ye as tailwindcss,hr as toArray,ge as toml,xe as typescript,Ne as typescriptCore,we as unicorn,Oe as yml};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ncontiero/eslint-config",
3
3
  "type": "module",
4
- "version": "5.1.0",
4
+ "version": "5.1.1",
5
5
  "description": "Nicolas's ESLint config.",
6
6
  "author": {
7
7
  "name": "Nicolas Contiero",
@@ -45,7 +45,7 @@
45
45
  "eslint-plugin-antfu": "^3.1.1",
46
46
  "eslint-plugin-command": "^3.2.0",
47
47
  "eslint-plugin-de-morgan": "^1.2.1",
48
- "eslint-plugin-import-x": "^4.9.3",
48
+ "eslint-plugin-import-x": "^4.9.4",
49
49
  "eslint-plugin-jsdoc": "^50.6.9",
50
50
  "eslint-plugin-jsonc": "^2.20.0",
51
51
  "eslint-plugin-jsx-a11y": "^6.10.2",
@@ -67,7 +67,7 @@
67
67
  "local-pkg": "^1.1.1",
68
68
  "prettier": "^3.5.3",
69
69
  "toml-eslint-parser": "^0.10.0",
70
- "typescript-eslint": "^8.28.0",
70
+ "typescript-eslint": "^8.29.0",
71
71
  "yaml-eslint-parser": "^1.3.0"
72
72
  },
73
73
  "devDependencies": {
@@ -78,7 +78,7 @@
78
78
  "@ncontiero/prettier-config": "^1.0.0",
79
79
  "@tanstack/eslint-plugin-query": "^5.68.0",
80
80
  "@types/node": "^22.13.14",
81
- "@typescript-eslint/parser": "^8.28.0",
81
+ "@typescript-eslint/parser": "^8.29.0",
82
82
  "eslint": "^9.23.0",
83
83
  "eslint-typegen": "^2.1.0",
84
84
  "execa": "^9.5.2",
@@ -88,7 +88,7 @@
88
88
  "tsup": "^8.4.0",
89
89
  "tsx": "^4.19.3",
90
90
  "typescript": "^5.8.2",
91
- "vitest": "^3.0.9"
91
+ "vitest": "^3.1.1"
92
92
  },
93
93
  "engines": {
94
94
  "node": ">=18"