sudipt dabral
sudipt dabral

Reputation: 1485

Eslint configure for react

I am using eslint in a react project, I have .jsx, .js, .test.jsx, .test.js files, I want to configure my eslintrc.json file to such that, ,it check .js and .jsx files as well as ignore .test.jsx and .test.jsx file, how may I do that ? Thanks for the help.

Upvotes: 0

Views: 309

Answers (1)

keikai
keikai

Reputation: 15186

You can set a .eslintignore file, to ignore certain folders and files.

Refer document: ignoring-files-and-directories

You can tell ESLint to ignore specific files and directories by creating an .eslintignore file in your project's root directory.
The .eslintignore file is a plain text file where each line is a glob pattern indicating which paths should be omitted from linting.


For example:

src/serviceWorker.ts
src/react-app-env.d.ts

Upvotes: 1

Related Questions