@storm-software/eslint 0.170.82 → 0.170.83
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/preset.cjs +113 -74
- package/dist/preset.js +113 -74
- package/dist/types.d.cts +3299 -2831
- package/dist/types.d.ts +3299 -2831
- package/package.json +2 -2
package/dist/preset.cjs
CHANGED
|
@@ -18657,6 +18657,31 @@ var ReactRouterPackages = [
|
|
|
18657
18657
|
"@react-router/serve",
|
|
18658
18658
|
"@react-router/dev"
|
|
18659
18659
|
];
|
|
18660
|
+
function renameRules2(config5) {
|
|
18661
|
+
const renamedRules = {};
|
|
18662
|
+
for (const [ruleName, ruleConfig] of Object.entries(config5.rules || {})) {
|
|
18663
|
+
if (ruleName.startsWith("@eslint-react/dom-")) {
|
|
18664
|
+
renamedRules[`react-dom/${ruleName.slice("@eslint-react/dom-".length)}`] = ruleConfig;
|
|
18665
|
+
} else if (ruleName.startsWith("@eslint-react/web-api-")) {
|
|
18666
|
+
renamedRules[`react-web-api/${ruleName.slice("@eslint-react/web-api-".length)}`] = ruleConfig;
|
|
18667
|
+
} else if (ruleName.startsWith("@eslint-react/jsx-")) {
|
|
18668
|
+
renamedRules[`react-jsx/${ruleName.slice("@eslint-react/jsx-".length)}`] = ruleConfig;
|
|
18669
|
+
} else if (ruleName.startsWith("@eslint-react/rsc-")) {
|
|
18670
|
+
renamedRules[`react-rsc/${ruleName.slice("@eslint-react/rsc-".length)}`] = ruleConfig;
|
|
18671
|
+
} else if (ruleName.startsWith("@eslint-react/naming-convention-")) {
|
|
18672
|
+
renamedRules[`react-naming-convention/${ruleName.slice(
|
|
18673
|
+
"@eslint-react/naming-convention-".length
|
|
18674
|
+
)}`] = ruleConfig;
|
|
18675
|
+
} else if (ruleName.startsWith("@eslint-react/x-")) {
|
|
18676
|
+
renamedRules[`react-x/${ruleName.slice("@eslint-react/x-".length)}`] = ruleConfig;
|
|
18677
|
+
} else if (ruleName.startsWith("@eslint-react/")) {
|
|
18678
|
+
renamedRules[`react/${ruleName.slice("@eslint-react/".length)}`] = ruleConfig;
|
|
18679
|
+
} else {
|
|
18680
|
+
renamedRules[ruleName] = ruleConfig;
|
|
18681
|
+
}
|
|
18682
|
+
}
|
|
18683
|
+
return renamedRules;
|
|
18684
|
+
}
|
|
18660
18685
|
async function react(options = {}) {
|
|
18661
18686
|
const {
|
|
18662
18687
|
files = [GLOB_SRC],
|
|
@@ -18669,22 +18694,36 @@ async function react(options = {}) {
|
|
|
18669
18694
|
"@eslint-react/eslint-plugin",
|
|
18670
18695
|
"eslint-plugin-react-hooks",
|
|
18671
18696
|
"eslint-plugin-react-refresh",
|
|
18672
|
-
"eslint-plugin-react-compiler"
|
|
18697
|
+
"eslint-plugin-react-compiler",
|
|
18698
|
+
"eslint-plugin-react-dom",
|
|
18699
|
+
"eslint-plugin-react-jsx",
|
|
18700
|
+
"eslint-plugin-react-naming-convention",
|
|
18701
|
+
"eslint-plugin-react-rsc",
|
|
18702
|
+
"eslint-plugin-react-web-api",
|
|
18703
|
+
"eslint-plugin-react-x"
|
|
18673
18704
|
]);
|
|
18674
|
-
const isTypeAware = !!tsconfigPath;
|
|
18675
|
-
const typeAwareRules = {
|
|
18676
|
-
"react/no-leaked-conditional-rendering": "warn"
|
|
18677
|
-
};
|
|
18678
18705
|
const [
|
|
18679
18706
|
pluginReact,
|
|
18680
18707
|
pluginReactHooks,
|
|
18681
18708
|
pluginReactRefresh,
|
|
18682
|
-
pluginReactCompiler
|
|
18709
|
+
pluginReactCompiler,
|
|
18710
|
+
pluginReactDom,
|
|
18711
|
+
pluginReactJsx,
|
|
18712
|
+
pluginReactNamingConvention,
|
|
18713
|
+
pluginReactRsc,
|
|
18714
|
+
pluginReactWebApi,
|
|
18715
|
+
pluginReactX
|
|
18683
18716
|
] = await Promise.all([
|
|
18684
18717
|
interopDefault(import('@eslint-react/eslint-plugin')),
|
|
18685
18718
|
interopDefault(import('eslint-plugin-react-hooks')),
|
|
18686
18719
|
interopDefault(import('eslint-plugin-react-refresh')),
|
|
18687
|
-
interopDefault(import('eslint-plugin-react-compiler'))
|
|
18720
|
+
interopDefault(import('eslint-plugin-react-compiler')),
|
|
18721
|
+
interopDefault(import('eslint-plugin-react-dom')),
|
|
18722
|
+
interopDefault(import('eslint-plugin-react-jsx')),
|
|
18723
|
+
interopDefault(import('eslint-plugin-react-naming-convention')),
|
|
18724
|
+
interopDefault(import('eslint-plugin-react-rsc')),
|
|
18725
|
+
interopDefault(import('eslint-plugin-react-web-api')),
|
|
18726
|
+
interopDefault(import('eslint-plugin-react-x'))
|
|
18688
18727
|
]);
|
|
18689
18728
|
const isAllowConstantExport = ReactRefreshAllowConstantExportPackages.some(
|
|
18690
18729
|
(i) => localPkg.isPackageExists(i)
|
|
@@ -18692,13 +18731,19 @@ async function react(options = {}) {
|
|
|
18692
18731
|
const isUsingReactRouter = ReactRouterPackages.some((i) => localPkg.isPackageExists(i));
|
|
18693
18732
|
return [
|
|
18694
18733
|
pluginReactHooks.configs.flat["recommended-latest"],
|
|
18695
|
-
isTypeAware ? pluginReact.configs["recommended-type-checked"] : pluginReact.configs["recommended"],
|
|
18696
18734
|
{
|
|
18697
18735
|
name: "storm/react/setup",
|
|
18698
18736
|
plugins: {
|
|
18699
18737
|
"react-hooks": pluginReactHooks,
|
|
18700
18738
|
"react-refresh": pluginReactRefresh,
|
|
18701
|
-
"react-compiler": pluginReactCompiler
|
|
18739
|
+
"react-compiler": pluginReactCompiler,
|
|
18740
|
+
react: pluginReact,
|
|
18741
|
+
"react-dom": pluginReactDom,
|
|
18742
|
+
"react-jsx": pluginReactJsx,
|
|
18743
|
+
"react-naming-convention": pluginReactNamingConvention,
|
|
18744
|
+
"react-rsc": pluginReactRsc,
|
|
18745
|
+
"react-web-api": pluginReactWebApi,
|
|
18746
|
+
"react-x": pluginReactX
|
|
18702
18747
|
}
|
|
18703
18748
|
},
|
|
18704
18749
|
{
|
|
@@ -18713,22 +18758,11 @@ async function react(options = {}) {
|
|
|
18713
18758
|
},
|
|
18714
18759
|
name: "storm/react/rules",
|
|
18715
18760
|
rules: {
|
|
18716
|
-
|
|
18717
|
-
|
|
18718
|
-
|
|
18719
|
-
"@eslint-react/dom-no-dangerously-set-innerhtml-with-children": "error",
|
|
18720
|
-
"@eslint-react/dom-no-find-dom-node": "error",
|
|
18721
|
-
"@eslint-react/dom-no-missing-button-type": "warn",
|
|
18722
|
-
"@eslint-react/dom-no-missing-iframe-sandbox": "warn",
|
|
18723
|
-
"@eslint-react/dom-no-namespace": "error",
|
|
18724
|
-
"@eslint-react/dom-no-render-return-value": "error",
|
|
18725
|
-
"@eslint-react/dom-no-script-url": "warn",
|
|
18726
|
-
"@eslint-react/dom-no-unsafe-iframe-sandbox": "warn",
|
|
18727
|
-
"@eslint-react/dom-no-unsafe-target-blank": "warn",
|
|
18728
|
-
// recommended rules react-hooks
|
|
18761
|
+
...renameRules2(
|
|
18762
|
+
!!tsconfigPath ? pluginReact.configs["recommended-type-checked"] : pluginReact.configs["recommended"]
|
|
18763
|
+
),
|
|
18729
18764
|
"react-hooks/exhaustive-deps": "warn",
|
|
18730
18765
|
"react-hooks/rules-of-hooks": "error",
|
|
18731
|
-
// react refresh
|
|
18732
18766
|
"react-refresh/only-export-components": [
|
|
18733
18767
|
"warn",
|
|
18734
18768
|
{
|
|
@@ -18752,66 +18786,71 @@ async function react(options = {}) {
|
|
|
18752
18786
|
)
|
|
18753
18787
|
}
|
|
18754
18788
|
],
|
|
18755
|
-
// recommended rules from @eslint-react/web-api
|
|
18756
|
-
"@eslint-react/web-api-no-leaked-event-listener": "warn",
|
|
18757
|
-
"@eslint-react/web-api-no-leaked-interval": "warn",
|
|
18758
|
-
"@eslint-react/web-api-no-leaked-resize-observer": "warn",
|
|
18759
|
-
"@eslint-react/web-api-no-leaked-timeout": "warn",
|
|
18760
|
-
// recommended rules from @eslint-react
|
|
18761
|
-
"@eslint-react/error-boundaries": "error",
|
|
18762
|
-
"@eslint-react/ensure-forward-ref-using-ref": "warn",
|
|
18763
|
-
"@eslint-react/jsx-no-duplicate-props": "warn",
|
|
18764
|
-
"@eslint-react/jsx-uses-vars": "warn",
|
|
18765
|
-
"@eslint-react/no-access-state-in-setstate": "error",
|
|
18766
|
-
"@eslint-react/no-array-index-key": "warn",
|
|
18767
|
-
"@eslint-react/no-children-count": "warn",
|
|
18768
|
-
"@eslint-react/no-children-for-each": "warn",
|
|
18769
|
-
"@eslint-react/no-children-map": "warn",
|
|
18770
|
-
"@eslint-react/no-children-only": "warn",
|
|
18771
|
-
"@eslint-react/no-children-to-array": "warn",
|
|
18772
|
-
"@eslint-react/no-clone-element": "warn",
|
|
18773
|
-
"@eslint-react/no-comment-textnodes": "warn",
|
|
18774
|
-
"@eslint-react/no-component-will-mount": "error",
|
|
18775
|
-
"@eslint-react/no-component-will-receive-props": "error",
|
|
18776
|
-
"@eslint-react/no-component-will-update": "error",
|
|
18777
|
-
"@eslint-react/no-context-provider": "warn",
|
|
18778
|
-
"@eslint-react/no-create-ref": "error",
|
|
18779
|
-
"@eslint-react/no-default-props": "error",
|
|
18780
|
-
"@eslint-react/no-direct-mutation-state": "error",
|
|
18781
|
-
"@eslint-react/no-duplicate-key": "error",
|
|
18782
|
-
"@eslint-react/no-forward-ref": "warn",
|
|
18783
|
-
"@eslint-react/no-implicit-key": "warn",
|
|
18784
|
-
"@eslint-react/no-missing-key": "error",
|
|
18785
|
-
"@eslint-react/no-nested-components": "error",
|
|
18786
|
-
"@eslint-react/no-prop-types": "error",
|
|
18787
|
-
"@eslint-react/no-redundant-should-component-update": "error",
|
|
18788
|
-
"@eslint-react/no-set-state-in-component-did-mount": "warn",
|
|
18789
|
-
"@eslint-react/no-set-state-in-component-did-update": "warn",
|
|
18790
|
-
"@eslint-react/no-set-state-in-component-will-update": "warn",
|
|
18791
|
-
"@eslint-react/no-string-refs": "error",
|
|
18792
|
-
"@eslint-react/no-unsafe-component-will-mount": "warn",
|
|
18793
|
-
"@eslint-react/no-unsafe-component-will-receive-props": "warn",
|
|
18794
|
-
"@eslint-react/no-unsafe-component-will-update": "warn",
|
|
18795
|
-
"@eslint-react/no-unstable-context-value": "warn",
|
|
18796
|
-
"@eslint-react/no-unstable-default-props": "warn",
|
|
18797
|
-
"@eslint-react/no-unused-class-component-members": "warn",
|
|
18798
|
-
"@eslint-react/no-unused-state": "warn",
|
|
18799
|
-
"@eslint-react/prefer-destructuring-assignment": "warn",
|
|
18800
|
-
"@eslint-react/prefer-shorthand-boolean": "warn",
|
|
18801
|
-
"@eslint-react/prefer-shorthand-fragment": "warn",
|
|
18802
|
-
// recommended rules from eslint-plugin-react-compiler
|
|
18803
18789
|
"react-compiler/react-compiler": "error",
|
|
18804
|
-
|
|
18790
|
+
"react-dom/no-void-elements-with-children": "warn",
|
|
18791
|
+
"react-dom/no-dangerously-set-innerhtml": "warn",
|
|
18792
|
+
"react-dom/no-dangerously-set-innerhtml-with-children": "error",
|
|
18793
|
+
"react-dom/no-find-dom-node": "error",
|
|
18794
|
+
"react-dom/no-missing-button-type": "warn",
|
|
18795
|
+
"react-dom/no-missing-iframe-sandbox": "warn",
|
|
18796
|
+
"react-dom/no-namespace": "error",
|
|
18797
|
+
"react-dom/no-render-return-value": "error",
|
|
18798
|
+
"react-dom/no-script-url": "warn",
|
|
18799
|
+
"react-dom/no-unsafe-iframe-sandbox": "warn",
|
|
18800
|
+
"react-dom/no-unsafe-target-blank": "warn",
|
|
18801
|
+
"react-web-api/no-leaked-event-listener": "warn",
|
|
18802
|
+
"react-web-api/no-leaked-interval": "warn",
|
|
18803
|
+
"react-web-api/no-leaked-resize-observer": "warn",
|
|
18804
|
+
"react-web-api/no-leaked-timeout": "warn",
|
|
18805
|
+
"react-x/error-boundaries": "error",
|
|
18806
|
+
"react/ensure-forward-ref-using-ref": "warn",
|
|
18807
|
+
"react/no-access-state-in-setstate": "error",
|
|
18808
|
+
"react/no-array-index-key": "warn",
|
|
18809
|
+
"react/no-children-count": "warn",
|
|
18810
|
+
"react/no-children-for-each": "warn",
|
|
18811
|
+
"react/no-children-map": "warn",
|
|
18812
|
+
"react/no-children-only": "warn",
|
|
18813
|
+
"react/no-children-to-array": "warn",
|
|
18814
|
+
"react/no-clone-element": "warn",
|
|
18815
|
+
"react/no-comment-textnodes": "warn",
|
|
18816
|
+
"react/no-component-will-mount": "error",
|
|
18817
|
+
"react/no-component-will-receive-props": "error",
|
|
18818
|
+
"react/no-component-will-update": "error",
|
|
18819
|
+
"react/no-context-provider": "warn",
|
|
18820
|
+
"react/no-create-ref": "error",
|
|
18821
|
+
"react/no-default-props": "error",
|
|
18822
|
+
"react/no-direct-mutation-state": "error",
|
|
18823
|
+
"react/no-duplicate-key": "error",
|
|
18824
|
+
"react/no-forward-ref": "warn",
|
|
18825
|
+
"react/no-implicit-key": "warn",
|
|
18826
|
+
"react/no-missing-key": "error",
|
|
18827
|
+
"react/no-nested-components": "error",
|
|
18828
|
+
"react/no-prop-types": "error",
|
|
18829
|
+
"react/no-redundant-should-component-update": "error",
|
|
18830
|
+
"react/no-set-state-in-component-did-mount": "warn",
|
|
18831
|
+
"react/no-set-state-in-component-did-update": "warn",
|
|
18832
|
+
"react/no-set-state-in-component-will-update": "warn",
|
|
18833
|
+
"react/no-string-refs": "error",
|
|
18834
|
+
"react/no-unsafe-component-will-mount": "warn",
|
|
18835
|
+
"react/no-unsafe-component-will-receive-props": "warn",
|
|
18836
|
+
"react/no-unsafe-component-will-update": "warn",
|
|
18837
|
+
"react/no-unstable-context-value": "warn",
|
|
18838
|
+
"react/no-unstable-default-props": "warn",
|
|
18839
|
+
"react/no-unused-class-component-members": "warn",
|
|
18840
|
+
"react/no-unused-state": "warn",
|
|
18841
|
+
"react/prefer-destructuring-assignment": "warn",
|
|
18842
|
+
"react/prefer-shorthand-boolean": "warn",
|
|
18843
|
+
"react/prefer-shorthand-fragment": "warn",
|
|
18805
18844
|
...overrides
|
|
18806
18845
|
}
|
|
18807
18846
|
},
|
|
18808
|
-
|
|
18847
|
+
...!!tsconfigPath ? [
|
|
18809
18848
|
{
|
|
18810
18849
|
files: filesTypeAware,
|
|
18811
18850
|
ignores: ignoresTypeAware,
|
|
18812
18851
|
name: "storm/react/type-aware-rules",
|
|
18813
18852
|
rules: {
|
|
18814
|
-
|
|
18853
|
+
"react/no-leaked-conditional-rendering": "warn"
|
|
18815
18854
|
}
|
|
18816
18855
|
}
|
|
18817
18856
|
] : []
|
package/dist/preset.js
CHANGED
|
@@ -18245,6 +18245,31 @@ var ReactRouterPackages = [
|
|
|
18245
18245
|
"@react-router/serve",
|
|
18246
18246
|
"@react-router/dev"
|
|
18247
18247
|
];
|
|
18248
|
+
function renameRules2(config5) {
|
|
18249
|
+
const renamedRules = {};
|
|
18250
|
+
for (const [ruleName, ruleConfig] of Object.entries(config5.rules || {})) {
|
|
18251
|
+
if (ruleName.startsWith("@eslint-react/dom-")) {
|
|
18252
|
+
renamedRules[`react-dom/${ruleName.slice("@eslint-react/dom-".length)}`] = ruleConfig;
|
|
18253
|
+
} else if (ruleName.startsWith("@eslint-react/web-api-")) {
|
|
18254
|
+
renamedRules[`react-web-api/${ruleName.slice("@eslint-react/web-api-".length)}`] = ruleConfig;
|
|
18255
|
+
} else if (ruleName.startsWith("@eslint-react/jsx-")) {
|
|
18256
|
+
renamedRules[`react-jsx/${ruleName.slice("@eslint-react/jsx-".length)}`] = ruleConfig;
|
|
18257
|
+
} else if (ruleName.startsWith("@eslint-react/rsc-")) {
|
|
18258
|
+
renamedRules[`react-rsc/${ruleName.slice("@eslint-react/rsc-".length)}`] = ruleConfig;
|
|
18259
|
+
} else if (ruleName.startsWith("@eslint-react/naming-convention-")) {
|
|
18260
|
+
renamedRules[`react-naming-convention/${ruleName.slice(
|
|
18261
|
+
"@eslint-react/naming-convention-".length
|
|
18262
|
+
)}`] = ruleConfig;
|
|
18263
|
+
} else if (ruleName.startsWith("@eslint-react/x-")) {
|
|
18264
|
+
renamedRules[`react-x/${ruleName.slice("@eslint-react/x-".length)}`] = ruleConfig;
|
|
18265
|
+
} else if (ruleName.startsWith("@eslint-react/")) {
|
|
18266
|
+
renamedRules[`react/${ruleName.slice("@eslint-react/".length)}`] = ruleConfig;
|
|
18267
|
+
} else {
|
|
18268
|
+
renamedRules[ruleName] = ruleConfig;
|
|
18269
|
+
}
|
|
18270
|
+
}
|
|
18271
|
+
return renamedRules;
|
|
18272
|
+
}
|
|
18248
18273
|
async function react(options = {}) {
|
|
18249
18274
|
const {
|
|
18250
18275
|
files = [GLOB_SRC],
|
|
@@ -18257,22 +18282,36 @@ async function react(options = {}) {
|
|
|
18257
18282
|
"@eslint-react/eslint-plugin",
|
|
18258
18283
|
"eslint-plugin-react-hooks",
|
|
18259
18284
|
"eslint-plugin-react-refresh",
|
|
18260
|
-
"eslint-plugin-react-compiler"
|
|
18285
|
+
"eslint-plugin-react-compiler",
|
|
18286
|
+
"eslint-plugin-react-dom",
|
|
18287
|
+
"eslint-plugin-react-jsx",
|
|
18288
|
+
"eslint-plugin-react-naming-convention",
|
|
18289
|
+
"eslint-plugin-react-rsc",
|
|
18290
|
+
"eslint-plugin-react-web-api",
|
|
18291
|
+
"eslint-plugin-react-x"
|
|
18261
18292
|
]);
|
|
18262
|
-
const isTypeAware = !!tsconfigPath;
|
|
18263
|
-
const typeAwareRules = {
|
|
18264
|
-
"react/no-leaked-conditional-rendering": "warn"
|
|
18265
|
-
};
|
|
18266
18293
|
const [
|
|
18267
18294
|
pluginReact,
|
|
18268
18295
|
pluginReactHooks,
|
|
18269
18296
|
pluginReactRefresh,
|
|
18270
|
-
pluginReactCompiler
|
|
18297
|
+
pluginReactCompiler,
|
|
18298
|
+
pluginReactDom,
|
|
18299
|
+
pluginReactJsx,
|
|
18300
|
+
pluginReactNamingConvention,
|
|
18301
|
+
pluginReactRsc,
|
|
18302
|
+
pluginReactWebApi,
|
|
18303
|
+
pluginReactX
|
|
18271
18304
|
] = await Promise.all([
|
|
18272
18305
|
interopDefault(import('@eslint-react/eslint-plugin')),
|
|
18273
18306
|
interopDefault(import('eslint-plugin-react-hooks')),
|
|
18274
18307
|
interopDefault(import('eslint-plugin-react-refresh')),
|
|
18275
|
-
interopDefault(import('eslint-plugin-react-compiler'))
|
|
18308
|
+
interopDefault(import('eslint-plugin-react-compiler')),
|
|
18309
|
+
interopDefault(import('eslint-plugin-react-dom')),
|
|
18310
|
+
interopDefault(import('eslint-plugin-react-jsx')),
|
|
18311
|
+
interopDefault(import('eslint-plugin-react-naming-convention')),
|
|
18312
|
+
interopDefault(import('eslint-plugin-react-rsc')),
|
|
18313
|
+
interopDefault(import('eslint-plugin-react-web-api')),
|
|
18314
|
+
interopDefault(import('eslint-plugin-react-x'))
|
|
18276
18315
|
]);
|
|
18277
18316
|
const isAllowConstantExport = ReactRefreshAllowConstantExportPackages.some(
|
|
18278
18317
|
(i) => isPackageExists(i)
|
|
@@ -18280,13 +18319,19 @@ async function react(options = {}) {
|
|
|
18280
18319
|
const isUsingReactRouter = ReactRouterPackages.some((i) => isPackageExists(i));
|
|
18281
18320
|
return [
|
|
18282
18321
|
pluginReactHooks.configs.flat["recommended-latest"],
|
|
18283
|
-
isTypeAware ? pluginReact.configs["recommended-type-checked"] : pluginReact.configs["recommended"],
|
|
18284
18322
|
{
|
|
18285
18323
|
name: "storm/react/setup",
|
|
18286
18324
|
plugins: {
|
|
18287
18325
|
"react-hooks": pluginReactHooks,
|
|
18288
18326
|
"react-refresh": pluginReactRefresh,
|
|
18289
|
-
"react-compiler": pluginReactCompiler
|
|
18327
|
+
"react-compiler": pluginReactCompiler,
|
|
18328
|
+
react: pluginReact,
|
|
18329
|
+
"react-dom": pluginReactDom,
|
|
18330
|
+
"react-jsx": pluginReactJsx,
|
|
18331
|
+
"react-naming-convention": pluginReactNamingConvention,
|
|
18332
|
+
"react-rsc": pluginReactRsc,
|
|
18333
|
+
"react-web-api": pluginReactWebApi,
|
|
18334
|
+
"react-x": pluginReactX
|
|
18290
18335
|
}
|
|
18291
18336
|
},
|
|
18292
18337
|
{
|
|
@@ -18301,22 +18346,11 @@ async function react(options = {}) {
|
|
|
18301
18346
|
},
|
|
18302
18347
|
name: "storm/react/rules",
|
|
18303
18348
|
rules: {
|
|
18304
|
-
|
|
18305
|
-
|
|
18306
|
-
|
|
18307
|
-
"@eslint-react/dom-no-dangerously-set-innerhtml-with-children": "error",
|
|
18308
|
-
"@eslint-react/dom-no-find-dom-node": "error",
|
|
18309
|
-
"@eslint-react/dom-no-missing-button-type": "warn",
|
|
18310
|
-
"@eslint-react/dom-no-missing-iframe-sandbox": "warn",
|
|
18311
|
-
"@eslint-react/dom-no-namespace": "error",
|
|
18312
|
-
"@eslint-react/dom-no-render-return-value": "error",
|
|
18313
|
-
"@eslint-react/dom-no-script-url": "warn",
|
|
18314
|
-
"@eslint-react/dom-no-unsafe-iframe-sandbox": "warn",
|
|
18315
|
-
"@eslint-react/dom-no-unsafe-target-blank": "warn",
|
|
18316
|
-
// recommended rules react-hooks
|
|
18349
|
+
...renameRules2(
|
|
18350
|
+
!!tsconfigPath ? pluginReact.configs["recommended-type-checked"] : pluginReact.configs["recommended"]
|
|
18351
|
+
),
|
|
18317
18352
|
"react-hooks/exhaustive-deps": "warn",
|
|
18318
18353
|
"react-hooks/rules-of-hooks": "error",
|
|
18319
|
-
// react refresh
|
|
18320
18354
|
"react-refresh/only-export-components": [
|
|
18321
18355
|
"warn",
|
|
18322
18356
|
{
|
|
@@ -18340,66 +18374,71 @@ async function react(options = {}) {
|
|
|
18340
18374
|
)
|
|
18341
18375
|
}
|
|
18342
18376
|
],
|
|
18343
|
-
// recommended rules from @eslint-react/web-api
|
|
18344
|
-
"@eslint-react/web-api-no-leaked-event-listener": "warn",
|
|
18345
|
-
"@eslint-react/web-api-no-leaked-interval": "warn",
|
|
18346
|
-
"@eslint-react/web-api-no-leaked-resize-observer": "warn",
|
|
18347
|
-
"@eslint-react/web-api-no-leaked-timeout": "warn",
|
|
18348
|
-
// recommended rules from @eslint-react
|
|
18349
|
-
"@eslint-react/error-boundaries": "error",
|
|
18350
|
-
"@eslint-react/ensure-forward-ref-using-ref": "warn",
|
|
18351
|
-
"@eslint-react/jsx-no-duplicate-props": "warn",
|
|
18352
|
-
"@eslint-react/jsx-uses-vars": "warn",
|
|
18353
|
-
"@eslint-react/no-access-state-in-setstate": "error",
|
|
18354
|
-
"@eslint-react/no-array-index-key": "warn",
|
|
18355
|
-
"@eslint-react/no-children-count": "warn",
|
|
18356
|
-
"@eslint-react/no-children-for-each": "warn",
|
|
18357
|
-
"@eslint-react/no-children-map": "warn",
|
|
18358
|
-
"@eslint-react/no-children-only": "warn",
|
|
18359
|
-
"@eslint-react/no-children-to-array": "warn",
|
|
18360
|
-
"@eslint-react/no-clone-element": "warn",
|
|
18361
|
-
"@eslint-react/no-comment-textnodes": "warn",
|
|
18362
|
-
"@eslint-react/no-component-will-mount": "error",
|
|
18363
|
-
"@eslint-react/no-component-will-receive-props": "error",
|
|
18364
|
-
"@eslint-react/no-component-will-update": "error",
|
|
18365
|
-
"@eslint-react/no-context-provider": "warn",
|
|
18366
|
-
"@eslint-react/no-create-ref": "error",
|
|
18367
|
-
"@eslint-react/no-default-props": "error",
|
|
18368
|
-
"@eslint-react/no-direct-mutation-state": "error",
|
|
18369
|
-
"@eslint-react/no-duplicate-key": "error",
|
|
18370
|
-
"@eslint-react/no-forward-ref": "warn",
|
|
18371
|
-
"@eslint-react/no-implicit-key": "warn",
|
|
18372
|
-
"@eslint-react/no-missing-key": "error",
|
|
18373
|
-
"@eslint-react/no-nested-components": "error",
|
|
18374
|
-
"@eslint-react/no-prop-types": "error",
|
|
18375
|
-
"@eslint-react/no-redundant-should-component-update": "error",
|
|
18376
|
-
"@eslint-react/no-set-state-in-component-did-mount": "warn",
|
|
18377
|
-
"@eslint-react/no-set-state-in-component-did-update": "warn",
|
|
18378
|
-
"@eslint-react/no-set-state-in-component-will-update": "warn",
|
|
18379
|
-
"@eslint-react/no-string-refs": "error",
|
|
18380
|
-
"@eslint-react/no-unsafe-component-will-mount": "warn",
|
|
18381
|
-
"@eslint-react/no-unsafe-component-will-receive-props": "warn",
|
|
18382
|
-
"@eslint-react/no-unsafe-component-will-update": "warn",
|
|
18383
|
-
"@eslint-react/no-unstable-context-value": "warn",
|
|
18384
|
-
"@eslint-react/no-unstable-default-props": "warn",
|
|
18385
|
-
"@eslint-react/no-unused-class-component-members": "warn",
|
|
18386
|
-
"@eslint-react/no-unused-state": "warn",
|
|
18387
|
-
"@eslint-react/prefer-destructuring-assignment": "warn",
|
|
18388
|
-
"@eslint-react/prefer-shorthand-boolean": "warn",
|
|
18389
|
-
"@eslint-react/prefer-shorthand-fragment": "warn",
|
|
18390
|
-
// recommended rules from eslint-plugin-react-compiler
|
|
18391
18377
|
"react-compiler/react-compiler": "error",
|
|
18392
|
-
|
|
18378
|
+
"react-dom/no-void-elements-with-children": "warn",
|
|
18379
|
+
"react-dom/no-dangerously-set-innerhtml": "warn",
|
|
18380
|
+
"react-dom/no-dangerously-set-innerhtml-with-children": "error",
|
|
18381
|
+
"react-dom/no-find-dom-node": "error",
|
|
18382
|
+
"react-dom/no-missing-button-type": "warn",
|
|
18383
|
+
"react-dom/no-missing-iframe-sandbox": "warn",
|
|
18384
|
+
"react-dom/no-namespace": "error",
|
|
18385
|
+
"react-dom/no-render-return-value": "error",
|
|
18386
|
+
"react-dom/no-script-url": "warn",
|
|
18387
|
+
"react-dom/no-unsafe-iframe-sandbox": "warn",
|
|
18388
|
+
"react-dom/no-unsafe-target-blank": "warn",
|
|
18389
|
+
"react-web-api/no-leaked-event-listener": "warn",
|
|
18390
|
+
"react-web-api/no-leaked-interval": "warn",
|
|
18391
|
+
"react-web-api/no-leaked-resize-observer": "warn",
|
|
18392
|
+
"react-web-api/no-leaked-timeout": "warn",
|
|
18393
|
+
"react-x/error-boundaries": "error",
|
|
18394
|
+
"react/ensure-forward-ref-using-ref": "warn",
|
|
18395
|
+
"react/no-access-state-in-setstate": "error",
|
|
18396
|
+
"react/no-array-index-key": "warn",
|
|
18397
|
+
"react/no-children-count": "warn",
|
|
18398
|
+
"react/no-children-for-each": "warn",
|
|
18399
|
+
"react/no-children-map": "warn",
|
|
18400
|
+
"react/no-children-only": "warn",
|
|
18401
|
+
"react/no-children-to-array": "warn",
|
|
18402
|
+
"react/no-clone-element": "warn",
|
|
18403
|
+
"react/no-comment-textnodes": "warn",
|
|
18404
|
+
"react/no-component-will-mount": "error",
|
|
18405
|
+
"react/no-component-will-receive-props": "error",
|
|
18406
|
+
"react/no-component-will-update": "error",
|
|
18407
|
+
"react/no-context-provider": "warn",
|
|
18408
|
+
"react/no-create-ref": "error",
|
|
18409
|
+
"react/no-default-props": "error",
|
|
18410
|
+
"react/no-direct-mutation-state": "error",
|
|
18411
|
+
"react/no-duplicate-key": "error",
|
|
18412
|
+
"react/no-forward-ref": "warn",
|
|
18413
|
+
"react/no-implicit-key": "warn",
|
|
18414
|
+
"react/no-missing-key": "error",
|
|
18415
|
+
"react/no-nested-components": "error",
|
|
18416
|
+
"react/no-prop-types": "error",
|
|
18417
|
+
"react/no-redundant-should-component-update": "error",
|
|
18418
|
+
"react/no-set-state-in-component-did-mount": "warn",
|
|
18419
|
+
"react/no-set-state-in-component-did-update": "warn",
|
|
18420
|
+
"react/no-set-state-in-component-will-update": "warn",
|
|
18421
|
+
"react/no-string-refs": "error",
|
|
18422
|
+
"react/no-unsafe-component-will-mount": "warn",
|
|
18423
|
+
"react/no-unsafe-component-will-receive-props": "warn",
|
|
18424
|
+
"react/no-unsafe-component-will-update": "warn",
|
|
18425
|
+
"react/no-unstable-context-value": "warn",
|
|
18426
|
+
"react/no-unstable-default-props": "warn",
|
|
18427
|
+
"react/no-unused-class-component-members": "warn",
|
|
18428
|
+
"react/no-unused-state": "warn",
|
|
18429
|
+
"react/prefer-destructuring-assignment": "warn",
|
|
18430
|
+
"react/prefer-shorthand-boolean": "warn",
|
|
18431
|
+
"react/prefer-shorthand-fragment": "warn",
|
|
18393
18432
|
...overrides
|
|
18394
18433
|
}
|
|
18395
18434
|
},
|
|
18396
|
-
|
|
18435
|
+
...!!tsconfigPath ? [
|
|
18397
18436
|
{
|
|
18398
18437
|
files: filesTypeAware,
|
|
18399
18438
|
ignores: ignoresTypeAware,
|
|
18400
18439
|
name: "storm/react/type-aware-rules",
|
|
18401
18440
|
rules: {
|
|
18402
|
-
|
|
18441
|
+
"react/no-leaked-conditional-rendering": "warn"
|
|
18403
18442
|
}
|
|
18404
18443
|
}
|
|
18405
18444
|
] : []
|