@newsteam/eslint-config 1.2.15 → 1.2.17
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/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -52
- package/dist/plugins/sort-react-dependency-arrays.d.ts +3 -2
- package/dist/plugins/sort-react-dependency-arrays.d.ts.map +1 -1
- package/dist/plugins/sort-react-dependency-arrays.js +95 -18
- package/dist/rules/array-function.d.ts +3 -0
- package/dist/rules/array-function.d.ts.map +1 -0
- package/dist/rules/array-function.js +56 -0
- package/dist/rules/css-modules.d.ts +3 -0
- package/dist/rules/css-modules.d.ts.map +1 -0
- package/dist/rules/css-modules.js +27 -0
- package/dist/rules/destructuring.d.ts +3 -0
- package/dist/rules/destructuring.d.ts.map +1 -0
- package/dist/rules/destructuring.js +39 -0
- package/dist/rules/eslint-comments.d.ts +3 -0
- package/dist/rules/eslint-comments.d.ts.map +1 -0
- package/dist/rules/eslint-comments.js +77 -0
- package/dist/rules/import-newlines.d.ts +3 -0
- package/dist/rules/import-newlines.d.ts.map +1 -0
- package/dist/rules/import-newlines.js +26 -0
- package/dist/rules/import-x.d.ts +3 -0
- package/dist/rules/import-x.d.ts.map +1 -0
- package/dist/rules/import-x.js +420 -0
- package/dist/{rules.d.ts → rules/index.d.ts} +1 -1
- package/dist/rules/index.d.ts.map +1 -0
- package/dist/{rules.js → rules/index.js} +51 -1
- package/dist/rules/next.d.ts +3 -0
- package/dist/rules/next.d.ts.map +1 -0
- package/dist/rules/next.js +140 -0
- package/dist/rules/no-unsanitized.d.ts +3 -0
- package/dist/rules/no-unsanitized.d.ts.map +1 -0
- package/dist/rules/no-unsanitized.js +38 -0
- package/dist/rules/no-useless-assign.d.ts +3 -0
- package/dist/rules/no-useless-assign.d.ts.map +1 -0
- package/dist/rules/no-useless-assign.js +20 -0
- package/dist/rules/node.d.ts +3 -0
- package/dist/rules/node.d.ts.map +1 -0
- package/dist/rules/node.js +305 -0
- package/dist/rules/perfectionist.d.ts +3 -0
- package/dist/rules/perfectionist.d.ts.map +1 -0
- package/dist/rules/perfectionist.js +94 -0
- package/dist/rules/promise.d.ts +3 -0
- package/dist/rules/promise.d.ts.map +1 -0
- package/dist/rules/promise.js +123 -0
- package/dist/rules/react-19-upgrade.d.ts +3 -0
- package/dist/rules/react-19-upgrade.d.ts.map +1 -0
- package/dist/rules/react-19-upgrade.js +20 -0
- package/dist/rules/react-compiler.d.ts +3 -0
- package/dist/rules/react-compiler.d.ts.map +1 -0
- package/dist/{plugins → rules}/react-compiler.js +7 -9
- package/dist/rules/react-hooks.d.ts +3 -0
- package/dist/rules/react-hooks.d.ts.map +1 -0
- package/dist/rules/react-hooks.js +163 -0
- package/dist/rules/react-perf.d.ts +3 -0
- package/dist/rules/react-perf.d.ts.map +1 -0
- package/dist/rules/react-perf.js +47 -0
- package/dist/rules/react-refresh.d.ts +3 -0
- package/dist/rules/react-refresh.d.ts.map +1 -0
- package/dist/rules/react-refresh.js +19 -0
- package/dist/rules/react.d.ts +3 -0
- package/dist/rules/react.d.ts.map +1 -0
- package/dist/rules/react.js +740 -0
- package/dist/rules/security.d.ts +3 -0
- package/dist/rules/security.d.ts.map +1 -0
- package/dist/rules/security.js +112 -0
- package/dist/rules/sort-react-dependency-arrays.d.ts +3 -0
- package/dist/rules/sort-react-dependency-arrays.d.ts.map +1 -0
- package/dist/rules/sort-react-dependency-arrays.js +12 -0
- package/dist/rules/stylistic.d.ts +3 -0
- package/dist/rules/stylistic.d.ts.map +1 -0
- package/dist/rules/stylistic.js +916 -0
- package/dist/rules/typescript.d.ts +3 -0
- package/dist/rules/typescript.d.ts.map +1 -0
- package/dist/{plugins → rules}/typescript.js +2 -1
- package/dist/rules/unicorn.d.ts +3 -0
- package/dist/rules/unicorn.d.ts.map +1 -0
- package/dist/rules/unicorn.js +998 -0
- package/dist/test/index.d.ts +2 -0
- package/dist/test/index.d.ts.map +1 -0
- package/dist/test/index.js +15 -0
- package/package.json +11 -13
- package/dist/plugins/array-function.d.ts +0 -3
- package/dist/plugins/array-function.d.ts.map +0 -1
- package/dist/plugins/array-function.js +0 -58
- package/dist/plugins/css-modules.d.ts +0 -3
- package/dist/plugins/css-modules.d.ts.map +0 -1
- package/dist/plugins/css-modules.js +0 -19
- package/dist/plugins/destructuring.d.ts +0 -3
- package/dist/plugins/destructuring.d.ts.map +0 -1
- package/dist/plugins/destructuring.js +0 -41
- package/dist/plugins/eslint-comments.d.ts +0 -3
- package/dist/plugins/eslint-comments.d.ts.map +0 -1
- package/dist/plugins/eslint-comments.js +0 -79
- package/dist/plugins/import-newlines.d.ts +0 -3
- package/dist/plugins/import-newlines.d.ts.map +0 -1
- package/dist/plugins/import-newlines.js +0 -28
- package/dist/plugins/import-x.d.ts +0 -3
- package/dist/plugins/import-x.d.ts.map +0 -1
- package/dist/plugins/import-x.js +0 -418
- package/dist/plugins/newline-destructuring.d.ts +0 -3
- package/dist/plugins/newline-destructuring.d.ts.map +0 -1
- package/dist/plugins/newline-destructuring.js +0 -26
- package/dist/plugins/next.d.ts +0 -3
- package/dist/plugins/next.d.ts.map +0 -1
- package/dist/plugins/next.js +0 -142
- package/dist/plugins/no-unsanitized.d.ts +0 -3
- package/dist/plugins/no-unsanitized.d.ts.map +0 -1
- package/dist/plugins/no-unsanitized.js +0 -40
- package/dist/plugins/no-useless-assign.d.ts +0 -3
- package/dist/plugins/no-useless-assign.d.ts.map +0 -1
- package/dist/plugins/no-useless-assign.js +0 -22
- package/dist/plugins/node.d.ts +0 -3
- package/dist/plugins/node.d.ts.map +0 -1
- package/dist/plugins/node.js +0 -307
- package/dist/plugins/perfectionist.d.ts +0 -3
- package/dist/plugins/perfectionist.d.ts.map +0 -1
- package/dist/plugins/perfectionist.js +0 -96
- package/dist/plugins/promise.d.ts +0 -3
- package/dist/plugins/promise.d.ts.map +0 -1
- package/dist/plugins/promise.js +0 -125
- package/dist/plugins/react-19-upgrade.d.ts +0 -3
- package/dist/plugins/react-19-upgrade.d.ts.map +0 -1
- package/dist/plugins/react-19-upgrade.js +0 -22
- package/dist/plugins/react-compiler.d.ts +0 -3
- package/dist/plugins/react-compiler.d.ts.map +0 -1
- package/dist/plugins/react-hooks.d.ts +0 -3
- package/dist/plugins/react-hooks.d.ts.map +0 -1
- package/dist/plugins/react-hooks.js +0 -165
- package/dist/plugins/react-perf.d.ts +0 -3
- package/dist/plugins/react-perf.d.ts.map +0 -1
- package/dist/plugins/react-perf.js +0 -49
- package/dist/plugins/react-refresh.d.ts +0 -3
- package/dist/plugins/react-refresh.d.ts.map +0 -1
- package/dist/plugins/react-refresh.js +0 -21
- package/dist/plugins/react.d.ts +0 -3
- package/dist/plugins/react.d.ts.map +0 -1
- package/dist/plugins/react.js +0 -738
- package/dist/plugins/security.d.ts +0 -3
- package/dist/plugins/security.d.ts.map +0 -1
- package/dist/plugins/security.js +0 -114
- package/dist/plugins/stylistic.d.ts +0 -3
- package/dist/plugins/stylistic.d.ts.map +0 -1
- package/dist/plugins/stylistic.js +0 -901
- package/dist/plugins/typescript.d.ts +0 -3
- package/dist/plugins/typescript.d.ts.map +0 -1
- package/dist/plugins/unicorn.d.ts +0 -3
- package/dist/plugins/unicorn.d.ts.map +0 -1
- package/dist/plugins/unicorn.js +0 -994
- package/dist/rules.d.ts.map +0 -1
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* These rules disallow unsafe coding practices that may result into security
|
|
3
|
+
* vulnerabilities. We will disallow assignments (e.g., to innerHTML) as well as
|
|
4
|
+
* calls (e.g., to insertAdjacentHTML) without the use of a pre-defined escaping
|
|
5
|
+
* function. The escaping functions must be called with a template string. The
|
|
6
|
+
* function names are hardcoded as Sanitizer.escapeHTML and escapeHTML.
|
|
7
|
+
*
|
|
8
|
+
* https://www.npmjs.com/package/eslint-plugin-no-unsanitized
|
|
9
|
+
*/
|
|
10
|
+
import { fixupPluginRules } from "@eslint/compat";
|
|
11
|
+
import plugin from "eslint-plugin-no-unsanitized";
|
|
12
|
+
export const noUnsanitizedPluginConfig = {
|
|
13
|
+
plugins: {
|
|
14
|
+
"no-unsanitized": fixupPluginRules(plugin),
|
|
15
|
+
},
|
|
16
|
+
rules: {
|
|
17
|
+
/*
|
|
18
|
+
* The method rule in eslint-plugin-no-unsanitized perform basic security
|
|
19
|
+
* checks for function calls. The idea of these checks is to ensure that
|
|
20
|
+
* certain insecure coding patterns are avoided in your codebase. We
|
|
21
|
+
* encourage developers to use HTML sanitizers or escapers to mitigate
|
|
22
|
+
* those insecure patterns.
|
|
23
|
+
*
|
|
24
|
+
* https://github.com/mozilla/eslint-plugin-no-unsanitized/blob/master/docs/rules/method.md
|
|
25
|
+
*/
|
|
26
|
+
"no-unsanitized/method": "warn",
|
|
27
|
+
/*
|
|
28
|
+
* The property rule in eslint-plugin-no-unsanitized perform basic security
|
|
29
|
+
* checks for property assignments. The idea of these checks is to ensure
|
|
30
|
+
* that certain insecure coding patterns are avoided in your codebase.
|
|
31
|
+
* We encourage developers to use HTML sanitizers or escapers to mitigate
|
|
32
|
+
* those insecure patterns.
|
|
33
|
+
*
|
|
34
|
+
* https://github.com/mozilla/eslint-plugin-no-unsanitized/blob/master/docs/rules/property.md
|
|
35
|
+
*/
|
|
36
|
+
"no-unsanitized/property": "warn",
|
|
37
|
+
},
|
|
38
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-useless-assign.d.ts","sourceRoot":"","sources":["../../src/rules/no-useless-assign.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAOrC,eAAO,MAAM,2BAA2B,EAAE,MAAM,CAAC,MAahD,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { fixupPluginRules } from "@eslint/compat";
|
|
2
|
+
import noUselessAssign from "eslint-plugin-no-useless-assign";
|
|
3
|
+
/*
|
|
4
|
+
* Prevent useless assignment
|
|
5
|
+
*
|
|
6
|
+
* https://www.npmjs.com/package/eslint-plugin-no-useless-assign
|
|
7
|
+
*/
|
|
8
|
+
export const noUselessAssignPluginConfig = {
|
|
9
|
+
plugins: {
|
|
10
|
+
"no-useless-assign": fixupPluginRules(noUselessAssign),
|
|
11
|
+
},
|
|
12
|
+
rules: {
|
|
13
|
+
/*
|
|
14
|
+
* Prevent useless assignment
|
|
15
|
+
*
|
|
16
|
+
* https://www.npmjs.com/package/eslint-plugin-no-useless-assign#usage
|
|
17
|
+
*/
|
|
18
|
+
"no-useless-assign/no-useless-assign": "warn",
|
|
19
|
+
},
|
|
20
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../src/rules/node.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AA0BrC,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,MA+TrC,CAAC"}
|
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
import { fixupPluginRules } from "@eslint/compat";
|
|
2
|
+
import node from "eslint-plugin-node";
|
|
3
|
+
import { NODE_VERSION } from "../settings.js";
|
|
4
|
+
const resolvePaths = [process.cwd()];
|
|
5
|
+
const tryExtensions = [
|
|
6
|
+
".js",
|
|
7
|
+
".jsx",
|
|
8
|
+
".mjs",
|
|
9
|
+
".json",
|
|
10
|
+
".ts",
|
|
11
|
+
".tsx",
|
|
12
|
+
".scss",
|
|
13
|
+
".ico",
|
|
14
|
+
".png",
|
|
15
|
+
".jpg",
|
|
16
|
+
".jpeg",
|
|
17
|
+
".gif",
|
|
18
|
+
];
|
|
19
|
+
/*
|
|
20
|
+
* Rules for Array functions and methods.
|
|
21
|
+
*
|
|
22
|
+
* https://www.npmjs.com/package/eslint-plugin-node
|
|
23
|
+
*/
|
|
24
|
+
export const nodePluginConfig = {
|
|
25
|
+
plugins: {
|
|
26
|
+
node: fixupPluginRules(node),
|
|
27
|
+
},
|
|
28
|
+
rules: {
|
|
29
|
+
/*
|
|
30
|
+
* Require return statements after callbacks
|
|
31
|
+
*
|
|
32
|
+
* https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/callback-return.md
|
|
33
|
+
*/
|
|
34
|
+
"node/callback-return": "warn",
|
|
35
|
+
/*
|
|
36
|
+
* Enforce either module.exports or exports
|
|
37
|
+
*
|
|
38
|
+
* https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/exports-style.md
|
|
39
|
+
*/
|
|
40
|
+
"node/exports-style": [
|
|
41
|
+
"warn",
|
|
42
|
+
"module.exports",
|
|
43
|
+
],
|
|
44
|
+
/*
|
|
45
|
+
* Enforce the style of file extensions in import declarations
|
|
46
|
+
*
|
|
47
|
+
* Turning this off since the future of node >= 16 requires extensions
|
|
48
|
+
*
|
|
49
|
+
* https://github.com/mysticatea/eslint-plugin-node/blob/HEAD/docs/rules/file-extension-in-import.md
|
|
50
|
+
*/
|
|
51
|
+
"node/file-extension-in-import": "off",
|
|
52
|
+
/*
|
|
53
|
+
* Require require() calls to be placed at top-level module scope
|
|
54
|
+
*
|
|
55
|
+
* https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/global-require.md
|
|
56
|
+
*/
|
|
57
|
+
"node/global-require": "warn",
|
|
58
|
+
/*
|
|
59
|
+
* Require require() calls to be placed at top-level module scope
|
|
60
|
+
*
|
|
61
|
+
* https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/handle-callback-err.md
|
|
62
|
+
*/
|
|
63
|
+
"node/handle-callback-err": "warn",
|
|
64
|
+
/*
|
|
65
|
+
* Ensure Node.js-style error-first callback pattern is followed
|
|
66
|
+
*
|
|
67
|
+
* https://github.com/mysticatea/eslint-plugin-node/blob/HEAD/docs/rules/no-callback-literal.md
|
|
68
|
+
*/
|
|
69
|
+
"node/no-callback-literal": "warn",
|
|
70
|
+
/*
|
|
71
|
+
* Disallow deprecated APIs
|
|
72
|
+
*
|
|
73
|
+
* https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-deprecated-api.md
|
|
74
|
+
*/
|
|
75
|
+
"node/no-deprecated-api": "warn",
|
|
76
|
+
/*
|
|
77
|
+
* Disallow the assignment to exports
|
|
78
|
+
*
|
|
79
|
+
* https://github.com/mysticatea/eslint-plugin-node/blob/eca48c8052728cd79d5f06f00fb5cfb03b996e14/docs/rules/no-exports-assign.md
|
|
80
|
+
*/
|
|
81
|
+
"node/no-exports-assign": "warn",
|
|
82
|
+
/*
|
|
83
|
+
* Disallow import declarations of extraneous packages
|
|
84
|
+
*
|
|
85
|
+
* https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-extraneous-import.md
|
|
86
|
+
*/
|
|
87
|
+
"node/no-extraneous-import": "warn",
|
|
88
|
+
/*
|
|
89
|
+
* Disallow require() expressions of extraneous packages
|
|
90
|
+
*
|
|
91
|
+
* https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-extraneous-require.md
|
|
92
|
+
*/
|
|
93
|
+
"node/no-extraneous-require": "warn",
|
|
94
|
+
/*
|
|
95
|
+
* Disallow import declarations of missing files
|
|
96
|
+
*
|
|
97
|
+
* https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-missing-import.md
|
|
98
|
+
*/
|
|
99
|
+
"node/no-missing-import": [
|
|
100
|
+
"off",
|
|
101
|
+
{
|
|
102
|
+
resolvePaths,
|
|
103
|
+
tryExtensions,
|
|
104
|
+
},
|
|
105
|
+
],
|
|
106
|
+
/*
|
|
107
|
+
* Disallow require() expressions of missing files
|
|
108
|
+
*
|
|
109
|
+
* https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-missing-require.md
|
|
110
|
+
*/
|
|
111
|
+
"node/no-missing-require": [
|
|
112
|
+
"off",
|
|
113
|
+
{
|
|
114
|
+
resolvePaths,
|
|
115
|
+
tryExtensions,
|
|
116
|
+
},
|
|
117
|
+
],
|
|
118
|
+
/*
|
|
119
|
+
* Disallow require calls to be mixed with regular variable declarations
|
|
120
|
+
*
|
|
121
|
+
* https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-mixed-requires.md
|
|
122
|
+
*/
|
|
123
|
+
"node/no-mixed-requires": "warn",
|
|
124
|
+
/*
|
|
125
|
+
* Disallow new operators with calls to require
|
|
126
|
+
*
|
|
127
|
+
* https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-new-require.md
|
|
128
|
+
*/
|
|
129
|
+
"node/no-new-require": "warn",
|
|
130
|
+
/*
|
|
131
|
+
* Disallow string concatenation with __dirname and __filename
|
|
132
|
+
*
|
|
133
|
+
* https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-path-concat.md
|
|
134
|
+
*/
|
|
135
|
+
"node/no-path-concat": "warn",
|
|
136
|
+
/*
|
|
137
|
+
* Disallow the use of process.env
|
|
138
|
+
*
|
|
139
|
+
* This is off for now because it's used extensively in the webpack DefinePlugin
|
|
140
|
+
* to allow for the deleting of code that only runs depending on certain
|
|
141
|
+
* environment configuration conditions. If we say something like
|
|
142
|
+
* if(process.env.mode === "development"){ ... } we want that code completely
|
|
143
|
+
* stripped if process.env.mode === "production".
|
|
144
|
+
*
|
|
145
|
+
* https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-process-env.md
|
|
146
|
+
*/
|
|
147
|
+
"node/no-process-env": "off",
|
|
148
|
+
/*
|
|
149
|
+
* Disallow the use of process.exit()
|
|
150
|
+
*
|
|
151
|
+
* https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-process-exit.md
|
|
152
|
+
*/
|
|
153
|
+
"node/no-process-exit": "warn",
|
|
154
|
+
/*
|
|
155
|
+
* Disallow specified modules when loaded by import declarations
|
|
156
|
+
*
|
|
157
|
+
* Handled by 'no-restricted-import'
|
|
158
|
+
*
|
|
159
|
+
* https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-restricted-import.md
|
|
160
|
+
*/
|
|
161
|
+
"node/no-restricted-import": "off",
|
|
162
|
+
/*
|
|
163
|
+
* Disallow specified modules when loaded by require
|
|
164
|
+
*
|
|
165
|
+
* Handled by 'no-restricted-require'
|
|
166
|
+
*
|
|
167
|
+
* https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-restricted-require.md
|
|
168
|
+
*/
|
|
169
|
+
"node/no-restricted-require": "off",
|
|
170
|
+
/*
|
|
171
|
+
* Disallow synchronous methods
|
|
172
|
+
*
|
|
173
|
+
* https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-sync.md
|
|
174
|
+
*/
|
|
175
|
+
"node/no-sync": "warn",
|
|
176
|
+
/*
|
|
177
|
+
* Disallow 'bin' files which are ignored by npm
|
|
178
|
+
*
|
|
179
|
+
* https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-unpublished-bin.md
|
|
180
|
+
*/
|
|
181
|
+
"node/no-unpublished-bin": "warn",
|
|
182
|
+
/*
|
|
183
|
+
* Disallow import declarations of private things
|
|
184
|
+
*
|
|
185
|
+
* https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-unpublished-import.md
|
|
186
|
+
*/
|
|
187
|
+
"node/no-unpublished-import": [
|
|
188
|
+
"warn",
|
|
189
|
+
{
|
|
190
|
+
allowModules: [
|
|
191
|
+
"@total-typescript/ts-reset",
|
|
192
|
+
"electron",
|
|
193
|
+
],
|
|
194
|
+
},
|
|
195
|
+
],
|
|
196
|
+
/*
|
|
197
|
+
* Disallow require() expressions of private things
|
|
198
|
+
*
|
|
199
|
+
* https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-unpublished-require.md
|
|
200
|
+
*/
|
|
201
|
+
"node/no-unpublished-require": "warn",
|
|
202
|
+
/*
|
|
203
|
+
* Disallow unsupported ECMAScript built-ins on the specified version
|
|
204
|
+
*
|
|
205
|
+
* https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-unsupported-features/es-builtins.md
|
|
206
|
+
*/
|
|
207
|
+
"node/no-unsupported-features/es-builtins": "warn",
|
|
208
|
+
/*
|
|
209
|
+
* Disallow unsupported ECMAScript syntax on the specified version
|
|
210
|
+
*
|
|
211
|
+
* https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-unsupported-features/es-syntax.md
|
|
212
|
+
*/
|
|
213
|
+
"node/no-unsupported-features/es-syntax": [
|
|
214
|
+
"warn",
|
|
215
|
+
{
|
|
216
|
+
ignores: [
|
|
217
|
+
"dynamicImport",
|
|
218
|
+
"modules",
|
|
219
|
+
],
|
|
220
|
+
version: NODE_VERSION,
|
|
221
|
+
},
|
|
222
|
+
],
|
|
223
|
+
/*
|
|
224
|
+
* Disallow unsupported Node.js built-in APIs on the specified version
|
|
225
|
+
*
|
|
226
|
+
* https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-unsupported-features/node-builtins.md
|
|
227
|
+
*/
|
|
228
|
+
"node/no-unsupported-features/node-builtins": [
|
|
229
|
+
"warn",
|
|
230
|
+
{
|
|
231
|
+
ignores: [],
|
|
232
|
+
version: NODE_VERSION,
|
|
233
|
+
},
|
|
234
|
+
],
|
|
235
|
+
/*
|
|
236
|
+
* Enforce either Buffer or require("buffer").Buffer
|
|
237
|
+
*
|
|
238
|
+
* https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/prefer-global/buffer.md
|
|
239
|
+
*/
|
|
240
|
+
"node/prefer-global/buffer": "warn",
|
|
241
|
+
/*
|
|
242
|
+
* Enforce either console or require("console")
|
|
243
|
+
*
|
|
244
|
+
* https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/prefer-global/console.md
|
|
245
|
+
*/
|
|
246
|
+
"node/prefer-global/console": "warn",
|
|
247
|
+
/*
|
|
248
|
+
* Enforce either process or require("process")
|
|
249
|
+
*
|
|
250
|
+
* https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/prefer-global/process.md
|
|
251
|
+
*/
|
|
252
|
+
"node/prefer-global/process": "warn",
|
|
253
|
+
/*
|
|
254
|
+
* Enforce either TextDecoder or require("util").TextDecoder
|
|
255
|
+
*
|
|
256
|
+
* https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/prefer-global/text-decoder.md
|
|
257
|
+
*/
|
|
258
|
+
"node/prefer-global/text-decoder": "warn",
|
|
259
|
+
/*
|
|
260
|
+
* Enforce either TextEncoder or require("util").TextEncoder
|
|
261
|
+
*
|
|
262
|
+
* https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/prefer-global/text-encoder.md
|
|
263
|
+
*/
|
|
264
|
+
"node/prefer-global/text-encoder": "warn",
|
|
265
|
+
/*
|
|
266
|
+
* Enforce either URL or require("url").URL
|
|
267
|
+
*
|
|
268
|
+
* https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/prefer-global/url.md
|
|
269
|
+
*/
|
|
270
|
+
"node/prefer-global/url": [
|
|
271
|
+
"warn",
|
|
272
|
+
"always",
|
|
273
|
+
],
|
|
274
|
+
/*
|
|
275
|
+
* Enforce either URLSearchParams or require("url").URLSearchParams
|
|
276
|
+
*
|
|
277
|
+
* https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/prefer-global/url-search-params.md
|
|
278
|
+
*/
|
|
279
|
+
"node/prefer-global/url-search-params": "warn",
|
|
280
|
+
/*
|
|
281
|
+
* Enforce require("dns").promises
|
|
282
|
+
*
|
|
283
|
+
* https://github.com/mysticatea/eslint-plugin-node/blob/HEAD/docs/rules/prefer-promises/dns.md
|
|
284
|
+
*/
|
|
285
|
+
"node/prefer-promises/dns": "warn",
|
|
286
|
+
/*
|
|
287
|
+
* Enforce require("fs").promises
|
|
288
|
+
*
|
|
289
|
+
* https://github.com/mysticatea/eslint-plugin-node/blob/HEAD/docs/rules/prefer-promises/fs.md
|
|
290
|
+
*/
|
|
291
|
+
"node/prefer-promises/fs": "warn",
|
|
292
|
+
/*
|
|
293
|
+
* Make process.exit() expressions the same code path as throw
|
|
294
|
+
*
|
|
295
|
+
* https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/process-exit-as-throw.md
|
|
296
|
+
*/
|
|
297
|
+
"node/process-exit-as-throw": "warn",
|
|
298
|
+
/*
|
|
299
|
+
* Enforce the correct usage of shebang
|
|
300
|
+
*
|
|
301
|
+
* https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/shebang.md
|
|
302
|
+
*/
|
|
303
|
+
"node/shebang": "warn",
|
|
304
|
+
},
|
|
305
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"perfectionist.d.ts","sourceRoot":"","sources":["../../src/rules/perfectionist.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGrC,eAAO,MAAM,yBAAyB,EAAE,MAAM,CAAC,MA4F9C,CAAC"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import perfectionist from "eslint-plugin-perfectionist";
|
|
2
|
+
export const perfectionistPluginConfig = {
|
|
3
|
+
plugins: {
|
|
4
|
+
perfectionist,
|
|
5
|
+
},
|
|
6
|
+
rules: {
|
|
7
|
+
"perfectionist/sort-array-includes": "warn",
|
|
8
|
+
"perfectionist/sort-astro-attributes": "off",
|
|
9
|
+
"perfectionist/sort-classes": "off",
|
|
10
|
+
"perfectionist/sort-decorators": "warn",
|
|
11
|
+
"perfectionist/sort-enums": "warn",
|
|
12
|
+
"perfectionist/sort-export-attributes": "warn",
|
|
13
|
+
"perfectionist/sort-exports": "warn",
|
|
14
|
+
"perfectionist/sort-heritage-clauses": "warn",
|
|
15
|
+
"perfectionist/sort-import-attributes": "warn",
|
|
16
|
+
"perfectionist/sort-imports": [
|
|
17
|
+
"warn",
|
|
18
|
+
{
|
|
19
|
+
groups: [
|
|
20
|
+
"builtin",
|
|
21
|
+
"external",
|
|
22
|
+
"internal",
|
|
23
|
+
["parent", "sibling", "index"],
|
|
24
|
+
"type",
|
|
25
|
+
"type-internal",
|
|
26
|
+
["type-parent", "type-sibling", "type-index"],
|
|
27
|
+
"side-effect",
|
|
28
|
+
["style", "side-effect-style"],
|
|
29
|
+
"unknown",
|
|
30
|
+
],
|
|
31
|
+
internalPattern: [
|
|
32
|
+
"@common/.*",
|
|
33
|
+
"@src/.*",
|
|
34
|
+
],
|
|
35
|
+
order: "asc",
|
|
36
|
+
sortSideEffects: true,
|
|
37
|
+
type: "natural",
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
"perfectionist/sort-interfaces": "warn",
|
|
41
|
+
"perfectionist/sort-intersection-types": [
|
|
42
|
+
"warn",
|
|
43
|
+
{
|
|
44
|
+
groups: [
|
|
45
|
+
"conditional",
|
|
46
|
+
"function",
|
|
47
|
+
"import",
|
|
48
|
+
"intersection",
|
|
49
|
+
"keyword",
|
|
50
|
+
"named",
|
|
51
|
+
"operator",
|
|
52
|
+
"tuple",
|
|
53
|
+
"union",
|
|
54
|
+
"literal",
|
|
55
|
+
"object",
|
|
56
|
+
"nullish",
|
|
57
|
+
"unknown",
|
|
58
|
+
],
|
|
59
|
+
},
|
|
60
|
+
],
|
|
61
|
+
"perfectionist/sort-jsx-props": "warn",
|
|
62
|
+
"perfectionist/sort-maps": "warn",
|
|
63
|
+
"perfectionist/sort-modules": "off",
|
|
64
|
+
"perfectionist/sort-named-exports": "warn",
|
|
65
|
+
"perfectionist/sort-named-imports": "warn",
|
|
66
|
+
"perfectionist/sort-object-types": "warn",
|
|
67
|
+
"perfectionist/sort-objects": "warn",
|
|
68
|
+
"perfectionist/sort-sets": "warn",
|
|
69
|
+
"perfectionist/sort-svelte-attributes": "off",
|
|
70
|
+
"perfectionist/sort-switch-case": "warn",
|
|
71
|
+
"perfectionist/sort-union-types": [
|
|
72
|
+
"warn",
|
|
73
|
+
{
|
|
74
|
+
groups: [
|
|
75
|
+
"conditional",
|
|
76
|
+
"function",
|
|
77
|
+
"import",
|
|
78
|
+
"intersection",
|
|
79
|
+
"keyword",
|
|
80
|
+
"named",
|
|
81
|
+
"operator",
|
|
82
|
+
"tuple",
|
|
83
|
+
"union",
|
|
84
|
+
"literal",
|
|
85
|
+
"object",
|
|
86
|
+
"nullish",
|
|
87
|
+
"unknown",
|
|
88
|
+
],
|
|
89
|
+
},
|
|
90
|
+
],
|
|
91
|
+
"perfectionist/sort-variable-declarations": "off",
|
|
92
|
+
"perfectionist/sort-vue-attributes": "off",
|
|
93
|
+
},
|
|
94
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"promise.d.ts","sourceRoot":"","sources":["../../src/rules/promise.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAQrC,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,MAsIxC,CAAC"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import promise from "eslint-plugin-promise";
|
|
2
|
+
/*
|
|
3
|
+
* Enforce best practices for JavaScript promises.
|
|
4
|
+
*
|
|
5
|
+
* https://github.com/xjamundx/eslint-plugin-promise
|
|
6
|
+
*/
|
|
7
|
+
export const promisePluginConfig = {
|
|
8
|
+
plugins: {
|
|
9
|
+
promise,
|
|
10
|
+
},
|
|
11
|
+
rules: {
|
|
12
|
+
/*
|
|
13
|
+
* Return inside each then() to create readable and reusable Promise chains.
|
|
14
|
+
*
|
|
15
|
+
* Off for now, doesn't seem like a good idea
|
|
16
|
+
*
|
|
17
|
+
* https://github.com/xjamundx/eslint-plugin-promise/blob/HEAD/docs/rules/always-return.md
|
|
18
|
+
*/
|
|
19
|
+
"promise/always-return": "off",
|
|
20
|
+
/*
|
|
21
|
+
* Avoid creating new promises outside of utility libs (use pify instead)
|
|
22
|
+
*
|
|
23
|
+
* Off for now, doesn't seem like a good idea
|
|
24
|
+
*
|
|
25
|
+
* https://github.com/xjamundx/eslint-plugin-promise/blob/HEAD/docs/rules/avoid-new.md
|
|
26
|
+
*/
|
|
27
|
+
"promise/avoid-new": "off",
|
|
28
|
+
/*
|
|
29
|
+
* Enforces the use of catch() on un-returned promises.
|
|
30
|
+
*
|
|
31
|
+
* https://github.com/xjamundx/eslint-plugin-promise/blob/HEAD/docs/rules/catch-or-return.md
|
|
32
|
+
*/
|
|
33
|
+
"promise/catch-or-return": "warn",
|
|
34
|
+
/*
|
|
35
|
+
* Avoid calling cb() inside of a then() (use nodeify instead)
|
|
36
|
+
*
|
|
37
|
+
* Off for now, doesn't seem like a good idea
|
|
38
|
+
*
|
|
39
|
+
* https://github.com/xjamundx/eslint-plugin-promise/blob/HEAD/docs/rules/no-callback-in-promise.md
|
|
40
|
+
*/
|
|
41
|
+
"promise/no-callback-in-promise": "off",
|
|
42
|
+
/*
|
|
43
|
+
* Disallow creating new promises with paths that resolve multiple times
|
|
44
|
+
*
|
|
45
|
+
* https://github.com/xjamundx/eslint-plugin-promise/blob/HEAD/docs/rules/no-multiple-resolved.md
|
|
46
|
+
*/
|
|
47
|
+
"promise/no-multiple-resolved": "warn",
|
|
48
|
+
/*
|
|
49
|
+
* In an ES5 environment, make sure to create a Promise constructor before using.
|
|
50
|
+
*
|
|
51
|
+
* Off for now because we're assuming there is always a native promise
|
|
52
|
+
*
|
|
53
|
+
* https://github.com/xjamundx/eslint-plugin-promise/blob/HEAD/docs/rules/no-native.md
|
|
54
|
+
*/
|
|
55
|
+
"promise/no-native": "off",
|
|
56
|
+
/*
|
|
57
|
+
* Avoid nested then() or catch() statements
|
|
58
|
+
*
|
|
59
|
+
* https://github.com/xjamundx/eslint-plugin-promise/blob/HEAD/docs/rules/no-nesting.md
|
|
60
|
+
*/
|
|
61
|
+
"promise/no-nesting": "warn",
|
|
62
|
+
/*
|
|
63
|
+
* Avoid calling new on a Promise static method
|
|
64
|
+
*
|
|
65
|
+
* https://github.com/xjamundx/eslint-plugin-promise/blob/HEAD/docs/rules/no-new-statics.md
|
|
66
|
+
*/
|
|
67
|
+
"promise/no-new-statics": "warn",
|
|
68
|
+
/*
|
|
69
|
+
* Avoid using promises inside of callbacks
|
|
70
|
+
*
|
|
71
|
+
* https://github.com/xjamundx/eslint-plugin-promise/blob/HEAD/docs/rules/no-promise-in-callback.md
|
|
72
|
+
*/
|
|
73
|
+
"promise/no-promise-in-callback": "warn",
|
|
74
|
+
/*
|
|
75
|
+
* Disallow return statements in finally()
|
|
76
|
+
*
|
|
77
|
+
* https://github.com/xjamundx/eslint-plugin-promise/blob/HEAD/docs/rules/no-return-in-finally.md
|
|
78
|
+
*/
|
|
79
|
+
"promise/no-return-in-finally": "warn",
|
|
80
|
+
/*
|
|
81
|
+
* Avoid wrapping values in Promise.resolve or Promise.reject when not needed.
|
|
82
|
+
*
|
|
83
|
+
* https://github.com/xjamundx/eslint-plugin-promise/blob/HEAD/docs/rules/no-return-wrap.md
|
|
84
|
+
*/
|
|
85
|
+
"promise/no-return-wrap": "warn",
|
|
86
|
+
/*
|
|
87
|
+
* Enforce consistent param names and ordering when creating new promises.
|
|
88
|
+
*
|
|
89
|
+
* https://github.com/xjamundx/eslint-plugin-promise/blob/HEAD/docs/rules/param-names.md
|
|
90
|
+
*/
|
|
91
|
+
"promise/param-names": "warn",
|
|
92
|
+
/*
|
|
93
|
+
* Prefer async/await to the callback pattern
|
|
94
|
+
*
|
|
95
|
+
* https://github.com/xjamundx/eslint-plugin-promise/blob/HEAD/docs/rules/prefer-await-to-callbacks.md
|
|
96
|
+
*/
|
|
97
|
+
"promise/prefer-await-to-callbacks": "warn",
|
|
98
|
+
/*
|
|
99
|
+
* Prefer await to then() for reading Promise values
|
|
100
|
+
*
|
|
101
|
+
* https://github.com/xjamundx/eslint-plugin-promise/blob/HEAD/docs/rules/prefer-await-to-then.md
|
|
102
|
+
*/
|
|
103
|
+
"promise/prefer-await-to-then": "warn",
|
|
104
|
+
/*
|
|
105
|
+
* Prefer catch to then(a, b)/then(null, b) for handling errors (promise/prefer-catch)
|
|
106
|
+
*
|
|
107
|
+
* https://github.com/xjamundx/eslint-plugin-promise/blob/HEAD/docs/rules/prefer-catch.md
|
|
108
|
+
*/
|
|
109
|
+
"promise/prefer-catch": "warn",
|
|
110
|
+
/*
|
|
111
|
+
* Disallow use of non-standard Promise static methods.
|
|
112
|
+
*
|
|
113
|
+
* https://github.com/xjamundx/eslint-plugin-promise/blob/HEAD/docs/rules/spec-only.md
|
|
114
|
+
*/
|
|
115
|
+
"promise/spec-only": "warn",
|
|
116
|
+
/*
|
|
117
|
+
* Ensures the proper number of arguments are passed to Promise functions
|
|
118
|
+
*
|
|
119
|
+
* https://github.com/xjamundx/eslint-plugin-promise/blob/HEAD/docs/rules/valid-params.md
|
|
120
|
+
*/
|
|
121
|
+
"promise/valid-params": "warn",
|
|
122
|
+
},
|
|
123
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-19-upgrade.d.ts","sourceRoot":"","sources":["../../src/rules/react-19-upgrade.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAQrC,eAAO,MAAM,0BAA0B,EAAE,MAAM,CAAC,MAa/C,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import react19Upgrade from "eslint-plugin-react-19-upgrade";
|
|
2
|
+
/*
|
|
3
|
+
* An ESLint plugin to identify and fix breaking changes when upgrading React 18 to React 19
|
|
4
|
+
*
|
|
5
|
+
* https://www.npmjs.com/package/eslint-plugin-react-19-upgrade
|
|
6
|
+
*/
|
|
7
|
+
export const react19UpgradePluginConfig = {
|
|
8
|
+
plugins: {
|
|
9
|
+
"react-19-upgrade": react19Upgrade,
|
|
10
|
+
},
|
|
11
|
+
rules: {
|
|
12
|
+
"react-19-upgrade/no-default-props": "warn",
|
|
13
|
+
"react-19-upgrade/no-defaultprops": "warn",
|
|
14
|
+
"react-19-upgrade/no-factories": "warn",
|
|
15
|
+
"react-19-upgrade/no-legacy-context": "warn",
|
|
16
|
+
"react-19-upgrade/no-prop-types": "warn",
|
|
17
|
+
"react-19-upgrade/no-proptypes": "warn",
|
|
18
|
+
"react-19-upgrade/no-string-refs": "warn",
|
|
19
|
+
},
|
|
20
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-compiler.d.ts","sourceRoot":"","sources":["../../src/rules/react-compiler.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAQrC,eAAO,MAAM,yBAAyB,EAAE,MAAM,CAAC,MAO9C,CAAC"}
|