Closed madebyjeffrey closed 4 years ago
Sounds reasonable to me. Feel like submitting a PR?
The fix is to wrap this line into "tslint is installed" check.
I am certainly willing to do this. Is there an official method of checking for tslint is installed? Most direct way I can think of is just seeing if node_modules.bin\tslint(.exe)? exists or checking the package_lock or the yarn equivalent.
It may be a bit tricky to perform the direct check for all platforms and different package managers. I would suggest to attempt loading the module and see if it fails. Something like below:
try {
require('tslint');
return true;
} catch (err) {
return false;
}
That would be beautiful if it works!
There might be a testing opportunity as well, but not sure if it is worth it to research it.
I don't think there is an easy way to test it, so it is fine without test.
Describe the problem
When performaing
ng add @fortawesome/angular-fontawesome@0.6.0
it asked for what font icons I would like:But afterwards failed with:
Cannot find module 'tslint'
What did you expect?
It to succeed without any errors. I do not use tslint.
Reproducible test case
Unable to produce a test case on stackblitz, requires command line.