强制使用“@ts-expect-error”而不是“@ts-ignore”。
该规则仅支持对.js/.ts文件进行检查。
// @ts-expect-error: with description export const str: string = 1; /** * Explaining comment * * @ts-expect-error: with description */ export const multiLine: number = 'value'; /** @ts-expect-error: with description */ export const block: string = 1;
// @ts-ignore
const str: string = 1;
/**
* Explaining comment
*
* @ts-ignore */
const multiLine: number = 'value';
/** @ts-ignore */
const block: string = 1;
const isOptionEnabled = (key: string): boolean => {
// @ts-ignore: if key isn't in globalOptions it'll be undefined which is false
return !!globalOptions[key];
};