Skip to content

Python script to run your linter for your only changed javascript, typescript and ruby files.

License

Notifications You must be signed in to change notification settings

akashanand708/Python-Script

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Lint your js/ts/rb files using Python script

Python script to run your linter for your only changed javascript, typescript and ruby files.

Note: Anyone can modify this file to use it for own purpose.

Problem statement:

Traditional way of linting our changed 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.

Steps to use

  1. Make sure we have python installed.
  2. Go to the root of the project.
  3. Add all the untracked files into git, which you want to commit.
  4. nvm use <node version> (if you are using nvm to switch to your node versions for your project or skip this)
  5. python3 BE_FE_Linter.py or python BE_FE_Linter.py

Gif

Alt Text

License

MIT

Free script, Hell Yeah!

About

Python script to run your linter for your only changed javascript, typescript and ruby files.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages