我在docker容器中有一个离子应用程序,每次构建应用程序时都应该有一个linter运行。 linter运行正常,但我没有收到任何错误消息或任何反馈。它只是说:
[09:43:46] lint finished in 15.66 s
仅此而已。没有发现任何错误的迹象(我知道我的代码充满了错误)或者linter已经做了任何事情。
我尝试进入docker容器并使用--verbose手动运行它,但它并没有真正给我任何有用的东西:
root@4a3cca750e27:/usr/src/app# npm run lint --verbose
npm info it worked if it ends with ok
npm verb cli [ '/usr/local/bin/node',
npm verb cli '/usr/local/bin/npm',
npm verb cli 'run',
npm verb cli 'lint',
npm verb cli '--verbose' ]
npm info using npm@4.2.0
npm info using node@v7.10.1
npm verb run-script [ 'prelint', 'lint', 'postlint' ]
npm info lifecycle ionic-agent-taskboard@0.0.1~prelint: ionic-agent-taskboard@0.0.1
npm info lifecycle ionic-agent-taskboard@0.0.1~lint: ionic-agent-taskboard@0.0.1
> ionic-agent-taskboard@0.0.1 lint /usr/src/app
> ionic-app-scripts lint
[10:12:07] ionic-app-scripts 2.1.3
[10:12:08] lint started ...
[10:12:21] lint finished in 13.40 s
npm verb lifecycle ionic-agent-taskboard@0.0.1~lint: unsafe-perm in lifecycle true
npm verb lifecycle ionic-agent-taskboard@0.0.1~lint: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bi
n:/usr/src/app/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
npm verb lifecycle ionic-agent-taskboard@0.0.1~lint: CWD: /usr/src/app
npm info lifecycle ionic-agent-taskboard@0.0.1~postlint: ionic-agent-taskboard@0.0.1
npm verb exit [ 0, true ]
npm info ok
我尝试找到同样问题的其他人,但我能找到的就是这个问题: https://github.com/ionic-team/ionic-app-scripts/issues/967 (从https://github.com/ionic-team/ionic-cli/issues/2218移出)
此问题已经关闭,没有任何真正的答案。
这是我的package.json版本号的一部分:
{
"scripts": {
"lint": "ionic-app-scripts lint",
},
"dependencies": {
"@ionic-native/core": "3.13.1",
"@ionic/app-scripts": "2.1.3",
"ionic-angular": "3.6.0",
"typescript": "2.3.4",
},
"devDependencies": {
"@ionic/app-scripts": "2.1.3",
"ionic": "3.19.1",
"tslint": "^4.3.0",
"tslint-ionic-rules": "0.0.14",
"typescript": "2.3.4",
}
}
修改
这是我的tslint.json文件,离子应该拿起:
{
"rulesDirectory": [
"node_modules/tslint-eslint-rules/dist/rules"
],
"rules": {
"no-duplicate-variable": true
}
}
在node_modules/tslint-eslint-rules/dist/rules
中,定义了一系列规则,这些规则都带有离子,因此它们应该至少做一些事情。