@storm-software/oxlint 0.0.3 → 0.0.5
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 +1 -1
- package/dist/{chunk-IGI5GSD4.js → chunk-3ZEETRNX.js} +7 -2
- package/dist/chunk-OPIMNRNA.js +136 -0
- package/dist/configs/react.cjs +129 -12
- package/dist/configs/react.d.cts +1 -1
- package/dist/configs/react.d.ts +1 -1
- package/dist/configs/react.js +1 -1
- package/dist/index.cjs +134 -15
- package/dist/index.js +3 -3
- package/dist/preset.cjs +134 -15
- package/dist/preset.js +2 -2
- package/dist/types.d.cts +1 -0
- package/dist/types.d.ts +1 -0
- package/package.json +6 -5
- package/dist/chunk-7WK2CHER.js +0 -19
package/README.md
CHANGED
|
@@ -27,7 +27,7 @@ This package is part of the <b>⚡Storm-Ops</b> monorepo. The Storm-Ops packages
|
|
|
27
27
|
|
|
28
28
|
<h3 align="center">💻 Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />
|
|
29
29
|
|
|
30
|
-
[](https://prettier.io/) [](http://nx.dev/) [](https://nextjs.org/) [](http://commitizen.github.io/cz-cli/)  [](https://fumadocs.vercel.app/) 
|
|
31
31
|
|
|
32
32
|
<!-- prettier-ignore-start -->
|
|
33
33
|
<!-- markdownlint-disable -->
|
|
@@ -11,7 +11,7 @@ import { pnpm } from './chunk-24KYXRHB.js';
|
|
|
11
11
|
import { prettier } from './chunk-GEMVBBN7.js';
|
|
12
12
|
import { promise } from './chunk-WQ37FH6C.js';
|
|
13
13
|
import { reactPerf } from './chunk-JHRYYA2I.js';
|
|
14
|
-
import { react } from './chunk-
|
|
14
|
+
import { react } from './chunk-OPIMNRNA.js';
|
|
15
15
|
import { regexp } from './chunk-I47UNAPW.js';
|
|
16
16
|
import { banner } from './chunk-5QRE5J4W.js';
|
|
17
17
|
import { imports } from './chunk-5IA7BNJZ.js';
|
|
@@ -2060,7 +2060,12 @@ async function getStormConfig(options = {}, ...userConfigs) {
|
|
|
2060
2060
|
configs.push(typescript(resolveSubOptions(enableTypeScript)));
|
|
2061
2061
|
}
|
|
2062
2062
|
if (enableReact) {
|
|
2063
|
-
configs.push(
|
|
2063
|
+
configs.push(
|
|
2064
|
+
...react({
|
|
2065
|
+
typeAware: enableTypeScript !== false,
|
|
2066
|
+
...resolveSubOptions(enableReact)
|
|
2067
|
+
})
|
|
2068
|
+
);
|
|
2064
2069
|
}
|
|
2065
2070
|
if (enableReactPerf) {
|
|
2066
2071
|
configs.push(reactPerf());
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { isPackageExists } from 'local-pkg';
|
|
2
|
+
|
|
3
|
+
// src/configs/react.ts
|
|
4
|
+
var ReactRefreshAllowConstantExportPackages = ["vite"];
|
|
5
|
+
var ReactRouterPackages = [
|
|
6
|
+
"@react-router/node",
|
|
7
|
+
"@react-router/react",
|
|
8
|
+
"@react-router/serve",
|
|
9
|
+
"@react-router/dev"
|
|
10
|
+
];
|
|
11
|
+
function react(options = {}) {
|
|
12
|
+
const { typeAware = true } = options;
|
|
13
|
+
const typeAwareRules = {
|
|
14
|
+
"react/no-leaked-conditional-rendering": "warn"
|
|
15
|
+
};
|
|
16
|
+
const isAllowConstantExport = ReactRefreshAllowConstantExportPackages.some(
|
|
17
|
+
(i) => isPackageExists(i)
|
|
18
|
+
);
|
|
19
|
+
const isUsingReactRouter = ReactRouterPackages.some((i) => isPackageExists(i));
|
|
20
|
+
return [
|
|
21
|
+
{
|
|
22
|
+
plugins: ["react"],
|
|
23
|
+
rules: {
|
|
24
|
+
// recommended rules from @eslint-react/dom
|
|
25
|
+
"react-dom/no-children-in-void-dom-elements": "warn",
|
|
26
|
+
"react-dom/no-dangerously-set-innerhtml": "warn",
|
|
27
|
+
"react-dom/no-dangerously-set-innerhtml-with-children": "error",
|
|
28
|
+
"react-dom/no-find-dom-node": "error",
|
|
29
|
+
"react-dom/no-missing-button-type": "warn",
|
|
30
|
+
"react-dom/no-missing-iframe-sandbox": "warn",
|
|
31
|
+
"react-dom/no-namespace": "error",
|
|
32
|
+
"react-dom/no-render-return-value": "error",
|
|
33
|
+
"react-dom/no-script-url": "warn",
|
|
34
|
+
"react-dom/no-unsafe-iframe-sandbox": "warn",
|
|
35
|
+
"react-dom/no-unsafe-target-blank": "warn",
|
|
36
|
+
// recommended rules react-hooks
|
|
37
|
+
"react-hooks/exhaustive-deps": "warn",
|
|
38
|
+
"react-hooks/rules-of-hooks": "error",
|
|
39
|
+
// react refresh
|
|
40
|
+
"react-refresh/only-export-components": [
|
|
41
|
+
"warn",
|
|
42
|
+
{
|
|
43
|
+
allowConstantExport: isAllowConstantExport,
|
|
44
|
+
allowExportNames: [
|
|
45
|
+
"dynamic",
|
|
46
|
+
"dynamicParams",
|
|
47
|
+
"revalidate",
|
|
48
|
+
"fetchCache",
|
|
49
|
+
"runtime",
|
|
50
|
+
"preferredRegion",
|
|
51
|
+
"maxDuration",
|
|
52
|
+
"config",
|
|
53
|
+
"generateStaticParams",
|
|
54
|
+
"metadata",
|
|
55
|
+
"generateMetadata",
|
|
56
|
+
"viewport",
|
|
57
|
+
"generateViewport"
|
|
58
|
+
].concat(
|
|
59
|
+
isUsingReactRouter ? ["meta", "links", "headers", "loader", "action"] : []
|
|
60
|
+
)
|
|
61
|
+
}
|
|
62
|
+
],
|
|
63
|
+
// recommended rules from @eslint-react/web-api
|
|
64
|
+
"react-web-api/no-leaked-event-listener": "warn",
|
|
65
|
+
"react-web-api/no-leaked-interval": "warn",
|
|
66
|
+
"react-web-api/no-leaked-resize-observer": "warn",
|
|
67
|
+
"react-web-api/no-leaked-timeout": "warn",
|
|
68
|
+
// recommended rules from @eslint-react
|
|
69
|
+
"react/ensure-forward-ref-using-ref": "warn",
|
|
70
|
+
"react/jsx-no-duplicate-props": "warn",
|
|
71
|
+
"react/jsx-uses-vars": "warn",
|
|
72
|
+
"react/no-access-state-in-setstate": "error",
|
|
73
|
+
"react/no-array-index-key": "warn",
|
|
74
|
+
"react/no-children-count": "warn",
|
|
75
|
+
"react/no-children-for-each": "warn",
|
|
76
|
+
"react/no-children-map": "warn",
|
|
77
|
+
"react/no-children-only": "warn",
|
|
78
|
+
"react/no-children-to-array": "warn",
|
|
79
|
+
"react/no-clone-element": "warn",
|
|
80
|
+
"react/no-comment-textnodes": "warn",
|
|
81
|
+
"react/no-component-will-mount": "error",
|
|
82
|
+
"react/no-component-will-receive-props": "error",
|
|
83
|
+
"react/no-component-will-update": "error",
|
|
84
|
+
"react/no-context-provider": "warn",
|
|
85
|
+
"react/no-create-ref": "error",
|
|
86
|
+
"react/no-default-props": "error",
|
|
87
|
+
"react/no-direct-mutation-state": "error",
|
|
88
|
+
"react/no-duplicate-key": "error",
|
|
89
|
+
"react/no-forward-ref": "warn",
|
|
90
|
+
"react/no-implicit-key": "warn",
|
|
91
|
+
"react/no-missing-key": "error",
|
|
92
|
+
"react/no-nested-components": "error",
|
|
93
|
+
"react/no-prop-types": "error",
|
|
94
|
+
"react/no-redundant-should-component-update": "error",
|
|
95
|
+
"react/no-set-state-in-component-did-mount": "warn",
|
|
96
|
+
"react/no-set-state-in-component-did-update": "warn",
|
|
97
|
+
"react/no-set-state-in-component-will-update": "warn",
|
|
98
|
+
"react/no-string-refs": "error",
|
|
99
|
+
"react/no-unsafe-component-will-mount": "warn",
|
|
100
|
+
"react/no-unsafe-component-will-receive-props": "warn",
|
|
101
|
+
"react/no-unsafe-component-will-update": "warn",
|
|
102
|
+
"react/no-unstable-context-value": "warn",
|
|
103
|
+
"react/no-unstable-default-props": "warn",
|
|
104
|
+
"react/no-unused-class-component-members": "warn",
|
|
105
|
+
"react/no-unused-state": "warn",
|
|
106
|
+
"react/prefer-destructuring-assignment": "warn",
|
|
107
|
+
"react/prefer-shorthand-boolean": "warn",
|
|
108
|
+
"react/prefer-shorthand-fragment": "warn",
|
|
109
|
+
"react/jsx-key": "error",
|
|
110
|
+
"react/jsx-no-target-blank": "warn",
|
|
111
|
+
"react/no-danger": "warn",
|
|
112
|
+
"react/no-unknown-property": "error"
|
|
113
|
+
},
|
|
114
|
+
settings: {
|
|
115
|
+
react: {
|
|
116
|
+
version: options.version || "detect"
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
jsPlugins: ["eslint-plugin-react-compiler"],
|
|
122
|
+
rules: {
|
|
123
|
+
"react-compiler/react-compiler": "error"
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
...typeAware ? [
|
|
127
|
+
{
|
|
128
|
+
rules: {
|
|
129
|
+
...typeAwareRules
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
] : []
|
|
133
|
+
];
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export { react };
|
package/dist/configs/react.cjs
CHANGED
|
@@ -1,21 +1,138 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var localPkg = require('local-pkg');
|
|
4
|
+
|
|
3
5
|
// src/configs/react.ts
|
|
6
|
+
var ReactRefreshAllowConstantExportPackages = ["vite"];
|
|
7
|
+
var ReactRouterPackages = [
|
|
8
|
+
"@react-router/node",
|
|
9
|
+
"@react-router/react",
|
|
10
|
+
"@react-router/serve",
|
|
11
|
+
"@react-router/dev"
|
|
12
|
+
];
|
|
4
13
|
function react(options = {}) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
14
|
+
const { typeAware = true } = options;
|
|
15
|
+
const typeAwareRules = {
|
|
16
|
+
"react/no-leaked-conditional-rendering": "warn"
|
|
17
|
+
};
|
|
18
|
+
const isAllowConstantExport = ReactRefreshAllowConstantExportPackages.some(
|
|
19
|
+
(i) => localPkg.isPackageExists(i)
|
|
20
|
+
);
|
|
21
|
+
const isUsingReactRouter = ReactRouterPackages.some((i) => localPkg.isPackageExists(i));
|
|
22
|
+
return [
|
|
23
|
+
{
|
|
24
|
+
plugins: ["react"],
|
|
25
|
+
rules: {
|
|
26
|
+
// recommended rules from @eslint-react/dom
|
|
27
|
+
"react-dom/no-children-in-void-dom-elements": "warn",
|
|
28
|
+
"react-dom/no-dangerously-set-innerhtml": "warn",
|
|
29
|
+
"react-dom/no-dangerously-set-innerhtml-with-children": "error",
|
|
30
|
+
"react-dom/no-find-dom-node": "error",
|
|
31
|
+
"react-dom/no-missing-button-type": "warn",
|
|
32
|
+
"react-dom/no-missing-iframe-sandbox": "warn",
|
|
33
|
+
"react-dom/no-namespace": "error",
|
|
34
|
+
"react-dom/no-render-return-value": "error",
|
|
35
|
+
"react-dom/no-script-url": "warn",
|
|
36
|
+
"react-dom/no-unsafe-iframe-sandbox": "warn",
|
|
37
|
+
"react-dom/no-unsafe-target-blank": "warn",
|
|
38
|
+
// recommended rules react-hooks
|
|
39
|
+
"react-hooks/exhaustive-deps": "warn",
|
|
40
|
+
"react-hooks/rules-of-hooks": "error",
|
|
41
|
+
// react refresh
|
|
42
|
+
"react-refresh/only-export-components": [
|
|
43
|
+
"warn",
|
|
44
|
+
{
|
|
45
|
+
allowConstantExport: isAllowConstantExport,
|
|
46
|
+
allowExportNames: [
|
|
47
|
+
"dynamic",
|
|
48
|
+
"dynamicParams",
|
|
49
|
+
"revalidate",
|
|
50
|
+
"fetchCache",
|
|
51
|
+
"runtime",
|
|
52
|
+
"preferredRegion",
|
|
53
|
+
"maxDuration",
|
|
54
|
+
"config",
|
|
55
|
+
"generateStaticParams",
|
|
56
|
+
"metadata",
|
|
57
|
+
"generateMetadata",
|
|
58
|
+
"viewport",
|
|
59
|
+
"generateViewport"
|
|
60
|
+
].concat(
|
|
61
|
+
isUsingReactRouter ? ["meta", "links", "headers", "loader", "action"] : []
|
|
62
|
+
)
|
|
63
|
+
}
|
|
64
|
+
],
|
|
65
|
+
// recommended rules from @eslint-react/web-api
|
|
66
|
+
"react-web-api/no-leaked-event-listener": "warn",
|
|
67
|
+
"react-web-api/no-leaked-interval": "warn",
|
|
68
|
+
"react-web-api/no-leaked-resize-observer": "warn",
|
|
69
|
+
"react-web-api/no-leaked-timeout": "warn",
|
|
70
|
+
// recommended rules from @eslint-react
|
|
71
|
+
"react/ensure-forward-ref-using-ref": "warn",
|
|
72
|
+
"react/jsx-no-duplicate-props": "warn",
|
|
73
|
+
"react/jsx-uses-vars": "warn",
|
|
74
|
+
"react/no-access-state-in-setstate": "error",
|
|
75
|
+
"react/no-array-index-key": "warn",
|
|
76
|
+
"react/no-children-count": "warn",
|
|
77
|
+
"react/no-children-for-each": "warn",
|
|
78
|
+
"react/no-children-map": "warn",
|
|
79
|
+
"react/no-children-only": "warn",
|
|
80
|
+
"react/no-children-to-array": "warn",
|
|
81
|
+
"react/no-clone-element": "warn",
|
|
82
|
+
"react/no-comment-textnodes": "warn",
|
|
83
|
+
"react/no-component-will-mount": "error",
|
|
84
|
+
"react/no-component-will-receive-props": "error",
|
|
85
|
+
"react/no-component-will-update": "error",
|
|
86
|
+
"react/no-context-provider": "warn",
|
|
87
|
+
"react/no-create-ref": "error",
|
|
88
|
+
"react/no-default-props": "error",
|
|
89
|
+
"react/no-direct-mutation-state": "error",
|
|
90
|
+
"react/no-duplicate-key": "error",
|
|
91
|
+
"react/no-forward-ref": "warn",
|
|
92
|
+
"react/no-implicit-key": "warn",
|
|
93
|
+
"react/no-missing-key": "error",
|
|
94
|
+
"react/no-nested-components": "error",
|
|
95
|
+
"react/no-prop-types": "error",
|
|
96
|
+
"react/no-redundant-should-component-update": "error",
|
|
97
|
+
"react/no-set-state-in-component-did-mount": "warn",
|
|
98
|
+
"react/no-set-state-in-component-did-update": "warn",
|
|
99
|
+
"react/no-set-state-in-component-will-update": "warn",
|
|
100
|
+
"react/no-string-refs": "error",
|
|
101
|
+
"react/no-unsafe-component-will-mount": "warn",
|
|
102
|
+
"react/no-unsafe-component-will-receive-props": "warn",
|
|
103
|
+
"react/no-unsafe-component-will-update": "warn",
|
|
104
|
+
"react/no-unstable-context-value": "warn",
|
|
105
|
+
"react/no-unstable-default-props": "warn",
|
|
106
|
+
"react/no-unused-class-component-members": "warn",
|
|
107
|
+
"react/no-unused-state": "warn",
|
|
108
|
+
"react/prefer-destructuring-assignment": "warn",
|
|
109
|
+
"react/prefer-shorthand-boolean": "warn",
|
|
110
|
+
"react/prefer-shorthand-fragment": "warn",
|
|
111
|
+
"react/jsx-key": "error",
|
|
112
|
+
"react/jsx-no-target-blank": "warn",
|
|
113
|
+
"react/no-danger": "warn",
|
|
114
|
+
"react/no-unknown-property": "error"
|
|
115
|
+
},
|
|
116
|
+
settings: {
|
|
117
|
+
react: {
|
|
118
|
+
version: options.version || "detect"
|
|
119
|
+
}
|
|
120
|
+
}
|
|
12
121
|
},
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
122
|
+
{
|
|
123
|
+
jsPlugins: ["eslint-plugin-react-compiler"],
|
|
124
|
+
rules: {
|
|
125
|
+
"react-compiler/react-compiler": "error"
|
|
16
126
|
}
|
|
17
|
-
}
|
|
18
|
-
|
|
127
|
+
},
|
|
128
|
+
...typeAware ? [
|
|
129
|
+
{
|
|
130
|
+
rules: {
|
|
131
|
+
...typeAwareRules
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
] : []
|
|
135
|
+
];
|
|
19
136
|
}
|
|
20
137
|
|
|
21
138
|
exports.react = react;
|
package/dist/configs/react.d.cts
CHANGED
package/dist/configs/react.d.ts
CHANGED
package/dist/configs/react.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { react } from '../chunk-
|
|
1
|
+
export { react } from '../chunk-OPIMNRNA.js';
|
package/dist/index.cjs
CHANGED
|
@@ -11,6 +11,7 @@ var path = require('path');
|
|
|
11
11
|
var z = require('zod/v4/mini');
|
|
12
12
|
var promises = require('fs/promises');
|
|
13
13
|
var config = require('eslint-plugin-prettier/recommended');
|
|
14
|
+
var localPkg = require('local-pkg');
|
|
14
15
|
|
|
15
16
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
17
|
|
|
@@ -2169,23 +2170,136 @@ function promise() {
|
|
|
2169
2170
|
plugins: ["promise"]
|
|
2170
2171
|
};
|
|
2171
2172
|
}
|
|
2172
|
-
|
|
2173
|
-
|
|
2173
|
+
var ReactRefreshAllowConstantExportPackages = ["vite"];
|
|
2174
|
+
var ReactRouterPackages = [
|
|
2175
|
+
"@react-router/node",
|
|
2176
|
+
"@react-router/react",
|
|
2177
|
+
"@react-router/serve",
|
|
2178
|
+
"@react-router/dev"
|
|
2179
|
+
];
|
|
2174
2180
|
function react(options = {}) {
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2181
|
+
const { typeAware = true } = options;
|
|
2182
|
+
const typeAwareRules = {
|
|
2183
|
+
"react/no-leaked-conditional-rendering": "warn"
|
|
2184
|
+
};
|
|
2185
|
+
const isAllowConstantExport = ReactRefreshAllowConstantExportPackages.some(
|
|
2186
|
+
(i) => localPkg.isPackageExists(i)
|
|
2187
|
+
);
|
|
2188
|
+
const isUsingReactRouter = ReactRouterPackages.some((i) => localPkg.isPackageExists(i));
|
|
2189
|
+
return [
|
|
2190
|
+
{
|
|
2191
|
+
plugins: ["react"],
|
|
2192
|
+
rules: {
|
|
2193
|
+
// recommended rules from @eslint-react/dom
|
|
2194
|
+
"react-dom/no-children-in-void-dom-elements": "warn",
|
|
2195
|
+
"react-dom/no-dangerously-set-innerhtml": "warn",
|
|
2196
|
+
"react-dom/no-dangerously-set-innerhtml-with-children": "error",
|
|
2197
|
+
"react-dom/no-find-dom-node": "error",
|
|
2198
|
+
"react-dom/no-missing-button-type": "warn",
|
|
2199
|
+
"react-dom/no-missing-iframe-sandbox": "warn",
|
|
2200
|
+
"react-dom/no-namespace": "error",
|
|
2201
|
+
"react-dom/no-render-return-value": "error",
|
|
2202
|
+
"react-dom/no-script-url": "warn",
|
|
2203
|
+
"react-dom/no-unsafe-iframe-sandbox": "warn",
|
|
2204
|
+
"react-dom/no-unsafe-target-blank": "warn",
|
|
2205
|
+
// recommended rules react-hooks
|
|
2206
|
+
"react-hooks/exhaustive-deps": "warn",
|
|
2207
|
+
"react-hooks/rules-of-hooks": "error",
|
|
2208
|
+
// react refresh
|
|
2209
|
+
"react-refresh/only-export-components": [
|
|
2210
|
+
"warn",
|
|
2211
|
+
{
|
|
2212
|
+
allowConstantExport: isAllowConstantExport,
|
|
2213
|
+
allowExportNames: [
|
|
2214
|
+
"dynamic",
|
|
2215
|
+
"dynamicParams",
|
|
2216
|
+
"revalidate",
|
|
2217
|
+
"fetchCache",
|
|
2218
|
+
"runtime",
|
|
2219
|
+
"preferredRegion",
|
|
2220
|
+
"maxDuration",
|
|
2221
|
+
"config",
|
|
2222
|
+
"generateStaticParams",
|
|
2223
|
+
"metadata",
|
|
2224
|
+
"generateMetadata",
|
|
2225
|
+
"viewport",
|
|
2226
|
+
"generateViewport"
|
|
2227
|
+
].concat(
|
|
2228
|
+
isUsingReactRouter ? ["meta", "links", "headers", "loader", "action"] : []
|
|
2229
|
+
)
|
|
2230
|
+
}
|
|
2231
|
+
],
|
|
2232
|
+
// recommended rules from @eslint-react/web-api
|
|
2233
|
+
"react-web-api/no-leaked-event-listener": "warn",
|
|
2234
|
+
"react-web-api/no-leaked-interval": "warn",
|
|
2235
|
+
"react-web-api/no-leaked-resize-observer": "warn",
|
|
2236
|
+
"react-web-api/no-leaked-timeout": "warn",
|
|
2237
|
+
// recommended rules from @eslint-react
|
|
2238
|
+
"react/ensure-forward-ref-using-ref": "warn",
|
|
2239
|
+
"react/jsx-no-duplicate-props": "warn",
|
|
2240
|
+
"react/jsx-uses-vars": "warn",
|
|
2241
|
+
"react/no-access-state-in-setstate": "error",
|
|
2242
|
+
"react/no-array-index-key": "warn",
|
|
2243
|
+
"react/no-children-count": "warn",
|
|
2244
|
+
"react/no-children-for-each": "warn",
|
|
2245
|
+
"react/no-children-map": "warn",
|
|
2246
|
+
"react/no-children-only": "warn",
|
|
2247
|
+
"react/no-children-to-array": "warn",
|
|
2248
|
+
"react/no-clone-element": "warn",
|
|
2249
|
+
"react/no-comment-textnodes": "warn",
|
|
2250
|
+
"react/no-component-will-mount": "error",
|
|
2251
|
+
"react/no-component-will-receive-props": "error",
|
|
2252
|
+
"react/no-component-will-update": "error",
|
|
2253
|
+
"react/no-context-provider": "warn",
|
|
2254
|
+
"react/no-create-ref": "error",
|
|
2255
|
+
"react/no-default-props": "error",
|
|
2256
|
+
"react/no-direct-mutation-state": "error",
|
|
2257
|
+
"react/no-duplicate-key": "error",
|
|
2258
|
+
"react/no-forward-ref": "warn",
|
|
2259
|
+
"react/no-implicit-key": "warn",
|
|
2260
|
+
"react/no-missing-key": "error",
|
|
2261
|
+
"react/no-nested-components": "error",
|
|
2262
|
+
"react/no-prop-types": "error",
|
|
2263
|
+
"react/no-redundant-should-component-update": "error",
|
|
2264
|
+
"react/no-set-state-in-component-did-mount": "warn",
|
|
2265
|
+
"react/no-set-state-in-component-did-update": "warn",
|
|
2266
|
+
"react/no-set-state-in-component-will-update": "warn",
|
|
2267
|
+
"react/no-string-refs": "error",
|
|
2268
|
+
"react/no-unsafe-component-will-mount": "warn",
|
|
2269
|
+
"react/no-unsafe-component-will-receive-props": "warn",
|
|
2270
|
+
"react/no-unsafe-component-will-update": "warn",
|
|
2271
|
+
"react/no-unstable-context-value": "warn",
|
|
2272
|
+
"react/no-unstable-default-props": "warn",
|
|
2273
|
+
"react/no-unused-class-component-members": "warn",
|
|
2274
|
+
"react/no-unused-state": "warn",
|
|
2275
|
+
"react/prefer-destructuring-assignment": "warn",
|
|
2276
|
+
"react/prefer-shorthand-boolean": "warn",
|
|
2277
|
+
"react/prefer-shorthand-fragment": "warn",
|
|
2278
|
+
"react/jsx-key": "error",
|
|
2279
|
+
"react/jsx-no-target-blank": "warn",
|
|
2280
|
+
"react/no-danger": "warn",
|
|
2281
|
+
"react/no-unknown-property": "error"
|
|
2282
|
+
},
|
|
2283
|
+
settings: {
|
|
2284
|
+
react: {
|
|
2285
|
+
version: options.version || "detect"
|
|
2286
|
+
}
|
|
2287
|
+
}
|
|
2182
2288
|
},
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2289
|
+
{
|
|
2290
|
+
jsPlugins: ["eslint-plugin-react-compiler"],
|
|
2291
|
+
rules: {
|
|
2292
|
+
"react-compiler/react-compiler": "error"
|
|
2186
2293
|
}
|
|
2187
|
-
}
|
|
2188
|
-
|
|
2294
|
+
},
|
|
2295
|
+
...typeAware ? [
|
|
2296
|
+
{
|
|
2297
|
+
rules: {
|
|
2298
|
+
...typeAwareRules
|
|
2299
|
+
}
|
|
2300
|
+
}
|
|
2301
|
+
] : []
|
|
2302
|
+
];
|
|
2189
2303
|
}
|
|
2190
2304
|
|
|
2191
2305
|
// src/configs/react-perf.ts
|
|
@@ -2463,7 +2577,12 @@ async function getStormConfig(options = {}, ...userConfigs) {
|
|
|
2463
2577
|
configs.push(typescript(resolveSubOptions(enableTypeScript)));
|
|
2464
2578
|
}
|
|
2465
2579
|
if (enableReact) {
|
|
2466
|
-
configs.push(
|
|
2580
|
+
configs.push(
|
|
2581
|
+
...react({
|
|
2582
|
+
typeAware: enableTypeScript !== false,
|
|
2583
|
+
...resolveSubOptions(enableReact)
|
|
2584
|
+
})
|
|
2585
|
+
);
|
|
2467
2586
|
}
|
|
2468
2587
|
if (enableReactPerf) {
|
|
2469
2588
|
configs.push(reactPerf());
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import './chunk-U76ID4TS.js';
|
|
2
2
|
export { formatConfig } from './chunk-PRECUC4G.js';
|
|
3
|
-
import { getStormConfig } from './chunk-
|
|
4
|
-
export { defineConfig, getConfig, getStormConfig } from './chunk-
|
|
3
|
+
import { getStormConfig } from './chunk-3ZEETRNX.js';
|
|
4
|
+
export { defineConfig, getConfig, getStormConfig } from './chunk-3ZEETRNX.js';
|
|
5
5
|
export { storybook } from './chunk-KRBDXNMO.js';
|
|
6
6
|
export { test } from './chunk-IYISSAYD.js';
|
|
7
7
|
export { tsdoc } from './chunk-ORLPYCNP.js';
|
|
@@ -15,7 +15,7 @@ export { pnpm } from './chunk-24KYXRHB.js';
|
|
|
15
15
|
export { prettier } from './chunk-GEMVBBN7.js';
|
|
16
16
|
export { promise } from './chunk-WQ37FH6C.js';
|
|
17
17
|
export { reactPerf } from './chunk-JHRYYA2I.js';
|
|
18
|
-
export { react } from './chunk-
|
|
18
|
+
export { react } from './chunk-OPIMNRNA.js';
|
|
19
19
|
export { regexp } from './chunk-I47UNAPW.js';
|
|
20
20
|
import './chunk-GGNOJ77I.js';
|
|
21
21
|
export { banner } from './chunk-5QRE5J4W.js';
|
package/dist/preset.cjs
CHANGED
|
@@ -11,6 +11,7 @@ var path = require('path');
|
|
|
11
11
|
var z = require('zod/v4/mini');
|
|
12
12
|
var promises = require('fs/promises');
|
|
13
13
|
var config = require('eslint-plugin-prettier/recommended');
|
|
14
|
+
var localPkg = require('local-pkg');
|
|
14
15
|
|
|
15
16
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
17
|
|
|
@@ -2169,23 +2170,136 @@ function promise() {
|
|
|
2169
2170
|
plugins: ["promise"]
|
|
2170
2171
|
};
|
|
2171
2172
|
}
|
|
2172
|
-
|
|
2173
|
-
|
|
2173
|
+
var ReactRefreshAllowConstantExportPackages = ["vite"];
|
|
2174
|
+
var ReactRouterPackages = [
|
|
2175
|
+
"@react-router/node",
|
|
2176
|
+
"@react-router/react",
|
|
2177
|
+
"@react-router/serve",
|
|
2178
|
+
"@react-router/dev"
|
|
2179
|
+
];
|
|
2174
2180
|
function react(options = {}) {
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2181
|
+
const { typeAware = true } = options;
|
|
2182
|
+
const typeAwareRules = {
|
|
2183
|
+
"react/no-leaked-conditional-rendering": "warn"
|
|
2184
|
+
};
|
|
2185
|
+
const isAllowConstantExport = ReactRefreshAllowConstantExportPackages.some(
|
|
2186
|
+
(i) => localPkg.isPackageExists(i)
|
|
2187
|
+
);
|
|
2188
|
+
const isUsingReactRouter = ReactRouterPackages.some((i) => localPkg.isPackageExists(i));
|
|
2189
|
+
return [
|
|
2190
|
+
{
|
|
2191
|
+
plugins: ["react"],
|
|
2192
|
+
rules: {
|
|
2193
|
+
// recommended rules from @eslint-react/dom
|
|
2194
|
+
"react-dom/no-children-in-void-dom-elements": "warn",
|
|
2195
|
+
"react-dom/no-dangerously-set-innerhtml": "warn",
|
|
2196
|
+
"react-dom/no-dangerously-set-innerhtml-with-children": "error",
|
|
2197
|
+
"react-dom/no-find-dom-node": "error",
|
|
2198
|
+
"react-dom/no-missing-button-type": "warn",
|
|
2199
|
+
"react-dom/no-missing-iframe-sandbox": "warn",
|
|
2200
|
+
"react-dom/no-namespace": "error",
|
|
2201
|
+
"react-dom/no-render-return-value": "error",
|
|
2202
|
+
"react-dom/no-script-url": "warn",
|
|
2203
|
+
"react-dom/no-unsafe-iframe-sandbox": "warn",
|
|
2204
|
+
"react-dom/no-unsafe-target-blank": "warn",
|
|
2205
|
+
// recommended rules react-hooks
|
|
2206
|
+
"react-hooks/exhaustive-deps": "warn",
|
|
2207
|
+
"react-hooks/rules-of-hooks": "error",
|
|
2208
|
+
// react refresh
|
|
2209
|
+
"react-refresh/only-export-components": [
|
|
2210
|
+
"warn",
|
|
2211
|
+
{
|
|
2212
|
+
allowConstantExport: isAllowConstantExport,
|
|
2213
|
+
allowExportNames: [
|
|
2214
|
+
"dynamic",
|
|
2215
|
+
"dynamicParams",
|
|
2216
|
+
"revalidate",
|
|
2217
|
+
"fetchCache",
|
|
2218
|
+
"runtime",
|
|
2219
|
+
"preferredRegion",
|
|
2220
|
+
"maxDuration",
|
|
2221
|
+
"config",
|
|
2222
|
+
"generateStaticParams",
|
|
2223
|
+
"metadata",
|
|
2224
|
+
"generateMetadata",
|
|
2225
|
+
"viewport",
|
|
2226
|
+
"generateViewport"
|
|
2227
|
+
].concat(
|
|
2228
|
+
isUsingReactRouter ? ["meta", "links", "headers", "loader", "action"] : []
|
|
2229
|
+
)
|
|
2230
|
+
}
|
|
2231
|
+
],
|
|
2232
|
+
// recommended rules from @eslint-react/web-api
|
|
2233
|
+
"react-web-api/no-leaked-event-listener": "warn",
|
|
2234
|
+
"react-web-api/no-leaked-interval": "warn",
|
|
2235
|
+
"react-web-api/no-leaked-resize-observer": "warn",
|
|
2236
|
+
"react-web-api/no-leaked-timeout": "warn",
|
|
2237
|
+
// recommended rules from @eslint-react
|
|
2238
|
+
"react/ensure-forward-ref-using-ref": "warn",
|
|
2239
|
+
"react/jsx-no-duplicate-props": "warn",
|
|
2240
|
+
"react/jsx-uses-vars": "warn",
|
|
2241
|
+
"react/no-access-state-in-setstate": "error",
|
|
2242
|
+
"react/no-array-index-key": "warn",
|
|
2243
|
+
"react/no-children-count": "warn",
|
|
2244
|
+
"react/no-children-for-each": "warn",
|
|
2245
|
+
"react/no-children-map": "warn",
|
|
2246
|
+
"react/no-children-only": "warn",
|
|
2247
|
+
"react/no-children-to-array": "warn",
|
|
2248
|
+
"react/no-clone-element": "warn",
|
|
2249
|
+
"react/no-comment-textnodes": "warn",
|
|
2250
|
+
"react/no-component-will-mount": "error",
|
|
2251
|
+
"react/no-component-will-receive-props": "error",
|
|
2252
|
+
"react/no-component-will-update": "error",
|
|
2253
|
+
"react/no-context-provider": "warn",
|
|
2254
|
+
"react/no-create-ref": "error",
|
|
2255
|
+
"react/no-default-props": "error",
|
|
2256
|
+
"react/no-direct-mutation-state": "error",
|
|
2257
|
+
"react/no-duplicate-key": "error",
|
|
2258
|
+
"react/no-forward-ref": "warn",
|
|
2259
|
+
"react/no-implicit-key": "warn",
|
|
2260
|
+
"react/no-missing-key": "error",
|
|
2261
|
+
"react/no-nested-components": "error",
|
|
2262
|
+
"react/no-prop-types": "error",
|
|
2263
|
+
"react/no-redundant-should-component-update": "error",
|
|
2264
|
+
"react/no-set-state-in-component-did-mount": "warn",
|
|
2265
|
+
"react/no-set-state-in-component-did-update": "warn",
|
|
2266
|
+
"react/no-set-state-in-component-will-update": "warn",
|
|
2267
|
+
"react/no-string-refs": "error",
|
|
2268
|
+
"react/no-unsafe-component-will-mount": "warn",
|
|
2269
|
+
"react/no-unsafe-component-will-receive-props": "warn",
|
|
2270
|
+
"react/no-unsafe-component-will-update": "warn",
|
|
2271
|
+
"react/no-unstable-context-value": "warn",
|
|
2272
|
+
"react/no-unstable-default-props": "warn",
|
|
2273
|
+
"react/no-unused-class-component-members": "warn",
|
|
2274
|
+
"react/no-unused-state": "warn",
|
|
2275
|
+
"react/prefer-destructuring-assignment": "warn",
|
|
2276
|
+
"react/prefer-shorthand-boolean": "warn",
|
|
2277
|
+
"react/prefer-shorthand-fragment": "warn",
|
|
2278
|
+
"react/jsx-key": "error",
|
|
2279
|
+
"react/jsx-no-target-blank": "warn",
|
|
2280
|
+
"react/no-danger": "warn",
|
|
2281
|
+
"react/no-unknown-property": "error"
|
|
2282
|
+
},
|
|
2283
|
+
settings: {
|
|
2284
|
+
react: {
|
|
2285
|
+
version: options.version || "detect"
|
|
2286
|
+
}
|
|
2287
|
+
}
|
|
2182
2288
|
},
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2289
|
+
{
|
|
2290
|
+
jsPlugins: ["eslint-plugin-react-compiler"],
|
|
2291
|
+
rules: {
|
|
2292
|
+
"react-compiler/react-compiler": "error"
|
|
2186
2293
|
}
|
|
2187
|
-
}
|
|
2188
|
-
|
|
2294
|
+
},
|
|
2295
|
+
...typeAware ? [
|
|
2296
|
+
{
|
|
2297
|
+
rules: {
|
|
2298
|
+
...typeAwareRules
|
|
2299
|
+
}
|
|
2300
|
+
}
|
|
2301
|
+
] : []
|
|
2302
|
+
];
|
|
2189
2303
|
}
|
|
2190
2304
|
|
|
2191
2305
|
// src/configs/react-perf.ts
|
|
@@ -2461,7 +2575,12 @@ async function getStormConfig(options = {}, ...userConfigs) {
|
|
|
2461
2575
|
configs.push(typescript(resolveSubOptions(enableTypeScript)));
|
|
2462
2576
|
}
|
|
2463
2577
|
if (enableReact) {
|
|
2464
|
-
configs.push(
|
|
2578
|
+
configs.push(
|
|
2579
|
+
...react({
|
|
2580
|
+
typeAware: enableTypeScript !== false,
|
|
2581
|
+
...resolveSubOptions(enableReact)
|
|
2582
|
+
})
|
|
2583
|
+
);
|
|
2465
2584
|
}
|
|
2466
2585
|
if (enableReactPerf) {
|
|
2467
2586
|
configs.push(reactPerf());
|
package/dist/preset.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { preset_default as default, defineConfig, getConfig, getStormConfig } from './chunk-
|
|
1
|
+
export { preset_default as default, defineConfig, getConfig, getStormConfig } from './chunk-3ZEETRNX.js';
|
|
2
2
|
import './chunk-KRBDXNMO.js';
|
|
3
3
|
import './chunk-IYISSAYD.js';
|
|
4
4
|
import './chunk-ORLPYCNP.js';
|
|
@@ -12,7 +12,7 @@ import './chunk-24KYXRHB.js';
|
|
|
12
12
|
import './chunk-GEMVBBN7.js';
|
|
13
13
|
import './chunk-WQ37FH6C.js';
|
|
14
14
|
import './chunk-JHRYYA2I.js';
|
|
15
|
-
import './chunk-
|
|
15
|
+
import './chunk-OPIMNRNA.js';
|
|
16
16
|
import './chunk-I47UNAPW.js';
|
|
17
17
|
import './chunk-5QRE5J4W.js';
|
|
18
18
|
import './chunk-5IA7BNJZ.js';
|
package/dist/types.d.cts
CHANGED
package/dist/types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storm-software/oxlint",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A package containing the base Oxlint configuration used by Storm Software across many projects.",
|
|
6
6
|
"keywords": ["oxlint", "oxlint-config", "storm-ops", "storm-software"],
|
|
@@ -127,10 +127,11 @@
|
|
|
127
127
|
"types": "./dist/index.d.ts",
|
|
128
128
|
"files": ["dist/**/*"],
|
|
129
129
|
"dependencies": {
|
|
130
|
-
"@storm-software/eslint-plugin-banner": "0.0.
|
|
131
|
-
"@storm-software/eslint-plugin-pnpm": "0.0.
|
|
132
|
-
"@storm-software/eslint-plugin-tsdoc": "0.0.
|
|
130
|
+
"@storm-software/eslint-plugin-banner": "0.0.5",
|
|
131
|
+
"@storm-software/eslint-plugin-pnpm": "0.0.5",
|
|
132
|
+
"@storm-software/eslint-plugin-tsdoc": "0.0.5",
|
|
133
133
|
"defu": "^6.1.7",
|
|
134
|
+
"eslint-config-prettier": "^10.1.8",
|
|
134
135
|
"eslint-plugin-prettier": "^5.5.6",
|
|
135
136
|
"eslint-plugin-react-compiler": "19.0.0-beta-21e868a-20250216",
|
|
136
137
|
"eslint-plugin-react-hooks": "^5.2.0",
|
|
@@ -150,5 +151,5 @@
|
|
|
150
151
|
},
|
|
151
152
|
"peerDependencies": { "oxlint": "^1.68.0", "oxlint-tsgolint": "^0.14.2" },
|
|
152
153
|
"publishConfig": { "access": "public" },
|
|
153
|
-
"gitHead": "
|
|
154
|
+
"gitHead": "83a2d7123e28aa79e99e1b5a383737229274dd9a"
|
|
154
155
|
}
|
package/dist/chunk-7WK2CHER.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
// src/configs/react.ts
|
|
2
|
-
function react(options = {}) {
|
|
3
|
-
return {
|
|
4
|
-
plugins: ["react"],
|
|
5
|
-
rules: {
|
|
6
|
-
"react/jsx-key": "error",
|
|
7
|
-
"react/jsx-no-target-blank": "warn",
|
|
8
|
-
"react/no-danger": "warn",
|
|
9
|
-
"react/no-unknown-property": "error"
|
|
10
|
-
},
|
|
11
|
-
settings: {
|
|
12
|
-
react: {
|
|
13
|
-
version: options.version || "detect"
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export { react };
|