Skip to content

Commit e051f25

Browse files
committed
docs: improve configuration examples and comments in configure-analyzer documentation
1 parent af33ef4 commit e051f25

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

apps/website/content/docs/configuration/configure-analyzer.mdx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -115,31 +115,31 @@ import eslintReact from "@eslint-react/eslint-plugin";
115115

116116
export default [
117117
{
118-
files: ["**/*.{ts,tsx}"],
119-
...eslintReact.configs["recommended-typescript"],
118+
files: ["**/*.ts", "**/*.tsx"],
120119
settings: {
121120
"react-x": {
122-
version: "19.1.0",
123-
importSource: "react",
124-
polymorphicPropName: "as",
121+
version: "19.1.0", // Specify the React version for semantic analysis (can be "detect" for auto-detection)
122+
importSource: "react", // Customize the import source for the React module (defaults to "react")
123+
polymorphicPropName: "as", // Define the prop name used for polymorphic components (e.g., <Component as="div">)
124+
125+
// (Experimental) Alias custom Hooks to built-in React Hooks for rule compatibility
125126
additionalHooks: {
126127
useEffect: ["useIsomorphicLayoutEffect"],
127128
useLayoutEffect: ["useIsomorphicLayoutEffect"],
128129
},
130+
131+
// (Experimental) Configure mapping for custom components and their attributes for more comprehensive analysis
132+
// It's recommended to use polymorphicPropName when possible, as this option is more complex
129133
additionalComponents: [
130134
{
131135
name: "Link",
132136
as: "a",
133-
attributes: [
134-
{ name: "to", as: "href" }, // Maps 'to' prop to 'href' attribute
135-
],
137+
attributes: [{ name: "to", as: "href" }],
136138
},
137139
{
138140
name: "EmbedContent",
139141
as: "iframe",
140-
attributes: [
141-
{ name: "sandbox", defaultValue: "" }, // Sets the default value for 'sandbox' attribute
142-
],
142+
attributes: [{ name: "sandbox", defaultValue: "" }],
143143
},
144144
],
145145
},

0 commit comments

Comments
 (0)