3.7.11.8.9>var a = 1
with tslint.json:
{
"rules": {
"semicolon": [true, "always"]
}
}
filipe.silva@DESKTOP-7ND6T3R MINGW64 /e/sandbox/tslint-test
$ ls
package.json test.ts tslint.json
filipe.silva@DESKTOP-7ND6T3R MINGW64 /e/sandbox/tslint-test
$ cat package.json
{
"scripts": {
"lint": "tslint './**/*.ts'"
}
}
filipe.silva@DESKTOP-7ND6T3R MINGW64 /e/sandbox/tslint-test
$ tslint './**/*.ts'
test.ts[1, 10]: missing semicolon
filipe.silva@DESKTOP-7ND6T3R MINGW64 /e/sandbox/tslint-test
$ npm run lint
> @ lint E:\sandbox\tslint-test
> tslint './**/*.ts'
filipe.silva@DESKTOP-7ND6T3R MINGW64 /e/sandbox/tslint-test
$
Running tslint via CLI or npm script should yield the same errors.
If I had to bet, I'd say it's related to resolving the path for globs, but have no idea how that is being done in tslint.
First, this is a great bug report! Thanks for the clear and concise report.
I tested your scenario on my machine (I added the --force option just to make the output nicer, didn't change the results) and couldn't duplicate your bug (I'm on OSX):
npm run lint
> @ lint /Users/jkillian/projects/secondary/bug-tslint
> tslint --force './**/*.ts'
test.ts[1, 10]: missing semicolon
This leads me to think it's a Windows/MINGW issue occurring here. Here's something to try that might help us debug:
node-inspector: "lint": "node-debug tslint './**/*.ts'"lib/tslint-cli.js file where the glob.sync command is.process.cwd() returns. Also see what the actual glob.sync command is returning.node-debug tslint './**/*.ts' and with your npm script.Can you let me know what results you get when doing this?
Heya, thanks for the swift response!
I tried using node-inspector (didn't know if it btw, thank you!) and here is the result for npm run lint:

And the result for cli node-debug tslint './**/*.ts':

So if I'm reading this correctly, the issue is on glob itself, or perhaps config for it?
I reproduced this issue on the glob repo, with a simpler example: https://github.com/isaacs/node-glob/issues/257
Seems like you're on the right track to getting this figured out. I'll watch that issue and we'll bump any dependencies on glob if needed down the road.
Roger, thanks for the help!
@mysticatea found the real issue: https://github.com/eslint/eslint/issues/5796#issuecomment-206717297!
It's the single quotes. In windows, arguments for npm scripts must use double quotes instead of single quotes.
Ha, who would've guessed. Glad to know the fix though, who knows down the road when a similar bug will pop up for somebody.
Most helpful comment
@mysticatea found the real issue: https://github.com/eslint/eslint/issues/5796#issuecomment-206717297!
It's the single quotes. In windows, arguments for npm scripts must use double quotes instead of single quotes.