Front-End
[Prettier] vsCode prettier delete cr 오류
승발자
2022. 7. 21. 00:23
728x90
반응형
prettier를 설치해서 사용하던도중 컴파일 오류는 아닌데 굉장히 거슬리게 빨간줄이 그어져있었다.
문제가 뭔가 하고보니 `cr` 을 삭제하라고한다. cr을 삭제하는 방법을 모르니 저 오류가 안뜨게 해보자.
프로젝트의 최상위 폴더에 .eslintrc.js에서 rules에 아래내용을 적어주면된다.
'prettier/prettier': [
'error',
{
'endOfLine': 'auto',
}
]
전체 코드는 아래와 같다.
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfig.json',
tsconfigRootDir : __dirname,
sourceType: 'module',
},
plugins: ['@typescript-eslint/eslint-plugin'],
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
],
root: true,
env: {
node: true,
jest: true,
},
ignorePatterns: ['.eslintrc.js'],
rules: {
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',
//이부분을 추가해주면된다.
'prettier/prettier': [
'error',
{
'endOfLine': 'auto',
}
]
},
};
이렇게 해주면 거슬리는 오류가 사라진다!
728x90
반응형