리팩토링이 필요한 프로젝트에 투입이 된 후, 여러 개선 사항 리스트를 작성하였습니다.
그 중 TypeScript 적용은 하면 좋으나 시간이 걸릴 작업으로 분류해놓았는데, 다른 개발자분들의 만장일치로 적용하기로 결정하였습니다. 하하
$ vue create project-name
tsconfig.json 에 우선 아래 설정을 추가한 뒤 작업 (작업시 값 변경 예정)
"strict": false,
"noImplicitAny": false,
"allowJs": true,
import VueLogger from "vuejs-logger";
Vue.use(VueLogger, options)
import VueLoggerPlugin from "vuejs-logger/dist/vue-logger";
Vue.use(VueLoggerPlugin, options)
shims-tsx.d.ts 에 아래 코드 추가
import { OktaAuth } from "@okta/okta-auth-js";
declare module "vue/types/vue" {
interface VueConstructor {
$auth: OktaAuth;
$log: {
debug(message: string, trace?: {}): void;
info(message: string, trace?: {}): void;
warning(message: string, trace?: {}): void;
error(message: string, trace?: {}): void;
fatal(message: string, trace?: {}): void;
};
}
}