@infernodesign/eslint-config 1.2.3 → 1.3.0
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 +16 -16
- package/dist/index.js +45 -45
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -9,7 +9,7 @@ import parse from "parse-gitignore";
|
|
|
9
9
|
import { execSync } from "node:child_process";
|
|
10
10
|
|
|
11
11
|
//#region package.json
|
|
12
|
-
var version = "1.
|
|
12
|
+
var version = "1.3.0";
|
|
13
13
|
|
|
14
14
|
//#endregion
|
|
15
15
|
//#region src/cli/constants.ts
|
|
@@ -121,9 +121,9 @@ const dependenciesMap = {
|
|
|
121
121
|
//#region src/cli/utils.ts
|
|
122
122
|
function getEslintConfigContent(mainConfig, additionalConfigs) {
|
|
123
123
|
return `
|
|
124
|
-
import
|
|
124
|
+
import { inferno } from '@infernodesign/eslint-config'
|
|
125
125
|
|
|
126
|
-
export default
|
|
126
|
+
export default inferno({
|
|
127
127
|
${mainConfig}
|
|
128
128
|
}${additionalConfigs?.map((config) => `,{\n${config}\n}`)})
|
|
129
129
|
`.trimStart();
|
|
@@ -268,11 +268,14 @@ async function run(options = {}) {
|
|
|
268
268
|
};
|
|
269
269
|
if (!argSkipPrompt) {
|
|
270
270
|
result = await p.group({
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
271
|
+
extra: ({ results }) => {
|
|
272
|
+
const isArgExtraValid = argExtra?.length && !argExtra.filter((element) => !extra.includes(element)).length;
|
|
273
|
+
if (!results.uncommittedConfirmed || isArgExtraValid) return;
|
|
274
|
+
const message = !isArgExtraValid && argExtra ? `"${argExtra}" isn't a valid extra util. Please choose from below: ` : "Select a extra utils:";
|
|
275
|
+
return p.multiselect({
|
|
276
|
+
message: c.reset(message),
|
|
277
|
+
options: extraOptions,
|
|
278
|
+
required: false
|
|
276
279
|
});
|
|
277
280
|
},
|
|
278
281
|
frameworks: ({ results }) => {
|
|
@@ -285,14 +288,11 @@ async function run(options = {}) {
|
|
|
285
288
|
required: false
|
|
286
289
|
});
|
|
287
290
|
},
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
message: c.reset(message),
|
|
294
|
-
options: extraOptions,
|
|
295
|
-
required: false
|
|
291
|
+
uncommittedConfirmed: () => {
|
|
292
|
+
if (argSkipPrompt || isGitClean()) return Promise.resolve(true);
|
|
293
|
+
return p.confirm({
|
|
294
|
+
initialValue: false,
|
|
295
|
+
message: "There are uncommitted changes in the current repository, are you sure to continue?"
|
|
296
296
|
});
|
|
297
297
|
},
|
|
298
298
|
updateVscodeSettings: ({ results }) => {
|
package/dist/index.js
CHANGED
|
@@ -1285,46 +1285,6 @@ async function react(options = {}) {
|
|
|
1285
1285
|
},
|
|
1286
1286
|
name: "inferno/react/rules",
|
|
1287
1287
|
rules: {
|
|
1288
|
-
"react/jsx-no-comment-textnodes": "warn",
|
|
1289
|
-
"react/jsx-no-duplicate-props": "warn",
|
|
1290
|
-
"react/jsx-uses-vars": "warn",
|
|
1291
|
-
"react/no-access-state-in-setstate": "error",
|
|
1292
|
-
"react/no-array-index-key": "warn",
|
|
1293
|
-
"react/no-children-count": "warn",
|
|
1294
|
-
"react/no-children-for-each": "warn",
|
|
1295
|
-
"react/no-children-map": "warn",
|
|
1296
|
-
"react/no-children-only": "warn",
|
|
1297
|
-
"react/no-children-to-array": "warn",
|
|
1298
|
-
"react/no-clone-element": "warn",
|
|
1299
|
-
"react/no-component-will-mount": "error",
|
|
1300
|
-
"react/no-component-will-receive-props": "error",
|
|
1301
|
-
"react/no-component-will-update": "error",
|
|
1302
|
-
"react/no-context-provider": "warn",
|
|
1303
|
-
"react/no-create-ref": "error",
|
|
1304
|
-
"react/no-default-props": "error",
|
|
1305
|
-
"react/no-direct-mutation-state": "error",
|
|
1306
|
-
"react/no-duplicate-key": "warn",
|
|
1307
|
-
"react/no-forward-ref": "warn",
|
|
1308
|
-
"react/no-implicit-key": "warn",
|
|
1309
|
-
"react/no-missing-key": "error",
|
|
1310
|
-
"react/no-nested-component-definitions": "error",
|
|
1311
|
-
"react/no-prop-types": "error",
|
|
1312
|
-
"react/no-redundant-should-component-update": "error",
|
|
1313
|
-
"react/no-set-state-in-component-did-mount": "warn",
|
|
1314
|
-
"react/no-set-state-in-component-did-update": "warn",
|
|
1315
|
-
"react/no-set-state-in-component-will-update": "warn",
|
|
1316
|
-
"react/no-string-refs": "error",
|
|
1317
|
-
"react/no-unnecessary-use-prefix": "warn",
|
|
1318
|
-
"react/no-unsafe-component-will-mount": "warn",
|
|
1319
|
-
"react/no-unsafe-component-will-receive-props": "warn",
|
|
1320
|
-
"react/no-unsafe-component-will-update": "warn",
|
|
1321
|
-
"react/no-unstable-context-value": "warn",
|
|
1322
|
-
"react/no-unstable-default-props": "warn",
|
|
1323
|
-
"react/no-unused-class-component-members": "warn",
|
|
1324
|
-
"react/no-unused-state": "warn",
|
|
1325
|
-
"react/no-use-context": "warn",
|
|
1326
|
-
"react/no-useless-forward-ref": "warn",
|
|
1327
|
-
"react/prefer-use-state-lazy-initialization": "warn",
|
|
1328
1288
|
"react-dom/no-dangerously-set-innerhtml": "warn",
|
|
1329
1289
|
"react-dom/no-dangerously-set-innerhtml-with-children": "error",
|
|
1330
1290
|
"react-dom/no-find-dom-node": "error",
|
|
@@ -1340,13 +1300,9 @@ async function react(options = {}) {
|
|
|
1340
1300
|
"react-dom/no-unsafe-target-blank": "warn",
|
|
1341
1301
|
"react-dom/no-use-form-state": "error",
|
|
1342
1302
|
"react-dom/no-void-elements-with-children": "error",
|
|
1303
|
+
"react-hooks-extra/no-direct-set-state-in-use-effect": "warn",
|
|
1343
1304
|
"react-hooks/exhaustive-deps": "warn",
|
|
1344
1305
|
"react-hooks/rules-of-hooks": "error",
|
|
1345
|
-
"react-hooks-extra/no-direct-set-state-in-use-effect": "warn",
|
|
1346
|
-
"react-web-api/no-leaked-event-listener": "warn",
|
|
1347
|
-
"react-web-api/no-leaked-interval": "warn",
|
|
1348
|
-
"react-web-api/no-leaked-resize-observer": "warn",
|
|
1349
|
-
"react-web-api/no-leaked-timeout": "warn",
|
|
1350
1306
|
"react-refresh/only-export-components": ["warn", {
|
|
1351
1307
|
allowConstantExport: isAllowConstantExport,
|
|
1352
1308
|
allowExportNames: [...isUsingNext ? [
|
|
@@ -1375,6 +1331,50 @@ async function react(options = {}) {
|
|
|
1375
1331
|
"shouldRevalidate"
|
|
1376
1332
|
] : []]
|
|
1377
1333
|
}],
|
|
1334
|
+
"react-web-api/no-leaked-event-listener": "warn",
|
|
1335
|
+
"react-web-api/no-leaked-interval": "warn",
|
|
1336
|
+
"react-web-api/no-leaked-resize-observer": "warn",
|
|
1337
|
+
"react-web-api/no-leaked-timeout": "warn",
|
|
1338
|
+
"react/jsx-no-comment-textnodes": "warn",
|
|
1339
|
+
"react/jsx-no-duplicate-props": "warn",
|
|
1340
|
+
"react/jsx-uses-vars": "warn",
|
|
1341
|
+
"react/no-access-state-in-setstate": "error",
|
|
1342
|
+
"react/no-array-index-key": "warn",
|
|
1343
|
+
"react/no-children-count": "warn",
|
|
1344
|
+
"react/no-children-for-each": "warn",
|
|
1345
|
+
"react/no-children-map": "warn",
|
|
1346
|
+
"react/no-children-only": "warn",
|
|
1347
|
+
"react/no-children-to-array": "warn",
|
|
1348
|
+
"react/no-clone-element": "warn",
|
|
1349
|
+
"react/no-component-will-mount": "error",
|
|
1350
|
+
"react/no-component-will-receive-props": "error",
|
|
1351
|
+
"react/no-component-will-update": "error",
|
|
1352
|
+
"react/no-context-provider": "warn",
|
|
1353
|
+
"react/no-create-ref": "error",
|
|
1354
|
+
"react/no-default-props": "error",
|
|
1355
|
+
"react/no-direct-mutation-state": "error",
|
|
1356
|
+
"react/no-duplicate-key": "warn",
|
|
1357
|
+
"react/no-forward-ref": "warn",
|
|
1358
|
+
"react/no-implicit-key": "warn",
|
|
1359
|
+
"react/no-missing-key": "error",
|
|
1360
|
+
"react/no-nested-component-definitions": "error",
|
|
1361
|
+
"react/no-prop-types": "error",
|
|
1362
|
+
"react/no-redundant-should-component-update": "error",
|
|
1363
|
+
"react/no-set-state-in-component-did-mount": "warn",
|
|
1364
|
+
"react/no-set-state-in-component-did-update": "warn",
|
|
1365
|
+
"react/no-set-state-in-component-will-update": "warn",
|
|
1366
|
+
"react/no-string-refs": "error",
|
|
1367
|
+
"react/no-unnecessary-use-prefix": "warn",
|
|
1368
|
+
"react/no-unsafe-component-will-mount": "warn",
|
|
1369
|
+
"react/no-unsafe-component-will-receive-props": "warn",
|
|
1370
|
+
"react/no-unsafe-component-will-update": "warn",
|
|
1371
|
+
"react/no-unstable-context-value": "warn",
|
|
1372
|
+
"react/no-unstable-default-props": "warn",
|
|
1373
|
+
"react/no-unused-class-component-members": "warn",
|
|
1374
|
+
"react/no-unused-state": "warn",
|
|
1375
|
+
"react/no-use-context": "warn",
|
|
1376
|
+
"react/no-useless-forward-ref": "warn",
|
|
1377
|
+
"react/prefer-use-state-lazy-initialization": "warn",
|
|
1378
1378
|
...overrides
|
|
1379
1379
|
}
|
|
1380
1380
|
},
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@infernodesign/eslint-config",
|
|
3
3
|
"description": "ESLint config for Inferno Design.",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.3.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "Inferno Design <support@infernodesign.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -81,7 +81,6 @@
|
|
|
81
81
|
"@types/node": "^24.7.2",
|
|
82
82
|
"@unocss/eslint-plugin": "^66.5.3",
|
|
83
83
|
"astro-eslint-parser": "^1.2.2",
|
|
84
|
-
"bumpp": "^10.3.1",
|
|
85
84
|
"eslint": "^9.37.0",
|
|
86
85
|
"eslint-plugin-astro": "^1.3.1",
|
|
87
86
|
"eslint-plugin-format": "^1.0.2",
|
|
@@ -188,6 +187,7 @@
|
|
|
188
187
|
"build:inspect": "pnpm run build && pnpx @eslint/config-inspector build",
|
|
189
188
|
"dev": "tsdown --watch",
|
|
190
189
|
"gen": "tsx scripts/typegen.ts && tsx scripts/versiongen.ts",
|
|
190
|
+
"lint": "eslint . --cache --cache-location node_modules/.cache/.eslintcache",
|
|
191
191
|
"test": "vitest",
|
|
192
192
|
"typecheck": "tsc --noEmit --emitDeclarationOnly false"
|
|
193
193
|
}
|