1.6.0
It's more a question than a bug, but I want to know what is the exact command behind the command ng lint.
I wand to run manually the command tslint to be able to make ax export in json format.
When I run tslint -p tsconfig.json -c tslint.json vs ng lint, I don't have the same error on my console.
I would like to know the exact command behind ng lint to be able to run it without angular-cli.
---- UPDATE ----
I was looking at the source code of angular cli and just see that we can add -t json to output ng lint error in json format.
Was nowhere on documentation..
@olivierscheffler yes, as you have found you now, you can pass the format to ng lint. We should properly document this. What ng lint does is lint the app, specs and e2e tests in your project. So if you're seeing different errors they might be because of linting the different parts.
What ng lint does is lint the app, specs and e2e tests in your project.
@filipesilva how exactly is the linting accomplished? It seems ng lint only checks files that are referenced by the Angular app, and misses some errors reported by tslint -p . (which covers all .ts files in the directory structure).
The background in our case is that we have some example .ts files for components which are not actually executed, but loaded over XHR to be inserted as code samples. Probably a bit of an edge-case, but it's a bit confusing when the docs describe ng lint as a simple wrapper around tslint.
@toupeira ng lint runs all targets named lint in your angular.json. Individually For a new project there is a lint target for your app, and one for your e2e suite.
Those lint targets are configured to use the tsconfig.json files for that project but you can change that. You can also add individual files using the files array inside options.
Each of those configs is like running tslint with a project, or with a list of files, while running tslint -p . directly is running it over the root tsconfig. Hope this helps.
@filipesilva thanks, that does clear things up! Would be great to add this information to https://github.com/angular/angular-cli/wiki/lint :)
We're actually rolling out new docs with 7 soon, you can see a preview here:https://next.angular.io/cli/lint
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
_This action has been performed automatically by a bot._
Most helpful comment
@toupeira
ng lintruns all targets namedlintin yourangular.json. Individually For a new project there is alinttarget for your app, and one for your e2e suite.Those lint targets are configured to use the
tsconfig.jsonfiles for that project but you can change that. You can also add individual files using thefilesarray insideoptions.Each of those configs is like running
tslintwith a project, or with a list of files, while runningtslint -p .directly is running it over the roottsconfig. Hope this helps.