@pumpn/eslint-config 15.5.2 → 15.5.3
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/config.js +14 -2
- package/deno.json +1 -1
- package/package.json +1 -1
- package/plugins.js +23 -6
- package/rules/depend.js +7 -0
- package/rules/eslint-comments.js +7 -0
- package/rules/func-params-args.js +7 -0
- package/rules/github.js +7 -0
- package/rules/import-x.js +7 -0
- package/rules/jsdoc.js +7 -0
- package/rules/jsx-a11y.js +7 -0
- package/rules/layout-and-formatting.js +7 -0
- package/rules/no-secrets.js +7 -0
- package/rules/no-unsanitized.js +7 -0
- package/rules/perfectionist.js +7 -0
- package/rules/possible-problems.js +7 -0
- package/rules/promise.js +7 -0
- package/rules/react.js +7 -0
- package/rules/redos.js +7 -0
- package/rules/regexp.js +7 -0
- package/rules/security.js +7 -0
- package/rules/sonarjs.js +7 -0
- package/rules/stylistic.js +7 -0
- package/rules/suggestions.js +7 -0
- package/rules/tailwindcss.js +7 -0
- package/rules/unicorn.js +7 -0
- package/rules.js +8 -1
package/config.js
CHANGED
|
@@ -5,6 +5,10 @@ import globals from "globals";
|
|
|
5
5
|
import plugins from "./plugins.js";
|
|
6
6
|
import rules from "./rules.js";
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* @import { Linter } from "eslint"
|
|
10
|
+
*/
|
|
11
|
+
|
|
8
12
|
const cssFilesRefreshRate = 5_000;
|
|
9
13
|
|
|
10
14
|
const convertedGlobals = Object.fromEntries(
|
|
@@ -45,7 +49,15 @@ const rulesWithAutofixDisabled = Object.fromEntries(
|
|
|
45
49
|
])
|
|
46
50
|
);
|
|
47
51
|
|
|
48
|
-
|
|
52
|
+
/**
|
|
53
|
+
* ESLint configuration.
|
|
54
|
+
*
|
|
55
|
+
* This configuration includes settings for various file types, plugins, and rules.
|
|
56
|
+
* It also defines specific settings for different environments and file patterns.
|
|
57
|
+
*
|
|
58
|
+
* @satisfies {Linter.Config[]}
|
|
59
|
+
*/
|
|
60
|
+
const config = /** @type {const} */ ([
|
|
49
61
|
{
|
|
50
62
|
ignores: [
|
|
51
63
|
"_fresh/**",
|
|
@@ -215,6 +227,6 @@ const config = [
|
|
|
215
227
|
plugins,
|
|
216
228
|
rules: rulesWithAutofixDisabled
|
|
217
229
|
}
|
|
218
|
-
];
|
|
230
|
+
]);
|
|
219
231
|
|
|
220
232
|
export default config;
|
package/deno.json
CHANGED
package/package.json
CHANGED
package/plugins.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
/* eslint-disable object-shorthand -- const types */
|
|
1
2
|
/* eslint-disable import-x/no-rename-default -- bad export names */
|
|
2
3
|
/* eslint-disable import-x/max-dependencies -- collection file */
|
|
4
|
+
|
|
3
5
|
// import github from "eslint-plugin-github";
|
|
4
6
|
// import jsxA11y from "eslint-plugin-jsx-a11y";
|
|
5
7
|
// import noUnsanitized from "eslint-plugin-no-unsanitized";
|
|
@@ -21,19 +23,34 @@ import sonarjs from "eslint-plugin-sonarjs";
|
|
|
21
23
|
import tailwindcss from "eslint-plugin-tailwindcss";
|
|
22
24
|
import unicorn from "eslint-plugin-unicorn";
|
|
23
25
|
|
|
24
|
-
|
|
26
|
+
/**
|
|
27
|
+
* @import { Linter, ESLint } from "eslint"
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
const reactPlugins = /** @type {Record<string, ESLint.Plugin>} */ (
|
|
31
|
+
/** @type {unknown} */ (react.configs.all.plugins)
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* @satisfies { Linter.Config["plugins"] }
|
|
36
|
+
*/
|
|
37
|
+
const plugins = /** @type {const} */ ({
|
|
25
38
|
// github,
|
|
26
39
|
// "jsx-a11y": jsxA11y,
|
|
27
40
|
// "no-unsanitized": noUnsanitized,
|
|
28
41
|
"@eslint-community/eslint-comments": eslintComments,
|
|
29
|
-
"@stylistic": stylistic,
|
|
42
|
+
"@stylistic": /** @type {ESLint.Plugin} */ (stylistic),
|
|
30
43
|
depend,
|
|
31
44
|
"disable-autofix": disableAutofix,
|
|
32
45
|
"func-params-args": funcParamsArgs,
|
|
33
|
-
"import-x":
|
|
46
|
+
"import-x": /** @type {ESLint.Plugin} */ (
|
|
47
|
+
/** @type {unknown} */ (importX)
|
|
48
|
+
),
|
|
34
49
|
jsdoc,
|
|
35
50
|
"no-secrets": noSecrets,
|
|
36
|
-
perfectionist
|
|
51
|
+
perfectionist: /** @type {ESLint.Plugin} */ (
|
|
52
|
+
/** @type {unknown} */ (perfectionist)
|
|
53
|
+
),
|
|
37
54
|
promise,
|
|
38
55
|
redos,
|
|
39
56
|
regexp,
|
|
@@ -41,7 +58,7 @@ const plugins = {
|
|
|
41
58
|
sonarjs,
|
|
42
59
|
tailwindcss,
|
|
43
60
|
unicorn,
|
|
44
|
-
...
|
|
45
|
-
};
|
|
61
|
+
...reactPlugins
|
|
62
|
+
});
|
|
46
63
|
|
|
47
64
|
export default plugins;
|
package/rules/depend.js
CHANGED
package/rules/eslint-comments.js
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import * as eslintCommentsRuleSets from "./eslint-comments/_exports.js";
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* @import { Linter } from "eslint"
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @satisfies {Linter.RulesRecord}
|
|
9
|
+
*/
|
|
3
10
|
const eslintCommentsRules = Object.values(eslintCommentsRuleSets)
|
|
4
11
|
.reduce(
|
|
5
12
|
(allRules, ruleSet) => ({
|
package/rules/github.js
CHANGED
package/rules/import-x.js
CHANGED
package/rules/jsdoc.js
CHANGED
package/rules/jsx-a11y.js
CHANGED
package/rules/no-secrets.js
CHANGED
package/rules/no-unsanitized.js
CHANGED
package/rules/perfectionist.js
CHANGED
package/rules/promise.js
CHANGED
package/rules/react.js
CHANGED
package/rules/redos.js
CHANGED
package/rules/regexp.js
CHANGED
package/rules/security.js
CHANGED
package/rules/sonarjs.js
CHANGED
package/rules/stylistic.js
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import * as stylisticRuleSets from "./stylistic/_exports.js";
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* @import { Linter } from "eslint"
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @satisfies {Linter.RulesRecord}
|
|
9
|
+
*/
|
|
3
10
|
const stylisticRules = Object.values(stylisticRuleSets)
|
|
4
11
|
.reduce(
|
|
5
12
|
(allRules, ruleSet) => ({
|
package/rules/suggestions.js
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @import { Linter } from "eslint"
|
|
3
|
+
*/
|
|
4
|
+
|
|
1
5
|
const minIdentifierLength = 2;
|
|
2
6
|
const maxIdentifierLength = 30;
|
|
3
7
|
const maxClassesPerFile = 1;
|
|
@@ -8,6 +12,9 @@ const maxNestedCallbacks = 10;
|
|
|
8
12
|
const maxParameters = 3;
|
|
9
13
|
const maxStatements = 20;
|
|
10
14
|
|
|
15
|
+
/**
|
|
16
|
+
* @satisfies {Linter.RulesRecord}
|
|
17
|
+
*/
|
|
11
18
|
const suggestionsRules = {
|
|
12
19
|
"max-classes-per-file": ["error", maxClassesPerFile],
|
|
13
20
|
"max-depth": ["error", maxDepth],
|
package/rules/tailwindcss.js
CHANGED
package/rules/unicorn.js
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @import { Linter } from "eslint"
|
|
3
|
+
*/
|
|
4
|
+
|
|
1
5
|
const hexadecimalGroupLength = 2;
|
|
2
6
|
const binaryGroupLength = 4;
|
|
3
7
|
const octalGroupLength = 4;
|
|
@@ -30,6 +34,9 @@ const patterns = {
|
|
|
30
34
|
"-->": "⟶"
|
|
31
35
|
};
|
|
32
36
|
|
|
37
|
+
/**
|
|
38
|
+
* @satisfies {Linter.RulesRecord}
|
|
39
|
+
*/
|
|
33
40
|
const unicornRules = {
|
|
34
41
|
"unicorn/catch-error-name": "error",
|
|
35
42
|
"unicorn/consistent-destructuring": "error",
|
package/rules.js
CHANGED
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
import * as ruleSets from "./rules/_exports.js";
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* @import { Linter } from "eslint"
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @satisfies {Linter.RulesRecord}
|
|
9
|
+
*/
|
|
3
10
|
const rules = Object.values(ruleSets)
|
|
4
11
|
.reduce(
|
|
5
|
-
(allRules, ruleSet) => ({
|
|
12
|
+
(allRules, ruleSet) => /** @type {const} */ ({
|
|
6
13
|
...allRules,
|
|
7
14
|
...ruleSet
|
|
8
15
|
}),
|