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

feat(angular): eslint config including template linting #3988

Merged
merged 14 commits into from
Nov 25, 2020

Conversation

JamesHenry
Copy link
Collaborator

@JamesHenry JamesHenry commented Oct 28, 2020

Current Behavior

For Angular projects we do not configure HTML files to be included in the lintFilePatterns for the @nrwl/linter:eslint builder and we do not include the @angular-eslint tooling to make template parsing and linting possible.

We also do not have a shareable config for Angular projects to extend from.

Expected Behavior

This PR:

  • Adds @angular-eslint tooling to allow for template parsing and linting, as well as Angular-specific code lint rules (official successor to Codelyzer in TSLint).
  • Adds two more shareable configs from Nx: angular and angular-template
  • Updates Nx Angular + ESLint projects to include HTML files in their lintFilePatterns when they are generated
  • Forcibly migrates any existing project-level .eslintrc.json files to the new overrides powered structure, as discussed with Jason.

#3949 unlocked our ability to add this capability because we now use overrides at the root in latest master and can reliably instruct ESLint to use different parsers and plugins for different file-types.

As usual, I have split the PR into 2 commits - (1) the code changes (2) the relevant migration

Related Issue(s)

Fixes #

@nx-cloud
Copy link

nx-cloud bot commented Oct 28, 2020

Nx Cloud Report

CI ran the following commands for commit a1d1d2a. Click to see the status, the terminal output, and the build insights.

Status Command Start Time
#000000 nx build-base angular 11/25/2020, 6:11:56 PM
#000000 nx build-base create-nx-plugin 11/25/2020, 6:12:02 PM
#000000 nx build-base express 11/25/2020, 6:12:12 PM
#000000 nx build-base nest 11/25/2020, 6:12:12 PM
#000000 nx build-base next 11/25/2020, 6:12:18 PM
#000000 nx build-base node 11/25/2020, 6:11:56 PM
#000000 nx build-base react 11/25/2020, 6:12:12 PM
#000000 nx build-base storybook 11/25/2020, 6:12:01 PM
#000000 nx build-base web 11/25/2020, 6:11:56 PM
#000000 nx run-many --target=build --all --parallel 11/25/2020, 6:10:34 PM
#000000 nx run-many --target=e2e --projects=e2e-angular 11/25/2020, 6:12:29 PM
#000000 nx run-many --target=e2e --projects=e2e-cli,e2e-nx-plugin 11/25/2020, 6:11:21 PM
#000000 nx run-many --target=e2e --projects=e2e-cypress,e2e-jest 11/25/2020, 6:10:17 PM
#000000 nx run-many --target=e2e --projects=e2e-next 11/25/2020, 6:10:23 PM
#000000 nx run-many --target=e2e --projects=e2e-node 11/25/2020, 6:11:32 PM
#000000 nx run-many --target=e2e --projects=e2e-react 11/25/2020, 6:11:49 PM
#000000 nx run-many --target=e2e --projects=e2e-web,e2e-linter,e2e-storybook 11/25/2020, 6:09:59 PM
#000000 nx run-many --target=e2e --projects=e2e-workspace 11/25/2020, 6:11:32 PM
#000000 nx run-many --target=lint --all --parallel 11/25/2020, 6:14:41 PM
#000000 nx run-many --target=test --all --parallel 11/25/2020, 6:11:23 PM

Sent with 💌 from NxCloud.

@JamesHenry JamesHenry force-pushed the eslint-angular-config branch from 8d9e0df to 4cf501d Compare October 29, 2020 07:33
@JamesHenry JamesHenry marked this pull request as ready for review October 29, 2020 15:51
@JamesHenry
Copy link
Collaborator Author

Added an additional commit with support for component and directive prefix linting based on user input/config to make it match up with TSLint

packages/angular/package.json Outdated Show resolved Hide resolved
packages/eslint-plugin-nx/src/index.ts Outdated Show resolved Hide resolved
packages/angular/src/utils/lint.ts Outdated Show resolved Hide resolved
@FrozenPandaz FrozenPandaz merged commit bd92a12 into nrwl:master Nov 25, 2020
@JamesHenry JamesHenry deleted the eslint-angular-config branch November 25, 2020 20:53
@github-actions
Copy link

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants