@pumpn/eslint-config 11.2.0 → 12.0.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.
Files changed (68) hide show
  1. package/.ls-lint.yml +6 -0
  2. package/.tool-versions +1 -0
  3. package/.vscode/settings.json +7 -0
  4. package/config.js +91 -62
  5. package/deno.json +40 -0
  6. package/deno.lock +3152 -0
  7. package/eslint.config.js +13 -0
  8. package/import-map.json +26 -0
  9. package/jsdoc.json +51 -0
  10. package/package.json +24 -17
  11. package/plugins.js +40 -0
  12. package/rules/_exports.js +21 -0
  13. package/rules/eslint-comments/_exports.js +2 -0
  14. package/rules/eslint-comments/best-practices.js +10 -0
  15. package/rules/eslint-comments/stylistic-issues.js +12 -0
  16. package/rules/eslint-comments.js +12 -0
  17. package/rules/github.js +27 -0
  18. package/rules/import/_exports.js +4 -0
  19. package/rules/import/helpful-warnings.js +18 -0
  20. package/rules/import/module-systems.js +9 -0
  21. package/rules/import/static-analysis.js +71 -0
  22. package/rules/import/style-guide.js +86 -0
  23. package/rules/import.js +12 -0
  24. package/rules/jsdoc.js +255 -54
  25. package/rules/jsx-a11y.js +139 -0
  26. package/rules/layout-and-formatting.js +4 -260
  27. package/rules/no-secrets.js +18 -0
  28. package/rules/no-unsanitized.js +6 -0
  29. package/rules/perfectionist.js +267 -0
  30. package/rules/possible-problems.js +66 -15
  31. package/rules/promise.js +25 -0
  32. package/rules/react.js +105 -2
  33. package/rules/redos.js +15 -0
  34. package/rules/regexp/_exports.js +3 -0
  35. package/rules/regexp/best-practices.js +43 -0
  36. package/rules/regexp/possible-errors.js +26 -0
  37. package/rules/regexp/stylistic-issues.js +62 -0
  38. package/rules/regexp.js +12 -0
  39. package/rules/security.js +18 -0
  40. package/rules/sonarjs/_exports.js +2 -0
  41. package/rules/sonarjs/bug-detection.js +14 -0
  42. package/rules/sonarjs/code-smell-detection.js +37 -0
  43. package/rules/sonarjs.js +12 -0
  44. package/rules/stylistic/_common/_exports.js +3 -0
  45. package/rules/stylistic/_common/min-items-for-array-newline.js +3 -0
  46. package/rules/stylistic/_exports.js +13 -0
  47. package/rules/stylistic/brackets.js +79 -0
  48. package/rules/stylistic/commas.js +13 -0
  49. package/rules/stylistic/comments.js +23 -0
  50. package/rules/stylistic/disallow.js +31 -0
  51. package/rules/stylistic/indent.js +12 -0
  52. package/rules/stylistic/jsx.js +35 -0
  53. package/rules/stylistic/linebreaks.js +74 -0
  54. package/rules/stylistic/misc.js +32 -0
  55. package/rules/stylistic/operators.js +26 -0
  56. package/rules/stylistic/quotes.js +7 -0
  57. package/rules/stylistic/semis.js +14 -0
  58. package/rules/stylistic/spacing.js +53 -0
  59. package/rules/stylistic/types.js +7 -0
  60. package/rules/stylistic.js +12 -0
  61. package/rules/suggestions.js +152 -135
  62. package/rules/tailwindcss.js +11 -0
  63. package/rules/unicorn.js +200 -0
  64. package/rules.js +11 -14
  65. package/.np-config.cjs +0 -1
  66. package/addons/deno.js +0 -15
  67. package/addons.js +0 -1
  68. package/rules/imports.js +0 -135
package/rules/react.js CHANGED
@@ -1,4 +1,107 @@
1
- export default {
1
+ const maxDepth = 10;
2
+
3
+ const reactRules = {
4
+ "react/boolean-prop-naming": "error",
5
+ "react/button-has-type": "error",
6
+ "react/default-props-match-prop-types": "error",
7
+ "react/destructuring-assignment": "error",
8
+ "react/display-name": "error",
9
+ "react/forbid-component-props": "error",
10
+ "react/forbid-dom-props": "error",
11
+ "react/forbid-elements": "error",
12
+ "react/forbid-foreign-prop-types": "error",
13
+ "react/forbid-prop-types": "error",
14
+ "react/function-component-definition": [
15
+ "error",
16
+ {
17
+ namedComponents: "arrow-function",
18
+ unnamedComponents: "arrow-function"
19
+ }
20
+ ],
21
+ "react/hook-use-state": ["error", { allowDestructuredState: true }],
22
+ "react/iframe-missing-sandbox": "error",
23
+ "react/jsx-boolean-value": "error",
24
+ "react/jsx-filename-extension": [
25
+ "error",
26
+ {
27
+ allow: "as-needed",
28
+ extensions: [".jsx"],
29
+ ignoreFilesWithoutCode: true
30
+ }
31
+ ],
32
+ "react/jsx-fragments": ["error", "syntax"],
33
+ "react/jsx-handler-names": "error",
34
+ "react/jsx-key": "error",
35
+ "react/jsx-max-depth": ["error", { max: maxDepth }],
36
+ "react/jsx-no-bind": "error",
37
+ "react/jsx-no-comment-textnodes": "error",
38
+ "react/jsx-no-constructed-context-values": "error",
39
+ "react/jsx-no-duplicate-props": "error",
40
+ "react/jsx-no-leaked-render": "error",
41
+ "react/jsx-no-literals": "off",
42
+ "react/jsx-no-script-url": "error",
43
+ "react/jsx-no-target-blank": [
44
+ "error",
45
+ {
46
+ allowReferrer: false,
47
+ enforceDynamicLinks: "always",
48
+ forms: false,
49
+ links: true,
50
+ warnOnSpreadAttributes: true
51
+ }
52
+ ],
53
+ "react/jsx-no-undef": "error",
54
+ "react/jsx-no-useless-fragment": "error",
55
+ "react/jsx-props-no-spreading": "off",
56
+ "react/jsx-uses-react": "error",
2
57
  "react/jsx-uses-vars": "error",
3
- "react/jsx-uses-react": "error"
58
+ "react/no-access-state-in-setstate": "error",
59
+ "react/no-adjacent-inline-elements": "error",
60
+ "react/no-array-index-key": "off",
61
+ "react/no-arrow-function-lifecycle": "off",
62
+ "react/no-children-prop": "error",
63
+ "react/no-danger": "error",
64
+ "react/no-danger-with-children": "error",
65
+ "react/no-deprecated": "error",
66
+ "react/no-did-mount-set-state": "error",
67
+ "react/no-did-update-set-state": "error",
68
+ "react/no-direct-mutation-state": "error",
69
+ "react/no-find-dom-node": "error",
70
+ "react/no-invalid-html-attribute": "error",
71
+ "react/no-is-mounted": "error",
72
+ "react/no-multi-comp": ["error", { ignoreStateless: false }],
73
+ "react/no-namespace": "error",
74
+ "react/no-object-type-as-default-prop": "error",
75
+ "react/no-redundant-should-component-update": "error",
76
+ "react/no-render-return-value": "error",
77
+ "react/no-set-state": "off",
78
+ "react/no-string-refs": "error",
79
+ "react/no-this-in-sfc": "error",
80
+ "react/no-typos": "error",
81
+ "react/no-unescaped-entities": "error",
82
+ "react/no-unknown-property": "error",
83
+ "react/no-unsafe": "error",
84
+ "react/no-unstable-nested-components": "error",
85
+ "react/no-unused-class-component-methods": "error",
86
+ "react/no-unused-prop-types": "error",
87
+ "react/no-unused-state": "error",
88
+ "react/no-will-update-set-state": "error",
89
+ "react/prefer-es6-class": ["error", "always"],
90
+ "react/prefer-exact-props": "error",
91
+ "react/prefer-read-only-props": "error",
92
+ "react/prefer-stateless-function": "error",
93
+ "react/prop-types": "off",
94
+ "react/react-in-jsx-scope": "off",
95
+ "react/require-default-props": "error",
96
+ "react/require-optimization": "error",
97
+ "react/require-render-return": "error",
98
+ "react/sort-comp": "off",
99
+ "react/sort-default-props": "off",
100
+ "react/sort-prop-types": "off",
101
+ "react/state-in-constructor": ["error", "never"],
102
+ "react/static-property-placement": "error",
103
+ "react/style-prop-object": "error",
104
+ "react/void-dom-elements-no-children": "error"
4
105
  };
106
+
107
+ export default reactRules;
package/rules/redos.js ADDED
@@ -0,0 +1,15 @@
1
+ const timeout = 10_000;
2
+
3
+ const redosRules = {
4
+ "redos/no-vulnerable": [
5
+ "error",
6
+ {
7
+ checker: "auto",
8
+ ignoreErrors: true,
9
+ permittableComplexities: [],
10
+ timeout
11
+ }
12
+ ]
13
+ };
14
+
15
+ export default redosRules;
@@ -0,0 +1,3 @@
1
+ export { default as bestPracticesRules } from "./best-practices.js";
2
+ export { default as possibleErrorsRules } from "./possible-errors.js";
3
+ export { default as stylisticIssuesRules } from "./stylistic-issues.js";
@@ -0,0 +1,43 @@
1
+ const bestPracticesRules = {
2
+ "regexp/confusing-quantifier": "error",
3
+ "regexp/control-character-escape": "error",
4
+ "regexp/negation": "error",
5
+ "regexp/no-dupe-characters-character-class": "error",
6
+ "regexp/no-empty-string-literal": "error",
7
+ "regexp/no-extra-lookaround-assertions": "error",
8
+ "regexp/no-invisible-character": "error",
9
+ "regexp/no-legacy-features": "error",
10
+ "regexp/no-non-standard-flag": "error",
11
+ "regexp/no-obscure-range": "error",
12
+ "regexp/no-octal": "error",
13
+ "regexp/no-standalone-backslash": "error",
14
+ "regexp/no-trivially-nested-assertion": "error",
15
+ "regexp/no-trivially-nested-quantifier": "error",
16
+ "regexp/no-unused-capturing-group": "error",
17
+ "regexp/no-useless-character-class": "error",
18
+ "regexp/no-useless-flag": "error",
19
+ "regexp/no-useless-lazy": "error",
20
+ "regexp/no-useless-quantifier": "error",
21
+ "regexp/no-useless-range": "error",
22
+ "regexp/no-useless-set-operand": "error",
23
+ "regexp/no-useless-string-literal": "error",
24
+ "regexp/no-useless-two-nums-quantifier": "error",
25
+ "regexp/no-zero-quantifier": "error",
26
+ "regexp/optimal-lookaround-quantifier": "error",
27
+ "regexp/optimal-quantifier-concatenation": "error",
28
+ "regexp/prefer-escape-replacement-dollar-char": "error",
29
+ "regexp/prefer-predefined-assertion": "error",
30
+ "regexp/prefer-quantifier": "error",
31
+ "regexp/prefer-range": "error",
32
+ "regexp/prefer-regexp-exec": "off",
33
+ "regexp/prefer-regexp-test": "off",
34
+ "regexp/prefer-set-operation": "error",
35
+ "regexp/require-unicode-regexp": "error",
36
+ // TODO [2024-04-01]: enable when https://github.com/microsoft/vscode/pull/206580 is merged
37
+ "regexp/require-unicode-sets-regexp": "off",
38
+ "regexp/simplify-set-operations": "error",
39
+ "regexp/sort-alternatives": "error",
40
+ "regexp/use-ignore-case": "error"
41
+ };
42
+
43
+ export default bestPracticesRules;
@@ -0,0 +1,26 @@
1
+ const possibleErrorsRules = {
2
+ "regexp/no-contradiction-with-assertion": "error",
3
+ "regexp/no-control-character": "error",
4
+ "regexp/no-dupe-disjunctions": "error",
5
+ "regexp/no-empty-alternative": "error",
6
+ "regexp/no-empty-capturing-group": "error",
7
+ "regexp/no-empty-character-class": "error",
8
+ "regexp/no-empty-group": "error",
9
+ "regexp/no-empty-lookarounds-assertion": "error",
10
+ "regexp/no-escape-backspace": "error",
11
+ "regexp/no-invalid-regexp": "error",
12
+ "regexp/no-lazy-ends": "error",
13
+ "regexp/no-misleading-capturing-group": "error",
14
+ "regexp/no-misleading-unicode-character": "error",
15
+ "regexp/no-missing-g-flag": "error",
16
+ "regexp/no-optional-assertion": "error",
17
+ "regexp/no-potentially-useless-backreference": "error",
18
+ "regexp/no-super-linear-backtracking": "error",
19
+ "regexp/no-super-linear-move": "error",
20
+ "regexp/no-useless-assertions": "error",
21
+ "regexp/no-useless-backreference": "error",
22
+ "regexp/no-useless-dollar-replacements": "error",
23
+ "regexp/strict": "error"
24
+ };
25
+
26
+ export default possibleErrorsRules;
@@ -0,0 +1,62 @@
1
+ const stylisticIssuesRules = {
2
+ "regexp/grapheme-string-literal": "off",
3
+ "regexp/hexadecimal-escape": ["error", "always"],
4
+ "regexp/letter-case": [
5
+ "error",
6
+ {
7
+ caseInsensitive: "lowercase",
8
+ controlEscape: "uppercase",
9
+ hexadecimalEscape: "lowercase",
10
+ unicodeEscape: "lowercase"
11
+ }
12
+ ],
13
+ "regexp/match-any": "error",
14
+ "regexp/no-useless-escape": "error",
15
+ "regexp/no-useless-non-capturing-group": "error",
16
+ "regexp/prefer-character-class": "error",
17
+ "regexp/prefer-d": "error",
18
+ "regexp/prefer-lookaround": [
19
+ "error",
20
+ {
21
+ lookbehind: true,
22
+ strictTypes: true
23
+ }
24
+ ],
25
+ "regexp/prefer-named-backreference": "error",
26
+ "regexp/prefer-named-capture-group": "error",
27
+ "regexp/prefer-named-replacement": [
28
+ "error",
29
+ {
30
+ strictTypes: true
31
+ }
32
+ ],
33
+ "regexp/prefer-plus-quantifier": "error",
34
+ "regexp/prefer-question-quantifier": "error",
35
+ "regexp/prefer-result-array-groups": [
36
+ "error",
37
+ {
38
+ strictTypes: true
39
+ }
40
+ ],
41
+ "regexp/prefer-star-quantifier": "error",
42
+ "regexp/prefer-unicode-codepoint-escapes": "error",
43
+ "regexp/prefer-w": "error",
44
+ "regexp/sort-character-class-elements": [
45
+ "error",
46
+ {
47
+ order: [
48
+ "\\s",
49
+ "\\w",
50
+ "\\d",
51
+ "\\p",
52
+ "*",
53
+ "\\q",
54
+ "[]"
55
+ ]
56
+ }
57
+ ],
58
+ "regexp/sort-flags": "error",
59
+ "regexp/unicode-escape": ["error", "unicodeCodePointEscape"]
60
+ };
61
+
62
+ export default stylisticIssuesRules;
@@ -0,0 +1,12 @@
1
+ import * as regexpRuleSets from "./regexp/_exports.js";
2
+
3
+ const regexpRules = Object.values(regexpRuleSets)
4
+ .reduce(
5
+ (allRules, ruleSet) => ({
6
+ ...allRules,
7
+ ...ruleSet
8
+ }),
9
+ {}
10
+ );
11
+
12
+ export default regexpRules;
@@ -0,0 +1,18 @@
1
+ const securityRules = {
2
+ "security/detect-bidi-characters": "warn",
3
+ "security/detect-buffer-noassert": "warn",
4
+ "security/detect-child-process": "warn",
5
+ "security/detect-disable-mustache-escape": "warn",
6
+ "security/detect-eval-with-expression": "warn",
7
+ "security/detect-new-buffer": "warn",
8
+ "security/detect-no-csrf-before-method-override": "warn",
9
+ "security/detect-non-literal-fs-filename": "warn",
10
+ "security/detect-non-literal-regexp": "warn",
11
+ "security/detect-non-literal-require": "warn",
12
+ "security/detect-object-injection": "off",
13
+ "security/detect-possible-timing-attacks": "warn",
14
+ "security/detect-pseudoRandomBytes": "warn",
15
+ "security/detect-unsafe-regex": "warn"
16
+ };
17
+
18
+ export default securityRules;
@@ -0,0 +1,2 @@
1
+ export { default as bugDetectionRules } from "./bug-detection.js";
2
+ export { default as sonarjsCodeSmellRules } from "./code-smell-detection.js";
@@ -0,0 +1,14 @@
1
+ const bugDetectionRules = {
2
+ "sonarjs/no-all-duplicated-branches": "error",
3
+ "sonarjs/no-element-overwrite": "error",
4
+ "sonarjs/no-empty-collection": "error",
5
+ "sonarjs/no-extra-arguments": "error",
6
+ "sonarjs/no-identical-conditions": "error",
7
+ "sonarjs/no-identical-expressions": "error",
8
+ "sonarjs/no-ignored-return": "error",
9
+ "sonarjs/no-one-iteration-loop": "error",
10
+ "sonarjs/no-use-of-empty-return-value": "error",
11
+ "sonarjs/non-existent-operator": "error"
12
+ };
13
+
14
+ export default bugDetectionRules;
@@ -0,0 +1,37 @@
1
+ const maximumCognitiveComplexity = 15;
2
+ const maxSwitchCases = 5;
3
+ const duplicateStringThreshold = 3;
4
+ const identicalFunctionThreshold = 3;
5
+
6
+ const codeSmellDetectionRules = {
7
+ "sonarjs/cognitive-complexity": ["error", maximumCognitiveComplexity],
8
+ "sonarjs/elseif-without-else": "off",
9
+ "sonarjs/max-switch-cases": ["error", maxSwitchCases],
10
+ "sonarjs/no-collapsible-if": "error",
11
+ "sonarjs/no-collection-size-mischeck": "error",
12
+ "sonarjs/no-duplicate-string": [
13
+ "error",
14
+ {
15
+ ignoreStrings: "application/json",
16
+ threshold: duplicateStringThreshold
17
+ }
18
+ ],
19
+ "sonarjs/no-duplicated-branches": "error",
20
+ "sonarjs/no-gratuitous-expressions": "error",
21
+ "sonarjs/no-identical-functions": ["error", identicalFunctionThreshold],
22
+ "sonarjs/no-inverted-boolean-check": "error",
23
+ "sonarjs/no-nested-switch": "error",
24
+ "sonarjs/no-nested-template-literals": "error",
25
+ "sonarjs/no-redundant-boolean": "error",
26
+ "sonarjs/no-redundant-jump": "error",
27
+ "sonarjs/no-same-line-conditional": "error",
28
+ "sonarjs/no-small-switch": "error",
29
+ "sonarjs/no-unused-collection": "error",
30
+ "sonarjs/no-useless-catch": "error",
31
+ "sonarjs/prefer-immediate-return": "error",
32
+ "sonarjs/prefer-object-literal": "error",
33
+ "sonarjs/prefer-single-boolean-return": "error",
34
+ "sonarjs/prefer-while": "error"
35
+ };
36
+
37
+ export default codeSmellDetectionRules;
@@ -0,0 +1,12 @@
1
+ import * as sonarjsRuleSets from "./sonarjs/_exports.js";
2
+
3
+ const sonarjsRules = Object.values(sonarjsRuleSets)
4
+ .reduce(
5
+ (allRules, ruleSet) => ({
6
+ ...allRules,
7
+ ...ruleSet
8
+ }),
9
+ {}
10
+ );
11
+
12
+ export default sonarjsRules;
@@ -0,0 +1,3 @@
1
+ export {
2
+ default as minItemsForArrayNewline
3
+ } from "./min-items-for-array-newline.js";
@@ -0,0 +1,3 @@
1
+ const minItemsForArrayNewline = 3;
2
+
3
+ export default minItemsForArrayNewline;
@@ -0,0 +1,13 @@
1
+ export { default as bracketsRules } from "./brackets.js";
2
+ export { default as commasRules } from "./commas.js";
3
+ export { default as commentsRules } from "./comments.js";
4
+ export { default as disallowRules } from "./disallow.js";
5
+ export { default as indentRules } from "./indent.js";
6
+ export { default as jsxRules } from "./jsx.js";
7
+ export { default as linebreaksRules } from "./linebreaks.js";
8
+ export { default as miscRules } from "./misc.js";
9
+ export { default as operatorsRules } from "./operators.js";
10
+ export { default as quotesRules } from "./quotes.js";
11
+ export { default as semisRules } from "./semis.js";
12
+ export { default as spacingRules } from "./spacing.js";
13
+ export { default as typesRules } from "./types.js";
@@ -0,0 +1,79 @@
1
+ import { minItemsForArrayNewline } from "./_common/_exports.js";
2
+
3
+ const minPropertiesForObjectNewline = 3;
4
+ const wrapMultilinesDefault = "parens-new-line";
5
+
6
+ const bracketsRules = {
7
+ "@stylistic/array-bracket-newline": [
8
+ "error",
9
+ {
10
+ minItems: minItemsForArrayNewline,
11
+ multiline: true
12
+ }
13
+ ],
14
+ "@stylistic/array-bracket-spacing": ["error", "never"],
15
+ "@stylistic/arrow-parens": ["error", "always"],
16
+ "@stylistic/brace-style": ["error", "stroustrup"],
17
+ "@stylistic/function-paren-newline": ["error", "multiline-arguments"],
18
+ "@stylistic/jsx-closing-bracket-location": "error",
19
+ "@stylistic/jsx-curly-brace-presence": [
20
+ "error",
21
+ {
22
+ children: "never",
23
+ propElementValues: "always",
24
+ props: "never"
25
+ }
26
+ ],
27
+ "@stylistic/jsx-curly-newline": [
28
+ "error",
29
+ {
30
+ multiline: "consistent",
31
+ singleline: "forbid"
32
+ }
33
+ ],
34
+ "@stylistic/jsx-curly-spacing": [
35
+ "error",
36
+ {
37
+ attributes: true,
38
+ children: true,
39
+ when: "never"
40
+ }
41
+ ],
42
+ "@stylistic/jsx-wrap-multilines": [
43
+ "error",
44
+ {
45
+ arrow: wrapMultilinesDefault,
46
+ assignment: wrapMultilinesDefault,
47
+ condition: wrapMultilinesDefault,
48
+ declaration: wrapMultilinesDefault,
49
+ logical: wrapMultilinesDefault,
50
+ return: wrapMultilinesDefault
51
+ // TODO [@stylistic/eslint-plugin@>1.6.3]: uncomment when @stylistic/eslint-plugin releases
52
+ // prop: "never"
53
+ }
54
+ ],
55
+ "@stylistic/new-parens": ["error", "always"],
56
+ "@stylistic/object-curly-newline": [
57
+ "error",
58
+ {
59
+ minProperties: minPropertiesForObjectNewline,
60
+ consistent: true,
61
+ multiline: true
62
+ }
63
+ ],
64
+ "@stylistic/object-curly-spacing": ["error", "always"],
65
+ "@stylistic/space-before-function-paren": [
66
+ "error",
67
+ {
68
+ anonymous: "always",
69
+ asyncArrow: "always",
70
+ named: "never"
71
+ }
72
+ ],
73
+ "@stylistic/space-in-parens": ["error", "never"],
74
+ "@stylistic/template-curly-spacing": ["error", "never"],
75
+ "@stylistic/wrap-iife": ["error", "inside"],
76
+ "@stylistic/wrap-regex": "off"
77
+ };
78
+
79
+ export default bracketsRules;
@@ -0,0 +1,13 @@
1
+ const commasRules = {
2
+ "@stylistic/comma-dangle": ["error", "never"],
3
+ "@stylistic/comma-spacing": [
4
+ "error",
5
+ {
6
+ before: false,
7
+ after: true
8
+ }
9
+ ],
10
+ "@stylistic/comma-style": ["error", "last"]
11
+ };
12
+
13
+ export default commasRules;
@@ -0,0 +1,23 @@
1
+ const commentsRules = {
2
+ "@stylistic/lines-around-comment": [
3
+ "error",
4
+ {
5
+ beforeBlockComment: true,
6
+ beforeLineComment: false,
7
+ afterBlockComment: false,
8
+ afterLineComment: false,
9
+ allowArrayEnd: false,
10
+ allowArrayStart: false,
11
+ allowBlockEnd: false,
12
+ allowBlockStart: false,
13
+ allowClassEnd: false,
14
+ allowClassStart: false,
15
+ allowObjectEnd: false,
16
+ allowObjectStart: false,
17
+ ignorePattern: "/* @type"
18
+ }
19
+ ],
20
+ "@stylistic/spaced-comment": "off"
21
+ };
22
+
23
+ export default commentsRules;
@@ -0,0 +1,31 @@
1
+ const disallowRules = {
2
+ "@stylistic/no-confusing-arrow": "error",
3
+ "@stylistic/no-extra-parens": ["error", "functions"],
4
+ "@stylistic/no-floating-decimal": "error",
5
+ "@stylistic/no-mixed-spaces-and-tabs": "error",
6
+ "@stylistic/no-multi-spaces": [
7
+ "error",
8
+ {
9
+ exceptions: { Property: false }
10
+ }
11
+ ],
12
+ "@stylistic/no-multiple-empty-lines": [
13
+ "error",
14
+ {
15
+ max: 1,
16
+ maxBOF: 0,
17
+ maxEOF: 1
18
+ }
19
+ ],
20
+ "@stylistic/no-tabs": "off",
21
+ "@stylistic/no-trailing-spaces": [
22
+ "error",
23
+ {
24
+ ignoreComments: false,
25
+ skipBlankLines: false
26
+ }
27
+ ],
28
+ "@stylistic/no-whitespace-before-property": "error"
29
+ };
30
+
31
+ export default disallowRules;
@@ -0,0 +1,12 @@
1
+ const indentRules = {
2
+ "@stylistic/indent": [
3
+ "error",
4
+ "tab",
5
+ { SwitchCase: 1 }
6
+ ],
7
+ "@stylistic/indent-binary-ops": ["error", "tab"],
8
+ "@stylistic/jsx-indent": ["error", "tab"],
9
+ "@stylistic/jsx-indent-props": ["error", "tab"]
10
+ };
11
+
12
+ export default indentRules;
@@ -0,0 +1,35 @@
1
+ const jsxRules = {
2
+ "@stylistic/jsx-child-element-spacing": "error",
3
+ "@stylistic/jsx-closing-tag-location": "error",
4
+ "@stylistic/jsx-equals-spacing": ["error", "never"],
5
+ "@stylistic/jsx-max-props-per-line": [
6
+ "error",
7
+ {
8
+ maximum: 1,
9
+ when: "multiline"
10
+ }
11
+ ],
12
+ // TODO [@stylistic/eslint-plugin@>1.6.3]: change to "non-jsx" when @stylistic/eslint-plugin releases
13
+ "@stylistic/jsx-one-expression-per-line": ["off"],
14
+ "@stylistic/jsx-pascal-case": ["error", { allowNamespace: true }],
15
+ "@stylistic/jsx-props-no-multi-spaces": "error",
16
+ "@stylistic/jsx-self-closing-comp": "error",
17
+ "@stylistic/jsx-sort-props": [
18
+ "off",
19
+ {
20
+ callbacksLast: true,
21
+ shorthandFirst: true
22
+ }
23
+ ],
24
+ "@stylistic/jsx-tag-spacing": [
25
+ "error",
26
+ {
27
+ beforeClosing: "allow",
28
+ beforeSelfClosing: "always",
29
+ afterOpening: "never",
30
+ closingSlash: "never"
31
+ }
32
+ ]
33
+ };
34
+
35
+ export default jsxRules;
@@ -0,0 +1,74 @@
1
+ import { minItemsForArrayNewline } from "./_common/_exports.js";
2
+
3
+ const maxIgnoredChainDepth = 3;
4
+
5
+ const lineBreaksRules = {
6
+ "@stylistic/array-element-newline": [
7
+ "error",
8
+ {
9
+ minItems: minItemsForArrayNewline,
10
+ multiline: true
11
+ }
12
+ ],
13
+ "@stylistic/eol-last": ["error", "always"],
14
+ "@stylistic/function-call-argument-newline": ["error", "consistent"],
15
+ "@stylistic/implicit-arrow-linebreak": ["error", "beside"],
16
+ "@stylistic/jsx-first-prop-new-line": ["error", "multiline"],
17
+ "@stylistic/jsx-newline": "error",
18
+ "@stylistic/linebreak-style": ["error", "unix"],
19
+ "@stylistic/lines-between-class-members": ["error", "always"],
20
+ "@stylistic/newline-per-chained-call": [
21
+ "error",
22
+ {
23
+ ignoreChainWithDepth: maxIgnoredChainDepth
24
+ }
25
+ ],
26
+ "@stylistic/object-property-newline": [
27
+ "error",
28
+ {
29
+ allowAllPropertiesOnSameLine: false
30
+ }
31
+ ],
32
+ "@stylistic/padding-line-between-statements": [
33
+ "error",
34
+ {
35
+ prev: "*",
36
+ next: "return",
37
+ blankLine: "always"
38
+ },
39
+ {
40
+ prev: [
41
+ "const",
42
+ "let",
43
+ "var"
44
+ ],
45
+ next: "*",
46
+ blankLine: "always"
47
+ },
48
+ {
49
+ prev: [
50
+ "const",
51
+ "let",
52
+ "var"
53
+ ],
54
+ next: [
55
+ "const",
56
+ "let",
57
+ "var"
58
+ ],
59
+ blankLine: "any"
60
+ },
61
+ {
62
+ prev: [
63
+ "return",
64
+ "break",
65
+ "block",
66
+ "block-like"
67
+ ],
68
+ next: ["case", "default"],
69
+ blankLine: "always"
70
+ }
71
+ ]
72
+ };
73
+
74
+ export default lineBreaksRules;