New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@ggascoigne/lint-staged-config

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ggascoigne/lint-staged-config

A shareable lint-staged configuration for projects.

  • 1.5.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Lint-Staged Config

My personal shareable lint-staged configuration.

Install

pnpm add -D lint-staged @ggascoigne/lint-staged-config

Usage

lint-staged.config.js

module.exports = require('@ggascoigne/lint-staged-config');

YML

module.exports = require('@ggascoigne/lint-staged-config/yml');

Extending

An example that includes checking for credentials, ignoring prettier on unknown extensions, yml linting, and executing tests and coverage output related to files that have been changed in the current commit only.

lint-staged.config.js

const config = require('@ggascoigne/lint-staged-config');
const ymlConfig = require('@ggascoigne/lint-staged-config/yml');

module.exports = {
  '*': ['secretlint'],
  '!(*.{md,js,jsx,ts,tsx,json,css,scss,yml,yaml})': [
    'prettier --cache --write --ignore-unknown',
  ],
  ...ymlConfig,
  ...config,
  '*.{js,jsx,ts,tsx}': [
    'pnpm test --bail --passWithNoTests --findRelatedTests --coverage',
  ],
};

Add a Husky Hook

Install husky:

pnpm add -D husky && npm set-script prepare "husky install" && pnpm prepare

Add the hook:

npx husky add .husky/pre-commit 'npx --no-install lint-staged'

License

MIT

Keywords

FAQs

Package last updated on 14 Nov 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc