@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.
- package/.ls-lint.yml +6 -0
- package/.tool-versions +1 -0
- package/.vscode/settings.json +7 -0
- package/config.js +91 -62
- package/deno.json +40 -0
- package/deno.lock +3152 -0
- package/eslint.config.js +13 -0
- package/import-map.json +26 -0
- package/jsdoc.json +51 -0
- package/package.json +24 -17
- package/plugins.js +40 -0
- package/rules/_exports.js +21 -0
- package/rules/eslint-comments/_exports.js +2 -0
- package/rules/eslint-comments/best-practices.js +10 -0
- package/rules/eslint-comments/stylistic-issues.js +12 -0
- package/rules/eslint-comments.js +12 -0
- package/rules/github.js +27 -0
- package/rules/import/_exports.js +4 -0
- package/rules/import/helpful-warnings.js +18 -0
- package/rules/import/module-systems.js +9 -0
- package/rules/import/static-analysis.js +71 -0
- package/rules/import/style-guide.js +86 -0
- package/rules/import.js +12 -0
- package/rules/jsdoc.js +255 -54
- package/rules/jsx-a11y.js +139 -0
- package/rules/layout-and-formatting.js +4 -260
- package/rules/no-secrets.js +18 -0
- package/rules/no-unsanitized.js +6 -0
- package/rules/perfectionist.js +267 -0
- package/rules/possible-problems.js +66 -15
- package/rules/promise.js +25 -0
- package/rules/react.js +105 -2
- package/rules/redos.js +15 -0
- package/rules/regexp/_exports.js +3 -0
- package/rules/regexp/best-practices.js +43 -0
- package/rules/regexp/possible-errors.js +26 -0
- package/rules/regexp/stylistic-issues.js +62 -0
- package/rules/regexp.js +12 -0
- package/rules/security.js +18 -0
- package/rules/sonarjs/_exports.js +2 -0
- package/rules/sonarjs/bug-detection.js +14 -0
- package/rules/sonarjs/code-smell-detection.js +37 -0
- package/rules/sonarjs.js +12 -0
- package/rules/stylistic/_common/_exports.js +3 -0
- package/rules/stylistic/_common/min-items-for-array-newline.js +3 -0
- package/rules/stylistic/_exports.js +13 -0
- package/rules/stylistic/brackets.js +79 -0
- package/rules/stylistic/commas.js +13 -0
- package/rules/stylistic/comments.js +23 -0
- package/rules/stylistic/disallow.js +31 -0
- package/rules/stylistic/indent.js +12 -0
- package/rules/stylistic/jsx.js +35 -0
- package/rules/stylistic/linebreaks.js +74 -0
- package/rules/stylistic/misc.js +32 -0
- package/rules/stylistic/operators.js +26 -0
- package/rules/stylistic/quotes.js +7 -0
- package/rules/stylistic/semis.js +14 -0
- package/rules/stylistic/spacing.js +53 -0
- package/rules/stylistic/types.js +7 -0
- package/rules/stylistic.js +12 -0
- package/rules/suggestions.js +152 -135
- package/rules/tailwindcss.js +11 -0
- package/rules/unicorn.js +200 -0
- package/rules.js +11 -14
- package/.np-config.cjs +0 -1
- package/addons/deno.js +0 -15
- package/addons.js +0 -1
- package/rules/imports.js +0 -135
package/.ls-lint.yml
ADDED
package/.tool-versions
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
nodejs 21.6.2
|
package/config.js
CHANGED
|
@@ -1,80 +1,66 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import eslintPluginImport from "eslint-plugin-import";
|
|
4
|
-
import eslintPluginJsdoc from "eslint-plugin-jsdoc";
|
|
5
|
-
import reactJsxRuntime from "eslint-plugin-react/configs/jsx-runtime.js";
|
|
6
|
-
import reactRecommended from "eslint-plugin-react/configs/recommended.js";
|
|
7
|
-
import eslintPluginSortKeysPlus from "eslint-plugin-sort-keys-plus";
|
|
1
|
+
import process from "node:process";
|
|
2
|
+
|
|
8
3
|
import globals from "globals";
|
|
9
4
|
|
|
5
|
+
import plugins from "./plugins.js";
|
|
10
6
|
import rules from "./rules.js";
|
|
11
7
|
|
|
8
|
+
const cssFilesRefreshRate = 5_000;
|
|
9
|
+
|
|
12
10
|
const convertedGlobals = Object.fromEntries(
|
|
13
11
|
Object.entries({
|
|
14
|
-
...globals.
|
|
15
|
-
...globals.
|
|
12
|
+
...globals.browser,
|
|
13
|
+
...globals.builtin
|
|
16
14
|
})
|
|
17
|
-
.map(([global, isWritable]) => [
|
|
15
|
+
.map(([global, isWritable]) => [
|
|
16
|
+
global,
|
|
17
|
+
isWritable
|
|
18
|
+
? "writable"
|
|
19
|
+
: "readonly"
|
|
20
|
+
])
|
|
18
21
|
);
|
|
19
22
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
export default [
|
|
23
|
-
js.configs.recommended,
|
|
23
|
+
const config = [
|
|
24
24
|
{
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
ignores: [
|
|
26
|
+
"_fresh/**",
|
|
27
|
+
"documentation/**",
|
|
28
|
+
"patches/**"
|
|
29
|
+
]
|
|
28
30
|
},
|
|
29
31
|
{
|
|
30
32
|
files: ["**/*.{js,mjs,cjs,jsx,mjsx,ts,tsx,mtsx}"],
|
|
31
33
|
languageOptions: {
|
|
32
34
|
ecmaVersion: "latest",
|
|
33
|
-
sourceType: "module",
|
|
34
35
|
globals: {
|
|
36
|
+
Deno: "readonly",
|
|
35
37
|
...convertedGlobals
|
|
36
38
|
},
|
|
37
|
-
parser: babelParser,
|
|
38
39
|
parserOptions: {
|
|
39
|
-
ecmaVersion: "latest",
|
|
40
|
-
sourceType: "module",
|
|
41
|
-
requireConfigFile: false,
|
|
42
40
|
ecmaFeatures: {
|
|
43
41
|
jsx: true
|
|
44
42
|
},
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
{
|
|
52
|
-
bugfixes: true,
|
|
53
|
-
shippedProposals: true
|
|
54
|
-
}
|
|
55
|
-
]
|
|
56
|
-
],
|
|
57
|
-
plugins: ["@babel/plugin-proposal-export-default-from"]
|
|
58
|
-
}
|
|
59
|
-
}
|
|
43
|
+
ecmaVersion: "latest",
|
|
44
|
+
jsxPragma: null,
|
|
45
|
+
requireConfigFile: false,
|
|
46
|
+
sourceType: "module"
|
|
47
|
+
},
|
|
48
|
+
sourceType: "module"
|
|
60
49
|
},
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
import: eslintPluginImport
|
|
50
|
+
linterOptions: {
|
|
51
|
+
noInlineConfig: false,
|
|
52
|
+
reportUnusedDisableDirectives: "error"
|
|
65
53
|
},
|
|
54
|
+
plugins,
|
|
55
|
+
rules,
|
|
66
56
|
settings: {
|
|
67
|
-
|
|
68
|
-
ignorePrivate: true,
|
|
69
|
-
mode: "permissive"
|
|
70
|
-
},
|
|
57
|
+
formComponents: ["Form"],
|
|
71
58
|
"import/core-modules": [],
|
|
72
59
|
"import/extensions": [
|
|
73
60
|
".js",
|
|
74
61
|
".mjs",
|
|
75
62
|
".jsx"
|
|
76
63
|
],
|
|
77
|
-
"import/ignore": ["node_modules", "\\.(coffee|scss|css|less|hbs|svg|json|cjs)$"],
|
|
78
64
|
"import/parsers": {
|
|
79
65
|
espree: [
|
|
80
66
|
".js",
|
|
@@ -84,38 +70,81 @@ export default [
|
|
|
84
70
|
]
|
|
85
71
|
},
|
|
86
72
|
"import/resolver": {
|
|
73
|
+
"@jsenv/importmap-eslint-resolver": {
|
|
74
|
+
importMapFileRelativeUrl: "./import-map.json",
|
|
75
|
+
projectDirectoryUrl: process.cwd()
|
|
76
|
+
},
|
|
87
77
|
node: true
|
|
88
78
|
},
|
|
89
|
-
|
|
90
|
-
|
|
79
|
+
jsdoc: {
|
|
80
|
+
mode: "typescript",
|
|
81
|
+
tagNamePreference: {
|
|
82
|
+
augments: "extends",
|
|
83
|
+
extends: "extends",
|
|
84
|
+
function: "method",
|
|
85
|
+
method: "method"
|
|
86
|
+
}
|
|
91
87
|
},
|
|
92
|
-
formComponents: ["Form"],
|
|
93
88
|
linkComponents: [
|
|
94
89
|
{
|
|
95
|
-
|
|
96
|
-
|
|
90
|
+
linkAttribute: "to",
|
|
91
|
+
name: "Link"
|
|
97
92
|
}
|
|
98
|
-
]
|
|
99
|
-
|
|
100
|
-
|
|
93
|
+
],
|
|
94
|
+
react: {
|
|
95
|
+
pragma: "h",
|
|
96
|
+
version: "18"
|
|
97
|
+
},
|
|
98
|
+
regexp: {
|
|
99
|
+
allowedCharacterRanges: ["alphanumeric"]
|
|
100
|
+
},
|
|
101
|
+
tailwindcss: {
|
|
102
|
+
callees: [
|
|
103
|
+
"classnames",
|
|
104
|
+
"clsx",
|
|
105
|
+
"ctl"
|
|
106
|
+
],
|
|
107
|
+
classRegex: "^class(Name)?$",
|
|
108
|
+
config: "tailwind.config.js",
|
|
109
|
+
cssFiles: [
|
|
110
|
+
"**/*.css",
|
|
111
|
+
"!**/node_modules",
|
|
112
|
+
"!**/.*",
|
|
113
|
+
"!**/dist",
|
|
114
|
+
"!**/build"
|
|
115
|
+
],
|
|
116
|
+
cssFilesRefreshRate,
|
|
117
|
+
removeDuplicates: true,
|
|
118
|
+
skipClassAttribute: false,
|
|
119
|
+
tags: [],
|
|
120
|
+
whitelist: []
|
|
121
|
+
}
|
|
122
|
+
}
|
|
101
123
|
},
|
|
102
124
|
{
|
|
103
|
-
files: ["
|
|
125
|
+
files: ["**/*.{jsx,mjsx,tsx,mtsx}"],
|
|
104
126
|
rules: {
|
|
105
|
-
"
|
|
127
|
+
"jsdoc/require-param": ["warn", { unnamedRootBase: ["props"] }]
|
|
106
128
|
}
|
|
107
129
|
},
|
|
108
130
|
{
|
|
109
|
-
files: ["
|
|
131
|
+
files: ["**/_exports.?(*.)js"],
|
|
110
132
|
rules: {
|
|
111
|
-
"import/
|
|
112
|
-
"import/
|
|
133
|
+
"import/max-dependencies": "off",
|
|
134
|
+
"import/prefer-default-export": "off"
|
|
113
135
|
}
|
|
114
136
|
},
|
|
115
137
|
{
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
138
|
+
files: [
|
|
139
|
+
"benchmarks/**/*",
|
|
140
|
+
"tests/**/*",
|
|
141
|
+
"scripts/**/*"
|
|
142
|
+
],
|
|
143
|
+
rules: {
|
|
144
|
+
"import/no-unused-modules": "off",
|
|
145
|
+
"import/unambiguous": "off"
|
|
119
146
|
}
|
|
120
147
|
}
|
|
121
148
|
];
|
|
149
|
+
|
|
150
|
+
export default config;
|
package/deno.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"tasks": {
|
|
3
|
+
"lint": "deno run -A npm:eslint .",
|
|
4
|
+
"docs": "jsdoc --configure jsdoc.json"
|
|
5
|
+
},
|
|
6
|
+
"compilerOptions": {
|
|
7
|
+
"allowJs": true,
|
|
8
|
+
"allowUnreachableCode": false,
|
|
9
|
+
"allowUnusedLabels": false,
|
|
10
|
+
"alwaysStrict": true,
|
|
11
|
+
"checkJs": true,
|
|
12
|
+
"exactOptionalPropertyTypes": true,
|
|
13
|
+
"jsx": "react-jsx",
|
|
14
|
+
"jsxImportSource": "preact",
|
|
15
|
+
"noErrorTruncation": true,
|
|
16
|
+
"noFallthroughCasesInSwitch": false,
|
|
17
|
+
"noImplicitAny": true,
|
|
18
|
+
"noImplicitOverride": true,
|
|
19
|
+
"noImplicitReturns": true,
|
|
20
|
+
"noImplicitThis": true,
|
|
21
|
+
"noPropertyAccessFromIndexSignature": false,
|
|
22
|
+
"noUncheckedIndexedAccess": false,
|
|
23
|
+
"noUnusedLocals": false,
|
|
24
|
+
"noUnusedParameters": false,
|
|
25
|
+
"strict": true,
|
|
26
|
+
"lib": [
|
|
27
|
+
"dom",
|
|
28
|
+
"dom.iterable",
|
|
29
|
+
"dom.asynciterable",
|
|
30
|
+
"deno.ns",
|
|
31
|
+
"deno.unstable",
|
|
32
|
+
"esnext"
|
|
33
|
+
]
|
|
34
|
+
},
|
|
35
|
+
"loader": "native",
|
|
36
|
+
"importMap": "./import-map.json",
|
|
37
|
+
"exclude": [
|
|
38
|
+
"**/_fresh/*"
|
|
39
|
+
]
|
|
40
|
+
}
|