有谁知道如何解决这个掉毛问题?它声称我没有使用 TasksComponent。谢谢!
'TasksComponent' 被分配了一个值,但从未使用过。(没有未使用的变量)
describe('root tests', () => {
it('renders without crashing', () => {
const TasksComponent = TasksWithData(Tasks);
const root = document.createElement('root');
ReactDOM.render(<TasksComponent {...taskconfig} />, root);
ReactDOM.unmountComponentAtNode(root);
});
});
这是我的 .eslintrc 文件:
module.exports = {
"env": {
"browser": true,
"es6": true,
"jest": true
},
"extends": "eslint:recommended",
"parserOptions": {
"ecmaFeatures": {
"experimentalObjectRestSpread": true,
"jsx": true
},
"sourceType": "module"
},
"plugins": [
"react"
],
"rules": {
"indent": [
"error",
4
],
"quotes": [
"warn",
"single"
],
"semi": [
"error",
"always"
]
}
};