jsx-boolean-value
NOTE: this rule is included the following rule sets:
recommendedreactjsxEnable full set in
deno.json:{
"lint": {
"rules": {
"tags": ["recommended"] // ...or "react", "jsx"
}
}
}Enable full set using the Deno CLI:
deno lint --rules-tags=recommended # or ... deno lint --rules-tags=react # or ... deno lint --rules-tags=jsx
This rule can be explictly included to or excluded from the rules present in the current tag by adding it to the
include or exclude array in deno.json:{
"lint": {
"rules": {
"include": ["jsx-boolean-value"],
"exclude": ["jsx-boolean-value"]
}
}
}强制一致的 JSX 布尔值样式。传递 true 作为布尔值可以使用简写语法省略。
无效:
const foo = <Foo isFoo={true} />;
const foo = <Foo isFoo={false} />;
有效:
const foo = <Foo isFoo />;
const foo = <Foo isFoo={false} />;