Skip to content

Commit c843f33

Browse files
authored
Merge pull request #688 from OWASP/feat/add-eslint
feat: add eslint to pre-commit
2 parents 44e0e90 + 54c0e90 commit c843f33

File tree

8 files changed

+3943
-91
lines changed

8 files changed

+3943
-91
lines changed

.eslintrc.js

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
module.exports = {
2+
env: {
3+
browser: true,
4+
commonjs: true,
5+
es2021: true
6+
},
7+
extends: 'standard',
8+
overrides: [
9+
],
10+
parserOptions: {
11+
ecmaVersion: 'latest'
12+
},
13+
rules: {
14+
}
15+
}

.github/workflows/pre-commit.yml

+6
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ jobs:
2323
uses: actions/setup-python@v4
2424
with:
2525
python-version: "3.9"
26+
- uses: actions/setup-node@v3
27+
with:
28+
node-version: 18
29+
cache: "npm"
30+
- name: Install npm dependencies
31+
run: npm install
2632
- uses: actions/cache@v3
2733
name: Cache plugin dir
2834
with:

.pre-commit-config.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,9 @@ repos:
3232
hooks:
3333
- id: commitlint
3434
stages: [commit-msg]
35+
- repo: https://github.com/eslint/eslint
36+
rev: v8.35.0
37+
hooks:
38+
- id: eslint
39+
args:
40+
- "--fix"

commitlint.config.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// commitlint.config.js
22
module.exports = {
3-
extends: [
4-
"@commitlint/config-conventional", // scoped packages are not prefixed
5-
],
6-
};
3+
extends: [
4+
'@commitlint/config-conventional' // scoped packages are not prefixed
5+
]
6+
}

js/index.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
function secret() {
2-
var password = "jLJIQZM=" + 9 + "aG7l" + 6 + "LAQ=" + 2 + "UdiM" + 7;
3-
return password;
4-
}
1+
/* eslint-disable no-unused-vars */
2+
function secret () {
3+
const password = 'jLJIQZM=' + 9 + 'aG7l' + 6 + 'LAQ=' + 2 + 'UdiM' + 7
4+
return password
5+
}

0 commit comments

Comments
 (0)