Skip to content

Commit 1daff3f

Browse files
committed
fix(ci): upgrade husky to latest stable version and migrate config (Closes #6892)
Signed-off-by: fatma-hashem <[email protected]>
1 parent 92d341b commit 1daff3f

File tree

7 files changed

+5939
-3918
lines changed

7 files changed

+5939
-3918
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ README.md
1717
package.json
1818
package-lock.json
1919
static/
20+
commitlint.config.js

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,4 +94,7 @@ default.profraw
9494
.gitpod.yml
9595

9696
# Temporary files
97-
spreadsheet.csv
97+
spreadsheet.csv
98+
99+
# Commitlint configuration (added to prevent ESLint parsing error)
100+
commitlint.config.js

.husky/commit-msg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npx commitlint --edit "$1"

.husky/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/sh
22
. "$(dirname "$0")/_/husky.sh"
33

4-
npm run lint
4+
npx lint-staged

commitlint.config.js

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
module.exports = {
2+
extends: ['@commitlint/config-conventional'],
3+
rules: {
4+
// These are common rules for open source projects
5+
'body-leading-blank': [1, 'always'],
6+
'body-max-line-length': [2, 'always', 100],
7+
'footer-leading-blank': [1, 'always'],
8+
'footer-max-line-length': [2, 'always', 100],
9+
'header-max-length': [2, 'always', 100],
10+
'scope-case': [2, 'always', 'lower-case'],
11+
'subject-case': [
12+
2,
13+
'never',
14+
['sentence-case', 'start-case', 'pascal-case', 'upper-case'],
15+
],
16+
'subject-empty': [2, 'never'],
17+
'subject-full-stop': [2, 'never', '.'],
18+
'type-case': [2, 'always', 'lower-case'],
19+
'type-empty': [2, 'never'],
20+
'type-enum': [
21+
2,
22+
'always',
23+
[
24+
'build',
25+
'chore',
26+
'ci',
27+
'docs',
28+
'feat',
29+
'fix',
30+
'perf',
31+
'refactor',
32+
'revert',
33+
'style',
34+
'test',
35+
'design',
36+
],
37+
],
38+
},
39+
};

0 commit comments

Comments
 (0)