JSPM

  • Created
  • Published
  • Downloads 9
  • Score
    100M100P100Q49370F
  • License MIT

Lint Sharable Configurations and Rules

Package Exports

  • @chenyueban/lint
  • @chenyueban/lint/src/eslint

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@chenyueban/lint) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

lint

NPM Version NPM

USAGE

  1. Install @chenyueban/lint
npm install --save-dev @chenyueban/lint
# or
yarn add @chenyueban/lint -D
  1. It will automatically generate a .eslintrc.json/.prettierrc.json/.lintstagedrc.json/.husky/.commitlintrc.json for you (if there's no such file before)

  2. You can customize the rules

in .eslintrc.json

{
  "extends": "./node_modules/@chenyueban/lint/src/eslint.js",
  "rules": {}
}

in .lintstagedrc.json

{
  "*.{less,sass,scss,md,json,yml}": ["prettier --write", "git add"],
  "*.{js,jsx,html}": ["prettier --write", "eslint --fix", "git add"],
  "*.ts?(x)": [
    "prettier --parser=typescript --write",
    "eslint --fix",
    "git add"
  ]
}

Mac os may not execute lint, please execute the following command:

chmod ug+x .husky/*
chmod ug+x .git/hooks/*