【问题标题】:Running TS Lint on legacy angular project在遗留 Angular 项目上运行 TS Lint
【发布时间】:2019-02-08 20:04:50
【问题描述】:

当我尝试通过 VS Code TsLint 扩展(运行时 linting)对我的 Angular 遗留应用程序进行 lint 时,不幸的是扩展失败了。

在启动时,我们设置了以下版本:

"@angular/cli": "~1.2.0",
"@angular/compiler-cli": "^4.0.1",
"@types/jasmine": "^2.2.30",
"autoprefixer": "^6.5.1",
"codelyzer": "~0.0.26",
"jasmine-core": "2.4.1",
"jasmine-spec-reporter": "2.5.0",
"karma": "1.2.0",
"karma-chrome-launcher": "^2.0.0",
"karma-cli": "^1.0.1",
"karma-jasmine": "^1.0.2",
"karma-remap-istanbul": "^0.2.1",
"protractor": "4.0.5",
"ts-node": "1.2.1",
"tslint": "3.13.0",
"typescript": "2.2.2"

此设置能够运行 ng lint,但 VS Code Tslinter 扩展失败并显示以下内容:

vscode-tslint: Cannot read tslint configuration - 'Cannot read property 'findConfigurationPath' of undefined'

我一直在进行一些 github 讨论,但它与旧版本的扩展有关。我目前使用的是 1.0.38。

还有其他人有类似的问题吗?我几乎 100% 确定这个问题与将旧版本的项目工具与新的 VS Code 扩展混合使用有关...

任何帮助都是appriciated

【问题讨论】:

    标签: visual-studio-code tslint


    【解决方案1】:

    我今天遇到了同样的问题,似乎 vscode-tslint 的依赖项已更新。

    我必须升级到:

    "tslint": "^5.7.0",
    "typescript": "^2.9.1"
    

    让它工作。

    我想目前的需求可以看here

    【讨论】:

    • 是的,确实是版本冲突。除了更新本地版本之外,我还清除了全局安装,重新启动 VS Code 几次 ;) 突然一切都开始运行了
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-03-02
    • 2012-04-06
    • 1970-01-01
    • 1970-01-01
    • 2018-06-15
    相关资源
    最近更新 更多