'eslint does not automatically fix on --fix
I use eslint to lint, but it does not automatically fix although I use --fix
PS C:\Users\issac\IdeaProjects\discord-bot> eslint --fix --ext .ts src
Warning: React version was set to "detect" in eslint-plugin-react settings, but the "react" package is not installed. Assuming latest React version for linting.
C:\Users\issac\IdeaProjects\discord-bot\src\bot.ts
16:1 error Expected indentation of 4 spaces but found 2 indent
17:1 error Expected indentation of 8 spaces but found 4 indent
18:1 error Expected indentation of 12 spaces but found 6 indent
19:1 error Expected indentation of 16 spaces but found 8 indent
... all most errors indent
75:1 error Expected indentation of 12 spaces but found 6 indent
76:1 error Expected indentation of 12 spaces but found 6 indent
76:34 error Unexpected use of '<<' no-bitwise
77:1 error Expected indentation of 8 spaces but found 4 indent
✖ 862 problems (852 errors, 10 warnings)
790 errors and 0 warnings potentially fixable with the `--fix` option.
Although I run with --fix every time, those errors won't disappear. This is my .eslintrc.js
module.exports = {
root: true,
env: {
es2021: true,
node: true,
},
parser: '@typescript-eslint/parser',
plugins: [
'@typescript-eslint',
],
extends: [
'airbnb',
'airbnb-typescript'
],
parserOptions: {
ecmaVersion: 13,
project: './tsconfig.json',
sourceType: 'module',
},
rules: {
'max-len': [1, 150, 4],
'object-curly-spacing': [2, 'always'],
'require-jsdoc': [0],
'indent': [2, 4],
'linebreak-style': [0],
'keyword-spacing': [2],
},
overrides: [
{
"files": ["*.ts"],
rules: {
"@typescript-eslint/explicit-function-return-type": ["error"]
}
}
]
};
Is there any way to make eslint fix those all indents?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
