1.3.1 • Published 5 years ago

pre-commit-lint v1.3.1

Weekly downloads
2
License
ISC
Repository
github
Last release
5 years ago

Using pre-commit-lint in your project

  1. Navigate to a git repo.
  2. Run the command pc-lint --init. This will create a pre-commit file in the .git/hooks directory of your repo.

Next time you commit any .js files, they will be run through a linter (by default this will be eslint). If any of the .js files raise linting errors, your changes will not be committed, and you will see the eslint output in your console.

Configuring pre-commit-lint

You can add an optional .pc-lint-config.json config file to the root of your repo. In this file you can configure the following options:

  • filesToIgnore: an array of string file paths to files that should not be linted.
  • linter: the string name of the linter you want to use. Currently, only eslint has been tested.

Here is an example .pc-lint-config.json with both these settings configured:

{
    "filesToIgnore": ["my-minified-file.js", "legacy-file-with-too-many-errors.js"],
    "linter": "eslint"
}

By default, no files will be ignored, and eslint will be used as the linter. Any setting specified in the pc-lint-config.json will override only the value for that setting, and defaults will be maintained for all settings not configured by the user.

1.3.1

5 years ago

1.3.0

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago