Skip to content

Commit

Permalink
fix: eslint prettier 관련 에러 수정 (20)
Browse files Browse the repository at this point in the history
- eslint.config.js를 eslintrc.cjs로 변경
- eslinttc.cjs안에 import-order 설정 추가
- .prettierc를 수정해 LF개행 문자 설정
- import order 설정
- package.json에 npm run type-check 명령어 추가
- git commit 시 자동으로 타입검사 실행
  • Loading branch information
nakyeonko3 committed Aug 25, 2024
1 parent a112214 commit 011d2d8
Show file tree
Hide file tree
Showing 17 changed files with 767 additions and 178 deletions.
55 changes: 55 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
module.exports = {
env: {
browser: true,
es2021: true,
node: true,
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
'plugin:prettier/recommended',
'plugin:import/recommended',
'plugin:import/typescript',
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 12,
sourceType: 'module',
},
plugins: ['react', '@typescript-eslint', 'react-hooks', 'import', 'prettier'],
rules: {
'react/react-in-jsx-scope': 'off',
'import/order': [
'error',
{
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'],
'newlines-between': 'always',
alphabetize: { order: 'asc', caseInsensitive: true },
},
],
'prettier/prettier': ['error', { endOfLine: 'auto' }],
},
ignorePatterns: ['node_modules/', 'build/', 'dist/', 'functions'],
settings: {
react: {
version: 'detect',
},
'import/resolver': {
typescript: {
project: './tsconfig.app.json',
},
node: {
extensions: ['.js', '.ts', '.tsx'],
paths: ['src'],
},
alias: {
map: [['@', './src']],
extensions: ['.ts', '.tsx', '.js', '.jsx', '.json'],
},
},
},
};
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ document/
.github/



functions/
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"bracketSpacing": true,
"arrowParens": "always",
"quoteProps": "as-needed",
"jsxSingleQuote": false,
"endOfLine": "lf",
"jsxSingleQuote": false,
"jsxBracketSameLine": false,
"requirePragma": false,
"insertPragma": false,
Expand Down
28 changes: 0 additions & 28 deletions eslint.config.js

This file was deleted.

3 changes: 2 additions & 1 deletion functions/tsconfig.dev.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"include": [
".eslintrc.js"
".eslintrc.js",
"src"
]
}
3 changes: 3 additions & 0 deletions lefthook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ pre-commit:
prettier:
glob: '*.{js,ts,jsx,tsx,json,yaml,md}'
run: npm run prettier {staged_files}
type-check:
glob: '*.{ts,tsx}'
run: npm run typecheck {staged_files}
# rubocop:
# tags: backend style
# glob: "*.rb"
Expand Down
Loading

0 comments on commit 011d2d8

Please sign in to comment.