When I run nx lint in a workspace created by nx, (also added @angular-architects/ddd), it only lint the default project.
It should lint all the projects and libs if no project name is specified, just like ng lint, right?
I pulled down the angular-architects demo repo, which uses "@nrwl/angular": "9.0.4" and Angular 9.0, and it's behaving as expected. I tried to investigate whether it has some special config but failed to find any.
test-lint by npx create-nx-workspace@latest with the angular preset and a default project my-proj.cd into test-lint and create another project by nx g app my-proj-admin.@angular-architects/ddd by nx add @angular-architects/ddd.nx g @angular-architects/ddd:domain blog.nx g @angular-architects/ddd:feature browse --domain blog --app my-proj --entity blog
nx g @angular-architects/ddd:feature edit --domain blog --app my-proj
nx lint.ng lint and compare.
Ouput of of nx lint:
> nx lint
> ng run my-proj:lint
Linting "my-proj"...
/home/xzhan/Development/Projects/test-lint/apps/my-proj/src/app/app.component.spec.ts:5:14
WARNING: 5:14 deprecation async is deprecated: use `waitForAsync()`, (expected removal in v12)
/home/xzhan/Development/Projects/test-lint/apps/my-proj/src/app/app.module.ts:5:1
ERROR: 5:1 nx-enforce-module-boundaries A project without tags cannot depend on any libraries
ERROR: 7:1 nx-enforce-module-boundaries A project without tags cannot depend on any libraries
Lint warnings found in the listed files.
Lint errors found in the listed files.
Output of ng lint:
ng lint
Your global Angular CLI version (10.1.1) is greater than your local
version (10.0.8). The local Angular CLI version is used.
To disable this warning use "ng config -g cli.warnings.versionMismatch false".
> NX WARNING The Angular CLI was invoked instead of the Nx CLI. Use "npx ng [command]" or "nx [command]" instead.
Linting "my-proj"...
/home/xzhan/Development/Projects/test-lint/apps/my-proj/src/app/app.component.spec.ts:5:14
WARNING: 5:14 deprecation async is deprecated: use `waitForAsync()`, (expected removal in v12)
/home/xzhan/Development/Projects/test-lint/apps/my-proj/src/app/app.module.ts:5:1
ERROR: 5:1 nx-enforce-module-boundaries A project without tags cannot depend on any libraries
ERROR: 7:1 nx-enforce-module-boundaries A project without tags cannot depend on any libraries
Lint warnings found in the listed files.
Lint errors found in the listed files.
Linting "my-proj-e2e"...
Tried to lint /home/xzhan/Development/Projects/test-lint/apps/my-proj-e2e/src/plugins/index.js but found no valid, enabled rules for this file type and file path in the resolved configuration.
All files pass linting.
Linting "my-proj-admin"...
/home/xzhan/Development/Projects/test-lint/apps/my-proj-admin/src/app/app.component.spec.ts:5:14
WARNING: 5:14 deprecation async is deprecated: use `waitForAsync()`, (expected removal in v12)
Lint warnings found in the listed files.
Linting "my-proj-admin-e2e"...
Tried to lint /home/xzhan/Development/Projects/test-lint/apps/my-proj-admin-e2e/src/plugins/index.js but found no valid, enabled rules for this file type and file path in the resolved configuration.
All files pass linting.
Linting "blog-domain"...
All files pass linting.
Linting "blog-feature-browse"...
All files pass linting.
Linting "blog-feature-edit"...
All files pass linting.
> NX Report complete - copy this into the issue template
nx : Not Found
@nrwl/angular : 10.2.0
@nrwl/cli : 10.2.0
@nrwl/cypress : 10.2.0
@nrwl/eslint-plugin-nx : Not Found
@nrwl/express : Not Found
@nrwl/jest : 10.2.0
@nrwl/linter : Not Found
@nrwl/nest : Not Found
@nrwl/next : Not Found
@nrwl/node : Not Found
@nrwl/react : Not Found
@nrwl/schematics : Not Found
@nrwl/tao : 10.2.0
@nrwl/web : Not Found
@nrwl/workspace : 10.2.0
typescript : 3.9.7
@HymanZHAN you can run the lint on all the projects via this command: nx run-many --all --target=lint
@shaharkazaz Thanks for sharing! That's good to know and I can include that in my package.json.
Still, the discrepancy between nx lint and ng lint is still confusing, given that it worked at one point (at least in the demo project).
@HymanZHAN thx for reporting, but I will close it as duplicate of #3575. Let's move the discussion there. We try to make the commands as general as possible, ie no special handling for lint, but I understand your case, and I will try to look at the issue.
Most helpful comment
@HymanZHAN you can run the lint on all the projects via this command:
nx run-many --all --target=lint