Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is the config file .eslintrc deprecated in favor of .eslintrc.* files?

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.

like image 803
Helge Drews Avatar asked Sep 10 '25 19:09

Helge Drews


1 Answers

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

like image 193
Nick McCurdy Avatar answered Sep 12 '25 10:09

Nick McCurdy