Closed
Description
Since 7.21.4 I get a react/jsx-indent-props
false positive when using props in a ternary operator. I thought issue I'm having is the same as #2828 and thus would be fixed in 7.21.5, but it looks like #2828 is fixed in 7.21.5 and this is not. 7.21.3 works fine. See below for eslint config.
Error
Code
import { h } from "preact";
const Component = (props) => {
return props.prop
? <input
type="email"
/>
: "";
};
export default Component;
eslint-Config
{
"env": {
"browser": true,
"commonjs": true,
"es6": true,
"jest": true
},
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parserOptions": {
"ecmaVersion": 2020,
"sourceType": "module"
},
"extends": [
"standard",
"eslint:recommended",
"standard-react"
],
"plugins": [
"react-hooks",
"jsx-props-no-empty-lines"
],
"settings": {
"react": {
"pragma": "h",
"version": "16.3"
}
},
"rules": {
"indent": [
"error",
2
],
"linebreak-style": [
"error",
"unix"
],
"quotes": [
"error",
"double"
],
"semi": [
"error",
"always"
],
"no-unused-vars": [
"error", {
"vars": "all",
"args": "after-used",
"ignoreRestSiblings": false
}
],
"eqeqeq": ["error"],
"no-redeclare": ["error"],
"no-empty": ["error"],
"vars-on-top": ["error"],
"no-eq-null": ["error"],
"no-extra-boolean-cast": ["error"],
"no-label-var": ["error"],
"no-undefined": ["error"],
"no-use-before-define": ["error"],
"no-mixed-requires": ["error"],
"camelcase": ["error"],
"no-mixed-spaces-and-tabs": ["error"],
"no-multi-assign": ["error"],
"no-const-assign": ["error"],
"no-var": ["error"],
"prefer-const": ["error"],
"operator-linebreak": ["error", "before"],
"no-console": ["error"],
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
"jsx-props-no-empty-lines/no-empty-lines": "error",
"jsx-quotes": ["error", "prefer-double"],
"react/jsx-pascal-case": "error",
"react/prop-types": [0],
"react/jsx-closing-bracket-location": [0],
"react/jsx-closing-tag-location": [0],
"react/jsx-handler-names": [0],
"react/jsx-indent-props": [
"error",
2
]
}
}
Metadata
Metadata
Assignees
Labels
No labels