@newsteam/eslint-config 1.2.19 → 1.2.20
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.map +1 -1
- package/dist/index.js +1 -0
- package/dist/plugins/sort-react-dependency-arrays.d.ts.map +1 -1
- package/dist/plugins/sort-react-dependency-arrays.js +33 -32
- package/dist/rules/css-modules.js +4 -4
- package/dist/rules/import-newlines.js +1 -1
- package/dist/rules/import-x.js +7 -7
- package/dist/rules/index.d.ts.map +1 -1
- package/dist/rules/index.js +19 -14
- package/dist/rules/next.js +1 -1
- package/dist/rules/react-19-upgrade.d.ts.map +1 -1
- package/dist/rules/react-19-upgrade.js +4 -0
- package/dist/rules/react-hooks.d.ts.map +1 -1
- package/dist/rules/react-hooks.js +1 -2
- package/dist/rules/react-performance.d.ts +3 -0
- package/dist/rules/react-performance.d.ts.map +1 -0
- package/dist/rules/{react-perf.js → react-performance.js} +1 -1
- package/dist/rules/react.d.ts.map +1 -1
- package/dist/rules/react.js +14 -12
- package/dist/rules/security.js +6 -6
- package/dist/rules/stylistic.js +2 -2
- package/dist/rules/typescript.js +1 -1
- package/dist/rules/unicorn.d.ts.map +1 -1
- package/dist/rules/unicorn.js +1212 -73
- package/dist/settings.d.ts +2 -2
- package/dist/settings.d.ts.map +1 -1
- package/dist/settings.js +2 -2
- package/package.json +30 -28
- package/dist/rules/no-unsanitized.d.ts +0 -3
- package/dist/rules/no-unsanitized.d.ts.map +0 -1
- package/dist/rules/no-unsanitized.js +0 -38
- package/dist/rules/react-compiler.d.ts +0 -3
- package/dist/rules/react-compiler.d.ts.map +0 -1
- package/dist/rules/react-compiler.js +0 -14
- package/dist/rules/react-perf.d.ts +0 -3
- package/dist/rules/react-perf.d.ts.map +0 -1
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AA6CrC,QAAA,MAAM,MAAM,EAAE,MAAM,CAAC,MAAM,EAqGzB,CAAC;eAGY,MAAM;AAGrB,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sort-react-dependency-arrays.d.ts","sourceRoot":"","sources":["../../src/plugins/sort-react-dependency-arrays.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"sort-react-dependency-arrays.d.ts","sourceRoot":"","sources":["../../src/plugins/sort-react-dependency-arrays.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;wBAsJZ,MAAM,CAAC,MAAM"}
|
|
@@ -19,7 +19,7 @@ const plugin = {
|
|
|
19
19
|
},
|
|
20
20
|
rules: {
|
|
21
21
|
sort: {
|
|
22
|
-
create(context) {
|
|
22
|
+
create: (context) => {
|
|
23
23
|
const { sourceCode } = context;
|
|
24
24
|
const getSortableNameFromNode = (node) => {
|
|
25
25
|
if (!node) {
|
|
@@ -42,38 +42,39 @@ const plugin = {
|
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
44
|
return {
|
|
45
|
-
CallExpression(node) {
|
|
46
|
-
if (isDependencyArrayHook(node.callee)) {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
return
|
|
57
|
-
name: getSortableNameFromNode(element),
|
|
58
|
-
originalNode: element,
|
|
59
|
-
// sourceCode.getText(el) gets the exact text of that element
|
|
60
|
-
source: sourceCode.getText(element),
|
|
61
|
-
};
|
|
62
|
-
})
|
|
63
|
-
.filter((item) => item !== undefined);
|
|
64
|
-
const currentNames = elementsWithMetadata.map((element) => element.name);
|
|
65
|
-
// 2. Create the sorted version
|
|
66
|
-
// eslint-disable-next-line unicorn/no-array-sort -- nah this causes down stream issues
|
|
67
|
-
const sortedMetadata = [...elementsWithMetadata].sort((itemA, itemB) => itemA.name.toLowerCase().localeCompare(itemB.name.toLowerCase()));
|
|
68
|
-
const sortedNames = sortedMetadata.map((element) => element.name);
|
|
69
|
-
// 3. Check if sorting changed anything
|
|
70
|
-
if (JSON.stringify(currentNames) !== JSON.stringify(sortedNames)) {
|
|
71
|
-
context.report({
|
|
72
|
-
fix: (fixer) => elementsWithMetadata.map((original, index) => fixer.replaceText(original.originalNode, sortedMetadata[index].source)),
|
|
73
|
-
messageId: "sortDependencies",
|
|
74
|
-
node: dependencies,
|
|
75
|
-
});
|
|
45
|
+
CallExpression: (node) => {
|
|
46
|
+
if (!isDependencyArrayHook(node.callee)) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
const [, dependencies] = node.arguments;
|
|
50
|
+
if (dependencies?.type === AST_NODE_TYPES.ArrayExpression
|
|
51
|
+
&& dependencies.elements.length > 1) {
|
|
52
|
+
// 1. Map elements to their sortable names AND their raw source text
|
|
53
|
+
const elementsWithMetadata = dependencies.elements
|
|
54
|
+
.map((element) => {
|
|
55
|
+
if (!element) {
|
|
56
|
+
return undefined;
|
|
76
57
|
}
|
|
58
|
+
return {
|
|
59
|
+
name: getSortableNameFromNode(element),
|
|
60
|
+
originalNode: element,
|
|
61
|
+
// sourceCode.getText(el) gets the exact text of that element
|
|
62
|
+
source: sourceCode.getText(element),
|
|
63
|
+
};
|
|
64
|
+
})
|
|
65
|
+
.filter((item) => item !== undefined);
|
|
66
|
+
const currentNames = elementsWithMetadata.map((element) => element.name);
|
|
67
|
+
// 2. Create the sorted version
|
|
68
|
+
// eslint-disable-next-line unicorn/no-array-sort -- nah this causes down stream issues
|
|
69
|
+
const sortedMetadata = [...elementsWithMetadata].sort((itemA, itemB) => itemA.name.toLowerCase().localeCompare(itemB.name.toLowerCase()));
|
|
70
|
+
const sortedNames = sortedMetadata.map((element) => element.name);
|
|
71
|
+
// 3. Check if sorting changed anything
|
|
72
|
+
if (JSON.stringify(currentNames) !== JSON.stringify(sortedNames)) {
|
|
73
|
+
context.report({
|
|
74
|
+
fix: (fixer) => elementsWithMetadata.map((original, index) => fixer.replaceText(original.originalNode, sortedMetadata[index].source)),
|
|
75
|
+
messageId: "sortDependencies",
|
|
76
|
+
node: dependencies,
|
|
77
|
+
});
|
|
77
78
|
}
|
|
78
79
|
}
|
|
79
80
|
},
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import cssModules from "@bhollis/eslint-plugin-css-modules";
|
|
2
2
|
/*
|
|
3
3
|
* This plugin intends to help you in tracking down problems when you are using css-modules.
|
|
4
|
-
* It tells if you are using a non-existent
|
|
5
|
-
* use some classes which you declared in
|
|
4
|
+
* It tells if you are using a non-existent CSS/scss/less class in js or if you forgot to
|
|
5
|
+
* use some classes which you declared in CSS/scss/less.
|
|
6
6
|
*
|
|
7
7
|
* https://www.npmjs.com/package/eslint-plugin-css-modules
|
|
8
8
|
*/
|
|
@@ -12,13 +12,13 @@ export const cssModulesPluginConfig = {
|
|
|
12
12
|
},
|
|
13
13
|
rules: {
|
|
14
14
|
/*
|
|
15
|
-
* Broken in
|
|
15
|
+
* Broken in ESLint 10
|
|
16
16
|
*
|
|
17
17
|
* https://www.npmjs.com/package/eslint-plugin-css-modules
|
|
18
18
|
*/
|
|
19
19
|
"css-modules/no-undef-class": ["off"],
|
|
20
20
|
/*
|
|
21
|
-
* Broken in
|
|
21
|
+
* Broken in ESLint 10
|
|
22
22
|
*
|
|
23
23
|
* https://www.npmjs.com/package/eslint-plugin-css-modules
|
|
24
24
|
*/
|
package/dist/rules/import-x.js
CHANGED
|
@@ -65,13 +65,13 @@ export const importXPluginConfig = {
|
|
|
65
65
|
* Prefer named exports to be grouped together in a single export declaration
|
|
66
66
|
*
|
|
67
67
|
* This is off for now because when you create anything that uses an interface
|
|
68
|
-
* in
|
|
68
|
+
* in TypeScript, you have to export that interface otherwise you'll get an error
|
|
69
69
|
* to the tune of:
|
|
70
70
|
*
|
|
71
71
|
* 'Default export of the module has or is using private name'
|
|
72
72
|
*
|
|
73
73
|
* As of the writing of this comment, you can't export your interface in the
|
|
74
|
-
* group, because the
|
|
74
|
+
* group, because the TypeScript parser sees that as an undefined variable.
|
|
75
75
|
* This means that the only option available is to export the interface and
|
|
76
76
|
* members separately instead of in a group.
|
|
77
77
|
*
|
|
@@ -92,7 +92,7 @@ export const importXPluginConfig = {
|
|
|
92
92
|
/*
|
|
93
93
|
* Ensure named imports correspond to a named export in the remote file.
|
|
94
94
|
*
|
|
95
|
-
*
|
|
95
|
+
* TypeScript takes care of this for us already, and @react-email/components bugs this out
|
|
96
96
|
*
|
|
97
97
|
* https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/named.md
|
|
98
98
|
*/
|
|
@@ -156,7 +156,7 @@ export const importXPluginConfig = {
|
|
|
156
156
|
/*
|
|
157
157
|
* Forbid default exports
|
|
158
158
|
*
|
|
159
|
-
* Broken in
|
|
159
|
+
* Broken in ESLint 10
|
|
160
160
|
*
|
|
161
161
|
* https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-default-export.md
|
|
162
162
|
*/
|
|
@@ -226,7 +226,7 @@ export const importXPluginConfig = {
|
|
|
226
226
|
/*
|
|
227
227
|
* Report use of exported name as property of default export
|
|
228
228
|
*
|
|
229
|
-
* Think this is bombing
|
|
229
|
+
* Think this is bombing ESLint with "heap limit Allocation failed"
|
|
230
230
|
*
|
|
231
231
|
* https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-named-as-default-member.md
|
|
232
232
|
*/
|
|
@@ -258,7 +258,7 @@ export const importXPluginConfig = {
|
|
|
258
258
|
/*
|
|
259
259
|
* No Node.js builtin modules.
|
|
260
260
|
*
|
|
261
|
-
* Off for now since we're assuming that most code is
|
|
261
|
+
* Off for now since we're assuming that most code is Node.js code
|
|
262
262
|
*
|
|
263
263
|
* https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-nodejs-modules.md
|
|
264
264
|
*/
|
|
@@ -409,7 +409,7 @@ export const importXPluginConfig = {
|
|
|
409
409
|
/*
|
|
410
410
|
* Report potentially ambiguous parse goal (script vs. module)
|
|
411
411
|
*
|
|
412
|
-
* Broken in
|
|
412
|
+
* Broken in ESLint 10
|
|
413
413
|
*
|
|
414
414
|
* https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/unambiguous.md
|
|
415
415
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/rules/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/rules/index.ts"],"names":[],"mappings":"AA+CA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AA8BrC,eAAO,MAAM,KAAK,EAAE,MAAM,CAAC,MAAM,EA0mDhC,CAAC"}
|
package/dist/rules/index.js
CHANGED
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
*
|
|
15
15
|
* https://eslint.org/docs/latest/rules/#best-practices
|
|
16
16
|
*/
|
|
17
|
-
import confusingBrowserGlobals from "confusing-browser-globals";
|
|
18
17
|
import { MAX_FUNCTION_PARAMETERS, MAXIMUM_CYCLOMATIC_COMPLEXITY, MAXIMUM_FILE_LINE_COUNT, NO_MAGIC_NUMBERS_CONFIG, } from "../settings.js";
|
|
19
18
|
import { arrayFuncPluginConfig } from "./array-function.js";
|
|
20
19
|
import { cssModulesPluginConfig } from "./css-modules.js";
|
|
@@ -22,15 +21,13 @@ import { destructuringPluginConfig } from "./destructuring.js";
|
|
|
22
21
|
import { eslintCommentsPluginConfig } from "./eslint-comments.js";
|
|
23
22
|
import { importNewlinesPluginConfig } from "./import-newlines.js";
|
|
24
23
|
import { importXPluginConfig } from "./import-x.js";
|
|
25
|
-
import { noUnsanitizedPluginConfig } from "./no-unsanitized.js";
|
|
26
24
|
import { noUselessAssignPluginConfig } from "./no-useless-assign.js";
|
|
27
25
|
import { nodePluginConfig } from "./node.js";
|
|
28
26
|
import { perfectionistPluginConfig } from "./perfectionist.js";
|
|
29
27
|
import { promisePluginConfig } from "./promise.js";
|
|
30
28
|
import { react19UpgradePluginConfig } from "./react-19-upgrade.js";
|
|
31
|
-
import { reactCompilerPluginConfig } from "./react-compiler.js";
|
|
32
29
|
import { reactHooksPluginConfig } from "./react-hooks.js";
|
|
33
|
-
import {
|
|
30
|
+
import { reactPerformancePluginConfig } from "./react-performance.js";
|
|
34
31
|
import { reactRefreshPluginConfig } from "./react-refresh.js";
|
|
35
32
|
import { reactPluginConfig } from "./react.js";
|
|
36
33
|
import { securityPluginConfig } from "./security.js";
|
|
@@ -45,18 +42,16 @@ const pluginConfig = [
|
|
|
45
42
|
destructuringPluginConfig,
|
|
46
43
|
eslintCommentsPluginConfig,
|
|
47
44
|
importNewlinesPluginConfig,
|
|
48
|
-
// contains rules turned off because they're not compatible with
|
|
45
|
+
// contains rules turned off because they're not compatible with ESLint 10
|
|
49
46
|
importXPluginConfig,
|
|
50
|
-
noUnsanitizedPluginConfig,
|
|
51
47
|
noUselessAssignPluginConfig,
|
|
52
48
|
nodePluginConfig,
|
|
53
49
|
perfectionistPluginConfig,
|
|
54
50
|
promisePluginConfig,
|
|
55
51
|
react19UpgradePluginConfig,
|
|
56
|
-
reactCompilerPluginConfig,
|
|
57
52
|
reactHooksPluginConfig,
|
|
58
|
-
|
|
59
|
-
// contains rules turned off because they're not compatible with
|
|
53
|
+
reactPerformancePluginConfig,
|
|
54
|
+
// contains rules turned off because they're not compatible with ESLint 10
|
|
60
55
|
reactPluginConfig,
|
|
61
56
|
reactRefreshPluginConfig,
|
|
62
57
|
securityPluginConfig,
|
|
@@ -248,9 +243,11 @@ export const rules = [
|
|
|
248
243
|
/*
|
|
249
244
|
* Require identifiers to match a specified regular expression
|
|
250
245
|
*
|
|
246
|
+
* Handled by unicorn
|
|
247
|
+
*
|
|
251
248
|
* https://eslint.org/docs/latest/rules/id-match
|
|
252
249
|
*/
|
|
253
|
-
"id-match": "
|
|
250
|
+
"id-match": "off",
|
|
254
251
|
/*
|
|
255
252
|
* Require or disallow initialization in variable declarations
|
|
256
253
|
*
|
|
@@ -260,10 +257,12 @@ export const rules = [
|
|
|
260
257
|
/*
|
|
261
258
|
* Require or disallow logical assignment operator shorthand
|
|
262
259
|
*
|
|
260
|
+
* off for now becuase we're letting unicorn take case of it
|
|
261
|
+
*
|
|
263
262
|
* https://eslint.org/docs/latest/rules/logical-assignment-operators
|
|
264
263
|
*/
|
|
265
264
|
"logical-assignment-operators": [
|
|
266
|
-
"
|
|
265
|
+
"off",
|
|
267
266
|
"always",
|
|
268
267
|
],
|
|
269
268
|
/*
|
|
@@ -439,9 +438,11 @@ export const rules = [
|
|
|
439
438
|
/*
|
|
440
439
|
* Disallow continue statements
|
|
441
440
|
*
|
|
441
|
+
* Whats wrong with continue?
|
|
442
|
+
*
|
|
442
443
|
* https://eslint.org/docs/latest/rules/no-continue
|
|
443
444
|
*/
|
|
444
|
-
"no-continue": "
|
|
445
|
+
"no-continue": "off",
|
|
445
446
|
/*
|
|
446
447
|
* Disallow control characters in regular expressions
|
|
447
448
|
*
|
|
@@ -887,7 +888,6 @@ export const rules = [
|
|
|
887
888
|
"warn",
|
|
888
889
|
"isFinite",
|
|
889
890
|
"isNaN",
|
|
890
|
-
...confusingBrowserGlobals,
|
|
891
891
|
],
|
|
892
892
|
/*
|
|
893
893
|
* Disallow specified modules when loaded by import
|
|
@@ -954,6 +954,11 @@ export const rules = [
|
|
|
954
954
|
object: "Math",
|
|
955
955
|
property: "pow",
|
|
956
956
|
},
|
|
957
|
+
{
|
|
958
|
+
message: "URL.parse is missing in older browsers. Please use 'new URL()' with a try-catch block or a custom utility instead.",
|
|
959
|
+
object: "URL",
|
|
960
|
+
property: "parse",
|
|
961
|
+
},
|
|
957
962
|
],
|
|
958
963
|
/*
|
|
959
964
|
* Disallow specified syntax
|
|
@@ -968,7 +973,7 @@ export const rules = [
|
|
|
968
973
|
*/
|
|
969
974
|
"no-return-assign": "warn",
|
|
970
975
|
/*
|
|
971
|
-
* Disallow
|
|
976
|
+
* Disallow JavaScript: urls
|
|
972
977
|
*
|
|
973
978
|
* https://eslint.org/docs/latest/rules/no-script-url
|
|
974
979
|
*/
|
package/dist/rules/next.js
CHANGED
|
@@ -1 +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,
|
|
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,MAoB/C,CAAC"}
|
|
@@ -12,12 +12,16 @@ export const react19UpgradePluginConfig = {
|
|
|
12
12
|
"react-19-upgrade/no-default-props": "warn",
|
|
13
13
|
"react-19-upgrade/no-defaultprops": "warn",
|
|
14
14
|
"react-19-upgrade/no-factories": "warn",
|
|
15
|
+
"react-19-upgrade/no-implicit-ref-callback-return": "warn",
|
|
15
16
|
"react-19-upgrade/no-legacy-context": "warn",
|
|
16
17
|
"react-19-upgrade/no-legacy-react-dom": "warn",
|
|
17
18
|
"react-19-upgrade/no-legacy-react-dom-server": "warn",
|
|
19
|
+
"react-19-upgrade/no-legacy-react-is": "warn",
|
|
20
|
+
"react-19-upgrade/no-legacy-test-utils": "warn",
|
|
18
21
|
"react-19-upgrade/no-legacy-test-utils-act": "warn",
|
|
19
22
|
"react-19-upgrade/no-prop-types": "warn",
|
|
20
23
|
"react-19-upgrade/no-proptypes": "warn",
|
|
24
|
+
"react-19-upgrade/no-shallow-renderer": "warn",
|
|
21
25
|
"react-19-upgrade/no-string-refs": "warn",
|
|
22
26
|
},
|
|
23
27
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-hooks.d.ts","sourceRoot":"","sources":["../../src/rules/react-hooks.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAWrC,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"react-hooks.d.ts","sourceRoot":"","sources":["../../src/rules/react-hooks.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAWrC,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,MAsL3C,CAAC"}
|
|
@@ -89,8 +89,7 @@ export const reactHooksPluginConfig = {
|
|
|
89
89
|
* https://react.dev/learn/you-might-not-need-an-effect#updating-state-based-on-props-or-state
|
|
90
90
|
*/
|
|
91
91
|
"react-hooks/no-deriving-state-in-effects": "warn",
|
|
92
|
-
// Apprently this doesn't exist anymore
|
|
93
|
-
// "react-hooks/no-unused-directives": "warn",
|
|
92
|
+
// Apprently this doesn't exist anymore "react-hooks/no-unused-directives": "warn",
|
|
94
93
|
/*
|
|
95
94
|
* Validates that existing manual memoized is preserved by the compiler.
|
|
96
95
|
* React Compiler will only compile components and hooks if its inference
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-performance.d.ts","sourceRoot":"","sources":["../../src/rules/react-performance.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AASrC,eAAO,MAAM,4BAA4B,EAAE,MAAM,CAAC,MA0CjD,CAAC"}
|
|
@@ -7,7 +7,7 @@ import reactPerf from "eslint-plugin-react-perf";
|
|
|
7
7
|
*
|
|
8
8
|
* https://www.npmjs.com/package/eslint-plugin-react-perf
|
|
9
9
|
*/
|
|
10
|
-
export const
|
|
10
|
+
export const reactPerformancePluginConfig = {
|
|
11
11
|
plugins: {
|
|
12
12
|
"react-perf": fixupPluginRules(reactPerf),
|
|
13
13
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../../src/rules/react.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAQrC,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../../src/rules/react.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAQrC,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAq0BtC,CAAC"}
|
package/dist/rules/react.js
CHANGED
|
@@ -89,7 +89,7 @@ export const reactPluginConfig = {
|
|
|
89
89
|
/*
|
|
90
90
|
* Require all forwardRef components include a ref parameter
|
|
91
91
|
*
|
|
92
|
-
* Broken in
|
|
92
|
+
* Broken in ESLint 10
|
|
93
93
|
*
|
|
94
94
|
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/forward-ref-uses-ref.md
|
|
95
95
|
*/
|
|
@@ -151,13 +151,15 @@ export const reactPluginConfig = {
|
|
|
151
151
|
/*
|
|
152
152
|
* Enforce curly braces or disallow unnecessary curly braces in JSX
|
|
153
153
|
*
|
|
154
|
-
* Handled by @stylistic
|
|
155
|
-
*
|
|
156
|
-
* This conflicts with react/jsx-no-literals. Leaving off for now.
|
|
157
|
-
*
|
|
158
154
|
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-curly-brace-presence.md
|
|
159
155
|
*/
|
|
160
|
-
"react/jsx-curly-brace-presence":
|
|
156
|
+
"react/jsx-curly-brace-presence": [
|
|
157
|
+
"error",
|
|
158
|
+
{
|
|
159
|
+
children: "always",
|
|
160
|
+
props: "never",
|
|
161
|
+
},
|
|
162
|
+
],
|
|
161
163
|
/*
|
|
162
164
|
* Enforce linebreaks in curly braces in JSX attributes and expressions. (fixable)
|
|
163
165
|
*
|
|
@@ -191,7 +193,7 @@ export const reactPluginConfig = {
|
|
|
191
193
|
/*
|
|
192
194
|
* Restrict file extensions that may contain JSX
|
|
193
195
|
*
|
|
194
|
-
* Broken in
|
|
196
|
+
* Broken in ESLint 10
|
|
195
197
|
*
|
|
196
198
|
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-filename-extension.md
|
|
197
199
|
*/
|
|
@@ -274,7 +276,7 @@ export const reactPluginConfig = {
|
|
|
274
276
|
*/
|
|
275
277
|
"react/jsx-max-props-per-line": "off",
|
|
276
278
|
/*
|
|
277
|
-
* Enforce a new line after
|
|
279
|
+
* Enforce a new line after JSX elements and expressions (fixable)
|
|
278
280
|
*
|
|
279
281
|
* Handled by @stylistic
|
|
280
282
|
*
|
|
@@ -320,7 +322,7 @@ export const reactPluginConfig = {
|
|
|
320
322
|
*/
|
|
321
323
|
"react/jsx-no-literals": "warn",
|
|
322
324
|
/*
|
|
323
|
-
* Prevent usage of
|
|
325
|
+
* Prevent usage of JavaScript: URLs
|
|
324
326
|
*
|
|
325
327
|
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-script-url.md
|
|
326
328
|
*/
|
|
@@ -380,7 +382,7 @@ export const reactPluginConfig = {
|
|
|
380
382
|
/*
|
|
381
383
|
* Disallow JSX props spreading
|
|
382
384
|
*
|
|
383
|
-
*
|
|
385
|
+
* TypeScript guards against sending the wrong props through, and the readability
|
|
384
386
|
* issue is overblown since this is only used when you explicitly want to proxy props.
|
|
385
387
|
*
|
|
386
388
|
* https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/jsx-props-no-spreading.md
|
|
@@ -653,7 +655,7 @@ export const reactPluginConfig = {
|
|
|
653
655
|
/*
|
|
654
656
|
* Prevent missing props validation in a React component definition
|
|
655
657
|
*
|
|
656
|
-
* We don't do prop validation since we're using
|
|
658
|
+
* We don't do prop validation since we're using TypeScript
|
|
657
659
|
*
|
|
658
660
|
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prop-types.md
|
|
659
661
|
*/
|
|
@@ -667,7 +669,7 @@ export const reactPluginConfig = {
|
|
|
667
669
|
/*
|
|
668
670
|
* Enforce a defaultProps definition for every prop that is not a required prop
|
|
669
671
|
*
|
|
670
|
-
* Not something that's necessary to enforce since we're using
|
|
672
|
+
* Not something that's necessary to enforce since we're using TypeScript
|
|
671
673
|
*
|
|
672
674
|
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/require-default-props.md
|
|
673
675
|
*/
|
package/dist/rules/security.js
CHANGED
|
@@ -10,7 +10,7 @@ export const securityPluginConfig = {
|
|
|
10
10
|
},
|
|
11
11
|
rules: {
|
|
12
12
|
/*
|
|
13
|
-
* Detects trojan source attacks that employ
|
|
13
|
+
* Detects trojan source attacks that employ Unicode bidi attacks to inject malicious code.
|
|
14
14
|
*/
|
|
15
15
|
"security/detect-bidi-characters": "warn",
|
|
16
16
|
/*
|
|
@@ -39,7 +39,7 @@ export const securityPluginConfig = {
|
|
|
39
39
|
* Detects eval(variable) which can allow an attacker to run arbitary
|
|
40
40
|
* code inside your process.
|
|
41
41
|
*
|
|
42
|
-
*
|
|
42
|
+
* https://security.stackexchange.com/questions/94017/what-are-the-security-issues-with-eval-in-javascript
|
|
43
43
|
*/
|
|
44
44
|
"security/detect-eval-with-expression": "warn",
|
|
45
45
|
/*
|
|
@@ -51,8 +51,8 @@ export const securityPluginConfig = {
|
|
|
51
51
|
*/
|
|
52
52
|
"security/detect-new-buffer": "warn",
|
|
53
53
|
/*
|
|
54
|
-
* Detects Express
|
|
55
|
-
* middleware. This can allow GET requests (which are not checked by
|
|
54
|
+
* Detects Express CSRF middleware setup before method-override
|
|
55
|
+
* middleware. This can allow GET requests (which are not checked by CSRF)
|
|
56
56
|
* to turn into POST requests later.
|
|
57
57
|
*
|
|
58
58
|
* https://blog.liftsecurity.io/2013/09/07/bypass-connect-csrf-protection-by-abusing
|
|
@@ -76,7 +76,7 @@ export const securityPluginConfig = {
|
|
|
76
76
|
* Detects require(variable), which might allow an attacker to load and
|
|
77
77
|
* run arbitrary code, or access arbitrary files on disk.
|
|
78
78
|
*
|
|
79
|
-
*
|
|
79
|
+
* https://www.bennadel.com/blog/2169-where-does-node-js-and-require-look-for-modules.htm
|
|
80
80
|
*/
|
|
81
81
|
"security/detect-non-literal-require": "warn",
|
|
82
82
|
/*
|
|
@@ -98,7 +98,7 @@ export const securityPluginConfig = {
|
|
|
98
98
|
* Detects if pseudoRandomBytes() is in use, which might not give you
|
|
99
99
|
* the randomness you need and expect.
|
|
100
100
|
*
|
|
101
|
-
*
|
|
101
|
+
* https://stackoverflow.com/questions/18130254/randombytes-vs-pseudorandombytes
|
|
102
102
|
*/
|
|
103
103
|
"security/detect-pseudoRandomBytes": "warn",
|
|
104
104
|
/*
|
package/dist/rules/stylistic.js
CHANGED
|
@@ -191,7 +191,7 @@ export const stylisticPluginConfig = {
|
|
|
191
191
|
},
|
|
192
192
|
},
|
|
193
193
|
singleLine: {
|
|
194
|
-
maxItems:
|
|
194
|
+
maxItems: Infinity,
|
|
195
195
|
spacing: "never",
|
|
196
196
|
},
|
|
197
197
|
},
|
|
@@ -333,7 +333,7 @@ export const stylisticPluginConfig = {
|
|
|
333
333
|
{ maximum: 1 },
|
|
334
334
|
],
|
|
335
335
|
/*
|
|
336
|
-
* Enforce a new line after
|
|
336
|
+
* Enforce a new line after JSX elements and expressions (fixable)
|
|
337
337
|
*
|
|
338
338
|
* This is off for now because it this would make too much empty space
|
|
339
339
|
*
|
package/dist/rules/typescript.js
CHANGED
|
@@ -114,7 +114,7 @@ export const typescriptPluginConfigs = [
|
|
|
114
114
|
*/
|
|
115
115
|
"@typescript-eslint/consistent-indexed-object-style": "warn",
|
|
116
116
|
/*
|
|
117
|
-
* This rule extends the base
|
|
117
|
+
* This rule extends the base ESLint/consistent-return rule. This version adds support for functions that return void or Promise<void>.
|
|
118
118
|
*
|
|
119
119
|
* Per the docs, using noImplicitReturns instead
|
|
120
120
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unicorn.d.ts","sourceRoot":"","sources":["../../src/rules/unicorn.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAQrC,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"unicorn.d.ts","sourceRoot":"","sources":["../../src/rules/unicorn.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAQrC,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,MAi6ExC,CAAC"}
|