@chenyueban/lint

    0.2.13 • Public • Published

    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.js/.prettierrc.js/lint-staged.config.js/.husky/commitlint.config.js for you (if there's no such file before)

    2. You can customize the rules

    in .eslintrc.js

    module.exports = {
      extends: [require.resolve('@chenyueban/lint/src/eslint')],
    
      rules: {
        // your rules
      },
    }

    in .prettierrc.js

    const config = require('@chenyueban/lint')
    
    module.exports = {
      ...config.prettier,
    }

    in lint-staged.config.js

    module.exports = {
      '*.{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/*

    Install

    npm i @chenyueban/lint

    DownloadsWeekly Downloads

    68

    Version

    0.2.13

    License

    MIT

    Unpacked Size

    19.4 kB

    Total Files

    22

    Last publish

    Collaborators

    • avatar