@storm-software/eslint 0.34.0 β 0.36.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/README.md +1 -1
- package/dist/preset.mjs +411 -152
- package/package.json +5 -1
package/README.md
CHANGED
|
@@ -21,7 +21,7 @@ This package is part of the <b>β‘Storm-Ops</b> monorepo. The Storm-Ops packages
|
|
|
21
21
|
|
|
22
22
|
<h3 align="center">π» Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />
|
|
23
23
|
|
|
24
|
-
[](https://prettier.io/) [](http://nx.dev/) [](https://nextjs.org/) [](http://commitizen.github.io/cz-cli/)  [](https://fumadocs.vercel.app/) 
|
|
25
25
|
|
|
26
26
|
<!-- prettier-ignore-start -->
|
|
27
27
|
<!-- markdownlint-disable -->
|
package/dist/preset.mjs
CHANGED
|
@@ -337,7 +337,7 @@ var src = {
|
|
|
337
337
|
|
|
338
338
|
const eslint = /*@__PURE__*/getDefaultExportFromCjs(src);
|
|
339
339
|
|
|
340
|
-
const config$
|
|
340
|
+
const config$4 = {
|
|
341
341
|
// This rule has been deprecated, but not yet removed.
|
|
342
342
|
"jsx-a11y/no-onchange": "off",
|
|
343
343
|
// ensure emoji are accessible
|
|
@@ -612,7 +612,7 @@ const config$3 = {
|
|
|
612
612
|
"jsx-a11y/prefer-tag-over-role": "off"
|
|
613
613
|
};
|
|
614
614
|
|
|
615
|
-
const config$
|
|
615
|
+
const config$3 = {
|
|
616
616
|
// We recommend using TypeScript over `prop-types`, as `prop-types` can add
|
|
617
617
|
// to a project's build size.
|
|
618
618
|
"react/prop-types": "off",
|
|
@@ -1177,7 +1177,7 @@ const config$2 = {
|
|
|
1177
1177
|
]
|
|
1178
1178
|
};
|
|
1179
1179
|
|
|
1180
|
-
const config$
|
|
1180
|
+
const config$2 = {
|
|
1181
1181
|
// Enforce Rules of Hooks
|
|
1182
1182
|
// https://github.com/facebook/react/blob/c11015ff4f610ac2924d1fc6d569a17657a404fd/packages/eslint-plugin-react-hooks/src/RulesOfHooks.js
|
|
1183
1183
|
"react-hooks/rules-of-hooks": "error",
|
|
@@ -1186,6 +1186,300 @@ const config$1 = {
|
|
|
1186
1186
|
"react-hooks/exhaustive-deps": "warn"
|
|
1187
1187
|
};
|
|
1188
1188
|
|
|
1189
|
+
const config$1 = {
|
|
1190
|
+
/**
|
|
1191
|
+
* Require return statements in array methods callbacks.
|
|
1192
|
+
*
|
|
1193
|
+
* π« Not fixable -https://eslint.org/docs/rules/array-callback-return
|
|
1194
|
+
*/
|
|
1195
|
+
"array-callback-return": ["error", { allowImplicit: true }],
|
|
1196
|
+
/**
|
|
1197
|
+
* Treat `var` statements as if they were block scoped.
|
|
1198
|
+
*
|
|
1199
|
+
* π« Not fixable - https://eslint.org/docs/rules/block-scoped-var
|
|
1200
|
+
*/
|
|
1201
|
+
"block-scoped-var": "error",
|
|
1202
|
+
/**
|
|
1203
|
+
* Require curly braces for multiline blocks.
|
|
1204
|
+
*
|
|
1205
|
+
* π§ Fixable - https://eslint.org/docs/rules/curly
|
|
1206
|
+
*/
|
|
1207
|
+
curly: ["warn", "multi-line"],
|
|
1208
|
+
/**
|
|
1209
|
+
* Require default clauses in switch statements to be last (if used).
|
|
1210
|
+
*
|
|
1211
|
+
* π« Not fixable - https://eslint.org/docs/rules/default-case-last
|
|
1212
|
+
*/
|
|
1213
|
+
"default-case-last": "error",
|
|
1214
|
+
/**
|
|
1215
|
+
* Require triple equals (`===` and `!==`).
|
|
1216
|
+
*
|
|
1217
|
+
* π§ Fixable - https://eslint.org/docs/rules/eqeqeq
|
|
1218
|
+
*/
|
|
1219
|
+
eqeqeq: "error",
|
|
1220
|
+
/**
|
|
1221
|
+
* Require grouped accessor pairs in object literals and classes.
|
|
1222
|
+
*
|
|
1223
|
+
* π« Not fixable - https://eslint.org/docs/rules/grouped-accessor-pairs
|
|
1224
|
+
*/
|
|
1225
|
+
"grouped-accessor-pairs": "error",
|
|
1226
|
+
/**
|
|
1227
|
+
* Disallow use of `alert()`.
|
|
1228
|
+
*
|
|
1229
|
+
* π« Not fixable - https://eslint.org/docs/rules/no-alert
|
|
1230
|
+
*/
|
|
1231
|
+
"no-alert": "error",
|
|
1232
|
+
/**
|
|
1233
|
+
* Disallow use of `caller`/`callee`.
|
|
1234
|
+
*
|
|
1235
|
+
* π« Not fixable - https://eslint.org/docs/rules/no-caller
|
|
1236
|
+
*/
|
|
1237
|
+
"no-caller": "error",
|
|
1238
|
+
/**
|
|
1239
|
+
* Disallow returning value in constructor.
|
|
1240
|
+
*
|
|
1241
|
+
* π« Not fixable - https://eslint.org/docs/rules/no-constructor-return
|
|
1242
|
+
*/
|
|
1243
|
+
"no-constructor-return": "error",
|
|
1244
|
+
/**
|
|
1245
|
+
* Disallow using an `else` if the `if` block contains a return.
|
|
1246
|
+
*
|
|
1247
|
+
* π§ Fixable - https://eslint.org/docs/rules/no-else-return
|
|
1248
|
+
*/
|
|
1249
|
+
"no-else-return": "warn",
|
|
1250
|
+
/**
|
|
1251
|
+
* Disallow `eval()`.
|
|
1252
|
+
*
|
|
1253
|
+
* π« Not fixable - https://eslint.org/docs/rules/no-eval
|
|
1254
|
+
*/
|
|
1255
|
+
"no-eval": "error",
|
|
1256
|
+
/**
|
|
1257
|
+
* Disallow extending native objects.
|
|
1258
|
+
*
|
|
1259
|
+
* π« Not fixable - https://eslint.org/docs/rules/no-extend-native
|
|
1260
|
+
*/
|
|
1261
|
+
"no-extend-native": "error",
|
|
1262
|
+
/**
|
|
1263
|
+
* Disallow unnecessary function binding.
|
|
1264
|
+
*
|
|
1265
|
+
* π§ Fixable - https://eslint.org/docs/rules/no-extra-bind
|
|
1266
|
+
*/
|
|
1267
|
+
"no-extra-bind": "error",
|
|
1268
|
+
/**
|
|
1269
|
+
* Disallow unnecessary labels.
|
|
1270
|
+
*
|
|
1271
|
+
* π§ Fixable - https://eslint.org/docs/rules/no-extra-label
|
|
1272
|
+
*/
|
|
1273
|
+
"no-extra-label": "error",
|
|
1274
|
+
/**
|
|
1275
|
+
* Disallow floating decimals.
|
|
1276
|
+
*
|
|
1277
|
+
* π§ Fixable - https://eslint.org/docs/rules/no-floating-decimal
|
|
1278
|
+
*/
|
|
1279
|
+
"no-floating-decimal": "error",
|
|
1280
|
+
/**
|
|
1281
|
+
* Make people convert types explicitly e.g. `Boolean(foo)` instead of `!!foo`.
|
|
1282
|
+
*
|
|
1283
|
+
* π§ Partially Fixable - https://eslint.org/docs/rules/no-implicit-coercion
|
|
1284
|
+
*/
|
|
1285
|
+
"no-implicit-coercion": "error",
|
|
1286
|
+
/**
|
|
1287
|
+
* Disallow use of `eval()`-like methods.
|
|
1288
|
+
*
|
|
1289
|
+
* https://eslint.org/docs/rules/no-implied-eval
|
|
1290
|
+
*/
|
|
1291
|
+
"no-implied-eval": "error",
|
|
1292
|
+
/**
|
|
1293
|
+
* Disallow usage of `__iterator__` property.
|
|
1294
|
+
*
|
|
1295
|
+
* π« Not fixable - https://eslint.org/docs/rules/no-iterator
|
|
1296
|
+
*/
|
|
1297
|
+
"no-iterator": "error",
|
|
1298
|
+
/**
|
|
1299
|
+
* Disallow use of labels for anything other than loops and switches.
|
|
1300
|
+
*
|
|
1301
|
+
* π« Not fixable - https://eslint.org/docs/rules/no-labels
|
|
1302
|
+
*/
|
|
1303
|
+
"no-labels": ["error"],
|
|
1304
|
+
/**
|
|
1305
|
+
* Disallow unnecessary nested blocks.
|
|
1306
|
+
*
|
|
1307
|
+
* π« Not fixable - https://eslint.org/docs/rules/no-lone-blocks
|
|
1308
|
+
*/
|
|
1309
|
+
"no-lone-blocks": "error",
|
|
1310
|
+
/**
|
|
1311
|
+
* Disallow `new` for side effects.
|
|
1312
|
+
*
|
|
1313
|
+
* π« Not fixable - https://eslint.org/docs/rules/no-new
|
|
1314
|
+
*/
|
|
1315
|
+
"no-new": "error",
|
|
1316
|
+
/**
|
|
1317
|
+
* Disallow function constructors.
|
|
1318
|
+
*
|
|
1319
|
+
* π« Not fixable - https://eslint.org/docs/rules/no-new-func
|
|
1320
|
+
*/
|
|
1321
|
+
"no-new-func": "error",
|
|
1322
|
+
/**
|
|
1323
|
+
* Disallow base types wrapper instances, such as `new String('foo')`.
|
|
1324
|
+
*
|
|
1325
|
+
* π« Not fixable - https://eslint.org/docs/rules/no-new-wrappers
|
|
1326
|
+
*/
|
|
1327
|
+
"no-new-wrappers": "error",
|
|
1328
|
+
/**
|
|
1329
|
+
* Disallow use of octal escape sequences in string literals.
|
|
1330
|
+
*
|
|
1331
|
+
* π« Not fixable - https://eslint.org/docs/rules/no-octal-escape
|
|
1332
|
+
*/
|
|
1333
|
+
"no-octal-escape": "error",
|
|
1334
|
+
/**
|
|
1335
|
+
* Disallow reassignment of function parameters.
|
|
1336
|
+
*
|
|
1337
|
+
* π« Not fixable - https://eslint.org/docs/rules/no-param-reassign
|
|
1338
|
+
*/
|
|
1339
|
+
"no-param-reassign": "error",
|
|
1340
|
+
/**
|
|
1341
|
+
* Disallow usage of the deprecated `__proto__` property.
|
|
1342
|
+
*
|
|
1343
|
+
* π« Not fixable - https://eslint.org/docs/rules/no-proto
|
|
1344
|
+
*/
|
|
1345
|
+
"no-proto": "error",
|
|
1346
|
+
/**
|
|
1347
|
+
* Disallow assignment in `return` statement.
|
|
1348
|
+
*
|
|
1349
|
+
* π« Not fixable - https://eslint.org/docs/rules/no-return-assign
|
|
1350
|
+
*/
|
|
1351
|
+
"no-return-assign": "error",
|
|
1352
|
+
/**
|
|
1353
|
+
* Disallows unnecessary `return await`.
|
|
1354
|
+
*
|
|
1355
|
+
* π« Not fixable - https://eslint.org/docs/rules/no-return-await
|
|
1356
|
+
*/
|
|
1357
|
+
"no-return-await": "error",
|
|
1358
|
+
/**
|
|
1359
|
+
* Disallow use of `javascript:` urls.
|
|
1360
|
+
*
|
|
1361
|
+
* π« Not fixable - https://eslint.org/docs/rules/no-script-url
|
|
1362
|
+
*/
|
|
1363
|
+
"no-script-url": "error",
|
|
1364
|
+
/**
|
|
1365
|
+
* Disallow comparisons where both sides are exactly the same.
|
|
1366
|
+
*
|
|
1367
|
+
* π« Not fixable - https://eslint.org/docs/rules/no-self-compare
|
|
1368
|
+
*/
|
|
1369
|
+
"no-self-compare": "error",
|
|
1370
|
+
/**
|
|
1371
|
+
* Disallow use of comma operator.
|
|
1372
|
+
*
|
|
1373
|
+
* π« Not fixable - https://eslint.org/docs/rules/no-sequences
|
|
1374
|
+
*/
|
|
1375
|
+
"no-sequences": "error",
|
|
1376
|
+
/**
|
|
1377
|
+
* Disallow unnecessary `.call()` and `.apply()`.
|
|
1378
|
+
*
|
|
1379
|
+
* π« Not fixable - https://eslint.org/docs/rules/no-useless-call
|
|
1380
|
+
*/
|
|
1381
|
+
"no-useless-call": "error",
|
|
1382
|
+
/**
|
|
1383
|
+
* Disallow unnecessary concatenation of strings.
|
|
1384
|
+
*
|
|
1385
|
+
* π« Not fixable - https://eslint.org/docs/rules/no-useless-concat
|
|
1386
|
+
*/
|
|
1387
|
+
"no-useless-concat": "error",
|
|
1388
|
+
/**
|
|
1389
|
+
* Disallow redundant return statements.
|
|
1390
|
+
*
|
|
1391
|
+
* π§ Fixable - https://eslint.org/docs/rules/no-useless-return
|
|
1392
|
+
*/
|
|
1393
|
+
"no-useless-return": "warn",
|
|
1394
|
+
/**
|
|
1395
|
+
* Require using named capture groups in regular expressions.
|
|
1396
|
+
*
|
|
1397
|
+
* π« Not fixable - https://eslint.org/docs/rules/prefer-named-capture-group
|
|
1398
|
+
*/
|
|
1399
|
+
"prefer-named-capture-group": "error",
|
|
1400
|
+
/**
|
|
1401
|
+
* Require using Error objects as Promise rejection reasons.
|
|
1402
|
+
*
|
|
1403
|
+
* π« Not fixable - https://eslint.org/docs/rules/prefer-promise-reject-errors
|
|
1404
|
+
*/
|
|
1405
|
+
"prefer-promise-reject-errors": ["error", { allowEmptyReject: true }],
|
|
1406
|
+
/**
|
|
1407
|
+
* Disallow use of the RegExp constructor in favor of regular expression
|
|
1408
|
+
* literals.
|
|
1409
|
+
*
|
|
1410
|
+
* π« Not fixable - https://eslint.org/docs/rules/prefer-regex-literals
|
|
1411
|
+
*/
|
|
1412
|
+
"prefer-regex-literals": "error",
|
|
1413
|
+
/**
|
|
1414
|
+
* Disallow "Yoda conditions", ensuring the comparison.
|
|
1415
|
+
*
|
|
1416
|
+
* π§ Fixable - https://eslint.org/docs/rules/yoda
|
|
1417
|
+
*/
|
|
1418
|
+
yoda: "warn",
|
|
1419
|
+
"unicorn/number-literal-case": "off",
|
|
1420
|
+
"unicorn/template-indent": "off",
|
|
1421
|
+
"unicorn/prevent-abbreviations": "off",
|
|
1422
|
+
"unicorn/no-await-expression-member": "off",
|
|
1423
|
+
"unicorn/no-useless-undefined": "off",
|
|
1424
|
+
"unicorn/no-array-push-push": "off",
|
|
1425
|
+
"unicorn/no-array-reduce": "off",
|
|
1426
|
+
"unicorn/no-useless-switch-case": "off",
|
|
1427
|
+
"@typescript-eslint/no-explicit-any": "off",
|
|
1428
|
+
"@typescript-eslint/no-empty-function": "off",
|
|
1429
|
+
"@typescript-eslint/no-var-requires": "off",
|
|
1430
|
+
"@typescript-eslint/ban-ts-comment": "off",
|
|
1431
|
+
"@typescript-eslint/no-empty-interface": "off",
|
|
1432
|
+
"@typescript-eslint/explicit-module-boundary-types": "off",
|
|
1433
|
+
"@typescript-eslint/explicit-function-return-type": "off",
|
|
1434
|
+
"@typescript-eslint/no-unused-vars": [
|
|
1435
|
+
"warn",
|
|
1436
|
+
{ varsIgnorePattern: "^_", argsIgnorePattern: "^_" }
|
|
1437
|
+
],
|
|
1438
|
+
"unicorn/prefer-string-replace-all": "off",
|
|
1439
|
+
"unicorn/no-abusive-eslint-disable": "off",
|
|
1440
|
+
"unicorn/import-style": "off",
|
|
1441
|
+
"unicorn/prefer-module": "off",
|
|
1442
|
+
"unicorn/consistent-function-scoping": "off",
|
|
1443
|
+
"class-methods-use-this": "off",
|
|
1444
|
+
"@typescript-eslint/no-restricted-imports": [
|
|
1445
|
+
"error",
|
|
1446
|
+
{
|
|
1447
|
+
"patterns": [
|
|
1448
|
+
{
|
|
1449
|
+
"group": ["nx/src/plugins/js*"],
|
|
1450
|
+
"message": "Imports from 'nx/src/plugins/js' are not allowed. Use '@nx/js' instead"
|
|
1451
|
+
},
|
|
1452
|
+
{
|
|
1453
|
+
"group": ["**/native-bindings", "**/native-bindings.js"],
|
|
1454
|
+
"message": "Direct imports from native-bindings.js are not allowed. Import from index.js instead."
|
|
1455
|
+
},
|
|
1456
|
+
{
|
|
1457
|
+
"group": ["create-storm-workspace"],
|
|
1458
|
+
"message": "Direct imports from `create-storm-workspace` are not allowed. Instead install this package globally (example: 'npm i create-storm-workspace -g')."
|
|
1459
|
+
},
|
|
1460
|
+
{
|
|
1461
|
+
"group": ["create-nx-workspace"],
|
|
1462
|
+
"message": "Direct imports from `create-nx-workspace` are not allowed. Instead install this package globally (example: 'npm i create-nx-workspace -g')."
|
|
1463
|
+
}
|
|
1464
|
+
]
|
|
1465
|
+
}
|
|
1466
|
+
],
|
|
1467
|
+
"@nx/enforce-module-boundaries": [
|
|
1468
|
+
"error",
|
|
1469
|
+
{
|
|
1470
|
+
enforceBuildableLibDependency: true,
|
|
1471
|
+
checkDynamicDependenciesExceptions: [".*"],
|
|
1472
|
+
allow: [],
|
|
1473
|
+
depConstraints: [
|
|
1474
|
+
{
|
|
1475
|
+
sourceTag: "*",
|
|
1476
|
+
onlyDependOnLibsWithTags: ["*"]
|
|
1477
|
+
}
|
|
1478
|
+
]
|
|
1479
|
+
}
|
|
1480
|
+
]
|
|
1481
|
+
};
|
|
1482
|
+
|
|
1189
1483
|
const config = {
|
|
1190
1484
|
/**
|
|
1191
1485
|
* Require TSDoc comments conform to the TSDoc specification.
|
|
@@ -12589,23 +12883,27 @@ const plugin = {
|
|
|
12589
12883
|
},
|
|
12590
12884
|
processors: {}
|
|
12591
12885
|
};
|
|
12592
|
-
plugin.configs.recommended =
|
|
12593
|
-
plugins: { banner: plugin },
|
|
12594
|
-
|
|
12595
|
-
"
|
|
12596
|
-
|
|
12597
|
-
|
|
12598
|
-
|
|
12599
|
-
|
|
12600
|
-
|
|
12601
|
-
|
|
12602
|
-
|
|
12603
|
-
|
|
12604
|
-
|
|
12605
|
-
|
|
12886
|
+
plugin.configs.recommended = [
|
|
12887
|
+
{ name: "banner/recommended/plugin", plugins: { banner: plugin } },
|
|
12888
|
+
{
|
|
12889
|
+
name: "banner/recommended/code-files",
|
|
12890
|
+
files: [
|
|
12891
|
+
"**/*.{,c,m}{j,t}s{,x}",
|
|
12892
|
+
"!tools/**/*",
|
|
12893
|
+
"!docs/**/*",
|
|
12894
|
+
"!crates/**/*",
|
|
12895
|
+
"!.*/**/*"
|
|
12896
|
+
],
|
|
12897
|
+
rules: {
|
|
12898
|
+
"banner/banner": [
|
|
12899
|
+
"error",
|
|
12900
|
+
{ banner: getFileBanner(""), commentType: "block", numNewlines: 2 }
|
|
12901
|
+
]
|
|
12902
|
+
}
|
|
12606
12903
|
}
|
|
12607
|
-
|
|
12904
|
+
];
|
|
12608
12905
|
|
|
12906
|
+
const CODE_BLOCK = "**/*.md{,x}/*";
|
|
12609
12907
|
const CODE_FILE = "**/*.{,c,m}{j,t}s{,x}";
|
|
12610
12908
|
const TS_FILE = "**/*.{,c,m}ts{,x}";
|
|
12611
12909
|
|
|
@@ -12616,7 +12914,7 @@ const formatConfig = (name, config = []) => {
|
|
|
12616
12914
|
}
|
|
12617
12915
|
return {
|
|
12618
12916
|
...config2,
|
|
12619
|
-
name: `Storm Software (${name}) #${index + 1}`,
|
|
12917
|
+
name: `Storm Software (${config2.name ? config2.name : name}) #${index + 1}`,
|
|
12620
12918
|
settings: {
|
|
12621
12919
|
"import/resolver": "node",
|
|
12622
12920
|
...config2.settings ?? {}
|
|
@@ -12626,103 +12924,20 @@ const formatConfig = (name, config = []) => {
|
|
|
12626
12924
|
};
|
|
12627
12925
|
|
|
12628
12926
|
function stormPreset(options = {
|
|
12629
|
-
|
|
12630
|
-
|
|
12631
|
-
|
|
12632
|
-
|
|
12633
|
-
{
|
|
12634
|
-
sourceTag: "*",
|
|
12635
|
-
onlyDependOnLibsWithTags: ["*"]
|
|
12636
|
-
}
|
|
12637
|
-
]
|
|
12638
|
-
}
|
|
12927
|
+
rules: {},
|
|
12928
|
+
ignores: [],
|
|
12929
|
+
markdown: {},
|
|
12930
|
+
react: {}
|
|
12639
12931
|
}, ...userConfigs) {
|
|
12640
|
-
const rules = {
|
|
12641
|
-
"unicorn/number-literal-case": 0,
|
|
12642
|
-
"unicorn/template-indent": 0,
|
|
12643
|
-
"unicorn/prevent-abbreviations": 0,
|
|
12644
|
-
"unicorn/no-await-expression-member": 0,
|
|
12645
|
-
"unicorn/no-useless-undefined": 0,
|
|
12646
|
-
"unicorn/no-array-push-push": 0,
|
|
12647
|
-
"unicorn/no-array-reduce": 0,
|
|
12648
|
-
"unicorn/no-useless-switch-case": 0,
|
|
12649
|
-
"@typescript-eslint/no-explicit-any": 0,
|
|
12650
|
-
"@typescript-eslint/no-empty-function": 0,
|
|
12651
|
-
"@typescript-eslint/no-var-requires": 0,
|
|
12652
|
-
"@typescript-eslint/ban-ts-comment": 0,
|
|
12653
|
-
"@typescript-eslint/no-empty-interface": 0,
|
|
12654
|
-
"@typescript-eslint/explicit-module-boundary-types": 0,
|
|
12655
|
-
"@typescript-eslint/explicit-function-return-type": 0,
|
|
12656
|
-
"@typescript-eslint/no-unused-vars": [
|
|
12657
|
-
"warn",
|
|
12658
|
-
{ varsIgnorePattern: "^_", argsIgnorePattern: "^_" }
|
|
12659
|
-
],
|
|
12660
|
-
"unicorn/prefer-string-replace-all": 0,
|
|
12661
|
-
"unicorn/no-abusive-eslint-disable": 0,
|
|
12662
|
-
"unicorn/import-style": 0,
|
|
12663
|
-
"unicorn/prefer-module": 0,
|
|
12664
|
-
"unicorn/consistent-function-scoping": 0,
|
|
12665
|
-
"class-methods-use-this": 0,
|
|
12666
|
-
...options.rules
|
|
12667
|
-
};
|
|
12668
12932
|
const configs = [
|
|
12669
12933
|
// https://eslint.org/docs/latest/rules/
|
|
12670
12934
|
eslint.configs.recommended,
|
|
12671
12935
|
// https://typescript-eslint.io/
|
|
12672
|
-
...tsEslint$1.configs.
|
|
12936
|
+
...tsEslint$1.configs.stylisticTypeChecked,
|
|
12673
12937
|
// https://github.com/sindresorhus/eslint-plugin-unicorn
|
|
12674
12938
|
eslintPluginUnicorn.configs["flat/recommended"],
|
|
12675
12939
|
// Prettier
|
|
12676
12940
|
prettierConfig,
|
|
12677
|
-
// Preset overrides
|
|
12678
|
-
{ rules },
|
|
12679
|
-
{
|
|
12680
|
-
languageOptions: {
|
|
12681
|
-
globals: Object.fromEntries(
|
|
12682
|
-
Object.keys(globals).flatMap(
|
|
12683
|
-
(group) => Object.keys(globals[group]).map((k) => [
|
|
12684
|
-
k,
|
|
12685
|
-
true
|
|
12686
|
-
])
|
|
12687
|
-
)
|
|
12688
|
-
)
|
|
12689
|
-
}
|
|
12690
|
-
},
|
|
12691
|
-
{ ignores: ["dist", "coverage", ...options.ignores || []] },
|
|
12692
|
-
// Markdown
|
|
12693
|
-
// https://www.npmjs.com/package/eslint-plugin-markdown
|
|
12694
|
-
options.markdown !== false && { plugins: { markdown } },
|
|
12695
|
-
options.markdown !== false && {
|
|
12696
|
-
files: [CODE_FILE],
|
|
12697
|
-
processor: "markdown/markdown"
|
|
12698
|
-
},
|
|
12699
|
-
options.markdown !== false && {
|
|
12700
|
-
files: ["**/*.md/*.js", "**/*.md/*.ts"],
|
|
12701
|
-
rules: {
|
|
12702
|
-
"unicorn/filename-case": 0,
|
|
12703
|
-
"no-undef": 0,
|
|
12704
|
-
"no-unused-expressions": 0,
|
|
12705
|
-
"padded-blocks": 0,
|
|
12706
|
-
"no-empty-pattern": 0,
|
|
12707
|
-
"no-redeclare": 0,
|
|
12708
|
-
"no-import-assign": 0,
|
|
12709
|
-
...options.markdown?.rules
|
|
12710
|
-
}
|
|
12711
|
-
},
|
|
12712
|
-
// React
|
|
12713
|
-
// https://www.npmjs.com/package/eslint-plugin-react
|
|
12714
|
-
options.react !== false && {
|
|
12715
|
-
plugins: { react, "react-hooks": reactHooks, "jsx-a11y": jsxA11y }
|
|
12716
|
-
},
|
|
12717
|
-
options.react !== false && {
|
|
12718
|
-
files: [CODE_FILE],
|
|
12719
|
-
rules: {
|
|
12720
|
-
...config$2,
|
|
12721
|
-
...config$1,
|
|
12722
|
-
...config$3,
|
|
12723
|
-
...options.react?.rules
|
|
12724
|
-
}
|
|
12725
|
-
},
|
|
12726
12941
|
// Import
|
|
12727
12942
|
// https://www.npmjs.com/package/eslint-plugin-import
|
|
12728
12943
|
// { plugins: { import: importEslint } },
|
|
@@ -12731,7 +12946,7 @@ function stormPreset(options = {
|
|
|
12731
12946
|
// rules: importRules
|
|
12732
12947
|
// },
|
|
12733
12948
|
// Banner
|
|
12734
|
-
plugin.configs["recommended"],
|
|
12949
|
+
plugin.configs["recommended"][0],
|
|
12735
12950
|
// TSDoc
|
|
12736
12951
|
// https://www.npmjs.com/package/eslint-plugin-tsdoc
|
|
12737
12952
|
{ plugins: { tsdoc } },
|
|
@@ -12739,51 +12954,9 @@ function stormPreset(options = {
|
|
|
12739
12954
|
files: [TS_FILE],
|
|
12740
12955
|
rules: config
|
|
12741
12956
|
},
|
|
12742
|
-
//
|
|
12957
|
+
// NX
|
|
12743
12958
|
{
|
|
12744
|
-
plugins: { "@nx": nxPlugin }
|
|
12745
|
-
languageOptions: {
|
|
12746
|
-
parser: tsEslint$1.parser,
|
|
12747
|
-
globals: {
|
|
12748
|
-
...globals.node,
|
|
12749
|
-
...globals.browser,
|
|
12750
|
-
"StormProvider": true
|
|
12751
|
-
}
|
|
12752
|
-
},
|
|
12753
|
-
files: [CODE_FILE],
|
|
12754
|
-
rules: {
|
|
12755
|
-
"@nx/enforce-module-boundaries": [
|
|
12756
|
-
"error",
|
|
12757
|
-
options.moduleBoundaries ? options.moduleBoundaries : {
|
|
12758
|
-
enforceBuildableLibDependency: true,
|
|
12759
|
-
checkDynamicDependenciesExceptions: [".*"],
|
|
12760
|
-
allow: [],
|
|
12761
|
-
depConstraints: [
|
|
12762
|
-
{
|
|
12763
|
-
sourceTag: "*",
|
|
12764
|
-
onlyDependOnLibsWithTags: ["*"]
|
|
12765
|
-
}
|
|
12766
|
-
]
|
|
12767
|
-
}
|
|
12768
|
-
],
|
|
12769
|
-
"no-restricted-imports": ["error", "create-nx-workspace"],
|
|
12770
|
-
"@typescript-eslint/no-restricted-imports": [
|
|
12771
|
-
"error",
|
|
12772
|
-
{
|
|
12773
|
-
"patterns": [
|
|
12774
|
-
{
|
|
12775
|
-
"group": ["nx/src/plugins/js*"],
|
|
12776
|
-
"message": "Imports from 'nx/src/plugins/js' are not allowed. Use '@nx/js' instead"
|
|
12777
|
-
},
|
|
12778
|
-
{
|
|
12779
|
-
"group": ["**/native-bindings", "**/native-bindings.js", ""],
|
|
12780
|
-
"message": "Direct imports from native-bindings.js are not allowed. Import from index.js instead."
|
|
12781
|
-
}
|
|
12782
|
-
]
|
|
12783
|
-
}
|
|
12784
|
-
],
|
|
12785
|
-
"unicorn/prefer-logical-operator-over-ternary": "warn"
|
|
12786
|
-
}
|
|
12959
|
+
plugins: { "@nx": nxPlugin }
|
|
12787
12960
|
},
|
|
12788
12961
|
// Json
|
|
12789
12962
|
// https://www.npmjs.com/package/eslint-plugin-json
|
|
@@ -12825,6 +12998,92 @@ function stormPreset(options = {
|
|
|
12825
12998
|
// User overrides
|
|
12826
12999
|
...userConfigs
|
|
12827
13000
|
].filter(Boolean);
|
|
13001
|
+
const typescriptConfig = {
|
|
13002
|
+
// https://typescript-eslint.io/
|
|
13003
|
+
...tsEslint$1.configs.stylisticTypeChecked,
|
|
13004
|
+
// https://www.npmjs.com/package/eslint-plugin-unicorn
|
|
13005
|
+
...eslintPluginUnicorn.configs["flat/recommended"],
|
|
13006
|
+
files: [CODE_FILE],
|
|
13007
|
+
languageOptions: {
|
|
13008
|
+
parser: tsEslint$1.parser,
|
|
13009
|
+
globals: {
|
|
13010
|
+
...Object.fromEntries(
|
|
13011
|
+
Object.keys(globals).flatMap(
|
|
13012
|
+
(group) => Object.keys(globals[group]).map((k) => [
|
|
13013
|
+
k,
|
|
13014
|
+
true
|
|
13015
|
+
])
|
|
13016
|
+
)
|
|
13017
|
+
),
|
|
13018
|
+
"StormProvider": true
|
|
13019
|
+
}
|
|
13020
|
+
},
|
|
13021
|
+
rules: {
|
|
13022
|
+
// https://eslint.org/docs/latest/rules/
|
|
13023
|
+
...eslint.configs.recommended.rules,
|
|
13024
|
+
// https://typescript-eslint.io/
|
|
13025
|
+
...tsEslint$1.configs.stylisticTypeChecked.reduce(
|
|
13026
|
+
(ret, record) => ({ ...ret, ...record.rules }),
|
|
13027
|
+
{}
|
|
13028
|
+
),
|
|
13029
|
+
// Prettier
|
|
13030
|
+
...prettierConfig.rules,
|
|
13031
|
+
// https://www.npmjs.com/package/eslint-plugin-unicorn
|
|
13032
|
+
...eslintPluginUnicorn.configs["flat/recommended"].rules,
|
|
13033
|
+
// Banner
|
|
13034
|
+
...plugin.configs["recommended"][1].rules,
|
|
13035
|
+
...config$1,
|
|
13036
|
+
...options.rules ?? {}
|
|
13037
|
+
},
|
|
13038
|
+
ignores: ["dist", "coverage", "tmp", ...options.ignores || []]
|
|
13039
|
+
};
|
|
13040
|
+
if (options.react) {
|
|
13041
|
+
typescriptConfig.plugins = {
|
|
13042
|
+
...typescriptConfig.plugins,
|
|
13043
|
+
react,
|
|
13044
|
+
"react-hooks": reactHooks,
|
|
13045
|
+
"jsx-a11y": jsxA11y
|
|
13046
|
+
};
|
|
13047
|
+
typescriptConfig.rules = {
|
|
13048
|
+
...typescriptConfig.rules,
|
|
13049
|
+
// React
|
|
13050
|
+
...config$3,
|
|
13051
|
+
...config$2,
|
|
13052
|
+
...config$4,
|
|
13053
|
+
...options.react
|
|
13054
|
+
};
|
|
13055
|
+
}
|
|
13056
|
+
configs.push(typescriptConfig);
|
|
13057
|
+
if (options.markdown) {
|
|
13058
|
+
configs.push(...markdown.configs.recommended);
|
|
13059
|
+
configs.push({
|
|
13060
|
+
files: [CODE_BLOCK],
|
|
13061
|
+
processor: "markdown/markdown",
|
|
13062
|
+
rules: {
|
|
13063
|
+
"unicorn/filename-case": "off",
|
|
13064
|
+
"no-undef": "off",
|
|
13065
|
+
"no-unused-expressions": "off",
|
|
13066
|
+
"padded-blocks": "off",
|
|
13067
|
+
"no-empty-pattern": "off",
|
|
13068
|
+
"no-redeclare": "off",
|
|
13069
|
+
"no-import-assign": "off",
|
|
13070
|
+
...options.markdown
|
|
13071
|
+
}
|
|
13072
|
+
});
|
|
13073
|
+
configs.push({
|
|
13074
|
+
files: ["**/*.md/*.js", "**/*.md/*.ts"],
|
|
13075
|
+
rules: {
|
|
13076
|
+
"unicorn/filename-case": "off",
|
|
13077
|
+
"no-undef": "off",
|
|
13078
|
+
"no-unused-expressions": "off",
|
|
13079
|
+
"padded-blocks": "off",
|
|
13080
|
+
"no-empty-pattern": "off",
|
|
13081
|
+
"no-redeclare": "off",
|
|
13082
|
+
"no-import-assign": "off",
|
|
13083
|
+
...options.markdown
|
|
13084
|
+
}
|
|
13085
|
+
});
|
|
13086
|
+
}
|
|
12828
13087
|
return formatConfig("Preset", configs);
|
|
12829
13088
|
}
|
|
12830
13089
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storm-software/eslint",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.36.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "β‘ A package containing the base ESLint configuration used by Storm Software across many projects.",
|
|
6
6
|
"repository": {
|
|
@@ -31,6 +31,10 @@
|
|
|
31
31
|
".": {
|
|
32
32
|
"types": "./dist/preset.d.mts",
|
|
33
33
|
"import": "./dist/preset.mjs"
|
|
34
|
+
},
|
|
35
|
+
"./preset": {
|
|
36
|
+
"types": "./dist/preset.d.mts",
|
|
37
|
+
"import": "./dist/preset.mjs"
|
|
34
38
|
}
|
|
35
39
|
},
|
|
36
40
|
"files": [
|