Python script to run your linter for your only changed javascript, typescript and ruby files.
We add some script tag in package.json like
"lint:server": "eslint 'app/server/**/*.js' 'app/server/**/*.ts' 'app/server/**/*.tsx'"
and we run
yarn lint:server
from root of our project where package.json lies.
Suppose, we are working in a code base connected to github, when we modify many files and add new files to our code base, let's say 10 or 20 files. we want to run our linter
(yarn eslint or BE linter command )
only for changed files, not for all file. It will not be optimised way to use
yarn lint:server
every time though we have only small number of changed files.
- Make sure we have python installed.
- Go to the root of the project.
- Add all the untracked files into git, which you want to commit.
- nvm use <node version> (if you are using nvm to switch to your node versions for your project or skip this)
- python3 BE_FE_Linter.py or python BE_FE_Linter.py
MIT
Free script, Hell Yeah!