Skip to content

Commit 6b7eba6

Browse files
committed
chore: Configure ESLint and Git Pre commit hook
- configure eslint and prettier format Delivers #187419115
1 parent f5639c0 commit 6b7eba6

17 files changed

+4218
-632
lines changed

.eslintrc.cjs

+55-2
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,71 @@
11
module.exports = {
22
root: true,
3-
env: { browser: true, es2020: true },
3+
env: {
4+
browser: true,
5+
es2020: true,
6+
node: true,
7+
},
48
extends: [
5-
"eslint:recommended",
9+
"airbnb",
10+
"airbnb-typescript",
11+
"airbnb/hooks",
612
"plugin:@typescript-eslint/recommended",
713
"plugin:react-hooks/recommended",
814
],
915
ignorePatterns: ["dist", ".eslintrc.cjs"],
1016
parser: "@typescript-eslint/parser",
17+
parserOptions: {
18+
project: './tsconfig.eslint.json',
19+
},
1120
plugins: ["react-refresh"],
1221
rules: {
22+
"react/react-in-jsx-scope": "off",
23+
"react/function-component-definition": [
24+
"warn",
25+
{
26+
namedComponents: "arrow-function",
27+
unnamedComponents: "arrow-function",
28+
},
29+
],
30+
"no-undef": "off",
1331
"react-refresh/only-export-components": [
1432
"warn",
1533
{ allowConstantExport: true },
1634
],
35+
"@typescript-eslint/quotes": ["off"],
36+
"arrow-body-style": ["warn", "as-needed"],
37+
"import/order": [
38+
"warn",
39+
{
40+
groups: [
41+
"builtin",
42+
"external",
43+
"internal",
44+
"parent",
45+
"sibling",
46+
"index",
47+
],
48+
"newlines-between": "always",
49+
},
50+
],
51+
"@typescript-eslint/comma-dangle": ["warn", "always-multiline"],
52+
"import/no-extraneous-dependencies": [
53+
"error",
54+
{
55+
devDependencies: [
56+
"vite.config.ts",
57+
"postcss.config.js",
58+
"tailwind.config.js",
59+
],
60+
},
61+
],
62+
"import/extensions": ["off"],
63+
},
64+
settings: {
65+
"import/resolver": {
66+
node: {
67+
extensions: [".js", ".jsx", ".ts", ".tsx"],
68+
},
69+
},
1770
},
1871
};

.husky/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
_

.husky/pre-commit

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npm run lint

.prettierrc.cjs

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
trailingComma: "es5",
3+
tabWidth: 2,
4+
semi: true,
5+
singleQuote: true,
6+
};

0 commit comments

Comments
 (0)