Run linters against staged git files and don't let anything slip into your code base! Linting makes more sense when run before committing your code. By doing so you can ensure no errors go into the repository and enforce code style. But running a lint process on a whole project is slow, and linting results can be irrelevant. Ultimately you only want to lint files that will be committed. This project contains a script that will run arbitrary shell tasks with a list of staged files as an argument, filtered by a specified glob pattern. Linter commands work on a subset of all staged files, defined by a glob pattern. lint-staged uses micromatch for matching files. The concept of lint-staged is to run configured linter tasks (or other tasks) on files that are staged in git. lint-staged will always pass a list of all staged files to the task, and ignoring any files should be configured in the task itself.

Features

  • Resolve the git root automatically, no configuration needed
  • Pick the staged files which are present inside the project directory
  • Filter them using the specified glob patterns
  • Pass absolute paths to the linters as arguments
  • Supported are any executables installed locally or globally via npm as well as any executable from your $PATH
  • You can run multiple commands in a sequence on every glob

Project Samples

Project Activity

See All Activity >

Categories

Git, Linters

License

MIT License

Follow lint-staged

lint-staged Web Site

You Might Also Like
SKUDONET Open Source Load Balancer Icon
SKUDONET Open Source Load Balancer

Take advantage of Open Source Load Balancer to elevate your business security and IT infrastructure with a custom ADC Solution.

SKUDONET ADC, operates at the application layer, efficiently distributing network load and application load across multiple servers. This not only enhances the performance of your application but also ensures that your web servers can handle more traffic seamlessly.
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of lint-staged!

Additional Project Details

Programming Language

JavaScript

Related Categories

JavaScript Git Software, JavaScript Linters

Registered

2021-07-08