question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Run Lint from the command line?

See original GitHub issue

It would be great to be able to type eslint into bash and have it run ESLint just like it was building. As it is, it can’t find the config file unless I eject. Is ejection really necessary here?

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:123
  • Comments:56 (8 by maintainers)

github_iconTop GitHub Comments

100reactions
SleepWalkercommented, Apr 23, 2019

scripts

simply add in scripts section in your package.json

"lint": "eslint src"

if you are using typescript, then:

"lint": "eslint --ext js,ts,tsx src"

run

then to run use:

$ yarn lint

or

$ npm run lint

config

and, of course, don’t forget to add .eslintrc.json into your project’s root (this is from official cra docs and this should be already done because you have read the docs, aren’t you?):

{
  "extends": "react-app"
}
73reactions
danielsterncommented, Dec 10, 2016

We are running it in coordination with Husky(https://github.com/typicode/husky) to run ESLint in our pre-push. We’re hoping for something like

  "scripts": {
    "prepush": "set CI=true&&npm test&&eslint",
  }
Read more comments on GitHub >

github_iconTop Results From Across the Web

Command Line Interface - ESLint - Pluggable JavaScript Linter
The ESLint Command Line Interface (CLI) lets you execute linting from the terminal. The CLI has a variety of options that you can...
Read more >
Improve your code with lint checks - Android Developers
Run lint from the command line · On Windows: gradlew lint · On Linux or Mac: ./gradlew lint.
Read more >
How to run eslint --fix from npm script - Stack Overflow
To run the newly added script to auto-fix the linting issues on the command line you should run the command like as below:...
Read more >
lint Command - IBM
To check a C program for errors, enter: lint command. · To suppress some of the messages, enter: lint -v -x program. ·...
Read more >
4.3 lint Command-Line Options - Oracle Solaris Studio 12.3
lint recognizes many cc command-line options, including -A, -D, -E, -g, -H, -O, -P, -U, -Xa, -Xc, -Xs, -Xt, and -Y, although -g...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found