@ladamczyk/qoq-eslint-v9-ts-react 5.0.1 → 5.1.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/lib/index.mjs +12 -7
- package/package.json +6 -6
package/lib/index.mjs
CHANGED
|
@@ -1,20 +1,25 @@
|
|
|
1
1
|
import reactPlugin from '@eslint-react/eslint-plugin';
|
|
2
|
+
import { restoreSonarjsRules, REACT_ONLY_SONARJS_RULES } from '@ladamczyk/qoq-eslint-v9-js';
|
|
2
3
|
import { baseConfig as baseConfig$1, disabledRules, NO_MULTI_COMP_RULE_NAME } from '@ladamczyk/qoq-eslint-v9-js-react';
|
|
3
4
|
import { baseConfig as baseConfig$2 } from '@ladamczyk/qoq-eslint-v9-ts';
|
|
4
5
|
import { objectMergeRight } from '@ladamczyk/qoq-utils';
|
|
5
|
-
import importPlugin from 'eslint-plugin-import-x';
|
|
6
6
|
|
|
7
7
|
const { plugins: jsReactBaseConfigPlugins, ...jsReactBaseConfigRest } = baseConfig$1;
|
|
8
8
|
const { plugins: tsBaseConfigPlugins, ...tsBaseConfigRest } = baseConfig$2;
|
|
9
|
+
// tsBaseConfigRest is merged in after jsReactBaseConfigRest and still carries the
|
|
10
|
+
// React/JSX rules disabled (it's built from eslint-v9-js, not eslint-v9-js-react), so
|
|
11
|
+
// its "off" wins the objectMergeRight merge unless re-restored here as the final override.
|
|
12
|
+
// `no-hook-setter-in-body` is intentionally excluded: it flags the same pattern
|
|
13
|
+
// (an unconditional state-setter call in a component's render body) as
|
|
14
|
+
// `@eslint-react/set-state-in-render`, which already covers it more broadly.
|
|
15
|
+
const restoredReactRules = restoreSonarjsRules(REACT_ONLY_SONARJS_RULES, [
|
|
16
|
+
'no-hook-setter-in-body',
|
|
17
|
+
]);
|
|
9
18
|
const baseConfig = {
|
|
10
|
-
...objectMergeRight(jsReactBaseConfigRest, {
|
|
11
|
-
rules: Object.keys(importPlugin.configs.recommended.rules).reduce((acc, key) => {
|
|
12
|
-
acc[key] = undefined;
|
|
13
|
-
return acc;
|
|
14
|
-
}, {}),
|
|
15
|
-
}, tsBaseConfigRest, {
|
|
19
|
+
...objectMergeRight(jsReactBaseConfigRest, tsBaseConfigRest, {
|
|
16
20
|
name: 'qoq-eslint-v9-ts-react',
|
|
17
21
|
rules: {
|
|
22
|
+
...restoredReactRules,
|
|
18
23
|
...disabledRules,
|
|
19
24
|
...(reactPlugin.configs['recommended-typescript'].rules ?? {}),
|
|
20
25
|
// Our custom rule lives in (and is registered by) `eslint-v9-js-react`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ladamczyk/qoq-eslint-v9-ts-react",
|
|
3
|
-
"version": "5.0
|
|
3
|
+
"version": "5.1.0",
|
|
4
4
|
"description": "Eslint flat config template for TS + React",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint TypeScript + React template",
|
|
@@ -43,10 +43,10 @@
|
|
|
43
43
|
"typecheck": "tsc --noEmit"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@eslint-react/eslint-plugin": "5.
|
|
47
|
-
"@ladamczyk/qoq-eslint-v9-js-react": "^5.0
|
|
48
|
-
"@ladamczyk/qoq-eslint-v9-ts": "^5.0
|
|
49
|
-
"@ladamczyk/qoq-utils": "^5.0
|
|
46
|
+
"@eslint-react/eslint-plugin": "5.14.8",
|
|
47
|
+
"@ladamczyk/qoq-eslint-v9-js-react": "^5.1.0",
|
|
48
|
+
"@ladamczyk/qoq-eslint-v9-ts": "^5.1.0",
|
|
49
|
+
"@ladamczyk/qoq-utils": "^5.1.0"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@rollup/plugin-typescript": "12.3.0",
|
|
@@ -64,5 +64,5 @@
|
|
|
64
64
|
"publishConfig": {
|
|
65
65
|
"access": "public"
|
|
66
66
|
},
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "85e683228da199b4dff181ebda0d34f412a74dd4"
|
|
68
68
|
}
|