I'm relearning eslint and am doing a test config for in create react app and also including prettier for formatting. The error states Failed to compile: 'Expected an assignment or function call and instead saw an expression no-unused-expressions'. I went to the eslint docs https://eslint.org/docs/rules/no-unused-expressions and added the 'allows' to the rules section. How do I fix this and is this maybe a prettier formatting conflict with eslint?
The error points to the line where the list item starts.
<div>
<ul>
{this.state.list.map((item, index) => {
<li key={index}>
{item}
<button
type="button"
onClick={() => {
this.onRemoveItem(index);
}}>
Remove
</button>
</li>;
})}
</ul>
</div>
Here is my .eslintrc.json
{
"extends": ["prettier", "prettier/react"],
"plugins": ["react", "jsx-a11y", "import", "prettier"],
"rules": {
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }],
"prettier/prettier": "error",
"arrow-body-style": ["warn", "always"],
"allowShortCircuit": true,
"allowTernary": true
},
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true,
"modules": true
}
},
"env": {
"browser": true,
"node": true,
"es6": true,
"node": true
}
}