@pumpn/eslint-config 12.1.4 → 13.0.1

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/plugins.js CHANGED
@@ -1,12 +1,12 @@
1
- /* eslint-disable import/max-dependencies -- collection file */
1
+ /* eslint-disable import-x/max-dependencies -- collection file */
2
2
  import eslintComments from "@eslint-community/eslint-plugin-eslint-comments";
3
3
  import stylistic from "@stylistic/eslint-plugin";
4
- import github from "eslint-plugin-github";
5
- import eslintPluginImport from "eslint-plugin-import";
4
+ // import github from "eslint-plugin-github";
5
+ import importX from "eslint-plugin-import-x";
6
6
  import jsdoc from "eslint-plugin-jsdoc";
7
- import jsxA11y from "eslint-plugin-jsx-a11y";
7
+ // import jsxA11y from "eslint-plugin-jsx-a11y";
8
8
  import noSecrets from "eslint-plugin-no-secrets";
9
- import noUnsanitized from "eslint-plugin-no-unsanitized";
9
+ // import noUnsanitized from "eslint-plugin-no-unsanitized";
10
10
  import perfectionist from "eslint-plugin-perfectionist";
11
11
  import promise from "eslint-plugin-promise";
12
12
  import react from "eslint-plugin-react";
@@ -20,12 +20,12 @@ import unicorn from "eslint-plugin-unicorn";
20
20
  const plugins = {
21
21
  "@eslint-community/eslint-comments": eslintComments,
22
22
  "@stylistic": stylistic,
23
- github,
24
- import: eslintPluginImport,
23
+ // github,
24
+ "import-x": importX,
25
25
  jsdoc,
26
- "jsx-a11y": jsxA11y,
26
+ // "jsx-a11y": jsxA11y,
27
27
  "no-secrets": noSecrets,
28
- "no-unsanitized": noUnsanitized,
28
+ // "no-unsanitized": noUnsanitized,
29
29
  perfectionist,
30
30
  promise,
31
31
  react,
package/rules/_exports.js CHANGED
@@ -1,17 +1,17 @@
1
1
  export { default as eslintCommentsRules } from "./eslint-comments.js";
2
- export { default as githubRules } from "./github.js";
3
- export { default as importRules } from "./import.js";
2
+ // export { default as githubRules } from "./github.js";
3
+ export { default as importXRules } from "./import-x.js";
4
4
  export { default as jsdocRules } from "./jsdoc.js";
5
- export { default as jsxA11yRules } from "./jsx-a11y.js";
5
+ // export { default as jsxA11yRules } from "./jsx-a11y.js";
6
6
  export {
7
7
  default as layoutAndFormattingRules
8
8
  } from "./layout-and-formatting.js";
9
9
  export { default as noSecretsRules } from "./no-secrets.js";
10
- export { default as noUnsanitizedRules } from "./no-unsanitized.js";
10
+ // export { default as noUnsanitizedRules } from "./no-unsanitized.js";
11
11
  export { default as perfectionistRules } from "./perfectionist.js";
12
12
  export { default as possibleProblemsRules } from "./possible-problems.js";
13
13
  export { default as reactRules } from "./react.js";
14
- export { default as redosRules } from "./redos.js";
14
+ // export { default as redosRules } from "./redos.js";
15
15
  export { default as regexpRules } from "./regexp.js";
16
16
  export { default as securityRules } from "./security.js";
17
17
  export { default as sonarjsRules } from "./sonarjs.js";
package/rules/github.js CHANGED
@@ -12,7 +12,7 @@ const githubRules = {
12
12
  "github/js-class-name": "error",
13
13
  "github/no-blur": "error",
14
14
  "github/no-d-none": "error",
15
- "github/no-dataset": "error",
15
+ "github/no-dataset": "off",
16
16
  "github/no-dynamic-script-tag": "error",
17
17
  "github/no-implicit-buggy-globals": "off",
18
18
  "github/no-inner-html": "error",
@@ -0,0 +1,18 @@
1
+ const helpfulWarningsRules = {
2
+ "import-x/export": "error",
3
+ "import-x/no-deprecated": "warn",
4
+ "import-x/no-empty-named-blocks": "error",
5
+ "import-x/no-extraneous-dependencies": "off",
6
+ "import-x/no-mutable-exports": "error",
7
+ "import-x/no-named-as-default": "error",
8
+ "import-x/no-named-as-default-member": "error",
9
+ "import-x/no-unused-modules": [
10
+ "error",
11
+ {
12
+ missingExports: true,
13
+ unusedExports: false
14
+ }
15
+ ]
16
+ };
17
+
18
+ export default helpfulWarningsRules;
@@ -0,0 +1,9 @@
1
+ const moduleSystemsRules = {
2
+ "import-x/no-amd": "error",
3
+ "import-x/no-commonjs": "error",
4
+ "import-x/no-import-module-exports": "error",
5
+ "import-x/no-nodejs-modules": "off",
6
+ "import-x/unambiguous": "error"
7
+ };
8
+
9
+ export default moduleSystemsRules;
@@ -1,24 +1,24 @@
1
1
  const staticAnalysisRules = {
2
- "import/default": "error",
3
- "import/named": "error",
4
- "import/namespace": "error",
5
- "import/no-absolute-path": "error",
6
- "import/no-cycle": [
2
+ "import-x/default": "error",
3
+ "import-x/named": "error",
4
+ "import-x/namespace": "error",
5
+ "import-x/no-absolute-path": "error",
6
+ "import-x/no-cycle": [
7
7
  "error",
8
8
  {
9
9
  maxDepth: Infinity
10
10
  }
11
11
  ],
12
- "import/no-dynamic-require": "error",
13
- "import/no-internal-modules": [
12
+ "import-x/no-dynamic-require": "error",
13
+ "import-x/no-internal-modules": [
14
14
  "off",
15
15
  {
16
16
  allow: []
17
17
  }
18
18
  ],
19
- "import/no-relative-packages": "error",
20
- "import/no-relative-parent-imports": "off",
21
- "import/no-restricted-paths": [
19
+ "import-x/no-relative-packages": "error",
20
+ "import-x/no-relative-parent-imports": "off",
21
+ "import-x/no-restricted-paths": [
22
22
  "error",
23
23
  {
24
24
  zones: [
@@ -56,17 +56,17 @@ const staticAnalysisRules = {
56
56
  ]
57
57
  }
58
58
  ],
59
- "import/no-self-import": "error",
60
- // TODO [2024-04-01]: Change to "error" when there is a resolver for deno
61
- "import/no-unresolved": "off",
62
- "import/no-useless-path-segments": [
59
+ "import-x/no-self-import": "error",
60
+ // TODO [2024-07-01]: Change to "error" when there is a resolver for deno
61
+ "import-x/no-unresolved": "off",
62
+ "import-x/no-useless-path-segments": [
63
63
  "error",
64
64
  {
65
65
  commonjs: false,
66
66
  noUselessIndex: false
67
67
  }
68
68
  ],
69
- "import/no-webpack-loader-syntax": "error"
69
+ "import-x/no-webpack-loader-syntax": "error"
70
70
  };
71
71
 
72
72
  export default staticAnalysisRules;
@@ -1,20 +1,20 @@
1
1
  const maxDependencies = 10;
2
2
 
3
3
  const styleGuideRules = {
4
- "import/consistent-type-specifier-style": "error",
5
- "import/dynamic-import-chunkname": "off",
6
- "import/exports-last": "error",
7
- "import/extensions": ["error", "ignorePackages"],
8
- "import/first": "error",
9
- "import/group-exports": "error",
10
- "import/max-dependencies": [
4
+ "import-x/consistent-type-specifier-style": "error",
5
+ "import-x/dynamic-import-chunkname": "off",
6
+ "import-x/exports-last": "error",
7
+ "import-x/extensions": ["error", "ignorePackages"],
8
+ "import-x/first": "error",
9
+ "import-x/group-exports": "error",
10
+ "import-x/max-dependencies": [
11
11
  "error",
12
12
  {
13
13
  max: maxDependencies
14
14
  }
15
15
  ],
16
- "import/newline-after-import": "error",
17
- "import/no-anonymous-default-export": [
16
+ "import-x/newline-after-import": "error",
17
+ "import-x/no-anonymous-default-export": [
18
18
  "error",
19
19
  {
20
20
  allowAnonymousClass: false,
@@ -27,18 +27,18 @@ const styleGuideRules = {
27
27
  allowObject: false
28
28
  }
29
29
  ],
30
- "import/no-default-export": "off",
31
- "import/no-duplicates": "error",
32
- "import/no-named-default": "error",
33
- "import/no-named-export": "off",
34
- "import/no-namespace": [
30
+ "import-x/no-default-export": "off",
31
+ "import-x/no-duplicates": "error",
32
+ "import-x/no-named-default": "error",
33
+ "import-x/no-named-export": "off",
34
+ "import-x/no-namespace": [
35
35
  "error",
36
36
  {
37
37
  ignore: ["{./**/,**/}_exports.?(*.)js"]
38
38
  }
39
39
  ],
40
- "import/no-unassigned-import": "error",
41
- "import/order": [
40
+ "import-x/no-unassigned-import": "error",
41
+ "import-x/order": [
42
42
  "off",
43
43
  {
44
44
  alphabetize: {
@@ -80,7 +80,7 @@ const styleGuideRules = {
80
80
  warnOnUnassignedImports: false
81
81
  }
82
82
  ],
83
- "import/prefer-default-export": ["error", { target: "single" }]
83
+ "import-x/prefer-default-export": ["error", { target: "single" }]
84
84
  };
85
85
 
86
86
  export default styleGuideRules;
@@ -0,0 +1,12 @@
1
+ import * as importRuleSets from "./import-x/_exports.js";
2
+
3
+ const importXRules = Object.values(importRuleSets)
4
+ .reduce(
5
+ (allRules, ruleSet) => ({
6
+ ...allRules,
7
+ ...ruleSet
8
+ }),
9
+ {}
10
+ );
11
+
12
+ export default importXRules;
package/rules/jsdoc.js CHANGED
@@ -49,7 +49,50 @@ const jsdocRules = {
49
49
  "jsdoc/require-description": [
50
50
  "warn",
51
51
  {
52
- contexts: ["any"],
52
+ contexts: [
53
+ // "ArrayExpression",
54
+ "ArrowFunctionExpression",
55
+ // "AssignmentExpression",
56
+ // "AwaitExpression",
57
+ // "BinaryExpression",
58
+ // "CallExpression",
59
+ // "ChainExpression",
60
+ // "Class",
61
+ "ClassDeclaration",
62
+ "ClassExpression",
63
+ // "ClassHasInstanceExpression",
64
+ // "ConditionalExpression",
65
+ // "DoExpression",
66
+ // "ExportAllDeclaration",
67
+ // "ExportDefaultDeclaration",
68
+ // "ExportNamedDeclaration",
69
+ // "Expression"
70
+ // "ExpressionStatement",
71
+ "FunctionDeclaration",
72
+ "FunctionExpression",
73
+ // "ImportDeclaration",
74
+ // "ImportExpression",
75
+ // "LogicalExpression",
76
+ // "LogicalExpression",
77
+ "MemberExpression",
78
+ "MethodDefinition"
79
+ // "ModuleDeclarations",
80
+ // "ModuleExpression",
81
+ // "NewExpression",
82
+ // "ObjectExpression"
83
+ // "PropertyDefinition",
84
+ // "RecordExpression",
85
+ // "SequenceExpression",
86
+ // "SliceExpression",
87
+ // "StaticBlock",
88
+ // "TaggedTemplateExpression",
89
+ // "ThisExpression",
90
+ // "TupleExpression",
91
+ // "UnaryExpression",
92
+ // "VariableDeclaration",
93
+ // "VariableDeclarator",
94
+ // "YieldExpression"
95
+ ],
53
96
  descriptionStyle: "body"
54
97
  }
55
98
  ],
@@ -142,6 +185,7 @@ const jsdocRules = {
142
185
  "constructor",
143
186
 
144
187
  // Relationships
188
+ "overload",
145
189
  "modifies",
146
190
  "mixes",
147
191
  "mixin",
@@ -1,5 +1,5 @@
1
1
  const layoutAndFormattingRules = {
2
- "line-comment-position": ["error", { position: "above" }],
2
+ "line-comment-position": "off",
3
3
  "unicode-bom": ["error", "never"]
4
4
  };
5
5
 
@@ -70,12 +70,12 @@ const perfectionistRules = {
70
70
  "builtin",
71
71
  "std",
72
72
  "external",
73
- "internal",
74
73
  "utilities",
75
74
  "plugins",
76
75
  "logic",
77
76
  "components",
78
77
  "islands",
78
+ "internal",
79
79
  "type",
80
80
  "internal-type",
81
81
  "parent-type",
@@ -88,6 +88,7 @@ const perfectionistRules = {
88
88
  "unknown"
89
89
  ],
90
90
  "ignore-case": false,
91
+ "internal-pattern": ["@/**"],
91
92
  "newlines-between": "always",
92
93
  order: "asc",
93
94
  type: "natural"
@@ -101,6 +102,14 @@ const perfectionistRules = {
101
102
  type: "natural"
102
103
  }
103
104
  ],
105
+ "perfectionist/sort-intersection-types": [
106
+ "error",
107
+ {
108
+ "ignore-case": false,
109
+ order: "asc",
110
+ type: "natural"
111
+ }
112
+ ],
104
113
  "perfectionist/sort-jsx-props": [
105
114
  "error",
106
115
  {
package/rules/react.js CHANGED
@@ -6,7 +6,7 @@ const reactRules = {
6
6
  "react/default-props-match-prop-types": "error",
7
7
  "react/destructuring-assignment": "error",
8
8
  "react/display-name": "error",
9
- "react/forbid-component-props": "error",
9
+ "react/forbid-component-props": "off",
10
10
  "react/forbid-dom-props": "error",
11
11
  "react/forbid-elements": "error",
12
12
  "react/forbid-foreign-prop-types": "error",
@@ -33,7 +33,7 @@ const bestPracticesRules = {
33
33
  "regexp/prefer-regexp-test": "off",
34
34
  "regexp/prefer-set-operation": "error",
35
35
  "regexp/require-unicode-regexp": "error",
36
- // TODO [2024-04-01]: enable when https://github.com/microsoft/vscode/pull/206580 is merged
36
+ // TODO [2024-07-01]: enable when https://github.com/microsoft/vscode/pull/206580 is resolved
37
37
  "regexp/require-unicode-sets-regexp": "off",
38
38
  "regexp/simplify-set-operations": "error",
39
39
  "regexp/sort-alternatives": "error",
@@ -45,18 +45,30 @@ const stylisticIssuesRules = {
45
45
  "error",
46
46
  {
47
47
  order: [
48
- "\\s",
49
- "\\w",
50
- "\\d",
51
- "\\p",
48
+ String.raw`\s`,
49
+ String.raw`\w`,
50
+ String.raw`\d`,
51
+ String.raw`\p`,
52
52
  "*",
53
- "\\q",
53
+ String.raw`\q`,
54
54
  "[]"
55
55
  ]
56
56
  }
57
57
  ],
58
58
  "regexp/sort-flags": "error",
59
- "regexp/unicode-escape": ["error", "unicodeCodePointEscape"]
59
+ "regexp/unicode-escape": ["error", "unicodeCodePointEscape"],
60
+ "regexp/unicode-property": [
61
+ "error",
62
+ {
63
+ generalCategory: "never",
64
+ key: "ignore",
65
+ property: {
66
+ binary: "ignore",
67
+ generalCategory: "ignore",
68
+ script: "long"
69
+ }
70
+ }
71
+ ]
60
72
  };
61
73
 
62
74
  export default stylisticIssuesRules;
@@ -47,9 +47,9 @@ const bracketsRules = {
47
47
  condition: wrapMultilinesDefault,
48
48
  declaration: wrapMultilinesDefault,
49
49
  logical: wrapMultilinesDefault,
50
+ prop: wrapMultilinesDefault,
51
+ propertyValue: wrapMultilinesDefault,
50
52
  return: wrapMultilinesDefault
51
- // TODO [@stylistic/eslint-plugin@>1.6.3]: uncomment when @stylistic/eslint-plugin releases
52
- // prop: "never"
53
53
  }
54
54
  ],
55
55
  "@stylistic/new-parens": ["error", "always"],
@@ -1,4 +1,5 @@
1
1
  const commentsRules = {
2
+ "@stylistic/line-comment-position": ["error", { position: "above" }],
2
3
  "@stylistic/lines-around-comment": [
3
4
  "error",
4
5
  {
@@ -17,6 +18,7 @@ const commentsRules = {
17
18
  ignorePattern: "/* @type"
18
19
  }
19
20
  ],
21
+ "@stylistic/multiline-comment-style": "off",
20
22
  "@stylistic/spaced-comment": "off"
21
23
  };
22
24
 
@@ -9,8 +9,7 @@ const jsxRules = {
9
9
  when: "multiline"
10
10
  }
11
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"],
12
+ "@stylistic/jsx-one-expression-per-line": ["error", { allow: "single-line" }],
14
13
  "@stylistic/jsx-pascal-case": ["error", { allowNamespace: true }],
15
14
  "@stylistic/jsx-props-no-multi-spaces": "error",
16
15
  "@stylistic/jsx-self-closing-comp": "error",
@@ -14,6 +14,7 @@ const lineBreaksRules = {
14
14
  "@stylistic/function-call-argument-newline": ["error", "consistent"],
15
15
  "@stylistic/implicit-arrow-linebreak": ["error", "beside"],
16
16
  "@stylistic/jsx-first-prop-new-line": ["error", "multiline"],
17
+ "@stylistic/jsx-function-call-newline": ["error", "multiline"],
17
18
  "@stylistic/jsx-newline": "error",
18
19
  "@stylistic/linebreak-style": ["error", "unix"],
19
20
  "@stylistic/lines-between-class-members": ["error", "always"],
@@ -5,7 +5,8 @@ const tailwindcssRules = {
5
5
  "tailwindcss/migration-from-tailwind-2": "error",
6
6
  "tailwindcss/no-arbitrary-value": "off",
7
7
  "tailwindcss/no-contradicting-classname": "error",
8
- "tailwindcss/no-custom-classname": "off"
8
+ "tailwindcss/no-custom-classname": "off",
9
+ "tailwindcss/no-unnecessary-arbitrary-value": "error"
9
10
  };
10
11
 
11
12
  export default tailwindcssRules;
package/rules/unicorn.js CHANGED
@@ -34,6 +34,7 @@ const unicornRules = {
34
34
  "unicorn/better-regex": "error",
35
35
  "unicorn/catch-error-name": "error",
36
36
  "unicorn/consistent-destructuring": "error",
37
+ "unicorn/consistent-empty-array-spread": "error",
37
38
  "unicorn/consistent-function-scoping": "error",
38
39
  "unicorn/custom-error-definition": "error",
39
40
  "unicorn/empty-brace-spaces": "error",
@@ -50,23 +51,25 @@ const unicornRules = {
50
51
  "unicorn/import-style": "error",
51
52
  "unicorn/new-for-builtins": "error",
52
53
  "unicorn/no-abusive-eslint-disable": "error",
53
- // TODO [eslint-plugin-unicorn@>51.0.1]: uncomment below when eslint-plugin-unicorn releases
54
- // "unicorn/no-anonymous-default-export": "error",
55
- "unicorn/no-array-callback-reference": "error",
54
+ "unicorn/no-anonymous-default-export": "error",
55
+ "unicorn/no-array-callback-reference": "off",
56
56
  "unicorn/no-array-for-each": "error",
57
57
  "unicorn/no-array-method-this-argument": "error",
58
58
  "unicorn/no-array-push-push": "error",
59
59
  "unicorn/no-array-reduce": "off",
60
60
  "unicorn/no-await-expression-member": "error",
61
+ "unicorn/no-await-in-promise-methods": "error",
61
62
  "unicorn/no-console-spaces": "error",
62
63
  "unicorn/no-document-cookie": "error",
63
64
  "unicorn/no-empty-file": "error",
64
65
  "unicorn/no-for-loop": "error",
65
66
  "unicorn/no-hex-escape": "error",
66
67
  "unicorn/no-instanceof-array": "error",
68
+ "unicorn/no-invalid-fetch-options": "error",
67
69
  "unicorn/no-invalid-remove-event-listener": "error",
68
70
  "unicorn/no-keyword-prefix": ["error", { disallowedPrefixes: ["new"] }],
69
71
  "unicorn/no-lonely-if": "error",
72
+ "unicorn/no-magic-array-flat-depth": "error",
70
73
  "unicorn/no-negated-condition": "error",
71
74
  "unicorn/no-nested-ternary": "error",
72
75
  "unicorn/no-new-array": "error",
@@ -74,6 +77,7 @@ const unicornRules = {
74
77
  "unicorn/no-null": "off",
75
78
  "unicorn/no-object-as-default-parameter": "error",
76
79
  "unicorn/no-process-exit": "error",
80
+ "unicorn/no-single-promise-in-promise-methods": "error",
77
81
  "unicorn/no-static-only-class": "error",
78
82
  "unicorn/no-thenable": "error",
79
83
  "unicorn/no-this-assignment": "error",
@@ -156,10 +160,12 @@ const unicornRules = {
156
160
  "unicorn/prefer-set-has": "error",
157
161
  "unicorn/prefer-set-size": "error",
158
162
  "unicorn/prefer-spread": "error",
163
+ "unicorn/prefer-string-raw": "error",
159
164
  "unicorn/prefer-string-replace-all": "error",
160
165
  "unicorn/prefer-string-slice": "error",
161
166
  "unicorn/prefer-string-starts-ends-with": "error",
162
167
  "unicorn/prefer-string-trim-start-end": "error",
168
+ "unicorn/prefer-structured-clone": "error",
163
169
  "unicorn/prefer-switch": "error",
164
170
  "unicorn/prefer-ternary": ["error", "only-single-line"],
165
171
  "unicorn/prefer-top-level-await": "error",
@@ -1,18 +0,0 @@
1
- const helpfulWarningsRules = {
2
- "import/export": "error",
3
- "import/no-deprecated": "warn",
4
- "import/no-empty-named-blocks": "error",
5
- "import/no-extraneous-dependencies": "off",
6
- "import/no-mutable-exports": "error",
7
- "import/no-named-as-default": "error",
8
- "import/no-named-as-default-member": "error",
9
- "import/no-unused-modules": [
10
- "error",
11
- {
12
- missingExports: true,
13
- unusedExports: false
14
- }
15
- ]
16
- };
17
-
18
- export default helpfulWarningsRules;
@@ -1,9 +0,0 @@
1
- const moduleSystemsRules = {
2
- "import/no-amd": "error",
3
- "import/no-commonjs": "error",
4
- "import/no-import-module-exports": "error",
5
- "import/no-nodejs-modules": "off",
6
- "import/unambiguous": "error"
7
- };
8
-
9
- export default moduleSystemsRules;
package/rules/import.js DELETED
@@ -1,12 +0,0 @@
1
- import * as importRuleSets from "./import/_exports.js";
2
-
3
- const importRules = Object.values(importRuleSets)
4
- .reduce(
5
- (allRules, ruleSet) => ({
6
- ...allRules,
7
- ...ruleSet
8
- }),
9
- {}
10
- );
11
-
12
- export default importRules;
File without changes