Skip to content
This repository has been archived by the owner on Jan 26, 2019. It is now read-only.

How to run ONLY tslint? #144

Closed
stevenmusumeche opened this issue Aug 20, 2017 · 9 comments
Closed

How to run ONLY tslint? #144

stevenmusumeche opened this issue Aug 20, 2017 · 9 comments

Comments

@stevenmusumeche
Copy link

Is there a way that I can run tslint directly without running the build command?

@wmonk
Copy link
Owner

wmonk commented Aug 22, 2017

Potentially

`npm bin`/tslint

@sebald
Copy link
Contributor

sebald commented Aug 22, 2017

You could add a script to your package.json. For example:

"scripts": {
  ...
+  "lint": "tslint --exclude **/*.d.ts src/**/*.ts src/**/*.tsx",
}

@stevenmusumeche
Copy link
Author

That does work, however it appears we need to update the tslint version to the latest? I am getting this error which seems to be fixed in later versions?

TypeError: Cannot read property 'flags' of undefined
    at Object.getCheckFlags (/Users/stevenmusumeche/conversations-embed-v3/embed/node_modules/typescript/lib/typescript.js:10137:22)
    at getTypeOfSymbol (/Users/stevenmusumeche/conversations-embed-v3/embed/node_modules/typescript/lib/typescript.js:30957:20)
    at getTypeOfNode (/Users/stevenmusumeche/conversations-embed-v3/embed/node_modules/typescript/lib/typescript.js:47329:24)
    at Object.getTypeAtLocation (/Users/stevenmusumeche/conversations-embed-v3/embed/node_modules/typescript/lib/typescript.js:26823:31)
    at getImplicitType (/Users/stevenmusumeche/conversations-embed-v3/embed/node_modules/tslint/lib/rules/noUnusedVariableRule.js:269:24)
    at cb (/Users/stevenmusumeche/conversations-embed-v3/embed/node_modules/tslint/lib/rules/noUnusedVariableRule.js:259:20)
    at visitEachNode (/Users/stevenmusumeche/conversations-embed-v3/embed/node_modules/typescript/lib/typescript.js:15956:30)
    at Object.forEachChild (/Users/stevenmusumeche/conversations-embed-v3/embed/node_modules/typescript/lib/typescript.js:16143:24)
    at cb (/Users/stevenmusumeche/conversations-embed-v3/embed/node_modules/tslint/lib/rules/noUnusedVariableRule.js:264:19)
    at visitNode (/Users/stevenmusumeche/conversations-embed-v3/embed/node_modules/typescript/lib/typescript.js:15944:20)

@sebald
Copy link
Contributor

sebald commented Aug 23, 2017

I didn't install tslint on my own, since it comes with the react-scripts-ts :)

@stevenmusumeche
Copy link
Author

Yes, that's what I mean. The version of tslint in this repo is an older one. I'm requesting that it be updated to (maybe) solve this issue.

@sebald
Copy link
Contributor

sebald commented Aug 24, 2017

But I have an old tslint too then and it works. My lock files tells me that for the dependency: tslint@^5.2.0 it installed version 5.5.0.

Guess this is a more general issue with tslint and was fixed here: palantir/tslint@a479f43

Regenerating your installed should five you a newer tslint version (e.g. yarn upgrade-interactive).

@YagoLopez
Copy link

Excuse my offtopic but I would like just the contrary. How can I run (not build) the app without tslint? thanks

@patrickmdnet
Copy link

To run lint without build, you can run the version of tslint that's part of your package.

node_modules\.bin\tslint --type-check --project .

@stevenmusumeche
Copy link
Author

@patrickmdnet that does work, however it causes the same error I posted above

Stevens-MacBook-Pro-2:embed stevenmusumeche$ ./node_modules/.bin/tslint --type-check --project .
TypeError: Cannot read property 'flags' of undefined
    at Object.getCheckFlags (/Users/stevenmusumeche/conversations-embed-v3/embed/node_modules/typescript/lib/typescript.js:10137:22)
    at getTypeOfSymbol (/Users/stevenmusumeche/conversations-embed-v3/embed/node_modules/typescript/lib/typescript.js:30957:20)
    at getTypeOfNode (/Users/stevenmusumeche/conversations-embed-v3/embed/node_modules/typescript/lib/typescript.js:47329:24)
    at Object.getTypeAtLocation (/Users/stevenmusumeche/conversations-embed-v3/embed/node_modules/typescript/lib/typescript.js:26823:31)
    at getImplicitType (/Users/stevenmusumeche/conversations-embed-v3/embed/node_modules/tslint/lib/rules/noUnusedVariableRule.js:269:24)
    at cb (/Users/stevenmusumeche/conversations-embed-v3/embed/node_modules/tslint/lib/rules/noUnusedVariableRule.js:259:20)
    at visitEachNode (/Users/stevenmusumeche/conversations-embed-v3/embed/node_modules/typescript/lib/typescript.js:15956:30)
    at Object.forEachChild (/Users/stevenmusumeche/conversations-embed-v3/embed/node_modules/typescript/lib/typescript.js:16143:24)
    at cb (/Users/stevenmusumeche/conversations-embed-v3/embed/node_modules/tslint/lib/rules/noUnusedVariableRule.js:264:19)
    at visitNode (/Users/stevenmusumeche/conversations-embed-v3/embed/node_modules/typescript/lib/typescript.js:15944:20)

@wmonk wmonk closed this as completed Aug 31, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants