What version of Oxlint are you using?
1.59.0
What command did you run?
oxlint
What does your .oxlintrc.json (or oxlint.config.ts) config file look like?
import { defineConfig, type OxlintConfig } from "oxlint";
export default defineConfig<OxlintConfig>({
jsPlugins: [{
name : "react-js",
specifier: "eslint-plugin-react",
}],
rules: {
"react-js/jsx-equals-spacing" : [ "error", "never" ],
},
});
What happened?
I am wanting to use the rule react/jsx-equals-spacing via a jsPlugin, however it is producing false reports in code such as below.
const myElement = (subject = "Hello World") => {
return (
<span className="email-compose-field-label main">
^^^
Subject: {subject}
</span>
);
};
The rule reports that a space is found after the className=.
The rule makes use of isSpaceBetweenTokens to find a space between the "=" Punctuator and "email-compose-field-label main" Literal.
Within isSpaceBetweenTokens the getTokenOrComment returns a JSXText for this string literal ""email-compose-field-label main"" and the regex considers this to contain a whitespace.
getTokenOrComment at an index within a string literal shouldn't be returning a JSXText. Both the ESTree AST and Rust AST consider it as a string literal.
If it helps with testing, I found that replacing isSpaceBetweenTokens in this rule with isSpaceBetween allows it to behave as expected.
What version of Oxlint are you using?
1.59.0
What command did you run?
oxlintWhat does your
.oxlintrc.json(oroxlint.config.ts) config file look like?What happened?
I am wanting to use the rule react/jsx-equals-spacing via a jsPlugin, however it is producing false reports in code such as below.
The rule reports that a space is found after the
className=.The rule makes use of
isSpaceBetweenTokensto find a space between the "=" Punctuator and "email-compose-field-label main" Literal.Within
isSpaceBetweenTokensthegetTokenOrCommentreturns a JSXText for this string literal""email-compose-field-label main""and the regex considers this to contain a whitespace.getTokenOrComment at an index within a string literal shouldn't be returning a JSXText. Both the ESTree AST and Rust AST consider it as a string literal.
If it helps with testing, I found that replacing isSpaceBetweenTokens in this rule with isSpaceBetween allows it to behave as expected.