我正在尝试使用AirBnB设置eslint以接受制表符(设置为4个空格)。但是我在某些行而不是全部行上不断出现以下错误:
预期缩进2个空格字符,但发现0。
eslintrc.js
module.exports = {
"env": {
"browser": true,
"node": true
},
"parser": "babel-eslint",
"extends": "airbnb",
"plugins": [
"react",
"jsx-a11y",
"import"
],
"rules": {
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }],
"indent": [2, "tab"],
"no-tabs": "off"
}
};
App.js
import React, { Component } from 'react';
import s from './AppContainer.module.scss';
import Button from '../../Components/Button';
class AppContainer extends Component {
constructor(props) {
super(props);
this.state = {};
}
render() {
return (
<div className="App"> // this line gets the error
<h1 className={s.title}> // this line gets the error
Blank React App
</h1>
<Button /> // this line gets the error
</div>
);
}
}
导出默认的AppContainer;