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.