Reactjs jsx上的eslint压痕
我正在尝试制作简单的组件。但是,当我单击Reactjs jsx上的eslint压痕,reactjs,eslint,eslintrc,Reactjs,Eslint,Eslintrc,我正在尝试制作简单的组件。但是,当我单击ctrl+s时,它会执行以下操作: 警告和错误如下: [eslint]预期结束标记与开始缩进匹配。 (react/jsx结束标记位置)[eslint]预期缩进4 空格字符,但找到2个。(react/jsx缩进) 我的.eslintrc: { "extends": "airbnb", "parserOptions": { "ecmaFeatures": { "jsx": true, "experimentalObje
ctrl+s
时,它会执行以下操作:
警告和错误如下:
[eslint]预期结束标记与开始缩进匹配。
(react/jsx结束标记位置)[eslint]预期缩进4
空格字符,但找到2个。(react/jsx缩进)
我的.eslintrc
:
{
"extends": "airbnb",
"parserOptions": {
"ecmaFeatures": {
"jsx": true,
"experimentalObjectRestSpread": true
}
},
"rules": {
"max-len": ["warn", 120],
"indent": ["warn", 2],
"react/jsx-indent": ["warn", 4],
"react/forbid-prop-types": 0,
"semi": [2, "never"],
"no-underscore-dangle": 0,
"no-console": 0,
"linebreak-style": 0,
"comma-dangle": [2, {
"arrays": "never",
"objects": "always",
"imports": "never",
"exports": "never",
"functions": "ignore"
}]
},
"globals": {
"localStorage": true
},
"env": {
"browser": true,
"node": true
}
}
怎么了?在gif中,永远不会以相同的缩进关闭。这应该做到:
const App = () => (
<button>
<span>asd</span>
</button>
)
const-App=()=>(
自闭症
)
在你的gif中,你有
const App = () => (
<button>
<span>asd</span>
</button>
)
const-App=()=>(
自闭症
)
或
const-App=()=>(
自闭症
)
const App = () => (
<button>
<span>asd</span>
</button>
)