Skip to content

Commit b2574c2

Browse files
committed
✨ Default-settings
eslint, prettier, husky 초기세팅
1 parent ad9ba01 commit b2574c2

8 files changed

+2336
-69
lines changed

.eslintrc.cjs

+40-8
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,50 @@
11
module.exports = {
2-
root: true,
3-
env: { browser: true, es2020: true },
2+
env: {
3+
browser: true,
4+
es2020: true,
5+
node: true,
6+
},
47
extends: [
58
'eslint:recommended',
69
'plugin:@typescript-eslint/recommended',
710
'plugin:react-hooks/recommended',
11+
'plugin:prettier/recommended',
12+
'plugin:import/typescript',
13+
'plugin:import/recommended',
814
],
9-
ignorePatterns: ['dist', '.eslintrc.cjs'],
1015
parser: '@typescript-eslint/parser',
11-
plugins: ['react-refresh'],
16+
parserOptions: {
17+
ecmaVersion: 'latest',
18+
sourceType: 'module',
19+
},
20+
plugins: ['react-refresh', 'prettier', 'import'],
21+
settings: {
22+
'import/resolver': {
23+
node: {},
24+
typescript: {
25+
directory: './src',
26+
},
27+
},
28+
'import/parsers': {
29+
'@typescript-eslint/parser': ['.ts', '.tsx'],
30+
},
31+
},
1232
rules: {
13-
'react-refresh/only-export-components': [
14-
'warn',
15-
{ allowConstantExport: true },
33+
'react-refresh/only-export-components': 'warn',
34+
'import/order': [
35+
'error',
36+
{
37+
groups: ['builtin', 'external', 'parent', 'sibling', 'index'],
38+
alphabetize: {
39+
order: 'asc',
40+
caseInsensitive: true,
41+
},
42+
'newlines-between': 'never',
43+
},
1644
],
45+
'import/no-unresolved': 'off',
46+
'import/export': 'off',
47+
'import/named': 0,
48+
'import/no-named-as-default': 0,
1749
},
18-
}
50+
};

.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-staged && npm run lint --fix

.prettierrc

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"singleQuote": true,
3+
"semi": true,
4+
"useTabs": false,
5+
"tabWidth": 2,
6+
"trailingComma": "all",
7+
"printWidth": 80,
8+
"bracketSpacing": true,
9+
"arrowParens": "always",
10+
"endOfLine": "auto"
11+
}

0 commit comments

Comments
 (0)