Closed DianaSuvorova closed 1 year ago
Most new bundlers (SWC, esbuild, bun) don't parse jsx inside .js files, so I always advice people to use explicit file extension, this avoid a lot of configuration in the long run IMO.
But if this is not something possible for you, this options can be added to the plugin 👍
Note: given that the plugin only use naming convention, this could generate some false positive (when exporting pure JS classes for example).
I see, let me try to come up with test cases and see what it will look like.
I am thinking adding a check that React
is in scope may act as a proxy to check that code is actually jsx.
upd: I am planning to add something similar to isReturningJSX
Interesting. Could be useful to go behind naming convention in general but let's use it only for JS files in the first (behind an option so that the plugin don't run on JS files by default)
We are looking to apply this lint rule to our codebase. Although we follow different file extension policies for React. So we need to allow the rule to parse '.js' files as well.
Would you be open to a contribution that would introduce an option to configure this rule to override parsable file extensions? The default can still be
tsx & jsx
?Thanks, Diana