Skip to content

Commit b92af02

Browse files
authored
Merge pull request #192 from panntod/development
Eslint rule and Refactor format file
2 parents d77faf7 + 35ff325 commit b92af02

File tree

120 files changed

+1339
-491
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+1339
-491
lines changed

.eslintrc.json

Lines changed: 135 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,143 @@
11
{
2-
"extends": ["next", "next/core-web-vitals", "eslint:recommended"],
2+
"root": true,
3+
"env": {
4+
"browser": true,
5+
"es2021": true,
6+
"node": true
7+
},
38
"globals": {
49
"React": "readonly"
510
},
11+
"parser": "@typescript-eslint/parser",
12+
"parserOptions": {
13+
"ecmaVersion": "latest",
14+
"sourceType": "module"
15+
},
16+
"plugins": [
17+
"react",
18+
"jsx-a11y",
19+
"@typescript-eslint",
20+
"import",
21+
"react-hooks",
22+
"prettier"
23+
],
24+
"extends": [
25+
"eslint:recommended",
26+
"plugin:react/recommended",
27+
"plugin:@typescript-eslint/recommended",
28+
"plugin:jsx-a11y/recommended",
29+
"plugin:import/errors",
30+
"plugin:import/warnings",
31+
"plugin:import/typescript",
32+
"plugin:react-hooks/recommended",
33+
"next",
34+
"next/core-web-vitals",
35+
"plugin:prettier/recommended"
36+
],
37+
"settings": {
38+
"react": {
39+
"version": "detect"
40+
},
41+
"import/resolver": {
42+
"node": {
43+
"extensions": [".ts", ".tsx"]
44+
}
45+
}
46+
},
47+
"overrides": [
48+
{
49+
"files": [
50+
"./src/pages/**/*.{js,ts,jsx,tsx,mdx}",
51+
"./src/_components/**/*.{js,ts,jsx,tsx,mdx}",
52+
"./src/app/**/*.{js,ts,jsx,tsx,mdx}"
53+
],
54+
"rules": {
55+
"import/order": [
56+
"error",
57+
{
58+
"groups": [
59+
"builtin",
60+
"external",
61+
"internal",
62+
["parent", "sibling"],
63+
"index",
64+
"object",
65+
"type"
66+
],
67+
"pathGroups": [
68+
{
69+
"pattern": "./**/**\\.css",
70+
"group": "type",
71+
"position": "after"
72+
}
73+
],
74+
"pathGroupsExcludedImportTypes": ["builtin"],
75+
"alphabetize": {
76+
"order": "asc",
77+
"caseInsensitive": true
78+
},
79+
"newlines-between": "always",
80+
"warnOnUnassignedImports": true
81+
}
82+
]
83+
}
84+
}
85+
],
686
"rules": {
87+
"prettier/prettier": "error",
88+
"react/react-in-jsx-scope": "off",
89+
"import/order": [
90+
"error",
91+
{
92+
"groups": [
93+
"builtin",
94+
"external",
95+
"internal",
96+
"parent",
97+
"sibling",
98+
"index",
99+
"object",
100+
"type"
101+
],
102+
"newlines-between": "always",
103+
"alphabetize": {
104+
"order": "asc",
105+
"caseInsensitive": true
106+
}
107+
}
108+
],
109+
"jsx-a11y/anchor-is-valid": [
110+
"error",
111+
{
112+
"aspects": ["invalidHref", "preferButton"]
113+
}
114+
],
115+
"@typescript-eslint/explicit-function-return-type": [
116+
"off",
117+
{
118+
"allowExpressions": true,
119+
"allowTypedFunctionExpressions": true
120+
}
121+
],
122+
"@typescript-eslint/no-explicit-any": "warn",
123+
"@typescript-eslint/no-unused-vars": [
124+
"warn",
125+
{
126+
"argsIgnorePattern": "^_"
127+
}
128+
],
129+
"jsx-a11y/click-events-have-key-events": "off",
130+
"jsx-a11y/no-noninteractive-element-interactions": "off",
131+
"jsx-a11y/no-static-element-interactions": "off",
7132
"no-unused-vars": "off",
8-
"no-unused-expressions": "warn"
133+
"no-unused-expressions": "warn",
134+
"quotes": [
135+
"error",
136+
"double",
137+
{
138+
"avoidEscape": true
139+
}
140+
],
141+
"comma-dangle": ["error", "always-multiline"]
9142
}
10143
}

.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 && npm run prettier
4+
npm run lint:fix && npm run prettier

.prettierignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.next
22
node_modules
3-
package.json
3+
package.json
4+
package-lock.json

.prettierrc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
{
22
"tabWidth": 2,
33
"semi": true,
4-
"singleQuote": false
4+
"singleQuote": false,
5+
"trailingComma": "all",
6+
"printWidth": 80,
7+
"endOfLine": "lf"
58
}

.vscode/extensions.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"recommendations": [
3+
"editorconfig.editorconfig",
4+
"dbaeumer.vscode-eslint",
5+
"esbenp.prettier-vscode"
6+
]
7+
}

.vscode/settings.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"editor.defaultFormatter": "esbenp.prettier-vscode",
3+
"editor.formatOnSave": true,
4+
"editor.codeActionsOnSave": {
5+
"source.fixAll.eslint": "always"
6+
},
7+
"css.validate": false,
8+
"scss.validate": false
9+
}

0 commit comments

Comments
 (0)