DEV Community

Masato Ohba
Masato Ohba

Posted on

13 4

.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 :-)

Sentry image

See why 4M developers consider Sentry, β€œnot bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

πŸ‘‹ Kindness is contagious

Please leave a ❀️ or a friendly comment on this post if you found it helpful!

Okay