Closed mightyiam closed 7 years ago
you can get around by adding --type-check
and --project
to tslint command
@mightyiam I'm not really sure what this issue is for and what you'd like to see done here. Let me know if there's something you do need, otherwise I'm closing as you should use @evollu's suggestion. That's what the warning is about.
I think #22 fixed this. Thank you!
Example to fix warning message:
node_modules/.bin/tslint --type-check --project tslint.json src/**/**.ts
Adding --type-check to the tslint command didnt work for me
@lohiarahul Why didn't it work? What error did you get? Did you set --project
?
Yes. "lint": "npm run tslint --type-check --project --force \"src/*/.ts\"",
Still shows
Warning: The 'no-use-before-declare' rule requires type infomation.
You need to actually point the --project
to something, like https://github.com/blakeembrey/tslint-config-standard/issues/18#issuecomment-318373683 said. You can read the docs from TSLint: https://palantir.github.io/tslint/usage/cli/.
Your NPM script is also wrong. You need to separate arguments with --
if you expect arguments to be passed through. Currently your flags aren't used and are doing nothing. Read the NPM docs here: https://docs.npmjs.com/cli/run-script.
Based on @blakeembrey comment, this works for me: npm run lint -- --type-check
I see t
Your NPM script is also wrong. You need to separate arguments with -- if you expect arguments to be passed through. Currently your flags aren't used and are doing nothing. Read the NPM docs here: https://docs.npmjs.com/cli/run-script.
i do have used -- in the script i pasted above
You need to actually point the --project to something, like #18 (comment) said. You can read the docs from TSLint: https://palantir.github.io/tslint/usage/cli/.
Is the project specified inline ? "lint": "npm run tslint --type-check --project:"../tsconfig.json" --force "src/*/.ts"" The doc doesnt have an example
@lohiarahul Again, you need two dashes after npm run tslint
to pass arguments to the NPM script. You did not use --
in either script you pasted unless you've lost formatting. In which case, I'd recommend you use code blocks in markdown.
You also use an =
, not :
, to specify the argument. You also need backslashes to escape quotes in JSON.
Has been released.
And I'm getting this:
Warning: The 'no-use-before-declare' rule requires type checking
There is something in the release notes about it.