@prowise/eslint-config-linting-rules 2.0.0 → 2.0.2
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/backend.js +5 -16
- package/base.js +30 -0
- package/eslint.config.js +9 -0
- package/front-react.js +19 -0
- package/front-solid.js +19 -0
- package/index.js +2 -34
- package/package.json +1 -1
- package/rules/{base-rules.js → baseSettings.js} +43 -551
- package/rules/plugin-import-rules.js +14 -2
- package/rules/plugin-jest-rules.js +65 -0
- package/rules/plugin-jsdoc-rules.js +6 -2
- package/rules/plugin-jsx-a11y-rules.js +49 -43
- package/rules/plugin-node-rules.js +41 -24
- package/rules/plugin-prefer-arrow-rules.js +17 -0
- package/rules/plugin-react-hooks-rules.js +5 -10
- package/rules/plugin-react-rules.js +24 -42
- package/rules/plugin-solid-rules.js +8 -2
- package/rules/plugin-stylistic-rules.js +538 -0
- package/rules/plugin-typescript-rules.js +59 -261
- package/rules/plugin-vitest-rules.js +77 -0
- package/rules/test-rules.js +1 -109
- package/typescript.js +6 -22
- package/eslint-plugin-esm-extensions/index.js +0 -155
- package/eslint-plugin-esm-extensions/package.json +0 -21
- package/frontend-vite.js +0 -38
- package/frontend.js +0 -39
- package/solid.js +0 -35
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
import confusingBrowserGlobals from "confusing-browser-globals";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
export default {
|
|
4
4
|
/*
|
|
5
5
|
* ✅ recommended
|
|
6
|
+
* 🔒 strict
|
|
6
7
|
* 🔧 fixable
|
|
7
8
|
* 💡 has suggestion
|
|
9
|
+
* 💭 requires type information
|
|
8
10
|
*/
|
|
9
11
|
|
|
10
12
|
rules: {
|
|
@@ -148,6 +150,11 @@ module.exports = {
|
|
|
148
150
|
*/
|
|
149
151
|
"no-empty-pattern": "error",
|
|
150
152
|
|
|
153
|
+
/**
|
|
154
|
+
* Disallow empty destructuring patterns ✅
|
|
155
|
+
* https://eslint.org/docs/latest/rules/no-empty-pattern.
|
|
156
|
+
*/
|
|
157
|
+
"no-empty-static-block": "off",
|
|
151
158
|
/**
|
|
152
159
|
* Disallow assigning to the exception in a catch block ✅
|
|
153
160
|
* https://eslint.org/docs/latest/rules/no-ex-assign.
|
|
@@ -204,9 +211,9 @@ module.exports = {
|
|
|
204
211
|
|
|
205
212
|
/**
|
|
206
213
|
* Disallow symbol constructor ✅
|
|
207
|
-
* https://eslint.org/docs/latest/rules/no-new-
|
|
214
|
+
* https://eslint.org/docs/latest/rules/no-new-native-nonconstructor.
|
|
208
215
|
*/
|
|
209
|
-
"no-new-
|
|
216
|
+
"no-new-native-nonconstructor": "error",
|
|
210
217
|
|
|
211
218
|
/**
|
|
212
219
|
* Disallow the use of object properties of the global object (Math and JSON) as functions ✅
|
|
@@ -404,7 +411,29 @@ module.exports = {
|
|
|
404
411
|
* Enforce that class methods use "this"
|
|
405
412
|
* https://eslint.org/docs/latest/rules/class-methods-use-this.
|
|
406
413
|
*/
|
|
407
|
-
"class-methods-use-this":
|
|
414
|
+
"class-methods-use-this": [
|
|
415
|
+
"off",
|
|
416
|
+
{
|
|
417
|
+
exceptMethods: [
|
|
418
|
+
"render",
|
|
419
|
+
"getInitialState",
|
|
420
|
+
"getDefaultProps",
|
|
421
|
+
"getChildContext",
|
|
422
|
+
"componentWillMount",
|
|
423
|
+
"UNSAFE_componentWillMount",
|
|
424
|
+
"componentDidMount",
|
|
425
|
+
"componentWillReceiveProps",
|
|
426
|
+
"UNSAFE_componentWillReceiveProps",
|
|
427
|
+
"shouldComponentUpdate",
|
|
428
|
+
"componentWillUpdate",
|
|
429
|
+
"UNSAFE_componentWillUpdate",
|
|
430
|
+
"componentDidUpdate",
|
|
431
|
+
"componentWillUnmount",
|
|
432
|
+
"componentDidCatch",
|
|
433
|
+
"getSnapshotBeforeUpdate",
|
|
434
|
+
],
|
|
435
|
+
},
|
|
436
|
+
],
|
|
408
437
|
|
|
409
438
|
/**
|
|
410
439
|
* Specify the maximum cyclomatic complexity allowed in a program
|
|
@@ -499,7 +528,7 @@ module.exports = {
|
|
|
499
528
|
* Disallow specified identifiers
|
|
500
529
|
* https://eslint.org/docs/latest/rules/id-denylist.
|
|
501
530
|
*/
|
|
502
|
-
"id-
|
|
531
|
+
"id-denylist": ["error", "any", "Undefined"],
|
|
503
532
|
|
|
504
533
|
/**
|
|
505
534
|
* This option enforces minimum and maximum identifier lengths
|
|
@@ -571,12 +600,6 @@ module.exports = {
|
|
|
571
600
|
*/
|
|
572
601
|
"max-statements": ["off", 10],
|
|
573
602
|
|
|
574
|
-
/**
|
|
575
|
-
* Enforce a particular style for multiline comments 🔧
|
|
576
|
-
* https://eslint.org/docs/latest/rules/multiline-comment-style.
|
|
577
|
-
*/
|
|
578
|
-
"multiline-comment-style": ["off", "starred-block"],
|
|
579
|
-
|
|
580
603
|
/**
|
|
581
604
|
* Require a capital letter for constructors
|
|
582
605
|
* https://eslint.org/docs/latest/rules/new-cap.
|
|
@@ -621,12 +644,6 @@ module.exports = {
|
|
|
621
644
|
*/
|
|
622
645
|
"no-case-declarations": "error",
|
|
623
646
|
|
|
624
|
-
/**
|
|
625
|
-
* Disallow arrow functions where they could be confused with comparisons 🔧
|
|
626
|
-
* https://eslint.org/docs/latest/rules/no-confusing-arrow.
|
|
627
|
-
*/
|
|
628
|
-
"no-confusing-arrow": "warn",
|
|
629
|
-
|
|
630
647
|
/**
|
|
631
648
|
* Disallow use of console
|
|
632
649
|
* https://eslint.org/docs/latest/rules/no-console.
|
|
@@ -710,18 +727,6 @@ module.exports = {
|
|
|
710
727
|
*/
|
|
711
728
|
"no-extra-label": "error",
|
|
712
729
|
|
|
713
|
-
/**
|
|
714
|
-
* Disallow unnecessary semicolons ✅ 🔧
|
|
715
|
-
* https://eslint.org/docs/latest/rules/no-extra-semi.
|
|
716
|
-
*/
|
|
717
|
-
"no-extra-semi": "error",
|
|
718
|
-
|
|
719
|
-
/**
|
|
720
|
-
* Disallow the use of leading or trailing decimal points in numeric literals 🔧
|
|
721
|
-
* https://eslint.org/docs/latest/rules/no-floating-decimal.
|
|
722
|
-
*/
|
|
723
|
-
"no-floating-decimal": "error",
|
|
724
|
-
|
|
725
730
|
/**
|
|
726
731
|
* Disallow reassignments of native objects or read-only globals ✅
|
|
727
732
|
* https://eslint.org/docs/latest/rules/no-global-assign.
|
|
@@ -816,30 +821,6 @@ module.exports = {
|
|
|
816
821
|
},
|
|
817
822
|
],
|
|
818
823
|
|
|
819
|
-
/**
|
|
820
|
-
* Disallow un-paren"d mixes of different operators
|
|
821
|
-
* https://eslint.org/docs/latest/rules/no-mixed-operators.
|
|
822
|
-
*/
|
|
823
|
-
"no-mixed-operators": [
|
|
824
|
-
"error",
|
|
825
|
-
{
|
|
826
|
-
// the list of arithmetic groups disallows mixing `%` and `**`
|
|
827
|
-
// with other arithmetic operators.
|
|
828
|
-
groups: [
|
|
829
|
-
["%", "**"],
|
|
830
|
-
["%", "+"],
|
|
831
|
-
["%", "-"],
|
|
832
|
-
["%", "*"],
|
|
833
|
-
["%", "/"],
|
|
834
|
-
["/", "*"],
|
|
835
|
-
["&", "|", "<<", ">>", ">>>"],
|
|
836
|
-
["==", "!=", "===", "!=="],
|
|
837
|
-
["&&", "||"],
|
|
838
|
-
],
|
|
839
|
-
allowSamePrecedence: false,
|
|
840
|
-
},
|
|
841
|
-
],
|
|
842
|
-
|
|
843
824
|
/**
|
|
844
825
|
* Disallow use of chained assignment expressions
|
|
845
826
|
* https://eslint.org/docs/latest/rules/no-multi-assign.
|
|
@@ -878,9 +859,9 @@ module.exports = {
|
|
|
878
859
|
|
|
879
860
|
/**
|
|
880
861
|
* Disallow use of the Object constructor
|
|
881
|
-
* https://eslint.org/docs/latest/rules/no-
|
|
862
|
+
* https://eslint.org/docs/latest/rules/no-object-constructor.
|
|
882
863
|
*/
|
|
883
|
-
"no-
|
|
864
|
+
"no-object-constructor": "error",
|
|
884
865
|
|
|
885
866
|
/**
|
|
886
867
|
* Disallows creating new instances of String, Number, and Boolean
|
|
@@ -1052,12 +1033,6 @@ module.exports = {
|
|
|
1052
1033
|
*/
|
|
1053
1034
|
"no-return-assign": "off",
|
|
1054
1035
|
|
|
1055
|
-
/**
|
|
1056
|
-
* Disallow redundant `return await`
|
|
1057
|
-
* https://eslint.org/docs/latest/rules/no-return-await.
|
|
1058
|
-
*/
|
|
1059
|
-
"no-return-await": "error",
|
|
1060
|
-
|
|
1061
1036
|
/**
|
|
1062
1037
|
* Disallow use of `javascript:` urls.
|
|
1063
1038
|
* Https://eslint.org/docs/latest/rules/no-script-url.
|
|
@@ -1238,12 +1213,6 @@ module.exports = {
|
|
|
1238
1213
|
*/
|
|
1239
1214
|
"one-var": ["error", "never"],
|
|
1240
1215
|
|
|
1241
|
-
/**
|
|
1242
|
-
* Require a newline around variable declaration 🔧
|
|
1243
|
-
* https://eslint.org/docs/latest/rules/one-var-declaration-per-line.
|
|
1244
|
-
*/
|
|
1245
|
-
"one-var-declaration-per-line": ["error", "always"],
|
|
1246
|
-
|
|
1247
1216
|
/**
|
|
1248
1217
|
* Require assignment operator shorthand where possible or prohibit it entirely 🔧
|
|
1249
1218
|
* https://eslint.org/docs/latest/rules/operator-assignment.
|
|
@@ -1338,12 +1307,6 @@ module.exports = {
|
|
|
1338
1307
|
*/
|
|
1339
1308
|
"prefer-template": "error",
|
|
1340
1309
|
|
|
1341
|
-
/**
|
|
1342
|
-
* Require quotes around object literal property names 🔧
|
|
1343
|
-
* https://eslint.org/docs/latest/rules/quote-props.
|
|
1344
|
-
*/
|
|
1345
|
-
"quote-props": ["error", "as-needed", { keywords: false, unnecessary: true, numbers: false }],
|
|
1346
|
-
|
|
1347
1310
|
/**
|
|
1348
1311
|
* Require use of the second argument for parseInt()
|
|
1349
1312
|
* https://eslint.org/docs/latest/rules/radix.
|
|
@@ -1406,471 +1369,6 @@ module.exports = {
|
|
|
1406
1369
|
*/
|
|
1407
1370
|
"symbol-description": "error",
|
|
1408
1371
|
|
|
1409
|
-
/**
|
|
1410
|
-
* Requires to declare all vars on top of their containing scope
|
|
1411
|
-
* https://eslint.org/docs/latest/rules/vars-on-top.
|
|
1412
|
-
*/
|
|
1413
|
-
"vars-on-top": "error",
|
|
1414
|
-
|
|
1415
|
-
/**
|
|
1416
|
-
* Require or disallow Yoda conditions 🔧
|
|
1417
|
-
* https://eslint.org/docs/latest/rules/yoda.
|
|
1418
|
-
*/
|
|
1419
|
-
yoda: "error",
|
|
1420
|
-
|
|
1421
|
-
// ======================= Styling & formatting =======================
|
|
1422
|
-
|
|
1423
|
-
/**
|
|
1424
|
-
* Enforce line breaks after opening and before closing array brackets 🔧
|
|
1425
|
-
* https://eslint.org/docs/latest/rules/array-bracket-newline.
|
|
1426
|
-
*/
|
|
1427
|
-
"array-bracket-newline": ["off", "consistent"], // object option alternative: { multiline: true, minItems: 3 }
|
|
1428
|
-
|
|
1429
|
-
/**
|
|
1430
|
-
* Enforce spacing inside array brackets 🔧
|
|
1431
|
-
* https://eslint.org/docs/latest/rules/array-bracket-spacing.
|
|
1432
|
-
*/
|
|
1433
|
-
"array-bracket-spacing": ["error", "never"],
|
|
1434
|
-
|
|
1435
|
-
/**
|
|
1436
|
-
* Enforce line breaks between array elements 🔧
|
|
1437
|
-
* https://eslint.org/docs/latest/rules/array-element-newline.
|
|
1438
|
-
*/
|
|
1439
|
-
"array-element-newline": ["off", { multiline: true, minItems: 3 }],
|
|
1440
|
-
|
|
1441
|
-
/**
|
|
1442
|
-
* Require parens in arrow function arguments 🔧
|
|
1443
|
-
* https://eslint.org/docs/latest/rules/arrow-parens.
|
|
1444
|
-
*/
|
|
1445
|
-
"arrow-parens": ["error", "always"],
|
|
1446
|
-
|
|
1447
|
-
/**
|
|
1448
|
-
* Require space before/after arrow function"s arrow 🔧
|
|
1449
|
-
* https://eslint.org/docs/latest/rules/arrow-spacing.
|
|
1450
|
-
*/
|
|
1451
|
-
"arrow-spacing": ["error", { before: true, after: true }],
|
|
1452
|
-
|
|
1453
|
-
/**
|
|
1454
|
-
* Enforce spacing inside single-line blocks 🔧
|
|
1455
|
-
* https://eslint.org/docs/latest/rules/block-spacing.
|
|
1456
|
-
*/
|
|
1457
|
-
"block-spacing": ["error", "always"],
|
|
1458
|
-
|
|
1459
|
-
/**
|
|
1460
|
-
* Enforce one true brace style 🔧
|
|
1461
|
-
* https://eslint.org/docs/latest/rules/brace-style.
|
|
1462
|
-
*/
|
|
1463
|
-
"brace-style": ["error", "1tbs", { allowSingleLine: true }],
|
|
1464
|
-
|
|
1465
|
-
/**
|
|
1466
|
-
* Require trailing commas in multiline object literals 🔧
|
|
1467
|
-
* https://eslint.org/docs/latest/rules/comma-dangle.
|
|
1468
|
-
*/
|
|
1469
|
-
"comma-dangle": [
|
|
1470
|
-
"error",
|
|
1471
|
-
{
|
|
1472
|
-
arrays: "always-multiline",
|
|
1473
|
-
objects: "always-multiline",
|
|
1474
|
-
imports: "always-multiline",
|
|
1475
|
-
exports: "always-multiline",
|
|
1476
|
-
functions: "always-multiline",
|
|
1477
|
-
},
|
|
1478
|
-
],
|
|
1479
|
-
|
|
1480
|
-
/**
|
|
1481
|
-
* Enforce spacing before and after comma 🔧
|
|
1482
|
-
* https://eslint.org/docs/latest/rules/comma-spacing.
|
|
1483
|
-
*/
|
|
1484
|
-
"comma-spacing": ["error", { before: false, after: true }],
|
|
1485
|
-
|
|
1486
|
-
/**
|
|
1487
|
-
* Enforce one true comma style 🔧
|
|
1488
|
-
* https://eslint.org/docs/latest/rules/comma-style.
|
|
1489
|
-
*/
|
|
1490
|
-
"comma-style": [
|
|
1491
|
-
"error",
|
|
1492
|
-
"last",
|
|
1493
|
-
{
|
|
1494
|
-
exceptions: {
|
|
1495
|
-
ArrayExpression: false,
|
|
1496
|
-
ArrayPattern: false,
|
|
1497
|
-
ArrowFunctionExpression: false,
|
|
1498
|
-
CallExpression: false,
|
|
1499
|
-
FunctionDeclaration: false,
|
|
1500
|
-
FunctionExpression: false,
|
|
1501
|
-
ImportDeclaration: false,
|
|
1502
|
-
ObjectExpression: false,
|
|
1503
|
-
ObjectPattern: false,
|
|
1504
|
-
VariableDeclaration: false,
|
|
1505
|
-
NewExpression: false,
|
|
1506
|
-
},
|
|
1507
|
-
},
|
|
1508
|
-
],
|
|
1509
|
-
|
|
1510
|
-
/**
|
|
1511
|
-
* Disallow padding inside computed properties 🔧
|
|
1512
|
-
* https://eslint.org/docs/latest/rules/computed-property-spacing.
|
|
1513
|
-
*/
|
|
1514
|
-
"computed-property-spacing": ["error", "never"],
|
|
1515
|
-
|
|
1516
|
-
/**
|
|
1517
|
-
* Enforces consistent newlines before or after dots 🔧
|
|
1518
|
-
* https://eslint.org/docs/latest/rules/dot-location.
|
|
1519
|
-
*/
|
|
1520
|
-
"dot-location": ["error", "property"],
|
|
1521
|
-
|
|
1522
|
-
/**
|
|
1523
|
-
* Enforce newline at the end of file, with no multiple empty lines 🔧
|
|
1524
|
-
* https://eslint.org/docs/latest/rules/eol-last.
|
|
1525
|
-
*/
|
|
1526
|
-
"eol-last": ["error", "always"],
|
|
1527
|
-
|
|
1528
|
-
/**
|
|
1529
|
-
* Enforce spacing between functions and their invocations 🔧
|
|
1530
|
-
* https://eslint.org/docs/latest/rules/func-call-spacing.
|
|
1531
|
-
*/
|
|
1532
|
-
"func-call-spacing": ["error", "never"],
|
|
1533
|
-
|
|
1534
|
-
/**
|
|
1535
|
-
* Enforce line breaks between arguments of a function call 🔧
|
|
1536
|
-
* https://eslint.org/docs/latest/rules/function-call-argument-newline.
|
|
1537
|
-
*/
|
|
1538
|
-
"function-call-argument-newline": ["error", "consistent"],
|
|
1539
|
-
|
|
1540
|
-
/**
|
|
1541
|
-
* Require line breaks inside function parentheses if there are line breaks between parameters. 🔧
|
|
1542
|
-
* https://eslint.org/docs/latest/rules/function-paren-newline.
|
|
1543
|
-
*/
|
|
1544
|
-
"function-paren-newline": "off",
|
|
1545
|
-
|
|
1546
|
-
/**
|
|
1547
|
-
* Enforce the spacing around the * in generator functions 🔧
|
|
1548
|
-
* https://eslint.org/docs/latest/rules/generator-star-spacing.
|
|
1549
|
-
*/
|
|
1550
|
-
"generator-star-spacing": ["error", { before: false, after: true }],
|
|
1551
|
-
|
|
1552
|
-
/**
|
|
1553
|
-
* Enforce the location of arrow function bodies with implicit returns 🔧
|
|
1554
|
-
* https://eslint.org/docs/latest/rules/implicit-arrow-linebreak.
|
|
1555
|
-
*/
|
|
1556
|
-
"implicit-arrow-linebreak": "off",
|
|
1557
|
-
|
|
1558
|
-
/**
|
|
1559
|
-
* This option sets a specific tab width for your code 🔧
|
|
1560
|
-
* https://eslint.org/docs/latest/rules/indent.
|
|
1561
|
-
*/
|
|
1562
|
-
indent: ["error", 4, { SwitchCase: 1 }],
|
|
1563
|
-
|
|
1564
|
-
/**
|
|
1565
|
-
* Specify whether double or single quotes should be used in JSX attributes 🔧
|
|
1566
|
-
* https://eslint.org/docs/latest/rules/jsx-quotes.
|
|
1567
|
-
*/
|
|
1568
|
-
"jsx-quotes": ["error", "prefer-double"],
|
|
1569
|
-
|
|
1570
|
-
/**
|
|
1571
|
-
* Enforces spacing between keys and values in object literal properties 🔧
|
|
1572
|
-
* https://eslint.org/docs/latest/rules/key-spacing.
|
|
1573
|
-
*/
|
|
1574
|
-
"key-spacing": ["error", { beforeColon: false, afterColon: true }],
|
|
1575
|
-
|
|
1576
|
-
/**
|
|
1577
|
-
* Require a space before & after certain keywords 🔧
|
|
1578
|
-
* https://eslint.org/docs/latest/rules/keyword-spacing.
|
|
1579
|
-
*/
|
|
1580
|
-
"keyword-spacing": [
|
|
1581
|
-
"error",
|
|
1582
|
-
{
|
|
1583
|
-
before: true,
|
|
1584
|
-
after: true,
|
|
1585
|
-
overrides: {
|
|
1586
|
-
return: { after: true },
|
|
1587
|
-
throw: { after: true },
|
|
1588
|
-
case: { after: true },
|
|
1589
|
-
},
|
|
1590
|
-
},
|
|
1591
|
-
],
|
|
1592
|
-
|
|
1593
|
-
/**
|
|
1594
|
-
* Enforce position of line comments
|
|
1595
|
-
* https://eslint.org/docs/latest/rules/line-comment-position.
|
|
1596
|
-
*/
|
|
1597
|
-
"line-comment-position": [
|
|
1598
|
-
"off",
|
|
1599
|
-
{
|
|
1600
|
-
position: "above",
|
|
1601
|
-
ignorePattern: "",
|
|
1602
|
-
applyDefaultPatterns: true,
|
|
1603
|
-
},
|
|
1604
|
-
],
|
|
1605
|
-
|
|
1606
|
-
/**
|
|
1607
|
-
* Disallow mixed "LF" and "CRLF" as linebreaks 🔧
|
|
1608
|
-
* https://eslint.org/docs/latest/rules/linebreak-style.
|
|
1609
|
-
*/
|
|
1610
|
-
"linebreak-style": ["error", "unix"],
|
|
1611
|
-
|
|
1612
|
-
/**
|
|
1613
|
-
* Enforces empty lines around comments 🔧
|
|
1614
|
-
* https://eslint.org/docs/latest/rules/lines-around-comment.
|
|
1615
|
-
*/
|
|
1616
|
-
"lines-around-comment": "off",
|
|
1617
|
-
|
|
1618
|
-
/**
|
|
1619
|
-
* Require or disallow an empty line between class members 🔧
|
|
1620
|
-
* https://eslint.org/docs/latest/rules/lines-between-class-members.
|
|
1621
|
-
*/
|
|
1622
|
-
"lines-between-class-members": ["error", "always", { exceptAfterSingleLine: true }],
|
|
1623
|
-
|
|
1624
|
-
/**
|
|
1625
|
-
* Specify the maximum length of a line in your program
|
|
1626
|
-
* https://eslint.org/docs/latest/rules/max-len.
|
|
1627
|
-
*/
|
|
1628
|
-
"max-len": [
|
|
1629
|
-
"error",
|
|
1630
|
-
{
|
|
1631
|
-
code: 120,
|
|
1632
|
-
tabWidth: 4,
|
|
1633
|
-
ignoreUrls: true,
|
|
1634
|
-
ignoreComments: false,
|
|
1635
|
-
ignoreRegExpLiterals: true,
|
|
1636
|
-
ignoreStrings: true,
|
|
1637
|
-
ignoreTemplateLiterals: true,
|
|
1638
|
-
},
|
|
1639
|
-
],
|
|
1640
|
-
|
|
1641
|
-
/**
|
|
1642
|
-
* Restrict the number of statements per line
|
|
1643
|
-
* https://eslint.org/docs/latest/rules/max-statements-per-line.
|
|
1644
|
-
*/
|
|
1645
|
-
"max-statements-per-line": ["off", { max: 1 }],
|
|
1646
|
-
|
|
1647
|
-
/**
|
|
1648
|
-
* Require multiline ternary 🔧
|
|
1649
|
-
* https://eslint.org/docs/latest/rules/multiline-ternary.
|
|
1650
|
-
*/
|
|
1651
|
-
"multiline-ternary": ["off", "never"],
|
|
1652
|
-
|
|
1653
|
-
/**
|
|
1654
|
-
* Disallow the omission of parentheses when invoking a constructor with no arguments 🔧
|
|
1655
|
-
* https://eslint.org/docs/latest/rules/new-parens.
|
|
1656
|
-
*/
|
|
1657
|
-
"new-parens": "error",
|
|
1658
|
-
|
|
1659
|
-
/**
|
|
1660
|
-
* Enforces new line after each method call in the chain to make it more readable and easy to maintain 🔧
|
|
1661
|
-
* https://eslint.org/docs/latest/rules/newline-per-chained-call.
|
|
1662
|
-
*/
|
|
1663
|
-
"newline-per-chained-call": ["error", { ignoreChainWithDepth: 3 }],
|
|
1664
|
-
|
|
1665
|
-
/**
|
|
1666
|
-
* Disallow unnecessary parentheses 🔧
|
|
1667
|
-
* https://eslint.org/docs/latest/rules/no-extra-parens.
|
|
1668
|
-
*/
|
|
1669
|
-
"no-extra-parens": [
|
|
1670
|
-
"off",
|
|
1671
|
-
"all",
|
|
1672
|
-
{
|
|
1673
|
-
conditionalAssign: true,
|
|
1674
|
-
nestedBinaryExpressions: false,
|
|
1675
|
-
returnAssign: false,
|
|
1676
|
-
ignoreJSX: "all", // delegate to eslint-plugin-react
|
|
1677
|
-
enforceForArrowConditionals: false,
|
|
1678
|
-
},
|
|
1679
|
-
],
|
|
1680
|
-
|
|
1681
|
-
/**
|
|
1682
|
-
* Disallow mixed spaces and tabs for indentation ✅
|
|
1683
|
-
* https://eslint.org/docs/latest/rules/no-mixed-spaces-and-tabs.
|
|
1684
|
-
*/
|
|
1685
|
-
"no-mixed-spaces-and-tabs": "error",
|
|
1686
|
-
|
|
1687
|
-
/**
|
|
1688
|
-
* Disallow use of multiple spaces 🔧
|
|
1689
|
-
* https://eslint.org/docs/latest/rules/no-multi-spaces.
|
|
1690
|
-
*/
|
|
1691
|
-
"no-multi-spaces": ["error", { ignoreEOLComments: false }],
|
|
1692
|
-
|
|
1693
|
-
/**
|
|
1694
|
-
* Disallow multiple empty lines, only one newline at the end, and no new lines at the beginning 🔧
|
|
1695
|
-
* https://eslint.org/docs/latest/rules/no-multiple-empty-lines.
|
|
1696
|
-
*/
|
|
1697
|
-
"no-multiple-empty-lines": ["error", { max: 1, maxBOF: 0, maxEOF: 0 }],
|
|
1698
|
-
|
|
1699
|
-
/**
|
|
1700
|
-
* Disallow tab characters entirely
|
|
1701
|
-
* https://eslint.org/docs/latest/rules/no-tabs.
|
|
1702
|
-
*/
|
|
1703
|
-
"no-tabs": "error",
|
|
1704
|
-
|
|
1705
|
-
/**
|
|
1706
|
-
* Disallow trailing whitespace at the end of lines 🔧
|
|
1707
|
-
* https://eslint.org/docs/latest/rules/no-trailing-spaces.
|
|
1708
|
-
*/
|
|
1709
|
-
"no-trailing-spaces": ["error", { skipBlankLines: false, ignoreComments: false }],
|
|
1710
|
-
|
|
1711
|
-
/**
|
|
1712
|
-
* Disallow whitespace before properties 🔧
|
|
1713
|
-
* https://eslint.org/docs/latest/rules/no-whitespace-before-property.
|
|
1714
|
-
*/
|
|
1715
|
-
"no-whitespace-before-property": "error",
|
|
1716
|
-
|
|
1717
|
-
/**
|
|
1718
|
-
* Enforce the location of single-line statements 🔧
|
|
1719
|
-
* https://eslint.org/docs/latest/rules/nonblock-statement-body-position.
|
|
1720
|
-
*/
|
|
1721
|
-
"nonblock-statement-body-position": ["error", "any", { overrides: {} }],
|
|
1722
|
-
|
|
1723
|
-
/**
|
|
1724
|
-
* Enforce line breaks between braces. 🔧
|
|
1725
|
-
* https://eslint.org/docs/latest/rules/object-curly-newline.
|
|
1726
|
-
*/
|
|
1727
|
-
"object-curly-newline": [
|
|
1728
|
-
"error",
|
|
1729
|
-
{
|
|
1730
|
-
ObjectExpression: { minProperties: 10, multiline: true, consistent: true },
|
|
1731
|
-
ObjectPattern: { minProperties: 10, multiline: true, consistent: true },
|
|
1732
|
-
ImportDeclaration: { minProperties: 10, multiline: true, consistent: true },
|
|
1733
|
-
ExportDeclaration: { minProperties: 10, multiline: true, consistent: true },
|
|
1734
|
-
},
|
|
1735
|
-
],
|
|
1736
|
-
|
|
1737
|
-
/**
|
|
1738
|
-
* Require padding inside curly braces 🔧
|
|
1739
|
-
* https://eslint.org/docs/latest/rules/object-curly-spacing.
|
|
1740
|
-
*/
|
|
1741
|
-
"object-curly-spacing": ["error", "always"],
|
|
1742
|
-
|
|
1743
|
-
/**
|
|
1744
|
-
* Enforce "same line" or "multiple line" on object properties. 🔧
|
|
1745
|
-
* https://eslint.org/docs/latest/rules/object-property-newline.
|
|
1746
|
-
*/
|
|
1747
|
-
"object-property-newline": ["error", { allowAllPropertiesOnSameLine: true }],
|
|
1748
|
-
|
|
1749
|
-
/**
|
|
1750
|
-
* Requires operator at the beginning of the line in multiline statements 🔧
|
|
1751
|
-
* https://eslint.org/docs/latest/rules/operator-linebreak.
|
|
1752
|
-
*/
|
|
1753
|
-
"operator-linebreak": ["error", "after", { overrides: { "?": "before", ":": "before" } }],
|
|
1754
|
-
|
|
1755
|
-
/**
|
|
1756
|
-
* Disallow padding within blocks 🔧
|
|
1757
|
-
* https://eslint.org/docs/latest/rules/padded-blocks.
|
|
1758
|
-
*/
|
|
1759
|
-
"padded-blocks": [
|
|
1760
|
-
"error",
|
|
1761
|
-
{
|
|
1762
|
-
blocks: "never",
|
|
1763
|
-
classes: "never",
|
|
1764
|
-
switches: "never",
|
|
1765
|
-
},
|
|
1766
|
-
{
|
|
1767
|
-
allowSingleLineBlocks: true,
|
|
1768
|
-
},
|
|
1769
|
-
],
|
|
1770
|
-
|
|
1771
|
-
/**
|
|
1772
|
-
* Require or disallow padding lines between statements 🔧
|
|
1773
|
-
* https://eslint.org/docs/latest/rules/padding-line-between-statements.
|
|
1774
|
-
*/
|
|
1775
|
-
"padding-line-between-statements": "off",
|
|
1776
|
-
|
|
1777
|
-
/**
|
|
1778
|
-
* Specifies double quotes should be used 🔧
|
|
1779
|
-
* https://eslint.org/docs/latest/rules/quotes.
|
|
1780
|
-
*/
|
|
1781
|
-
quotes: ["error", "double", { avoidEscape: true }],
|
|
1782
|
-
|
|
1783
|
-
/**
|
|
1784
|
-
* Enforce spacing between object rest-spread 🔧
|
|
1785
|
-
* https://eslint.org/docs/latest/rules/rest-spread-spacing.
|
|
1786
|
-
*/
|
|
1787
|
-
"rest-spread-spacing": ["error", "never"],
|
|
1788
|
-
|
|
1789
|
-
/**
|
|
1790
|
-
* Require or disallow use of semicolons instead of ASI.
|
|
1791
|
-
*/
|
|
1792
|
-
semi: ["error", "always"],
|
|
1793
|
-
|
|
1794
|
-
/**
|
|
1795
|
-
* Enforce spacing before and after semicolons 🔧
|
|
1796
|
-
* https://eslint.org/docs/latest/rules/semi-spacing.
|
|
1797
|
-
*/
|
|
1798
|
-
"semi-spacing": ["error", { before: false, after: true }],
|
|
1799
|
-
|
|
1800
|
-
/**
|
|
1801
|
-
* Enforce location of semicolons 🔧
|
|
1802
|
-
* https://eslint.org/docs/latest/rules/semi-style.
|
|
1803
|
-
*/
|
|
1804
|
-
"semi-style": ["error", "last"],
|
|
1805
|
-
|
|
1806
|
-
/**
|
|
1807
|
-
* Require or disallow space before blocks 🔧
|
|
1808
|
-
* https://eslint.org/docs/latest/rules/space-before-blocks.
|
|
1809
|
-
*/
|
|
1810
|
-
"space-before-blocks": "error",
|
|
1811
|
-
|
|
1812
|
-
/**
|
|
1813
|
-
* Require or disallow space before function opening parenthesis 🔧
|
|
1814
|
-
* https://eslint.org/docs/latest/rules/space-before-function-paren.
|
|
1815
|
-
*/
|
|
1816
|
-
"space-before-function-paren": ["error", { anonymous: "always", named: "never", asyncArrow: "always" }],
|
|
1817
|
-
|
|
1818
|
-
/**
|
|
1819
|
-
* Require or disallow spaces inside parentheses 🔧
|
|
1820
|
-
* https://eslint.org/docs/latest/rules/space-in-parens.
|
|
1821
|
-
*/
|
|
1822
|
-
"space-in-parens": ["error", "never"],
|
|
1823
|
-
|
|
1824
|
-
/**
|
|
1825
|
-
* Require spacing around infix operators 🔧
|
|
1826
|
-
* https://eslint.org/docs/latest/rules/space-infix-ops.
|
|
1827
|
-
*/
|
|
1828
|
-
"space-infix-ops": ["error", { int32Hint: false }],
|
|
1829
|
-
|
|
1830
|
-
/**
|
|
1831
|
-
* Require or disallow spaces before/after unary operators 🔧
|
|
1832
|
-
* https://eslint.org/docs/latest/rules/space-unary-ops.
|
|
1833
|
-
*/
|
|
1834
|
-
"space-unary-ops": ["error", { words: true, nonwords: false, overrides: {} }],
|
|
1835
|
-
|
|
1836
|
-
/**
|
|
1837
|
-
* Require or disallow a space immediately following the // or /* in a comment 🔧
|
|
1838
|
-
* https://eslint.org/docs/latest/rules/spaced-comment.
|
|
1839
|
-
*/
|
|
1840
|
-
"spaced-comment": [
|
|
1841
|
-
"error",
|
|
1842
|
-
"always",
|
|
1843
|
-
{
|
|
1844
|
-
line: {
|
|
1845
|
-
exceptions: ["-", "+"],
|
|
1846
|
-
markers: ["=", "!", "/"], // space here to support sprockets directives, slash for TS /// comments
|
|
1847
|
-
},
|
|
1848
|
-
block: {
|
|
1849
|
-
exceptions: ["-", "+"],
|
|
1850
|
-
markers: ["=", "!", ":", "::"], // space here to support sprockets directives and flow comment types
|
|
1851
|
-
balanced: true,
|
|
1852
|
-
},
|
|
1853
|
-
},
|
|
1854
|
-
],
|
|
1855
|
-
|
|
1856
|
-
/**
|
|
1857
|
-
* Enforce spacing around colons of switch statements 🔧
|
|
1858
|
-
* https://eslint.org/docs/latest/rules/switch-colon-spacing.
|
|
1859
|
-
*/
|
|
1860
|
-
"switch-colon-spacing": ["error", { after: true, before: false }],
|
|
1861
|
-
|
|
1862
|
-
/**
|
|
1863
|
-
* Enforce usage of spacing in template strings 🔧
|
|
1864
|
-
* https://eslint.org/docs/latest/rules/template-curly-spacing.
|
|
1865
|
-
*/
|
|
1866
|
-
"template-curly-spacing": "error",
|
|
1867
|
-
|
|
1868
|
-
/**
|
|
1869
|
-
* Require or disallow spacing between template tags and their literals 🔧
|
|
1870
|
-
* https://eslint.org/docs/latest/rules/template-tag-spacing.
|
|
1871
|
-
*/
|
|
1872
|
-
"template-tag-spacing": ["error", "never"],
|
|
1873
|
-
|
|
1874
1372
|
/**
|
|
1875
1373
|
* Require or disallow the Unicode Byte Order Mark 🔧
|
|
1876
1374
|
* https://eslint.org/docs/latest/rules/unicode-bom.
|
|
@@ -1878,21 +1376,15 @@ module.exports = {
|
|
|
1878
1376
|
"unicode-bom": ["error", "never"],
|
|
1879
1377
|
|
|
1880
1378
|
/**
|
|
1881
|
-
*
|
|
1882
|
-
* https://eslint.org/docs/latest/rules/
|
|
1883
|
-
*/
|
|
1884
|
-
"wrap-iife": ["error", "inside", { functionPrototypeMethods: false }],
|
|
1885
|
-
|
|
1886
|
-
/**
|
|
1887
|
-
* Require regex literals to be wrapped in parentheses 🔧
|
|
1888
|
-
* https://eslint.org/docs/latest/rules/wrap-regex.
|
|
1379
|
+
* Requires to declare all vars on top of their containing scope
|
|
1380
|
+
* https://eslint.org/docs/latest/rules/vars-on-top.
|
|
1889
1381
|
*/
|
|
1890
|
-
"
|
|
1382
|
+
"vars-on-top": "error",
|
|
1891
1383
|
|
|
1892
1384
|
/**
|
|
1893
|
-
*
|
|
1894
|
-
* https://eslint.org/docs/latest/rules/
|
|
1385
|
+
* Require or disallow Yoda conditions 🔧
|
|
1386
|
+
* https://eslint.org/docs/latest/rules/yoda.
|
|
1895
1387
|
*/
|
|
1896
|
-
|
|
1388
|
+
yoda: "error",
|
|
1897
1389
|
},
|
|
1898
1390
|
};
|