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

fix(eslint-plugin): directive-class-suffix reporting selectorless directives #394

Merged
merged 6 commits into from Apr 17, 2021

Conversation

rafaelss95
Copy link
Member

1st. commit is the fix for #353.
2nd. commit is a refactor that:

  • makes report message more-friendly;
  • removes unnecessary tests and uses data property to ensure we pass the correct parameters to the user.

In any case, if you prefer, I could split it into 2 PRs.

Fixes #353.

@nx-cloud
Copy link

nx-cloud bot commented Apr 4, 2021

Nx Cloud Report

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

📂 See all runs for this branch

Status Command
#000000 nx run-many --target=build --all --parallel
#000000 nx run-many --target=check-configs --all --parallel
#000000 nx run-many --target=test --all --parallel
#000000 nx run-many --target=typecheck --all --parallel

Sent with 💌 from NxCloud.

@Directive
class TestDirective {}
`,
@Directive()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You seem to have removed the @Directive case, please add it back I think it's worth having just so we know how the linter behaves.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also add a comment next to the new @Directive() case and reference back to the issue discussion

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You seem to have removed the @directive case, please add it back I think it's worth having just so we know how the linter behaves.

Hmm, yes I've removed because it doesn't even compile as you can see here:

Captura de Tela 2021-04-06 às 19 54 21

Repro link

But, let me know if you want me to add it back anyway.

Please also add a comment next to the new @Directive() case and reference back to the issue discussion

Added the link, let me know if we need an additional description as well.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is parsable TypeScript, so it's still good to understand how our tooling behaves when it exists, right? With the TS compiler being so forgiving it's worth knowing whether our tooling will blow up or not I think (and to be clear I don't think it will but I just don't see the logic in removing the test case as if this code could not exist in someone's codebase)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem. Added it back.

Copy link
Member

@JamesHenry JamesHenry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comments

@codecov
Copy link

codecov bot commented Apr 6, 2021

Codecov Report

Merging #394 (e3d6f6b) into master (7870d1e) will increase coverage by 1.72%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master     #394      +/-   ##
==========================================
+ Coverage   63.88%   65.60%   +1.72%     
==========================================
  Files          12       10       -2     
  Lines         443      410      -33     
  Branches       74       64      -10     
==========================================
- Hits          283      269      -14     
+ Misses        132      114      -18     
+ Partials       28       27       -1     
Impacted Files Coverage Δ
.../template-parser/src/convert-source-span-to-loc.ts
packages/builder/src/utils/eslint-utils.ts

@JamesHenry JamesHenry enabled auto-merge (squash) April 17, 2021 12:12
@JamesHenry JamesHenry merged commit 42d4e5d into angular-eslint:master Apr 17, 2021
@rafaelss95 rafaelss95 deleted the fix/353 branch April 20, 2021 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

directive-class-suffix rule not compatibly with Ivy requirements
2 participants