-
-
Notifications
You must be signed in to change notification settings - Fork 452
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
Prettier compatibility for JS/TS (eslint-config-prettier
)
#615
Comments
An alternative solution is to find and disable all conflicting rules. In my case, for now, it's: export default antfu({
rules: {
'style/arrow-parens': 'off',
'style/object-curly-spacing': 'off',
'style/brace-style': 'off',
'style/indent': 'off',
'style/operator-linebreak': 'off',
'style/quote-props': 'off',
'svelte/indent': 'off',
},
}); Which is not terrible, but also it's likely that new contributors will find more issues and won't know how to deal with them. |
Maybe you can use https://www.npmjs.com/package/eslint-flat-config-utils (the one this config also uses) with |
After: I think I will be able to use this: import antfu from '@antfu/eslint-config'
import prettier from 'eslint-config-prettier'
import { composer } from 'eslint-flat-config-utils'
export default antfu().overrideRules(composer(prettier)).renamePlugins({
'@typescript-eslint': 'ts',
'@stylistic': 'style',
}); I wonder if import antfu from '@antfu/eslint-config'
import prettier from 'eslint-config-prettier'
export default antfu().overrideRules(prettier); This would be very reasonable, short of including |
I think it should be doing that already - if not I'd consider it a bug |
This comment was marked as off-topic.
This comment was marked as off-topic.
It seems that you're right. Let's wait for this PR to be merged: and then this issue can be fixed by just documenting it in the readme, e.g. ## Prettier
If you're using prettier outside eslint, you can disable the config via etc:
```js
import antfu from '@antfu/eslint-config'
import prettierConflicts from 'eslint-config-prettier'
export default antfu({
rules: {
'some-rule': 'off'
}
}, prettierConflicts);
``` I found a small exception:
It conflicts with prettier, but it's not part of |
Clear and concise description of the problem
I'd like to use Prettier (externally) and this config for everything else. The suggestion is generally to use either
stylistic
or prettier, but not both. The problem is thatstylistic
has extra linting rules that Prettier doesn't concern itself with.We have eslint-config-prettier for this purpose but I don’t think it works when plugins are renamed.
Suggested solution
Alternative
I think the alternative is
with the drawbacks:
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: