score:131
eslint "**/*.js"
to run on all js files in all the folders recursively (in the current folder)
You can also do: AnyFolder/**/*.js
And to ignore a folder: eslint "**/*.js" --ignore-pattern node_modules/
Know more at eslint/command-line-interface
score:3
I'm not sure if the accepted answer is outdated, but by looking at the docs,
By default, it uses .js as the only file extension.
Also, according to a member's comment on the project's Github, using .
equals running in all subdirectories. It seems to me that running eslint .
should suffice (though it doesn't cover the new ES Module .mjs
files).
score:3
To add to TranBrian10's solution, I installed eslint locally, so calling eslint
in the terminal results in a command not found
error.
I was able to get around this by using npx eslint
instead:
`eslint . --ext .js` -> `npx eslint . --ext .js`
And as GollyJer noted, this won't work for Windows due to the .
syntax
score:57
eslint . --ext .js
to lint files with the .js extension.
The .
targets files in the current directory and all subdirectories.
To include other file extensions,
eslint . --ext .js,.jsx
or eslint . --ext .js --ext .jsx
.
The eslint documentation covers this option.
Source: stackoverflow.com
Related Query
- How to configure package.json to run eslint script
- How do you configure babel to run with different configurations in different environments
- How to configure atom-beautify package to format with babel/jsx javascript files?
- How to run useEffect once even if there're dependencies? And why ESLint is complaining about it?
- How do I configure webpack to run bootstrap and sass?
- How do I configure eslint rules to ignore react-hooks/exhaustive-deps globally?
- How to configure Storybook to run from a directory other than the project root
- How to run eslint in create react app
- Error while npm run build? eslint package error
- How can I configure my prod env vars when I run my build process?
- How to configure NGINX to serve a JSON API and a React.js on the same box
- How to add async attribute to script generated by react scripts (at the npm run build stage on the create-react-app template)
- Webpack Babel script added to my index.html file needs to be src="/main.js" but is src="main.js". How can I configure this correctly?
- How to package React front end with Spring Boot and run the executable jar?
- how to run Json server along with ReactJS on same port
- How do I configure parcel to exit build with an error if eslint does not validate
- How should I migrate an existing Leaflet script to upload kml files to run in React-Leaflet
- How to run fake json backend from terminal
- how to configure styled jsx in Eslint
- How to configure ASP.NET Core 3.1 application to run ReactJS and MVC website side by side
- How do I correctly configure eslint to lint JSX files in SublimeText3
- How to run external script using an Electron-React app
- How to build and run a reactjs application in Jenkins using batch script
- How to use env variables in package json or the other way around
- how to fix eslint error for custom script tag
- How to run script in react
- How to run eslint rules on just typescript files?
- how to run multiple watch script in docker
- how to run python script in ruby on rails from a react frontend
- React - How to run a node_modules package at compile/build time instead of run time?
More Query from same tag
- Replacing an object in an object array in Redux Store using Javascript/Lodash
- Is there a way to take a code which is defined inside render , out from render function in React?
- React Contextprovider force update Video Element to play Video
- Gatsby XSS Prevention
- Controlling React component props from DOM
- tslint says calls to console.log are not allowed - How do I allow this?
- How to add styles to all infinite scroll rendering items?
- How to redirect in NextJs
- React Import Icons / Images in bulk
- Working with react input field says synthetic even when i try and save, and setting value instead of defaultValue is rendering [Object, object]
- React: Return Statement
- How to sync data to AWS DynamoDB using Amplify DataStore?
- react redux action not calling reducer
- FlowRouter - Inserting content to HTML template
- Ionic Slide React Content Is All On One Line
- React error when using audio.play() function
- Filter empty arrays from object of arrays in JS
- When is the promise executed for suspense in React?
- Where I can change the profile picture in the react-admin header?
- Javascript Syntax - Arrow function for class
- How can I use react-query in a React class component?
- Why I have a loop in my react application?
- cannot access value passed from context api in firestore fetch data function
- How to toggle class to each li element in React.js?
- Why are my props not being passed into my component when mount rendering?
- Can't delete multiple images inside React Firebase Promises
- Unable to Mock in Jest
- Should I use ref or findDOMNode to get react root dom node of an element?
- Component state in ReactJS
- How to create key for nested submenu?