~3.15.1~2.0.3TypeScript code being linted: (irrelevant)
with tslint.json configuration: (irrelevant)
package.json configuration: "scripts": {
"unquoted": "tslint src/**/*.ts",
"quoted": "tslint 'src/**/*.ts'"
},
Unconsistend behavior when running @ windows or linux (and not working at all on windows).
Consistent behavior across platforms.
Use both, I guess:
"scripts": {
"unquoted_and_quoted": "tslint src/**/*.ts && tslint 'src/**/*.ts'"
},
Check readme and files: https://github.com/acdcjunior/tslint-windows-path-inconsistency
(pasting README here for reference:)
npm run unquoted)@windows 10
$ npm run unquoted
> [email protected] unquoted D:\github\tslint-windows-path-inconsistency
> tslint src/**/*.ts
src/FirstLevel.ts[1, 12]: " should be '
src/second/SecondLevel.ts[1, 12]: " should be '
src/second/third/ThirdLevel.ts[1, 12]: " should be '
npm ERR! Windows_NT 10.0.14393
...
@centos 7
md5-30bf8fa1f4f5c81c78cee26869cbf622[box@box tslint-windows-path-inconsistency]$ npm run unquoted
> [email protected] unquoted /box/github/tslint-windows-path-inconsistency
> tslint src/**/*.ts
src/second/SecondLevel.ts[1, 12]: " should be '
npm ERR! Linux 3.10.0-229.el7.x86_64
...
npm run quoted)@windows 10
$ npm run quoted
> [email protected] quoted D:\github\tslint-windows-path-inconsistency
> tslint 'src/**/*.ts'
$
@centos 7
[box@box tslint-windows-path-inconsistency]$ npm run quoted
> [email protected] quoted /box/github/tslint-windows-path-inconsistency
> tslint 'src/**/*.ts'
src/FirstLevel.ts[1, 12]: " should be '
src/second/SecondLevel.ts[1, 12]: " should be '
src/second/third/ThirdLevel.ts[1, 12]: " should be '
npm ERR! Linux 3.10.0-229.el7.x86_64
...
@acdcjunior you can use double quotes "聽(escaped)聽as workaround to ensure consistency between platforms.
"scripts": {
"lint": "tslint \"src/**/*.ts\""
},
I have idea聽how to fix it, but need more time to ensure that fix for running TSLint from npm scripts won't break anything when聽it is used directly from terminal.
Hi @acdcjunior, this answer and this comment should provide context for the different behavior you're seeing.
When running in centos unquoted, perhaps you don't have the globstar option enabled in your shell and thus the glob isn't matching the files you expect. @IllusionMH's recommendation is good, use double-quotes so that node-glob processes the glob.
I actually don't think this is a bug, it's just how shells work, so I'm going to close this. If you have an idea to change stuff for the better @IllusionMH, happy to reopen / accept that change.
Most helpful comment
@acdcjunior you can use double quotes
"聽(escaped)聽as workaround to ensure consistency between platforms.I have idea聽how to fix it, but need more time to ensure that fix for running TSLint from npm scripts won't break anything when聽it is used directly from terminal.