eslint / create-config

Utility to create ESLint config files
MIT License
76 stars 19 forks source link

fix: enable linting `.jsx` files when React is selected #126

Closed mdjermanovic closed 5 months ago

mdjermanovic commented 5 months ago

I saw this problem mentioned several times in issues/discussions:

$ npx @eslint/create-config
√ How would you like to use ESLint? · problems    
√ What type of modules does your project use? · esm
√ Which framework does your project use? · react
√ The React plugin doesn't officially support ESLint v9 yet. What would you like to do? · 9.x
√ Does your project use TypeScript? · javascript
√ Where does your code run? · browser
The config that you've selected requires the following dependencies:

eslint@9.x, globals, @eslint/js, eslint-plugin-react, @eslint/compat
√ Would you like to install them now? · No / Yes
√ Which package manager do you want to use? · npm
☕️Installing...

...

Successfully created C:\projects\tmp\tmp\eslint.config.mjs file.

$ npx eslint a.jsx

C:\projects\tmp\tmp\a.jsx
  0:0  warning  File ignored because of a matching ignore pattern. Use "--no-ignore" to disable file ignore settings or use "--no-warn-ignored" to suppress this warning

✖ 1 problem (0 errors, 1 warning)

This PR adds a config for **/*.jsx files when React is selected so that they become lintable right away with the created config file.