@biscuittin/eslint-config 0.1.1 → 0.3.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/dist/index.d.ts +8 -37
- package/dist/index.js +264 -183
- package/package.json +6 -2
- package/typegen.d.ts +1 -31
package/dist/index.d.ts
CHANGED
|
@@ -60,36 +60,6 @@ interface RuleOptions {
|
|
|
60
60
|
* @see https://eslint-react.xyz/docs/rules/avoid-shorthand-fragment
|
|
61
61
|
*/
|
|
62
62
|
'@eslint-react/avoid-shorthand-fragment'?: Linter.RuleEntry<[]>;
|
|
63
|
-
/**
|
|
64
|
-
* Reports all class components.
|
|
65
|
-
* @see https://eslint-react.xyz/docs/rules/debug-class-component
|
|
66
|
-
*/
|
|
67
|
-
'@eslint-react/debug/class-component'?: Linter.RuleEntry<[]>;
|
|
68
|
-
/**
|
|
69
|
-
* Reports all function components.
|
|
70
|
-
* @see https://eslint-react.xyz/docs/rules/debug-function-component
|
|
71
|
-
*/
|
|
72
|
-
'@eslint-react/debug/function-component'?: Linter.RuleEntry<[]>;
|
|
73
|
-
/**
|
|
74
|
-
* Reports all React Hooks.
|
|
75
|
-
* @see https://eslint-react.xyz/docs/rules/debug-hook
|
|
76
|
-
*/
|
|
77
|
-
'@eslint-react/debug/hook'?: Linter.RuleEntry<[]>;
|
|
78
|
-
/**
|
|
79
|
-
* Reports all identifiers that are initialized from React.
|
|
80
|
-
* @see https://eslint-react.xyz/docs/rules/debug-is-from-react
|
|
81
|
-
*/
|
|
82
|
-
'@eslint-react/debug/is-from-react'?: Linter.RuleEntry<[]>;
|
|
83
|
-
/**
|
|
84
|
-
* Reports all JSX elements and fragments.
|
|
85
|
-
* @see https://eslint-react.xyz/docs/rules/debug-jsx
|
|
86
|
-
*/
|
|
87
|
-
'@eslint-react/debug/jsx'?: Linter.RuleEntry<[]>;
|
|
88
|
-
/**
|
|
89
|
-
* Reports all React Hooks.
|
|
90
|
-
* @see https://eslint-react.xyz/docs/rules/debug-hook
|
|
91
|
-
*/
|
|
92
|
-
'@eslint-react/debug/react-hooks'?: Linter.RuleEntry<[]>;
|
|
93
63
|
/**
|
|
94
64
|
* Disallow `children` in void DOM elements.
|
|
95
65
|
* @see https://eslint-react.xyz/docs/rules/dom-no-void-elements-with-children
|
|
@@ -14222,7 +14192,7 @@ type Yoda = [] | [("always" | "never")] | [("always" | "never"), {
|
|
|
14222
14192
|
onlyEquality?: boolean;
|
|
14223
14193
|
}];
|
|
14224
14194
|
// Names of all the configs
|
|
14225
|
-
type ConfigNames = '@biscuittin/eslint-config/eslint-comments/setup' | '@biscuittin/eslint-config/eslint-comments/rules' | '@biscuittin/eslint-config/disables/script' | '@biscuittin/eslint-config/disables/cli' | '@biscuittin/eslint-config/disables/bin' | '@biscuittin/eslint-config/disables/dts' | '@biscuittin/eslint-config/disables/commonjs' | '@biscuittin/eslint-config/disables/config-files' | '@biscuittin/eslint-config/formatters/setup' | '@biscuittin/eslint-config/formatters/rules/typescript' | '@biscuittin/eslint-config/formatters/rules/json' | '@biscuittin/eslint-config/formatters/rules/markdown' | '@biscuittin/eslint-config/formatters/rules/malva' | '@biscuittin/eslint-config/formatters/rules/markup' | '@biscuittin/eslint-config/formatters/rules/yaml' | '@biscuittin/eslint-config/ignores/files' | '@biscuittin/eslint-config/ignores/gitignore' | '@biscuittin/eslint-config/imports/setup' | '@biscuittin/eslint-config/imports/rules' | '@biscuittin/eslint-config/imports/stylistic' | '@biscuittin/eslint-config/javascript/setup' | '@biscuittin/eslint-config/javascript/commonjs' | '@biscuittin/eslint-config/javascript/module' | '@biscuittin/eslint-config/javascript/rules' | '@biscuittin/eslint-config/json/setup' | '@biscuittin/eslint-config/json/rules' | '@biscuittin/eslint-config/json/stylistic' | '@biscuittin/eslint-config/json/package-json' | '@biscuittin/eslint-config/json/tsconfig-json' | '@biscuittin/eslint-config/jsx/setup' | '@biscuittin/eslint-config/next-js/setup' | '@biscuittin/eslint-config/next-js/rules' | '@biscuittin/eslint-config/node-js/setup' | '@biscuittin/eslint-config/node-js/rules' | '@biscuittin/eslint-config/node-js/script' | '@biscuittin/eslint-config/node-js/commonjs' | '@biscuittin/eslint-config/node-js/module' | '@biscuittin/eslint-config/react/setup' | '@biscuittin/eslint-config/react/rules' | '@biscuittin/eslint-config/react/stylistic' | '@biscuittin/eslint-config/
|
|
14195
|
+
type ConfigNames = '@biscuittin/eslint-config/eslint-comments/setup' | '@biscuittin/eslint-config/eslint-comments/rules' | '@biscuittin/eslint-config/disables/script' | '@biscuittin/eslint-config/disables/cli' | '@biscuittin/eslint-config/disables/bin' | '@biscuittin/eslint-config/disables/dts' | '@biscuittin/eslint-config/disables/commonjs' | '@biscuittin/eslint-config/disables/config-files' | '@biscuittin/eslint-config/formatters/setup' | '@biscuittin/eslint-config/formatters/rules/typescript' | '@biscuittin/eslint-config/formatters/rules/json' | '@biscuittin/eslint-config/formatters/rules/markdown' | '@biscuittin/eslint-config/formatters/rules/malva' | '@biscuittin/eslint-config/formatters/rules/markup' | '@biscuittin/eslint-config/formatters/rules/yaml' | '@biscuittin/eslint-config/ignores/files' | '@biscuittin/eslint-config/ignores/gitignore' | '@biscuittin/eslint-config/imports/setup' | '@biscuittin/eslint-config/imports/rules' | '@biscuittin/eslint-config/imports/stylistic' | '@biscuittin/eslint-config/javascript/setup' | '@biscuittin/eslint-config/javascript/commonjs' | '@biscuittin/eslint-config/javascript/module' | '@biscuittin/eslint-config/javascript/rules' | '@biscuittin/eslint-config/json/setup' | '@biscuittin/eslint-config/json/rules' | '@biscuittin/eslint-config/json/stylistic' | '@biscuittin/eslint-config/json/package-json' | '@biscuittin/eslint-config/json/tsconfig-json' | '@biscuittin/eslint-config/jsx/setup' | '@biscuittin/eslint-config/next-js/setup' | '@biscuittin/eslint-config/next-js/rules' | '@biscuittin/eslint-config/node-js/setup' | '@biscuittin/eslint-config/node-js/rules' | '@biscuittin/eslint-config/node-js/script' | '@biscuittin/eslint-config/node-js/commonjs' | '@biscuittin/eslint-config/node-js/module' | '@biscuittin/eslint-config/react/setup' | '@biscuittin/eslint-config/react/rules' | '@biscuittin/eslint-config/react/stylistic' | '@biscuittin/eslint-config/react/type-check' | '@biscuittin/eslint-config/react/react-compiler' | '@biscuittin/eslint-config/regexp/setup' | '@biscuittin/eslint-config/regexp/rules' | '@biscuittin/eslint-config/tailwindcss/setup' | '@biscuittin/eslint-config/tailwindcss/rules' | '@biscuittin/eslint-config/typescript/setup' | '@biscuittin/eslint-config/typescript/rules' | '@biscuittin/eslint-config/unicorn/setup/all-src' | '@biscuittin/eslint-config/unicorn/setup/src' | '@biscuittin/eslint-config/unicorn/rules/all-src' | '@biscuittin/eslint-config/unicorn/rules/src';
|
|
14226
14196
|
//#endregion
|
|
14227
14197
|
//#region src/types.d.ts
|
|
14228
14198
|
/**
|
|
@@ -14436,12 +14406,6 @@ interface OptionsTypeScript extends OptionsIsInEditor {
|
|
|
14436
14406
|
* @see [@typescript-eslint/parser#extraFileExtensions](https://typescript-eslint.io/packages/parser/#extrafileextensions)
|
|
14437
14407
|
*/
|
|
14438
14408
|
extraFileExtensions?: string[];
|
|
14439
|
-
/**
|
|
14440
|
-
* Enable [@eslint-react/eslint-plugin](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin) type-checking rules.
|
|
14441
|
-
*
|
|
14442
|
-
* @default `true` when `react` is enabled, otherwise `false`
|
|
14443
|
-
*/
|
|
14444
|
-
reactTypeCheck?: boolean;
|
|
14445
14409
|
}
|
|
14446
14410
|
type OptionsJson = OptionsExtraFiles & OptionsStylistic;
|
|
14447
14411
|
interface OptionsReact {
|
|
@@ -14451,6 +14415,12 @@ interface OptionsReact {
|
|
|
14451
14415
|
* @default true
|
|
14452
14416
|
*/
|
|
14453
14417
|
stylistic?: boolean;
|
|
14418
|
+
/**
|
|
14419
|
+
* Enable [@eslint-react/eslint-plugin](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin) type-checking rules.
|
|
14420
|
+
*
|
|
14421
|
+
* @default `true` when TypeScript is installed, otherwise `false`
|
|
14422
|
+
*/
|
|
14423
|
+
typeCheck?: boolean;
|
|
14454
14424
|
/**
|
|
14455
14425
|
* Enable React Compiler rules.
|
|
14456
14426
|
*
|
|
@@ -14547,6 +14517,7 @@ interface ESLintConfigOptions {
|
|
|
14547
14517
|
typescript?: SharedOptions<OptionsTypeScript> | boolean;
|
|
14548
14518
|
json?: SharedOptions<OptionsExtraFiles> | boolean;
|
|
14549
14519
|
react?: SharedOptions<OptionsReact> | boolean;
|
|
14520
|
+
nextjs?: SharedOptions | boolean;
|
|
14550
14521
|
node?: SharedOptions<OptionsNodeJs> | boolean;
|
|
14551
14522
|
tailwindcss?: SharedOptions<OptionsTailwindCss> | boolean;
|
|
14552
14523
|
}
|
package/dist/index.js
CHANGED
|
@@ -20,11 +20,15 @@ import eslintPluginJsonc from "eslint-plugin-jsonc";
|
|
|
20
20
|
import eslintPluginNextJs from "@next/eslint-plugin-next";
|
|
21
21
|
import eslintPluginReactRefresh from "eslint-plugin-react-refresh";
|
|
22
22
|
import eslintPluginNode from "eslint-plugin-n";
|
|
23
|
-
import eslintPluginReact from "@eslint-react/eslint-plugin";
|
|
24
23
|
import { eslint_plugin_jsx_a11y_minimal } from "@eslint-sukka/eslint-plugin-react-jsx-a11y";
|
|
25
24
|
import eslintPluginStylistic from "@stylistic/eslint-plugin";
|
|
26
25
|
import * as eslintPluginReactCompiler from "eslint-plugin-react-compiler";
|
|
26
|
+
import eslintPluginReactDom from "eslint-plugin-react-dom";
|
|
27
27
|
import * as eslintPluginReactHooks from "eslint-plugin-react-hooks";
|
|
28
|
+
import eslintPluginReactHooksExtra from "eslint-plugin-react-hooks-extra";
|
|
29
|
+
import eslintPluginReactNamingConvention from "eslint-plugin-react-naming-convention";
|
|
30
|
+
import eslintPluginReactWebApi from "eslint-plugin-react-web-api";
|
|
31
|
+
import eslintPluginReactX from "eslint-plugin-react-x";
|
|
28
32
|
import * as eslintPluginRegexp from "eslint-plugin-regexp";
|
|
29
33
|
import eslintPluginBetterTailwindcss from "eslint-plugin-better-tailwindcss";
|
|
30
34
|
import { createTypeScriptImportResolver, defaultExtensions } from "eslint-import-resolver-typescript";
|
|
@@ -242,14 +246,10 @@ const GLOB_JSON = "**/*.json";
|
|
|
242
246
|
const GLOB_JSON5 = "**/*.json5";
|
|
243
247
|
const GLOB_JSONC = "**/*.jsonc";
|
|
244
248
|
const GLOB_MARKDOWN = "**/*.md";
|
|
245
|
-
const GLOB_SVELTE = "**/*.svelte";
|
|
246
|
-
const GLOB_VUE = "**/*.vue";
|
|
247
249
|
const GLOB_YAML = "**/*.y?(a)ml";
|
|
248
250
|
const GLOB_TOML = "**/*.toml";
|
|
249
|
-
const GLOB_XML = "**/*.xml";
|
|
250
251
|
const GLOB_HTML = "**/*.htm?(l)";
|
|
251
252
|
const GLOB_SVG = "**/*.svg";
|
|
252
|
-
const GLOB_ASTRO = "**/*.astro";
|
|
253
253
|
const GLOB_MARKDOWN_CODE = `${GLOB_MARKDOWN}/${GLOB_SRC}`;
|
|
254
254
|
const GLOB_TESTS = [
|
|
255
255
|
`**/__tests__/**/*.${GLOB_SRC_EXT}`,
|
|
@@ -266,14 +266,10 @@ const GLOB_ALL_SRC = [
|
|
|
266
266
|
GLOB_JSON5,
|
|
267
267
|
GLOB_JSONC,
|
|
268
268
|
GLOB_MARKDOWN,
|
|
269
|
-
GLOB_SVELTE,
|
|
270
|
-
GLOB_VUE,
|
|
271
269
|
GLOB_YAML,
|
|
272
270
|
GLOB_TOML,
|
|
273
|
-
GLOB_XML,
|
|
274
271
|
GLOB_HTML,
|
|
275
|
-
GLOB_SVG
|
|
276
|
-
GLOB_ASTRO
|
|
272
|
+
GLOB_SVG
|
|
277
273
|
];
|
|
278
274
|
const GLOB_EXCLUDE = [
|
|
279
275
|
"**/node_modules",
|
|
@@ -477,12 +473,7 @@ async function formatters(options = {}) {
|
|
|
477
473
|
},
|
|
478
474
|
{
|
|
479
475
|
name: `${name$12.rules}/markup`,
|
|
480
|
-
files: [
|
|
481
|
-
GLOB_HTML,
|
|
482
|
-
GLOB_VUE,
|
|
483
|
-
GLOB_SVELTE,
|
|
484
|
-
GLOB_ASTRO
|
|
485
|
-
],
|
|
476
|
+
files: [GLOB_HTML],
|
|
486
477
|
languageOptions: { parser: parsers_default["parserPlain"] },
|
|
487
478
|
rules: hasPlugin("markup") ? { "format/dprint": ["error", {
|
|
488
479
|
language: getPluginUrl("markup"),
|
|
@@ -1006,7 +997,6 @@ function nextJs() {
|
|
|
1006
997
|
name: name$6.rules,
|
|
1007
998
|
files: files$4,
|
|
1008
999
|
rules: {
|
|
1009
|
-
...pluginNextJs.flatConfig.coreWebVitals.rules,
|
|
1010
1000
|
"react-refresh/only-export-components": ["warn", { allowExportNames: [
|
|
1011
1001
|
"config",
|
|
1012
1002
|
"generateStaticParams",
|
|
@@ -1014,7 +1004,28 @@ function nextJs() {
|
|
|
1014
1004
|
"generateMetadata",
|
|
1015
1005
|
"viewport",
|
|
1016
1006
|
"generateViewport"
|
|
1017
|
-
] }]
|
|
1007
|
+
] }],
|
|
1008
|
+
"@next/next/google-font-display": "warn",
|
|
1009
|
+
"@next/next/google-font-preconnect": "warn",
|
|
1010
|
+
"@next/next/next-script-for-ga": "warn",
|
|
1011
|
+
"@next/next/no-async-client-component": "warn",
|
|
1012
|
+
"@next/next/no-before-interactive-script-outside-document": "warn",
|
|
1013
|
+
"@next/next/no-css-tags": "warn",
|
|
1014
|
+
"@next/next/no-head-element": "warn",
|
|
1015
|
+
"@next/next/no-img-element": "warn",
|
|
1016
|
+
"@next/next/no-page-custom-font": "warn",
|
|
1017
|
+
"@next/next/no-styled-jsx-in-document": "warn",
|
|
1018
|
+
"@next/next/no-title-in-document-head": "warn",
|
|
1019
|
+
"@next/next/no-typos": "warn",
|
|
1020
|
+
"@next/next/no-unwanted-polyfillio": "warn",
|
|
1021
|
+
"@next/next/inline-script-id": "error",
|
|
1022
|
+
"@next/next/no-assign-module-variable": "error",
|
|
1023
|
+
"@next/next/no-document-import-in-page": "error",
|
|
1024
|
+
"@next/next/no-duplicate-head": "error",
|
|
1025
|
+
"@next/next/no-head-import-in-document": "error",
|
|
1026
|
+
"@next/next/no-script-component-in-head": "error",
|
|
1027
|
+
"@next/next/no-html-link-for-pages": "error",
|
|
1028
|
+
"@next/next/no-sync-scripts": "error"
|
|
1018
1029
|
}
|
|
1019
1030
|
}];
|
|
1020
1031
|
}
|
|
@@ -1128,154 +1139,238 @@ function nodeJs(options = {}) {
|
|
|
1128
1139
|
|
|
1129
1140
|
//#endregion
|
|
1130
1141
|
//#region src/configs/react.ts
|
|
1131
|
-
const reactPlugins$1 = eslintPluginReact.configs.all.plugins;
|
|
1132
1142
|
const pluginJsxA11y = memo(eslint_plugin_jsx_a11y_minimal, "eslint-plugin-react-jsx-a11y");
|
|
1133
|
-
const pluginReact
|
|
1143
|
+
const pluginReact = memo(eslintPluginReactX, "eslint-plugin-react-x");
|
|
1134
1144
|
const pluginReactCompiler = memo(eslintPluginReactCompiler, "eslint-plugin-react-compiler");
|
|
1135
|
-
const
|
|
1136
|
-
const pluginReactDom$1 = memo(reactPlugins$1["@eslint-react/dom"], "eslint-plugin-react-dom");
|
|
1145
|
+
const pluginReactDom = memo(eslintPluginReactDom, "eslint-plugin-react-dom");
|
|
1137
1146
|
const pluginReactHooks = memo(eslintPluginReactHooks, "eslint-plugin-react-hooks");
|
|
1138
|
-
const pluginReactHooksExtra = memo(
|
|
1139
|
-
const
|
|
1147
|
+
const pluginReactHooksExtra = memo(eslintPluginReactHooksExtra, "eslint-plugin-react-hooks-extra");
|
|
1148
|
+
const pluginReactNamingConvention = memo(eslintPluginReactNamingConvention, "eslint-plugin-react-naming-convention");
|
|
1140
1149
|
const pluginReactRefresh = memo(eslintPluginReactRefresh, "eslint-plugin-react-refresh");
|
|
1141
|
-
const pluginReactWebApi = memo(
|
|
1150
|
+
const pluginReactWebApi = memo(eslintPluginReactWebApi, "eslint-plugin-react-web-api");
|
|
1142
1151
|
const pluginStylistic = memo(eslintPluginStylistic, "eslint-plugin-stylistic");
|
|
1152
|
+
const pluginTypescript$1 = memo(plugin, "@typescript-eslint/eslint-plugin");
|
|
1143
1153
|
const name$4 = getFlatConfigName("react");
|
|
1144
1154
|
const files$3 = [GLOB_SRC];
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
strict: true,
|
|
1170
|
-
strictImportCheck: true,
|
|
1171
|
-
version: "detect",
|
|
1172
|
-
additionalHooks: {
|
|
1173
|
-
useEffect: ["useIsomorphicLayoutEffect"],
|
|
1174
|
-
useLayoutEffect: ["useIsomorphicLayoutEffect"]
|
|
1175
|
-
}
|
|
1176
|
-
} }
|
|
1177
|
-
},
|
|
1178
|
-
{
|
|
1179
|
-
name: name$4.rules,
|
|
1180
|
-
files: files$3,
|
|
1181
|
-
rules: {
|
|
1182
|
-
"react-hooks/rules-of-hooks": "error",
|
|
1183
|
-
"react-hooks/exhaustive-deps": "error",
|
|
1184
|
-
"react-compiler/react-compiler": reactCompiler ? "error" : "off",
|
|
1185
|
-
"react-refresh/only-export-components": "warn",
|
|
1186
|
-
"jsx-a11y/alt-text": ["warn", {
|
|
1187
|
-
elements: ["img"],
|
|
1188
|
-
img: ["Image"]
|
|
1189
|
-
}],
|
|
1190
|
-
"jsx-a11y/aria-props": "warn",
|
|
1191
|
-
"jsx-a11y/aria-proptypes": "warn",
|
|
1192
|
-
"jsx-a11y/aria-role": "warn",
|
|
1193
|
-
"jsx-a11y/aria-unsupported-elements": "warn",
|
|
1194
|
-
"jsx-a11y/iframe-has-title": "warn",
|
|
1195
|
-
"jsx-a11y/no-access-key": "warn",
|
|
1196
|
-
"jsx-a11y/role-has-required-aria-props": "warn",
|
|
1197
|
-
"jsx-a11y/role-supports-aria-props": "warn",
|
|
1198
|
-
"jsx-a11y/tabindex-no-positive": "warn",
|
|
1199
|
-
...eslintPluginReact.configs.x.rules,
|
|
1200
|
-
"@eslint-react/ensure-forward-ref-using-ref": "error",
|
|
1201
|
-
"@eslint-react/no-duplicate-jsx-props": "error",
|
|
1202
|
-
"@eslint-react/no-duplicate-key": "error",
|
|
1203
|
-
"@eslint-react/no-children-count": "error",
|
|
1204
|
-
"@eslint-react/no-children-for-each": "error",
|
|
1205
|
-
"@eslint-react/no-children-only": "error",
|
|
1206
|
-
"@eslint-react/no-children-to-array": "error",
|
|
1207
|
-
"@eslint-react/no-clone-element": "error",
|
|
1208
|
-
"@eslint-react/no-comment-textnodes": "error",
|
|
1209
|
-
"@eslint-react/no-implicit-key": "error",
|
|
1210
|
-
"@eslint-react/no-missing-component-display-name": "error",
|
|
1211
|
-
"@eslint-react/no-unstable-context-value": "error",
|
|
1212
|
-
"@eslint-react/dom/no-unsafe-target-blank": "off",
|
|
1213
|
-
"@eslint-react/dom/no-void-elements-with-children": "error",
|
|
1214
|
-
"@eslint-react/web-api/no-leaked-event-listener": "error",
|
|
1215
|
-
"@eslint-react/web-api/no-leaked-interval": "error",
|
|
1216
|
-
"@eslint-react/web-api/no-leaked-resize-observer": "error",
|
|
1217
|
-
"@eslint-react/web-api/no-leaked-timeout": "error",
|
|
1218
|
-
"@eslint-react/hooks-extra/no-unnecessary-use-callback": "error",
|
|
1219
|
-
"@eslint-react/hooks-extra/no-unnecessary-use-memo": "error",
|
|
1220
|
-
"@eslint-react/hooks-extra/no-useless-custom-hooks": "error",
|
|
1221
|
-
"@eslint-react/hooks-extra/no-direct-set-state-in-use-effect": "error",
|
|
1222
|
-
"@eslint-react/hooks-extra/no-direct-set-state-in-use-layout-effect": "error"
|
|
1223
|
-
}
|
|
1224
|
-
},
|
|
1225
|
-
{
|
|
1226
|
-
name: name$4.stylistic,
|
|
1227
|
-
files: files$3,
|
|
1228
|
-
rules: stylistic ? {
|
|
1229
|
-
"@eslint-react/prefer-destructuring-assignment": "error",
|
|
1230
|
-
"@eslint-react/prefer-react-namespace-import": "warn",
|
|
1231
|
-
"@eslint-react/prefer-shorthand-boolean": "error",
|
|
1232
|
-
"@eslint-react/prefer-shorthand-fragment": "off",
|
|
1233
|
-
"@eslint-react/avoid-shorthand-boolean": "off",
|
|
1234
|
-
"@eslint-react/avoid-shorthand-fragment": "error",
|
|
1235
|
-
"@stylistic/jsx-closing-bracket-location": "error",
|
|
1236
|
-
"@stylistic/jsx-closing-tag-location": "error",
|
|
1237
|
-
"@stylistic/jsx-curly-brace-presence": ["error", { propElementValues: "always" }],
|
|
1238
|
-
"@stylistic/jsx-equals-spacing": "error",
|
|
1239
|
-
"@stylistic/jsx-first-prop-new-line": ["error", "multiline"],
|
|
1240
|
-
"@stylistic/jsx-function-call-newline": ["error", "multiline"],
|
|
1241
|
-
"@stylistic/jsx-max-props-per-line": ["error", {
|
|
1242
|
-
maximum: 1,
|
|
1243
|
-
when: "multiline"
|
|
1244
|
-
}],
|
|
1245
|
-
"@stylistic/jsx-one-expression-per-line": ["error", { allow: "non-jsx" }],
|
|
1246
|
-
"@stylistic/jsx-pascal-case": ["error", {
|
|
1247
|
-
allowNamespace: true,
|
|
1248
|
-
ignore: ["motion"]
|
|
1249
|
-
}],
|
|
1250
|
-
"@stylistic/jsx-self-closing-comp": ["error", {
|
|
1251
|
-
component: true,
|
|
1252
|
-
html: true
|
|
1253
|
-
}],
|
|
1254
|
-
"@stylistic/jsx-tag-spacing": ["error", {
|
|
1255
|
-
afterOpening: "never",
|
|
1256
|
-
beforeClosing: "never",
|
|
1257
|
-
beforeSelfClosing: "always",
|
|
1258
|
-
closingSlash: "never"
|
|
1259
|
-
}],
|
|
1260
|
-
"@stylistic/jsx-wrap-multilines": ["error", {
|
|
1261
|
-
arrow: "parens-new-line",
|
|
1262
|
-
assignment: "parens-new-line",
|
|
1263
|
-
condition: "parens-new-line",
|
|
1264
|
-
declaration: "parens-new-line",
|
|
1265
|
-
logical: "parens-new-line",
|
|
1266
|
-
prop: "parens-new-line",
|
|
1267
|
-
propertyValue: "parens-new-line",
|
|
1268
|
-
return: "parens-new-line"
|
|
1269
|
-
}],
|
|
1270
|
-
"@stylistic/jsx-sort-props": ["error", {
|
|
1271
|
-
callbacksLast: true,
|
|
1272
|
-
shorthandFirst: true,
|
|
1273
|
-
multiline: "last",
|
|
1274
|
-
reservedFirst: true
|
|
1275
|
-
}]
|
|
1276
|
-
} : {}
|
|
1155
|
+
const configSetup = {
|
|
1156
|
+
name: name$4.setup,
|
|
1157
|
+
files: files$3,
|
|
1158
|
+
plugins: {
|
|
1159
|
+
"react-hooks": pluginReactHooks,
|
|
1160
|
+
"react-refresh": pluginReactRefresh,
|
|
1161
|
+
"jsx-a11y": pluginJsxA11y,
|
|
1162
|
+
"@eslint-react": pluginReact,
|
|
1163
|
+
"@eslint-react/dom": pluginReactDom,
|
|
1164
|
+
"@eslint-react/web-api": pluginReactWebApi,
|
|
1165
|
+
"@eslint-react/hooks-extra": pluginReactHooksExtra,
|
|
1166
|
+
"@eslint-react/naming-convention": pluginReactNamingConvention
|
|
1167
|
+
},
|
|
1168
|
+
settings: { "react-x": {
|
|
1169
|
+
version: "detect",
|
|
1170
|
+
importSource: "react",
|
|
1171
|
+
strict: true,
|
|
1172
|
+
skipImportCheck: true,
|
|
1173
|
+
polymorphicPropName: "as",
|
|
1174
|
+
jsxPragma: "createElement",
|
|
1175
|
+
jsxPragmaFrag: "Fragment",
|
|
1176
|
+
additionalHooks: {
|
|
1177
|
+
useEffect: ["useIsomorphicLayoutEffect"],
|
|
1178
|
+
useLayoutEffect: ["useIsomorphicLayoutEffect"]
|
|
1277
1179
|
}
|
|
1278
|
-
|
|
1180
|
+
} }
|
|
1181
|
+
};
|
|
1182
|
+
const configCommonRules = {
|
|
1183
|
+
name: name$4.rules,
|
|
1184
|
+
files: files$3,
|
|
1185
|
+
rules: {
|
|
1186
|
+
"react-hooks/rules-of-hooks": "error",
|
|
1187
|
+
"react-hooks/exhaustive-deps": ["error", { additionalHooks: "useIsomorphicLayoutEffect" }],
|
|
1188
|
+
"react-refresh/only-export-components": "warn",
|
|
1189
|
+
"jsx-a11y/alt-text": ["warn", {
|
|
1190
|
+
elements: ["img"],
|
|
1191
|
+
img: ["Image"]
|
|
1192
|
+
}],
|
|
1193
|
+
"jsx-a11y/aria-props": "warn",
|
|
1194
|
+
"jsx-a11y/aria-proptypes": "warn",
|
|
1195
|
+
"jsx-a11y/aria-role": "warn",
|
|
1196
|
+
"jsx-a11y/aria-unsupported-elements": "warn",
|
|
1197
|
+
"jsx-a11y/iframe-has-title": "warn",
|
|
1198
|
+
"jsx-a11y/no-access-key": "warn",
|
|
1199
|
+
"jsx-a11y/role-has-required-aria-props": "warn",
|
|
1200
|
+
"jsx-a11y/role-supports-aria-props": "warn",
|
|
1201
|
+
"jsx-a11y/tabindex-no-positive": "warn",
|
|
1202
|
+
"@eslint-react/jsx-key-before-spread": "warn",
|
|
1203
|
+
"@eslint-react/jsx-no-duplicate-props": "error",
|
|
1204
|
+
"@eslint-react/jsx-no-iife": "off",
|
|
1205
|
+
"@eslint-react/jsx-no-undef": "off",
|
|
1206
|
+
"@eslint-react/jsx-uses-react": "warn",
|
|
1207
|
+
"@eslint-react/jsx-uses-vars": "warn",
|
|
1208
|
+
"@eslint-react/no-access-state-in-setstate": "error",
|
|
1209
|
+
"@eslint-react/no-array-index-key": "warn",
|
|
1210
|
+
"@eslint-react/no-children-count": "error",
|
|
1211
|
+
"@eslint-react/no-children-for-each": "error",
|
|
1212
|
+
"@eslint-react/no-children-map": "warn",
|
|
1213
|
+
"@eslint-react/no-children-only": "error",
|
|
1214
|
+
"@eslint-react/no-children-prop": "off",
|
|
1215
|
+
"@eslint-react/no-children-to-array": "error",
|
|
1216
|
+
"@eslint-react/no-class-component": "off",
|
|
1217
|
+
"@eslint-react/no-clone-element": "error",
|
|
1218
|
+
"@eslint-react/no-comment-textnodes": "error",
|
|
1219
|
+
"@eslint-react/no-complex-conditional-rendering": "off",
|
|
1220
|
+
"@eslint-react/no-component-will-mount": "error",
|
|
1221
|
+
"@eslint-react/no-component-will-receive-props": "error",
|
|
1222
|
+
"@eslint-react/no-component-will-update": "error",
|
|
1223
|
+
"@eslint-react/no-context-provider": "warn",
|
|
1224
|
+
"@eslint-react/no-create-ref": "error",
|
|
1225
|
+
"@eslint-react/no-default-props": "error",
|
|
1226
|
+
"@eslint-react/no-direct-mutation-state": "error",
|
|
1227
|
+
"@eslint-react/no-duplicate-key": "error",
|
|
1228
|
+
"@eslint-react/no-forward-ref": "warn",
|
|
1229
|
+
"@eslint-react/no-implicit-key": "error",
|
|
1230
|
+
"@eslint-react/no-leaked-conditional-rendering": "off",
|
|
1231
|
+
"@eslint-react/no-missing-component-display-name": "error",
|
|
1232
|
+
"@eslint-react/no-missing-context-display-name": "off",
|
|
1233
|
+
"@eslint-react/no-missing-key": "error",
|
|
1234
|
+
"@eslint-react/no-misused-capture-owner-stack": "error",
|
|
1235
|
+
"@eslint-react/no-nested-component-definitions": "error",
|
|
1236
|
+
"@eslint-react/no-nested-lazy-component-declarations": "error",
|
|
1237
|
+
"@eslint-react/no-prop-types": "error",
|
|
1238
|
+
"@eslint-react/no-redundant-should-component-update": "error",
|
|
1239
|
+
"@eslint-react/no-set-state-in-component-did-mount": "warn",
|
|
1240
|
+
"@eslint-react/no-set-state-in-component-did-update": "warn",
|
|
1241
|
+
"@eslint-react/no-set-state-in-component-will-update": "warn",
|
|
1242
|
+
"@eslint-react/no-string-refs": "error",
|
|
1243
|
+
"@eslint-react/no-unsafe-component-will-mount": "warn",
|
|
1244
|
+
"@eslint-react/no-unsafe-component-will-receive-props": "warn",
|
|
1245
|
+
"@eslint-react/no-unsafe-component-will-update": "warn",
|
|
1246
|
+
"@eslint-react/no-unstable-context-value": "error",
|
|
1247
|
+
"@eslint-react/no-unstable-default-props": "warn",
|
|
1248
|
+
"@eslint-react/no-unused-class-component-members": "warn",
|
|
1249
|
+
"@eslint-react/no-unused-state": "warn",
|
|
1250
|
+
"@eslint-react/no-use-context": "warn",
|
|
1251
|
+
"@eslint-react/no-useless-forward-ref": "error",
|
|
1252
|
+
"@eslint-react/no-useless-fragment": "off",
|
|
1253
|
+
"@eslint-react/prefer-destructuring-assignment": "off",
|
|
1254
|
+
"@eslint-react/prefer-react-namespace-import": "off",
|
|
1255
|
+
"@eslint-react/prefer-read-only-props": "off",
|
|
1256
|
+
"@eslint-react/prefer-shorthand-boolean": "off",
|
|
1257
|
+
"@eslint-react/prefer-shorthand-fragment": "off",
|
|
1258
|
+
"@eslint-react/avoid-shorthand-boolean": "off",
|
|
1259
|
+
"@eslint-react/avoid-shorthand-fragment": "off",
|
|
1260
|
+
"@eslint-react/dom/no-dangerously-set-innerhtml": "warn",
|
|
1261
|
+
"@eslint-react/dom/no-dangerously-set-innerhtml-with-children": "error",
|
|
1262
|
+
"@eslint-react/dom/no-find-dom-node": "error",
|
|
1263
|
+
"@eslint-react/dom/no-flush-sync": "error",
|
|
1264
|
+
"@eslint-react/dom/no-hydrate": "error",
|
|
1265
|
+
"@eslint-react/dom/no-missing-button-type": "warn",
|
|
1266
|
+
"@eslint-react/dom/no-missing-iframe-sandbox": "warn",
|
|
1267
|
+
"@eslint-react/dom/no-namespace": "error",
|
|
1268
|
+
"@eslint-react/dom/no-render": "error",
|
|
1269
|
+
"@eslint-react/dom/no-render-return-value": "error",
|
|
1270
|
+
"@eslint-react/dom/no-script-url": "warn",
|
|
1271
|
+
"@eslint-react/dom/no-unknown-property": "off",
|
|
1272
|
+
"@eslint-react/dom/no-unsafe-iframe-sandbox": "warn",
|
|
1273
|
+
"@eslint-react/dom/no-unsafe-target-blank": "off",
|
|
1274
|
+
"@eslint-react/dom/no-use-form-state": "error",
|
|
1275
|
+
"@eslint-react/dom/no-void-elements-with-children": "error",
|
|
1276
|
+
"@eslint-react/web-api/no-leaked-event-listener": "error",
|
|
1277
|
+
"@eslint-react/web-api/no-leaked-interval": "error",
|
|
1278
|
+
"@eslint-react/web-api/no-leaked-resize-observer": "error",
|
|
1279
|
+
"@eslint-react/web-api/no-leaked-timeout": "error",
|
|
1280
|
+
"@eslint-react/hooks-extra/no-direct-set-state-in-use-effect": "error",
|
|
1281
|
+
"@eslint-react/hooks-extra/no-direct-set-state-in-use-layout-effect": "error",
|
|
1282
|
+
"@eslint-react/hooks-extra/no-unnecessary-use-callback": "error",
|
|
1283
|
+
"@eslint-react/hooks-extra/no-unnecessary-use-memo": "error",
|
|
1284
|
+
"@eslint-react/hooks-extra/no-unnecessary-use-prefix": "error",
|
|
1285
|
+
"@eslint-react/hooks-extra/prefer-use-state-lazy-initialization": "warn",
|
|
1286
|
+
"@eslint-react/naming-convention/component-name": "warn",
|
|
1287
|
+
"@eslint-react/naming-convention/context-name": "warn",
|
|
1288
|
+
"@eslint-react/naming-convention/filename": "off",
|
|
1289
|
+
"@eslint-react/naming-convention/filename-extension": "warn",
|
|
1290
|
+
"@eslint-react/naming-convention/use-state": "warn"
|
|
1291
|
+
}
|
|
1292
|
+
};
|
|
1293
|
+
const configStylistic = {
|
|
1294
|
+
name: name$4.stylistic,
|
|
1295
|
+
files: files$3,
|
|
1296
|
+
plugins: { "@stylistic": pluginStylistic },
|
|
1297
|
+
rules: {
|
|
1298
|
+
"@eslint-react/prefer-destructuring-assignment": "error",
|
|
1299
|
+
"@eslint-react/prefer-react-namespace-import": "warn",
|
|
1300
|
+
"@eslint-react/prefer-shorthand-boolean": "error",
|
|
1301
|
+
"@eslint-react/prefer-shorthand-fragment": "off",
|
|
1302
|
+
"@eslint-react/avoid-shorthand-boolean": "off",
|
|
1303
|
+
"@eslint-react/avoid-shorthand-fragment": "error",
|
|
1304
|
+
"@stylistic/jsx-closing-bracket-location": "error",
|
|
1305
|
+
"@stylistic/jsx-closing-tag-location": "error",
|
|
1306
|
+
"@stylistic/jsx-curly-brace-presence": ["error", { propElementValues: "always" }],
|
|
1307
|
+
"@stylistic/jsx-equals-spacing": "error",
|
|
1308
|
+
"@stylistic/jsx-first-prop-new-line": ["error", "multiline"],
|
|
1309
|
+
"@stylistic/jsx-function-call-newline": ["error", "multiline"],
|
|
1310
|
+
"@stylistic/jsx-max-props-per-line": ["error", {
|
|
1311
|
+
maximum: 1,
|
|
1312
|
+
when: "multiline"
|
|
1313
|
+
}],
|
|
1314
|
+
"@stylistic/jsx-one-expression-per-line": ["error", { allow: "non-jsx" }],
|
|
1315
|
+
"@stylistic/jsx-pascal-case": ["error", {
|
|
1316
|
+
allowNamespace: true,
|
|
1317
|
+
ignore: ["motion"]
|
|
1318
|
+
}],
|
|
1319
|
+
"@stylistic/jsx-self-closing-comp": ["error", {
|
|
1320
|
+
component: true,
|
|
1321
|
+
html: true
|
|
1322
|
+
}],
|
|
1323
|
+
"@stylistic/jsx-tag-spacing": ["error", {
|
|
1324
|
+
afterOpening: "never",
|
|
1325
|
+
beforeClosing: "never",
|
|
1326
|
+
beforeSelfClosing: "always",
|
|
1327
|
+
closingSlash: "never"
|
|
1328
|
+
}],
|
|
1329
|
+
"@stylistic/jsx-wrap-multilines": ["error", {
|
|
1330
|
+
arrow: "parens-new-line",
|
|
1331
|
+
assignment: "parens-new-line",
|
|
1332
|
+
condition: "parens-new-line",
|
|
1333
|
+
declaration: "parens-new-line",
|
|
1334
|
+
logical: "parens-new-line",
|
|
1335
|
+
prop: "parens-new-line",
|
|
1336
|
+
propertyValue: "parens-new-line",
|
|
1337
|
+
return: "parens-new-line"
|
|
1338
|
+
}],
|
|
1339
|
+
"@stylistic/jsx-sort-props": ["error", {
|
|
1340
|
+
callbacksLast: true,
|
|
1341
|
+
shorthandFirst: true,
|
|
1342
|
+
multiline: "last",
|
|
1343
|
+
reservedFirst: true
|
|
1344
|
+
}]
|
|
1345
|
+
}
|
|
1346
|
+
};
|
|
1347
|
+
const configTypeCheck = {
|
|
1348
|
+
name: `${name$4.base}/type-check`,
|
|
1349
|
+
files: [GLOB_TS, GLOB_TSX],
|
|
1350
|
+
plugins: { "@typescript-eslint": pluginTypescript$1 },
|
|
1351
|
+
rules: {
|
|
1352
|
+
"@eslint-react/dom/no-unknown-property": "off",
|
|
1353
|
+
"@eslint-react/jsx-no-duplicate-props": "off",
|
|
1354
|
+
"@eslint-react/jsx-uses-react": "off",
|
|
1355
|
+
"@eslint-react/jsx-uses-vars": "off",
|
|
1356
|
+
"@eslint-react/no-leaked-conditional-rendering": "error",
|
|
1357
|
+
"@eslint-react/prefer-read-only-props": "warn",
|
|
1358
|
+
"@typescript-eslint/no-misused-promises": ["error", { checksVoidReturn: { attributes: false } }]
|
|
1359
|
+
}
|
|
1360
|
+
};
|
|
1361
|
+
const configReactCompiler = {
|
|
1362
|
+
name: `${name$4.base}/react-compiler`,
|
|
1363
|
+
files: files$3,
|
|
1364
|
+
plugins: { "react-compiler": pluginReactCompiler },
|
|
1365
|
+
rules: { "react-compiler/react-compiler": "error" }
|
|
1366
|
+
};
|
|
1367
|
+
function react(options = {}) {
|
|
1368
|
+
const { stylistic = true, typeCheck = false, reactCompiler = false } = options;
|
|
1369
|
+
const configs$2 = [configSetup, configCommonRules];
|
|
1370
|
+
if (stylistic) configs$2.push(configStylistic);
|
|
1371
|
+
if (typeCheck) configs$2.push(configTypeCheck);
|
|
1372
|
+
if (reactCompiler) configs$2.push(configReactCompiler);
|
|
1373
|
+
return configs$2;
|
|
1279
1374
|
}
|
|
1280
1375
|
|
|
1281
1376
|
//#endregion
|
|
@@ -1330,12 +1425,9 @@ function tailwindcss(options = {}) {
|
|
|
1330
1425
|
|
|
1331
1426
|
//#endregion
|
|
1332
1427
|
//#region src/configs/typescript.ts
|
|
1333
|
-
const reactPlugins = eslintPluginReact.configs.all.plugins;
|
|
1334
1428
|
const pluginAntfu = memo(eslintPluginAntfu, "eslint-plugin-antfu");
|
|
1335
1429
|
const pluginImportX = memo(eslintPluginImportX, "eslint-plugin-import-x");
|
|
1336
|
-
const
|
|
1337
|
-
const pluginReactDom = memo(reactPlugins["@eslint-react/dom"], "eslint-plugin-react-dom");
|
|
1338
|
-
const pluginTypescript = memo(plugin, "typescript-eslint");
|
|
1430
|
+
const pluginTypescript = memo(plugin, "@typescript-eslint/eslint-plugin");
|
|
1339
1431
|
const name$1 = getFlatConfigName("typescript");
|
|
1340
1432
|
const typescriptStrictTypeCheckedRuleList = configs.strictTypeChecked.map((config$1) => config$1.rules);
|
|
1341
1433
|
const typescriptStrictTypeCheckedRules = Object.assign({}, ...typescriptStrictTypeCheckedRuleList);
|
|
@@ -1343,7 +1435,7 @@ const typescriptStylisticTypeCheckedRuleList = configs.stylisticTypeChecked.map(
|
|
|
1343
1435
|
const typescriptStylisticTypeCheckedRules = Object.assign({}, ...typescriptStylisticTypeCheckedRuleList);
|
|
1344
1436
|
const externalModuleFolders = ["node_modules", "node_modules/@types"];
|
|
1345
1437
|
function typescript(options = {}) {
|
|
1346
|
-
const { isInEditor = false, tsconfigPath = true, tsconfigRootDir = process.cwd(), allowDefaultProject = [], extraFileExtensions = []
|
|
1438
|
+
const { isInEditor = false, tsconfigPath = true, tsconfigRootDir = process.cwd(), allowDefaultProject = [], extraFileExtensions = [] } = options;
|
|
1347
1439
|
const files$7 = [
|
|
1348
1440
|
GLOB_TS,
|
|
1349
1441
|
GLOB_TSX,
|
|
@@ -1444,22 +1536,6 @@ function typescript(options = {}) {
|
|
|
1444
1536
|
"antfu/no-ts-export-equal": "error"
|
|
1445
1537
|
}
|
|
1446
1538
|
},
|
|
1447
|
-
{
|
|
1448
|
-
name: `${name$1.base}/react-type-checked`,
|
|
1449
|
-
files: files$7,
|
|
1450
|
-
plugins: {
|
|
1451
|
-
"@eslint-react": pluginReact,
|
|
1452
|
-
"@eslint-react/dom": pluginReactDom
|
|
1453
|
-
},
|
|
1454
|
-
rules: reactTypeCheck ? {
|
|
1455
|
-
"@typescript-eslint/no-misused-promises": ["error", { checksVoidReturn: { attributes: false } }],
|
|
1456
|
-
"@eslint-react/dom/no-unknown-property": "off",
|
|
1457
|
-
"@eslint-react/no-duplicate-jsx-props": "off",
|
|
1458
|
-
"@eslint-react/use-jsx-vars": "off",
|
|
1459
|
-
"@eslint-react/no-leaked-conditional-rendering": "error",
|
|
1460
|
-
"@eslint-react/prefer-read-only-props": "warn"
|
|
1461
|
-
} : {}
|
|
1462
|
-
},
|
|
1463
1539
|
{
|
|
1464
1540
|
files: ["**/*.cts"],
|
|
1465
1541
|
rules: { "@typescript-eslint/no-require-imports": "off" }
|
|
@@ -1536,17 +1612,22 @@ function configOptions(options, defaultOptions) {
|
|
|
1536
1612
|
async function config(options, ...userConfigs) {
|
|
1537
1613
|
const configs$2 = [];
|
|
1538
1614
|
const enableTypeScript = enabled(options?.typescript, isPackageExists("typescript"));
|
|
1539
|
-
const enableReact = enabled(options?.react, isPackageExists("react"));
|
|
1540
1615
|
const importsOption = enableTypeScript ? configOptions(options?.typescript) : {};
|
|
1541
1616
|
configs$2.push(ignores(options?.ignores), comments(), imports(importsOption));
|
|
1542
1617
|
if (enabled(options?.javascript, true)) configs$2.push(javascript(configOptions(options?.javascript)));
|
|
1543
|
-
if (enableTypeScript) configs$2.push(typescript(configOptions(options?.typescript
|
|
1618
|
+
if (enableTypeScript) configs$2.push(typescript(configOptions(options?.typescript)));
|
|
1544
1619
|
if (enabled(options?.json, true)) {
|
|
1545
1620
|
const formatOption = configOptions(options?.format, { indentWidth: 2 });
|
|
1546
1621
|
configs$2.push(json(configOptions(options?.json, { stylistic: formatOption })));
|
|
1547
1622
|
}
|
|
1548
|
-
if (
|
|
1549
|
-
|
|
1623
|
+
if (enabled(options?.react, isPackageExists("react") || isPackageExists("@types/react"))) {
|
|
1624
|
+
const enableReactCompiler = isPackageExists("babel-plugin-react-compiler") || isPackageExists("react-compiler-webpack");
|
|
1625
|
+
configs$2.push(jsx(), react(configOptions(options?.react, {
|
|
1626
|
+
typeCheck: enableTypeScript,
|
|
1627
|
+
reactCompiler: enableReactCompiler
|
|
1628
|
+
})));
|
|
1629
|
+
}
|
|
1630
|
+
if (enabled(options?.nextjs, isPackageExists("next"))) configs$2.push(nextJs());
|
|
1550
1631
|
if (enabled(options?.node, isPackageExists("@types/node"))) configs$2.push(nodeJs(configOptions(options?.node)));
|
|
1551
1632
|
if (enabled(options?.tailwindcss, isPackageExists("tailwindcss"))) configs$2.push(tailwindcss(configOptions(options?.tailwindcss)));
|
|
1552
1633
|
configs$2.push(regexp(), unicorn(), disables());
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@biscuittin/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.3.0",
|
|
5
5
|
"description": "A collection of ESLint configurations for Biscuit Tin projects.",
|
|
6
6
|
"author": "Biscuit Tin <opensource@biscuitt.in>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -60,7 +60,6 @@
|
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
62
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.5.0",
|
|
63
|
-
"@eslint-react/eslint-plugin": "^1.52.3",
|
|
64
63
|
"@eslint-sukka/eslint-plugin-react-jsx-a11y": "^6.22.1",
|
|
65
64
|
"@eslint/js": "^9.32.0",
|
|
66
65
|
"@eslint/json": "^0.13.1",
|
|
@@ -79,8 +78,13 @@
|
|
|
79
78
|
"eslint-plugin-n": "^17.21.3",
|
|
80
79
|
"eslint-plugin-perfectionist": "^4.15.0",
|
|
81
80
|
"eslint-plugin-react-compiler": "19.1.0-rc.2",
|
|
81
|
+
"eslint-plugin-react-dom": "^1.52.3",
|
|
82
82
|
"eslint-plugin-react-hooks": "^5.2.0",
|
|
83
|
+
"eslint-plugin-react-hooks-extra": "^1.52.3",
|
|
84
|
+
"eslint-plugin-react-naming-convention": "^1.52.3",
|
|
83
85
|
"eslint-plugin-react-refresh": "^0.4.20",
|
|
86
|
+
"eslint-plugin-react-web-api": "^1.52.3",
|
|
87
|
+
"eslint-plugin-react-x": "^1.52.3",
|
|
84
88
|
"eslint-plugin-regexp": "^2.9.1",
|
|
85
89
|
"eslint-plugin-unicorn": "^60.0.0",
|
|
86
90
|
"eslint-plugin-unused-imports": "^4.1.4",
|
package/typegen.d.ts
CHANGED
|
@@ -58,36 +58,6 @@ export interface RuleOptions {
|
|
|
58
58
|
* @see https://eslint-react.xyz/docs/rules/avoid-shorthand-fragment
|
|
59
59
|
*/
|
|
60
60
|
'@eslint-react/avoid-shorthand-fragment'?: Linter.RuleEntry<[]>
|
|
61
|
-
/**
|
|
62
|
-
* Reports all class components.
|
|
63
|
-
* @see https://eslint-react.xyz/docs/rules/debug-class-component
|
|
64
|
-
*/
|
|
65
|
-
'@eslint-react/debug/class-component'?: Linter.RuleEntry<[]>
|
|
66
|
-
/**
|
|
67
|
-
* Reports all function components.
|
|
68
|
-
* @see https://eslint-react.xyz/docs/rules/debug-function-component
|
|
69
|
-
*/
|
|
70
|
-
'@eslint-react/debug/function-component'?: Linter.RuleEntry<[]>
|
|
71
|
-
/**
|
|
72
|
-
* Reports all React Hooks.
|
|
73
|
-
* @see https://eslint-react.xyz/docs/rules/debug-hook
|
|
74
|
-
*/
|
|
75
|
-
'@eslint-react/debug/hook'?: Linter.RuleEntry<[]>
|
|
76
|
-
/**
|
|
77
|
-
* Reports all identifiers that are initialized from React.
|
|
78
|
-
* @see https://eslint-react.xyz/docs/rules/debug-is-from-react
|
|
79
|
-
*/
|
|
80
|
-
'@eslint-react/debug/is-from-react'?: Linter.RuleEntry<[]>
|
|
81
|
-
/**
|
|
82
|
-
* Reports all JSX elements and fragments.
|
|
83
|
-
* @see https://eslint-react.xyz/docs/rules/debug-jsx
|
|
84
|
-
*/
|
|
85
|
-
'@eslint-react/debug/jsx'?: Linter.RuleEntry<[]>
|
|
86
|
-
/**
|
|
87
|
-
* Reports all React Hooks.
|
|
88
|
-
* @see https://eslint-react.xyz/docs/rules/debug-hook
|
|
89
|
-
*/
|
|
90
|
-
'@eslint-react/debug/react-hooks'?: Linter.RuleEntry<[]>
|
|
91
61
|
/**
|
|
92
62
|
* Disallow `children` in void DOM elements.
|
|
93
63
|
* @see https://eslint-react.xyz/docs/rules/dom-no-void-elements-with-children
|
|
@@ -16044,4 +16014,4 @@ type Yoda = []|[("always" | "never")]|[("always" | "never"), {
|
|
|
16044
16014
|
onlyEquality?: boolean
|
|
16045
16015
|
}]
|
|
16046
16016
|
// Names of all the configs
|
|
16047
|
-
export type ConfigNames = '@biscuittin/eslint-config/eslint-comments/setup' | '@biscuittin/eslint-config/eslint-comments/rules' | '@biscuittin/eslint-config/disables/script' | '@biscuittin/eslint-config/disables/cli' | '@biscuittin/eslint-config/disables/bin' | '@biscuittin/eslint-config/disables/dts' | '@biscuittin/eslint-config/disables/commonjs' | '@biscuittin/eslint-config/disables/config-files' | '@biscuittin/eslint-config/formatters/setup' | '@biscuittin/eslint-config/formatters/rules/typescript' | '@biscuittin/eslint-config/formatters/rules/json' | '@biscuittin/eslint-config/formatters/rules/markdown' | '@biscuittin/eslint-config/formatters/rules/malva' | '@biscuittin/eslint-config/formatters/rules/markup' | '@biscuittin/eslint-config/formatters/rules/yaml' | '@biscuittin/eslint-config/ignores/files' | '@biscuittin/eslint-config/ignores/gitignore' | '@biscuittin/eslint-config/imports/setup' | '@biscuittin/eslint-config/imports/rules' | '@biscuittin/eslint-config/imports/stylistic' | '@biscuittin/eslint-config/javascript/setup' | '@biscuittin/eslint-config/javascript/commonjs' | '@biscuittin/eslint-config/javascript/module' | '@biscuittin/eslint-config/javascript/rules' | '@biscuittin/eslint-config/json/setup' | '@biscuittin/eslint-config/json/rules' | '@biscuittin/eslint-config/json/stylistic' | '@biscuittin/eslint-config/json/package-json' | '@biscuittin/eslint-config/json/tsconfig-json' | '@biscuittin/eslint-config/jsx/setup' | '@biscuittin/eslint-config/next-js/setup' | '@biscuittin/eslint-config/next-js/rules' | '@biscuittin/eslint-config/node-js/setup' | '@biscuittin/eslint-config/node-js/rules' | '@biscuittin/eslint-config/node-js/script' | '@biscuittin/eslint-config/node-js/commonjs' | '@biscuittin/eslint-config/node-js/module' | '@biscuittin/eslint-config/react/setup' | '@biscuittin/eslint-config/react/rules' | '@biscuittin/eslint-config/react/stylistic' | '@biscuittin/eslint-config/
|
|
16017
|
+
export type ConfigNames = '@biscuittin/eslint-config/eslint-comments/setup' | '@biscuittin/eslint-config/eslint-comments/rules' | '@biscuittin/eslint-config/disables/script' | '@biscuittin/eslint-config/disables/cli' | '@biscuittin/eslint-config/disables/bin' | '@biscuittin/eslint-config/disables/dts' | '@biscuittin/eslint-config/disables/commonjs' | '@biscuittin/eslint-config/disables/config-files' | '@biscuittin/eslint-config/formatters/setup' | '@biscuittin/eslint-config/formatters/rules/typescript' | '@biscuittin/eslint-config/formatters/rules/json' | '@biscuittin/eslint-config/formatters/rules/markdown' | '@biscuittin/eslint-config/formatters/rules/malva' | '@biscuittin/eslint-config/formatters/rules/markup' | '@biscuittin/eslint-config/formatters/rules/yaml' | '@biscuittin/eslint-config/ignores/files' | '@biscuittin/eslint-config/ignores/gitignore' | '@biscuittin/eslint-config/imports/setup' | '@biscuittin/eslint-config/imports/rules' | '@biscuittin/eslint-config/imports/stylistic' | '@biscuittin/eslint-config/javascript/setup' | '@biscuittin/eslint-config/javascript/commonjs' | '@biscuittin/eslint-config/javascript/module' | '@biscuittin/eslint-config/javascript/rules' | '@biscuittin/eslint-config/json/setup' | '@biscuittin/eslint-config/json/rules' | '@biscuittin/eslint-config/json/stylistic' | '@biscuittin/eslint-config/json/package-json' | '@biscuittin/eslint-config/json/tsconfig-json' | '@biscuittin/eslint-config/jsx/setup' | '@biscuittin/eslint-config/next-js/setup' | '@biscuittin/eslint-config/next-js/rules' | '@biscuittin/eslint-config/node-js/setup' | '@biscuittin/eslint-config/node-js/rules' | '@biscuittin/eslint-config/node-js/script' | '@biscuittin/eslint-config/node-js/commonjs' | '@biscuittin/eslint-config/node-js/module' | '@biscuittin/eslint-config/react/setup' | '@biscuittin/eslint-config/react/rules' | '@biscuittin/eslint-config/react/stylistic' | '@biscuittin/eslint-config/react/type-check' | '@biscuittin/eslint-config/react/react-compiler' | '@biscuittin/eslint-config/regexp/setup' | '@biscuittin/eslint-config/regexp/rules' | '@biscuittin/eslint-config/tailwindcss/setup' | '@biscuittin/eslint-config/tailwindcss/rules' | '@biscuittin/eslint-config/typescript/setup' | '@biscuittin/eslint-config/typescript/rules' | '@biscuittin/eslint-config/unicorn/setup/all-src' | '@biscuittin/eslint-config/unicorn/setup/src' | '@biscuittin/eslint-config/unicorn/rules/all-src' | '@biscuittin/eslint-config/unicorn/rules/src'
|