4.3.12.1.4*.spec.{ts,tsx} files. Using the following command:
tslint -e '**/lib/**' --project tsconfig.json --type-check 'packages/**/*.{ts,tsx}'
with tslint.json configuration:
{
"extends": ["tslint:latest", "tslint-react"],
"rules": {
"interface-over-type-literal": false,
"jsx-no-multiline-js": false,
"member-access": false,
"no-consecutive-blank-lines": false,
"object-literal-sort-keys": false,
"ordered-imports": false,
"quotemark": [true, "jsx-double"]
}
}
TSlint shouts at me that:
Error:
Invalid source file: packages/redux-forms-react/src/__tests__/connectField.spec.tsx. Ensure that the files supplied to lint have a .ts, .tsx, .js or .jsx extension.
TSlint should be able to correctly test *.spec.{ts,tsx} files.
@oreqizer have you tried './packages/**/*.{ts,tsx}'? Because packages might be resolved as node module.
aahhh I figured it out - I had **/__tests__/** ignored in tsconfig.json. didn't think that would affect TSlint. closing then!
thanks
This should probably be an error in the API. Seems like TSLint doesn't look at the files list if a tsconfig.json is provided.
@oreqizer Had the same issue, it should be stated somewhere.
Any progress on this? Or is there a workaround?
@DevWurm this is a relatively old issue, please file a new issue with the provided template if you're still hitting this problem with the latest tslint
I have the same issue with latest tslint as of today
If you are running into this problem, when updating an angular-cli project, make sure you delete any "files"-entries from the "lint"-section in .angular-cli.json.
old:
"lint": [
{
"files": "src/**/*.ts",
"project": "src/tsconfig.app.json"
},
{
"files": "src/**/*.ts",
"project": "src/tsconfig.spec.json"
},
{
"files": "src/**/*.ts",
"project": "e2e/tsconfig.e2e.json"
}
],
new:
"lint": [
{
"project": "src/tsconfig.app.json"
},
{
"project": "src/tsconfig.spec.json"
},
{
"project": "e2e/tsconfig.e2e.json"
}
],
Most helpful comment
I have the same issue with latest tslint as of today