programing

vuej의 tslint 오류를 자동 수정하려면 어떻게 해야 합니까?

goodjava 2022. 11. 10. 20:46

vuej의 tslint 오류를 자동 수정하려면 어떻게 해야 합니까?

나는 달리고 있다vue-cli-service lint --fix내 vuejs/타자기본 프로젝트에서.예상대로 대부분의 보풀 오류/경고는 자동으로 해결됩니다.

단, 특정 tslint 규칙이 있습니다."semicolon": [true, "always", "ignore-interfaces"]) 이 명령어로 자동 수정하고 싶습니다.타이프 스크립트인터페이스는 다음과 같습니다(예상된 보풀 결과).

interface component {
    type: "input" | "dropdown" | "checkbox",
    hidden?: boolean
}

보풀이 실행되면 이렇게 포맷됩니다.메시지는[eslint] Replace,with;(prettier/prettier)

interface component {
    type: "input" | "dropdown" | "checkbox";
    hidden?: boolean;
}

이 규칙을 추가했습니다."semicolon": [true, "always", "ignore-interfaces"]tslint 파일로 변환되지만 결과는 변경되지 않습니다.

콘솔 메시지([eslint] Replace , with ; (prettier/prettier))는, 다음의 항목을 선택했을 가능성이 있습니다.ESLint + PrettierVue CLI를 사용하여 프로젝트를 생성하는 경우 옵션이지만 ESLint는 지원하지 않습니다.tslint.json(플러그인이 필요하지만 YMMV).

다른 방법으로는 TSLint로 전환하여 생성된 파일을 편집하는 방법이 있습니다.tslint.json당신이 원하는 것을 포함하다semicolon규칙.

언급URL : https://stackoverflow.com/questions/52663009/how-can-i-auto-fix-tslint-errors-in-vuejs