I am updating some repos and would like to migrate from 5.x to 7.x eslint. But we use the file .eslintrc in all our repos. According to eslints's official configuration docs it seems to be deprecated, now. What format should we use instead?
I suppose .eslintrc.js
format would be the most flexible while .eslintrc.json
may be enough as long as we don't need any dynamic code? In the same configuration docs, the eslint team uses .eslintrc
all the time by theirselves and I see the .eslintrc
file a lot in other repos, too. So I am a little bit confused about how serious this deprecation really is, what is best practice, now, and what is most future proof.
Is the config file
.eslintrc
deprecated in favor of.eslintrc.*
files?
Yes, but it's still supported.
What format should we use instead?
.eslintrc.json
is the most similar to what you're used to, it's the same format but with an explicit JSON extension. If you'd like to avoid extra files, you can alternatively add your config to the eslintConfig
field of package.json
. If you need dynamic code, use .eslintrc.js
or .eslintrc.cjs
.
Configuration Guide
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With