DEV Community

Masato Ohba
Masato Ohba

Posted on

.eslintrc without file extension is deprecated

.eslintrc file format

As you may know, the ESLint officially encourages us to give an adequate file extension to .eslintrc.

ESLint supports configuration files in several formats:

  • JavaScript - use .eslintrc.js and export an object containing your configuration.
  • YAML - use .eslintrc.yaml or .eslintrc.yml to define the configuration structure.
  • JSON - use .eslintrc.json to define the configuration structure. ESLint's JSON files also allow JavaScript-style comments.
  • package.json - create an eslintConfig property in your package.json file and define your configuration there.
  • Deprecated - use .eslintrc, which can be either JSON or YAML.

https://eslint.org/docs/user-guide/configuring#configuration-file-formats

This deprecation started at https://github.com/eslint/eslint/pull/4406. Yes, almost 2.5 years ago.

Contribution chance

It's been quite some time since it got deprecated. However, I still see plenty of JavaScript projects using .eslintrc as a configuration file for ESLint even in some big projects.

In other words, there are plenty of chances to contribute toward OSS. I started sending a patch for that to some projects.

Bonus

Do you feel it too nitpicky? I initially felt so when sending a pull request, but the following words from a Gatsby.js maintainer encourage me to make this world better. 🙃

A 1000 nitpicky fixes add up to an amazing project so thanks :-)

Top comments (0)