sample.ts
// TypeScript now allows you to import JSON files
import data from 'data.json';
console.log(data)
data.json
{
"foo": "bar"
}
tslint.yaml
rules:
quotemark:
- true
- single
When running tslint --fix, the double quotes in the data.json file are replaced with single-quotes due to the quotemark rule. But single-quotes are not valid in JSON files. Only double quotes are valid JSON.
The quotemark rule should not apply to JSON files.
Let's skip linting JSON files altogether rather than address this issue for only one rule. #4426
Just to clarify, you are importing JSON files using the TS 2.9+ --resolveJsonModule option, right?
Yes, that's correct.
should be fixed in v5.12.1, which no longer tries to lint JSON files at all. let me know if that works for you
Awesome! thanks!
Most helpful comment
should be fixed in v5.12.1, which no longer tries to lint JSON files at all. let me know if that works for you