blakeembrey / tslint-config-standard

A TSLint config for JavaScript Standard Style
Other
358 stars 43 forks source link

TSLint v5 #18

Closed mightyiam closed 7 years ago

mightyiam commented 7 years ago

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.

evollu commented 7 years ago

you can get around by adding --type-check and --project to tslint command

blakeembrey commented 7 years ago

@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.

mightyiam commented 7 years ago

I think #22 fixed this. Thank you!

fabiohbarbosa commented 7 years ago

Example to fix warning message: node_modules/.bin/tslint --type-check --project tslint.json src/**/**.ts

codermannn commented 7 years ago

Adding --type-check to the tslint command didnt work for me

blakeembrey commented 7 years ago

@lohiarahul Why didn't it work? What error did you get? Did you set --project?

codermannn commented 7 years ago

Yes. "lint": "npm run tslint --type-check --project --force \"src/*/.ts\"",

codermannn commented 7 years ago

Still shows

Warning: The 'no-use-before-declare' rule requires type infomation.

blakeembrey commented 7 years ago

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/.

blakeembrey commented 7 years ago

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.

fsenart commented 7 years ago

Based on @blakeembrey comment, this works for me: npm run lint -- --type-check

codermannn commented 7 years ago

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

codermannn commented 7 years ago

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

blakeembrey commented 7 years ago

@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.