-
Notifications
You must be signed in to change notification settings - Fork 12k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ng lint with format flag errors #10657
Comments
Here's how I got past this: I created 2 convenience configurations in angular.json specifically for linting for 'my-test' and 'my-test-e2e'. For the purposes of this example, I named them 'ci-app-lint' and 'ci-e2e-lint' In the defined configurations, I added "format" option. In npm, I created a script that wraps lint for console vs CI by specifying the configurations it should run:
Jenkins calls I know I can get around the convenience configurations and pass all the flags i need for my-test and my-test-e2e in the The error output was really unhelpful and the docs weren't much better. It took some trial and error to figure out how to work with configurations. |
@alisa-duncan comment helped me a lot. I didn't realize that in version 6 (or 5) you have to update your npm scripts to include the name of your project. Additionally, project-name-e2e is considered a separate project as well. This has also helped me figure out why my Thanks! |
@alisa-duncan could you share your |
@senseysensor something like this
|
I also faced the same issue when updated to the new Angular version. I have fixed it just my specifying exact project name in lint commands in package.json like this:
where test-app is my project name. |
I am running into the same issue. I have one application and one lib. My I was able to fix it with the solution proposed above. Is this how we are supposed to deal with this error? Do we have to specify each project individually when fixing linting errors? |
When running a command with args against multiple targets, all targets should be given the args. As parseArguments was mutating the passed args array this wasn't the case. Fix by making a shallow clone of the array. This was especially noticeable when using the `ng lint --fix` command on a newly generated project, as files in the app target would be fixed, but e2e target would be only be linted (with no fix) Possibly closes angular#10657, angular#10656, angular#11005
When running a command with args against multiple targets, all targets should be given the args. As parseArguments was mutating the passed args array this wasn't the case. Fix by not mutating the array. This was especially noticeable when using the `ng lint --fix` command on a newly generated project, as files in the app target would be fixed, but e2e target would be only be linted (with no fix) Possibly closes angular#10657, angular#10656, angular#11005
When running a command with args against multiple targets, all targets should be given the args. As parseArguments was mutating the passed args array this wasn't the case. Fix by not mutating the array. This was especially noticeable when using the `ng lint --fix` command on a newly generated project, as files in the app target would be fixed, but e2e target would be only be linted (with no fix) Possibly closes #10657, #10656, #11005
When running a command with args against multiple targets, all targets should be given the args. As parseArguments was mutating the passed args array this wasn't the case. Fix by not mutating the array. This was especially noticeable when using the `ng lint --fix` command on a newly generated project, as files in the app target would be fixed, but e2e target would be only be linted (with no fix) Possibly closes #10657, #10656, #11005
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Versions
Repro steps
ng lint
with format flag.ng new my-test cd my-test ng lint --format checkstyle
I can edit angular.json to add
"format":"checkstyle"
option to "my-test" and "my-test-e2e" projects. Thenng lint
will run successfully and console will contain checkstyle output for each project.Observed behavior
When using format option in angular.json, I get 2 checkstyle outputs (one for each project).
Desired behavior
format
param via command line so that it can be used via CI and local builds.Mention any other details that might be useful (optional)
We use Jenkins CI and use checkstyle reporter to file for CI builds only, but would like to retain prose console output for local builds. We cannot do that when format is set in angular.json.
This is similar to #10422 but reporter was using multiple libraries. This issue is visible in a basic application.
The text was updated successfully, but these errors were encountered: