Skip to content
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 --format stylish by default should apply to main app #11005

Closed
johnpapa opened this issue May 24, 2018 · 3 comments
Closed

ng lint --format stylish by default should apply to main app #11005

johnpapa opened this issue May 24, 2018 · 3 comments

Comments

@johnpapa
Copy link
Contributor

Versions


Angular CLI: 6.0.3
Node: 8.11.1
OS: darwin x64
Angular: 6.0.3
... animations, cli, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.6.3
@angular-devkit/build-angular     0.6.3
@angular-devkit/build-optimizer   0.6.3
@angular-devkit/core              0.6.3
@angular-devkit/schematics        0.6.3
@ngtools/webpack                  6.0.3
@schematics/angular               0.6.3
@schematics/update                0.6.3
rxjs                              6.2.0
typescript                        2.7.2
webpack                           4.8.3
    

Repro steps

ng new my-dream-app
cd my-dream-app
ng lint --format stylish

Observed behavior

▶ng lint --format stylish
Architect commands with multiple targets cannot specify overrides.'lint' would be run on the following projects: my-app,my-app-e2e
Error: Architect commands with multiple targets cannot specify overrides.'lint' would be run on the following projects: my-app,my-app-e2e
    at LintCommand.validate (/Users/papa/_play/my-app/node_modules/@angular/cli/models/architect-command.js:75:23)
    at /Users/papa/_play/my-app/node_modules/@angular/cli/models/command-runner.js:274:39
    at Generator.next (<anonymous>)
    at /Users/papa/_play/my-app/node_modules/@angular/cli/models/command-runner.js:7:71
    at new Promise (<anonymous>)
    at __awaiter (/Users/papa/_play/my-app/node_modules/@angular/cli/models/command-runner.js:3:12)
    at validateAndRunCommand (/Users/papa/_play/my-app/node_modules/@angular/cli/models/command-runner.js:273:12)
    at Object.<anonymous> (/Users/papa/_play/my-app/node_modules/@angular/cli/models/command-runner.js:100:26)
    at Generator.next (<anonymous>)
    at fulfilled (/Users/papa/_play/my-app/node_modules/@angular/cli/models/command-runner.js:4:58)

Desired behavior

By default if no app is specified, it should cover the main app (not the e2e)

@mikesimmonds
Copy link

For any less-experienced developers like myself coming across this issue:
When passing flags to ng lint (eg --fix) you must include the name of the project (found in package.json).
Example:
ng lint --fix [doesn't work]
ng lint app-name --fix [does work]

mnahkies added a commit to mnahkies/angular-cli that referenced this issue Oct 21, 2018
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
mnahkies added a commit to mnahkies/angular-cli that referenced this issue Nov 20, 2018
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
alexeagle pushed a commit that referenced this issue Dec 6, 2018
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
alexeagle pushed a commit that referenced this issue Dec 6, 2018
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
@alan-agius4
Copy link
Collaborator

Fixed via 5571d09

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 9, 2019
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