@tsrx/eslint-plugin 0.7.5 → 0.7.6
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/README.md +109 -9
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +433 -82
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
- package/src/index.ts +10 -1
package/src/index.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module';
|
|
2
|
+
import { get_core_rule } from './utils/core-rule.js';
|
|
2
3
|
import noReturnInComponent from './rules/no-return-in-component.js';
|
|
3
4
|
import controlFlowJsx from './rules/control-flow-jsx.js';
|
|
4
5
|
import validForOfKey from './rules/valid-for-of-key.js';
|
|
@@ -7,6 +8,7 @@ import jsxCurlyBracePresence from './rules/jsx-curly-brace-presence.js';
|
|
|
7
8
|
import noUnusedVars from './rules/no-unused-vars.js';
|
|
8
9
|
import noAwaitInLoop from './rules/no-await-in-loop.js';
|
|
9
10
|
import noUnreachable from './rules/no-unreachable.js';
|
|
11
|
+
import noUselessAssignment from './rules/no-useless-assignment.js';
|
|
10
12
|
|
|
11
13
|
const plugin = {
|
|
12
14
|
meta: {
|
|
@@ -22,6 +24,7 @@ const plugin = {
|
|
|
22
24
|
'no-unused-vars': noUnusedVars,
|
|
23
25
|
'no-await-in-loop': noAwaitInLoop,
|
|
24
26
|
'no-unreachable': noUnreachable,
|
|
27
|
+
'no-useless-assignment': noUselessAssignment,
|
|
25
28
|
},
|
|
26
29
|
configs: {} as any,
|
|
27
30
|
};
|
|
@@ -119,7 +122,9 @@ plugin.configs.react = [
|
|
|
119
122
|
|
|
120
123
|
// For `js.configs.recommended` users, listed after it: the TSRX versions of the
|
|
121
124
|
// core rules it turns on. A config can't read the severity another gives the
|
|
122
|
-
// core rule, so each is an error, as `js.configs.recommended` has it.
|
|
125
|
+
// core rule, so each is an error, as `js.configs.recommended` has it. ESLint 10's
|
|
126
|
+
// `js.configs.recommended` also turns on `no-useless-assignment`, which its meta
|
|
127
|
+
// marks as recommended.
|
|
123
128
|
plugin.configs.js = [
|
|
124
129
|
{
|
|
125
130
|
name: 'tsrx/js-tsrx-files',
|
|
@@ -132,6 +137,10 @@ plugin.configs.js = [
|
|
|
132
137
|
'tsrx/no-unused-vars': 'error',
|
|
133
138
|
'no-unreachable': 'off',
|
|
134
139
|
'tsrx/no-unreachable': 'error',
|
|
140
|
+
...(get_core_rule('no-useless-assignment').meta?.docs?.recommended === true && {
|
|
141
|
+
'no-useless-assignment': 'off',
|
|
142
|
+
'tsrx/no-useless-assignment': 'error',
|
|
143
|
+
}),
|
|
135
144
|
},
|
|
136
145
|
},
|
|
137
146
|
];
|