打字稿lint-fix命令在检查打字稿棉布问题后不起作用吗?需要知道解决方法或修复程序

发布于 2025-02-10 17:17:31 字数 941 浏览 3 评论 0原文

当我通过运行npm运行lint检查打字条代码中的Linting问题时,它会发出伸缩问题,但是当我尝试使用npm运行lint修复问题时,给出一个错误,说明:

    npm ERR! code ELIFECYCLE
    npm ERR! errno 2
    npm ERR! [email protected] lint:fix: `sudo npm run lint --fix`
    npm ERR! Exit status 2
    npm ERR! 
    npm ERR! Failed at the [email protected] lint:fix script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

包装中使用的脚本。JSON是:

"scripts": {
    
    "lint": "./node_modules/tslint/bin/tslint -c tslint.json -p tsconfig.json --exclude 'node_modules/**/*.{j,t}s'",
    "lint:fix": "sudo npm run lint --fix",
}

When I check for issues with linting in typescript code by running npm run lint it gives out the linting issues but when I try fixing the issues using npm run lint:fix, it gives out an error stating:

    npm ERR! code ELIFECYCLE
    npm ERR! errno 2
    npm ERR! [email protected] lint:fix: `sudo npm run lint --fix`
    npm ERR! Exit status 2
    npm ERR! 
    npm ERR! Failed at the [email protected] lint:fix script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

scripts used in the package.json are :

"scripts": {
    
    "lint": "./node_modules/tslint/bin/tslint -c tslint.json -p tsconfig.json --exclude 'node_modules/**/*.{j,t}s'",
    "lint:fix": "sudo npm run lint --fix",
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文