오늘 한 일
- 블로그 빌드 에러 해결
- GDSC OT 진행
블로그 빌드 에러 해결
next-blog를 빌드할 때마다 제대로 타입을 인식하지 못하고 있었다. 그래서 테스트 차원에서 Create Next App으로 빠르게 워크스페이스 만들고 빌드하려고 했다.
근데 CNA도 먹히지 않았다. 의존성 설치 도중에 gatsby 어쩌구의 라이브러리와 의존성 충돌이 난다고 하면서 설치가 진행되지 않았다..
그래서 그냥 기존에 gatsby로 만들었던 blog를 삭제했다. 그러니까 된다.. 뭐지..?
이참에 린트, 타입 세팅까지!
yarn berry 버전 업그레이드 하면서 린트, 타입 세팅도 다시 해줬다.
eslint에서 overrides 옵션을 사용하지 않고 그냥 이렇게 했다.
module.exports = {
root: true,
env: {
browser: true,
es2021: true,
node: true,
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
],
parser: '@typescript-eslint/parser',
parserOptions: {
tsconfigRootDir: __dirname,
project: ['./tsconfig.base.json'],
},
plugins: ['@typescript-eslint', 'prettier', 'import'],
rules: {
'prettier/prettier': ['error', { endOfLine: 'auto' }],
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': 'warn',
'@typescript-eslint/naming-convention': [
'error',
{
format: ['camelCase', 'UPPER_CASE', 'PascalCase'],
selector: 'variable',
leadingUnderscore: 'allow',
},
{ format: ['camelCase', 'PascalCase'], selector: 'function' },
{ format: ['PascalCase'], selector: 'interface' },
{ format: ['PascalCase'], selector: 'typeAlias' },
],
'import/order': [
'warn',
{
'newlines-between': 'always',
groups: [
['builtin', 'external'],
['internal', 'parent', 'sibling', 'index'],
['object'],
['type'],
],
pathGroups: [
{
pattern: '@/**',
group: 'internal',
},
],
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
},
],
},
ignorePatterns: [
'.yarn/**/*',
'.pnp.cjs',
'.pnp.loader.mjs',
'.eslintrc.js',
'**/dist/**/*',
'**/__generated__/**/*',
],
}
tsconfig도 수정
{
"compilerOptions": {
"target": "ESNext",
"jsx": "react",
"module": "ESNext",
"moduleResolution": "Node",
"declaration": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true
}
}
내일 할 일
- 블로그 개발
- 스터디 계획 세우기