Skip to content

Commit c994179

Browse files
committed
docs(README.md): Add validate eslint doc section
1 parent c406f10 commit c994179

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

README.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ This repository contains JOSA's custom pre-commit hooks.
55
## Available Hooks
66

77
- [Validate Flux](#validate-flux) - A script to validate Flux custom resources and Kustomize overlays.
8+
- [Validate Eslint](#validate-eslint) - A script to validate eslint rules on Javascript and Typescript files.
89

910
___
1011

@@ -41,3 +42,39 @@ pre-commit install -t pre-push
4142
```
4243

4344
___
45+
46+
## validate-eslint
47+
48+
This script runs eslint rule checks on staged files that have the following extensions:
49+
50+
- ts
51+
- tsx
52+
- vue
53+
- js
54+
- jsx
55+
56+
### Prerequisites
57+
58+
You need the following to be installed on your machine before running this pre-commit script.
59+
60+
- [ESLINT v8.11](https://www.npmjs.com/package/eslint)
61+
62+
### Usage
63+
64+
Add this to your .pre-commit-config.yaml:
65+
66+
```yaml
67+
- repo: https://github.com/jordanopensource/pre-commit-hooks
68+
rev: v0.1.0 # Use the ref you want to point at
69+
hooks:
70+
- id: validate-eslint
71+
# - id: ...
72+
```
73+
74+
After the configuration is added, you'll need to run
75+
76+
```bash
77+
pre-commit install -t pre-commit
78+
```
79+
80+
___

0 commit comments

Comments
 (0)