@ivanmaxlogiudice/eslint-config 3.0.0-beta.8 → 3.0.0-beta.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +9 -9
- package/dist/index.js +24 -16
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -11,7 +11,7 @@ import c from "picocolors";
|
|
|
11
11
|
// package.json
|
|
12
12
|
var package_default = {
|
|
13
13
|
name: "@ivanmaxlogiudice/eslint-config",
|
|
14
|
-
version: "3.0.0-beta.
|
|
14
|
+
version: "3.0.0-beta.9",
|
|
15
15
|
packageManager: "bun@1.1.26",
|
|
16
16
|
description: "Personal ESLint config",
|
|
17
17
|
type: "module",
|
|
@@ -261,10 +261,10 @@ async function updateEslintFiles(result) {
|
|
|
261
261
|
p.log.success(c2.green(`Created ${configFileName}`));
|
|
262
262
|
const files = fs.readdirSync(cwd).sort();
|
|
263
263
|
const legacyConfig = [];
|
|
264
|
-
|
|
264
|
+
for (const file of files) {
|
|
265
265
|
if (/eslint|prettier/.test(file) && !/eslint\.config\./.test(file))
|
|
266
266
|
legacyConfig.push(file);
|
|
267
|
-
}
|
|
267
|
+
}
|
|
268
268
|
if (legacyConfig.length)
|
|
269
269
|
p.note(`${c2.dim(legacyConfig.join(", "))}`, "You can now remove those files manually");
|
|
270
270
|
}
|
|
@@ -286,24 +286,24 @@ async function updatePackageJson(result) {
|
|
|
286
286
|
pkg.devDependencies.eslint ??= package_default.devDependencies.eslint;
|
|
287
287
|
const addedPackages = [];
|
|
288
288
|
if (result.extra.length) {
|
|
289
|
-
result.extra
|
|
289
|
+
for (const item of result.extra) {
|
|
290
290
|
switch (item) {
|
|
291
291
|
case "unocss":
|
|
292
|
-
["@unocss/eslint-plugin"]
|
|
292
|
+
for (const f of ["@unocss/eslint-plugin"]) {
|
|
293
293
|
pkg.devDependencies[f] = package_default.devDependencies[f];
|
|
294
294
|
addedPackages.push(f);
|
|
295
|
-
}
|
|
295
|
+
}
|
|
296
296
|
break;
|
|
297
297
|
}
|
|
298
|
-
}
|
|
298
|
+
}
|
|
299
299
|
}
|
|
300
300
|
for (const framework of result.frameworks) {
|
|
301
301
|
const deps = dependenciesMap[framework];
|
|
302
302
|
if (deps) {
|
|
303
|
-
|
|
303
|
+
for (const f of deps) {
|
|
304
304
|
pkg.devDependencies[f] = package_default.devDependencies[f];
|
|
305
305
|
addedPackages.push(f);
|
|
306
|
-
}
|
|
306
|
+
}
|
|
307
307
|
}
|
|
308
308
|
}
|
|
309
309
|
if (addedPackages.length)
|
package/dist/index.js
CHANGED
|
@@ -335,9 +335,6 @@ function javascript(options = {}) {
|
|
|
335
335
|
],
|
|
336
336
|
"no-restricted-syntax": [
|
|
337
337
|
"error",
|
|
338
|
-
"DebuggerStatement",
|
|
339
|
-
"LabeledStatement",
|
|
340
|
-
"WithStatement",
|
|
341
338
|
"TSEnumDeclaration[const=true]",
|
|
342
339
|
"TSExportAssignment"
|
|
343
340
|
],
|
|
@@ -1141,31 +1138,42 @@ function unicorn() {
|
|
|
1141
1138
|
unicorn: plugin8
|
|
1142
1139
|
},
|
|
1143
1140
|
rules: {
|
|
1144
|
-
|
|
1141
|
+
"unicorn/consistent-empty-array-spread": "error",
|
|
1142
|
+
"unicorn/consistent-function-scoping": "error",
|
|
1145
1143
|
"unicorn/error-message": "error",
|
|
1146
|
-
// Uppercase regex escapes
|
|
1147
1144
|
"unicorn/escape-case": "error",
|
|
1148
|
-
|
|
1145
|
+
"unicorn/new-for-builtins": "error",
|
|
1146
|
+
"unicorn/no-array-for-each": "error",
|
|
1147
|
+
"unicorn/no-array-push-push": "error",
|
|
1148
|
+
"unicorn/no-await-in-promise-methods": "error",
|
|
1149
1149
|
"unicorn/no-instanceof-array": "error",
|
|
1150
|
-
|
|
1150
|
+
"unicorn/no-invalid-remove-event-listener": "error",
|
|
1151
|
+
"unicorn/no-lonely-if": "error",
|
|
1152
|
+
"unicorn/no-negation-in-equality-check": "error",
|
|
1151
1153
|
"unicorn/no-new-array": "error",
|
|
1152
|
-
// Prevent deprecated `new Buffer()`
|
|
1153
1154
|
"unicorn/no-new-buffer": "error",
|
|
1154
|
-
|
|
1155
|
+
"unicorn/no-unnecessary-await": "error",
|
|
1155
1156
|
"unicorn/number-literal-case": "error",
|
|
1156
|
-
|
|
1157
|
+
"unicorn/prefer-array-find": "error",
|
|
1158
|
+
"unicorn/prefer-array-flat-map": "error",
|
|
1159
|
+
"unicorn/prefer-array-some": "error",
|
|
1160
|
+
"unicorn/prefer-at": "error",
|
|
1157
1161
|
"unicorn/prefer-dom-node-text-content": "error",
|
|
1158
|
-
// includes over indexOf when checking for existence
|
|
1159
1162
|
"unicorn/prefer-includes": "error",
|
|
1160
|
-
|
|
1163
|
+
"unicorn/prefer-modern-math-apis": "error",
|
|
1164
|
+
"unicorn/prefer-negative-index": "error",
|
|
1161
1165
|
"unicorn/prefer-node-protocol": "error",
|
|
1162
|
-
// Prefer using number properties like `Number.isNaN` rather than `isNaN`
|
|
1163
1166
|
"unicorn/prefer-number-properties": "error",
|
|
1164
|
-
|
|
1167
|
+
"unicorn/prefer-prototype-methods": "error",
|
|
1168
|
+
"unicorn/prefer-query-selector": "error",
|
|
1169
|
+
"unicorn/prefer-regexp-test": "error",
|
|
1170
|
+
"unicorn/prefer-string-raw": "error",
|
|
1171
|
+
"unicorn/prefer-string-replace-all": "error",
|
|
1172
|
+
"unicorn/prefer-string-slice": "error",
|
|
1165
1173
|
"unicorn/prefer-string-starts-ends-with": "error",
|
|
1166
|
-
|
|
1174
|
+
"unicorn/prefer-string-trim-start-end": "error",
|
|
1175
|
+
"unicorn/prefer-structured-clone": "error",
|
|
1167
1176
|
"unicorn/prefer-type-error": "error",
|
|
1168
|
-
// Use new when throwing error
|
|
1169
1177
|
"unicorn/throw-new-error": "error"
|
|
1170
1178
|
}
|
|
1171
1179
|
}
|