-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Indentation rule conflict with prettier #372
Comments
Prettier recommends disabling all formatting rules, which you can do by installing |
Hi, @j-f1 I just changed my config to be: module.exports = {
parser: '@typescript-eslint/parser',
extends: [
'plugin:@typescript-eslint/recommended',
'prettier/@typescript-eslint',
'plugin:prettier/recommended',
'plugin:react/recommended',
'plugin:jsx-a11y/recommended'
],
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
ecmaFeatures: {
jsx: true
}
},
plugins: ['@typescript-eslint', 'react', 'jsx-a11y'],
settings: {
react: {
version: 'detect'
}
},
rules: {
'@typescript-eslint/indent': ['error', 2]
}
}; But I am still getting the same error. Please help. |
You also need to remove the |
Ok, so how do I set my lint config to allow indentation levels to be 2 instead of the default 4. |
Prettier should cover that for you. |
That's what I had tried originally, by removing {
"singleQuote": true,
"bracketSpacing": false
} |
Any suggestions? @j-f1 |
This should be working: module.exports = {
parser: '@typescript-eslint/parser',
extends: [
'plugin:@typescript-eslint/recommended',
'prettier/@typescript-eslint',
'plugin:prettier/recommended',
'plugin:react/recommended',
'plugin:jsx-a11y/recommended'
],
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
ecmaFeatures: {
jsx: true
}
},
plugins: ['@typescript-eslint', 'react', 'jsx-a11y'],
settings: {
react: {
version: 'detect'
}
}
}; |
Thanks a lot! It works now. 🙂 |
Im sorry i need to reopen this issue because i got same issue while use Dependency Injection in method parameter. Can you help me to solve this issue?
|
I'm not sure you understand why this was closed. If you think this is another issue, please open a new issue. Also - please do not comment on old, closed issues. ESP ones that are 6 months old. |
Repro
Config
Expected Result
No indentation error
Actual Result
When prettier is followed:
When eslint is followed:
Additional Info
Versions
@typescript-eslint/eslint-plugin
1.5.0
@typescript-eslint/parser
1.5.0
TypeScript
3.3.4000
ESLint
5.15.3
node
10.15.2
npm
6.9.0
The text was updated successfully, but these errors were encountered: