Yur*_*hov 5 typescript eslint tslint visual-studio-code
您能否建议我如何在 TypeScript 项目中打开已弃用的 API 检测?我使用 Visual Studio 代码。我已经做了什么:
yarn add eslint -Dyarn add eslint-plugin-deprecate -Dyarn add -D typescript @typescript-eslint/parser @typescript-eslint/eslint-plugin{
"plugins": [
"@typescript-eslint",
"deprecate"
],
"parser": "@typescript-eslint/parser",
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
]
}
Run Code Online (Sandbox Code Playgroud)
然后我eslint . --ext .ts在终端中运行命令,尽管我的代码使用了已弃用的 API,但没有出现预期的错误或警告:
const audioContext = new AudioContext();
const processor = audioContext.createScriptProcessor(2048, 1, 1);
//onaudioprocess is deprecated
processor.onaudioprocess = event => {
console.log(event);
//...
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1157 次 |
| 最近记录: |