sf-food-trucks

Lint-staged Configuration

lint-staged

Installation

Use the package manager pnpm to install the lint-staged configuration and related packages in the root project.

pnpm add --save-dev --save-exact --workspace-root --workspace lint-staged-config
pnpm add --save-dev --save-exact --workspace-root lint-staged

Configuration

Create a lint-staged configuration file in ES module format. Import the configuration from lint-staged-config and export as default.

// Default to check in root project, but provide config to fix, too.
import baseConfig from 'lint-staged-config';
export default baseConfig;

Usage

Lint-staged is typically executed in the Git pre-commit hook to format and lint staged files, but the CLI tool can be used directly or in scripts.

pnpm lint-staged