Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Package summary
Share
0
issues
0
licenses
Package created
15 Jan 2016
Version published
5 Feb 2024
Maintainers
1
Total deps
0
Direct deps
0
License
MIT
Generating a report...
Hold on while we generate a fresh audit report for this package.

Frequently Asked Questions

What does lint-staged do?

Lint-staged is a JavaScript module designed to enhance code quality by running linters on staged Git files. With lint-staged, you can ensure that your codebase remains clean and maintainable by preventing unwanted or non-standard code from making it into your repository.

How do you use lint-staged?

To start using lint-staged, first install the package using the following command in your terminal:

npm install --save-dev lint-staged

Once installed, you need to setup a pre-commit hook to run lint-staged. A popular choice for this setup is Husky. Install some linters, like ESLint or Prettier, then configure lint-staged to run those linters and other tasks on specific file types.

Here's an example setup in your package.json:

{
  "lint-staged": {
    "*.js": "eslint",
    "*.{json,md}": "prettier --write"
  }
}

After this setup, when you try to commit your changes, lint-staged will run the assigned tasks on the staged files. If all tasks pass, the changes are successfully committed. If any task fails, the commit is aborted.

Where are the lint-staged docs?

The best place to find the lint-staged documentation is on the project's GitHub repository at https://github.com/okonet/lint-staged. The readme file on the repository's main page contains detailed instructions and examples for different use cases. This document is the go-to reference for understanding the initial setup, configuration options and supported commands, usage examples, and resolving common issues.