11import { name , version } from "../package.json" ;
22
3- import type { CompatiblePlugin } from "@eslint-react/shared" ;
4- import reactDom from "eslint-plugin-react-dom" ;
5- import reactHooksExtra from "eslint-plugin-react-hooks-extra" ;
6- import reactNamingConvention from "eslint-plugin-react-naming-convention" ;
7- import reactWebApi from "eslint-plugin-react-web-api" ;
3+ import type { CompatibleConfig , CompatiblePlugin } from "@eslint-react/shared" ;
84import react from "eslint-plugin-react-x" ;
95
106import * as allConfig from "./configs/all" ;
@@ -24,24 +20,29 @@ import * as strictTypescriptConfig from "./configs/strict-typescript";
2420import * as webApiConfig from "./configs/web-api" ;
2521import * as xConfig from "./configs/x" ;
2622
27- import { padKeysLeft } from "./utils" ;
23+ type ConfigName =
24+ | "all"
25+ | "disable-conflict-eslint-plugin-react"
26+ | "disable-dom"
27+ | "disable-type-checked"
28+ | "disable-web-api"
29+ | "dom"
30+ | "no-deprecated"
31+ | "off"
32+ | "recommended"
33+ | "recommended-type-checked"
34+ | "recommended-typescript"
35+ | "strict"
36+ | "strict-type-checked"
37+ | "strict-typescript"
38+ | "web-api"
39+ | "x" ;
2840
29- const plugin : CompatiblePlugin = {
41+ const plugin : CompatiblePlugin & { configs : Record < ConfigName , CompatibleConfig > } = {
3042 meta : {
3143 name,
3244 version,
3345 } ,
34- rules : {
35- ...react . rules ,
36- ...padKeysLeft ( reactDom . rules , "dom/" ) ,
37- ...padKeysLeft ( reactWebApi . rules , "web-api/" ) ,
38- ...padKeysLeft ( reactHooksExtra . rules , "hooks-extra/" ) ,
39- ...padKeysLeft ( reactNamingConvention . rules , "naming-convention/" ) ,
40- } ,
41- } ;
42-
43- export default {
44- ...plugin ,
4546 configs : {
4647 /**
4748 * Enable all applicable rules from this plugin
@@ -110,4 +111,9 @@ export default {
110111 */
111112 [ "x" ] : xConfig ,
112113 } ,
114+ rules : {
115+ ...react . rules ,
116+ } ,
113117} ;
118+
119+ export default plugin ;
0 commit comments