Lint only over changed files

The bigger your project gets, the longer time lint takes.

So the following task is quite useful since we basically want to run lint only over changed files.

# package.json
{
  "scripts": {
    "tslint": "git diff --name-only develop... | grep -E '\\.tsx?$' | xargs yarn tslint"
  }
}

I'm referring tslint here, but the same is true of eslint, stylelint, and etc.

Did you find this post useful? Show some love!
Ben Halpern DEV.TO FOUNDER

Hey there, we see you aren't signed in.

Please consider creating an account on dev.to. It literally takes a few seconds and we'd appreciate the support so much. ❤️

Classic DEV Post from Dec 22 '17

How we can make a difference as software engineers

As the holiday season rolls around again the idea of doing good in the world ...

READ POST
Follow @asopki to see more of their posts in your feed.