eslint-plugin-react icon indicating copy to clipboard operation
eslint-plugin-react copied to clipboard

[eslint] switch to `eslint.config.js`

Open mdjermanovic opened this issue 1 year ago • 5 comments

Updates linting for this repo to use ESLint flat config (eslint.config.js).

The goal is to test out flat config on popular ESLint plugins, please see https://github.com/eslint/eslint/issues/13481 Phase 3: Compatibility testing.

I've verified that:

  • eslint . lints the same 249 files as before + the new eslint.config.js file + .eslint-doc-generatorrc.js
  • Lint results of eslint . are the same as before (0 errors and the exact same 50 warnings).
  • Calculated configs for files (eslint --print-config) are the same as before except for structural differences between eslintrc and flat config formats, and one change I made for the import/no-extraneous-dependencies rule.

mdjermanovic avatar Jul 09 '23 11:07 mdjermanovic

I'm not sure if the failures on CI are related to these changes.

mdjermanovic avatar Jul 09 '23 11:07 mdjermanovic

I prefer .eslintrc as a format, and will stay with it until I’m absolutely forced not to. I’m happy to keep this PR open, though, to help eslint test.

There are indeed existing failures on master (i asked about them in the discord a month ago or so).

ljharb avatar Jul 09 '23 14:07 ljharb

I prefer .eslintrc as a format, and will stay with it until I’m absolutely forced not to. I’m happy to keep this PR open, though, to help eslint test.

You intend to make the entire react ecosystem work with the old format because of your own personal preference?

jviall avatar Aug 10 '23 16:08 jviall

@jviall no, that's not in any way what i said.

The linting config format this project uses does not affect anyone else at all, ever. This plugin will of course support being used in flat config, but that has literally nothing to do with this PR.

ljharb avatar Aug 11 '23 01:08 ljharb

eslintrc is no longer searched for

ebenali avatar Jan 16 '24 08:01 ebenali