Skip to content

Commit 67de9ef

Browse files
Merge pull request #13 from codeXsit/dev
Fixed commitlint
2 parents a8316e1 + ed9a79a commit 67de9ef

File tree

6 files changed

+57
-43
lines changed

6 files changed

+57
-43
lines changed

.eslintrc.cjs

Lines changed: 36 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,36 @@
1-
module.exports = {
2-
env: {
3-
browser: true,
4-
es2021: true,
5-
},
6-
extends: ["airbnb", "prettier"],
7-
plugins: ["prettier"],
8-
overrides: [
9-
{
10-
env: {
11-
node: true,
12-
},
13-
files: [".eslintrc.{js,cjs}"],
14-
parserOptions: {
15-
sourceType: "script",
16-
},
17-
},
18-
],
19-
parserOptions: {
20-
ecmaVersion: "latest",
21-
sourceType: "module",
22-
},
23-
rules: {
24-
quotes: ["error", "double", { avoidEscape: true }],
25-
"no-shadow": "off",
26-
"react/jsx-uses-react": ["off"],
27-
"react/react-in-jsx-scope": ["off"],
28-
"no-unused-vars": [
29-
"error",
30-
{ vars: "all", args: "after-used", ignoreRestSiblings: false },
31-
],
32-
"react/jsx-pascal-case": ["error", { allowAllCaps: true }],
33-
"no-console": "error",
34-
"import/no-extraneous-dependencies": ["error", { devDependencies: true }],
35-
"prettier/prettier": "off",
36-
},
37-
};
1+
module.exports = {
2+
env: {
3+
browser: true,
4+
es2021: true,
5+
},
6+
extends: ["airbnb", "prettier"],
7+
plugins: ["prettier"],
8+
overrides: [
9+
{
10+
env: {
11+
node: true,
12+
},
13+
files: [".eslintrc.{js,cjs}"],
14+
parserOptions: {
15+
sourceType: "script",
16+
},
17+
},
18+
],
19+
parserOptions: {
20+
ecmaVersion: "latest",
21+
sourceType: "module",
22+
},
23+
rules: {
24+
quotes: ["error", "double", { avoidEscape: true }],
25+
"no-shadow": "off",
26+
"react/jsx-uses-react": ["off"],
27+
"react/react-in-jsx-scope": ["off"],
28+
"no-unused-vars": [
29+
"error",
30+
{ vars: "all", args: "after-used", ignoreRestSiblings: false },
31+
],
32+
"react/jsx-pascal-case": ["error", { allowAllCaps: true }],
33+
"no-console": "error",
34+
"import/no-extraneous-dependencies": ["error", { devDependencies: true }],
35+
},
36+
};

.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
#!/usr/bin/env sh
22
. "$(dirname -- "$0")/_/husky.sh"
33

4-
npm run lint
4+
npm run lint && npm run style

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ This is the official website of CodeX Club, SIT.
1010
- Firebase
1111

1212
### Contributors
13-
Ankush Dutta
13+
14+
Ankush Dutta
15+
Miran Firdausi

package.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0",
1010
"preview": "vite preview",
1111
"lint:fix": "eslint --fix .",
12+
"style": "prettier --write {src,test}/**/* ./*.{json,*.json} !package-lock.json -u --no-error-on-unmatched-pattern",
1213
"prepare": "husky install"
1314
},
1415
"dependencies": {
@@ -42,7 +43,15 @@
4243
},
4344
"husky": {
4445
"hooks": {
45-
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
46+
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
47+
"pre-commit": "lint-staged"
4648
}
49+
},
50+
"lint-staged": {
51+
"**/*.{js,jsx,ts,tsx,html,css,json}": [
52+
"prettier --write",
53+
"eslint --fix src/",
54+
"git add"
55+
]
4756
}
4857
}

src/assets/styles/index.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
@import "tailwindcss/base";
2-
@import "tailwindcss/components";
3-
@import "tailwindcss/utilities";
1+
@import "tailwindcss/base";
2+
@import "tailwindcss/components";
3+
@import "tailwindcss/utilities";

0 commit comments

Comments
 (0)