Hey all got a issue with npm and tslint I was hoping you could help me with. Ok here comes my situation and code:
package.json
"scripts": {
"lint": "tslint -c tslint.json 'src/app/**/*.ts'",
"pretest": "npm run lint ",
"test": "echo 'No test are made'",
...
},
When I run command npm test
this is the output:
input terminal
$ npm test
output terminal
> [email protected] pretest c:\Users\Hjorth\Documents\github\keoom-angular
> npm run lint
> [email protected] lint c:\Users\Hjorth\Documents\github\keoom-angular
> tslint -c tslint.json 'src/app/**/*.ts'
> [email protected] test c:\Users\Hjorth\Documents\github\keoom-angular
> echo 'No test are made'
'No test are made'
If I only run command tslint -c tslint.json 'src/app/**/*.ts'
I on the other hand see the linting error.
input terminal
$ tslint -c tslint.json 'src/app/**/*.ts'
output terminal
src/app/app.component.ts[1, 27]: " should be '
So as you can see there is a linting error in my code, but if I am not running the script directly It will not show. What I am expecting is this:
When I run npm test
the script pretest
will run, and that script will run the script lint
, it will then exit with exit 0
before test
script is run as it will find the linting error.
Anyone that can be of assistance.
It's the quotes around the file spec in the tslint
command that are the problem:
"lint": "tslint -c tslint.json 'src/app/**/*.ts'"
^ ^
If you remove those, you should see the expected error reported by tslint
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With