8000 refactor(eslint-plugin): [sort-ngmodule-metadata-arrays]: properly handle multiple fixes at once by rafaelss95 · Pull Request #677 · angular-eslint/angular-eslint · GitHub
[go: up one dir, main page]

Skip to content

refactor(eslint-plugin): [sort-ngmodule-metadata-arrays]: properly handle multiple fixes at once #677

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

Closed
wants to merge 2 commits into from

Conversation

rafaelss95
Copy link
Member
@rafaelss95 rafaelss95 commented Sep 10, 2021

Besides addressing the issue #675, the report node is more accurate now and reports nested arrays.

PS: TBH, I'm not sure which scope should be this PR, so I used refactor 🤷‍♂️

Closes #677.

},
fixable: 'code',
schema: [],
messages: {
sortNgmoduleMetadataArrays:
'`NgModule` metadata arrays should be sorted in ASC alphabetical order',
suggestFix: 'Sort members (WARNING! comments will probably be messed up)',
Copy link
Member Author

Choose a reason for hiding this comment

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

Please, suggest a better message if that's the case.

@nx-cloud
Copy link
nx-cloud bot commented Sep 10, 2021

Comment on lines 54 to 57
...(hasCommentsWithinElements(sourceCode, elements)
? { suggest: [{ messageId: 'suggestFix', fix }] }
: { fix }),
Copy link
Member Author
@rafaelss95 rafaelss95 Sep 10, 2021

Choose a reason for hiding this comment

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

I even tried to use fix, even if there were comments, but besides being very costly to maintain such an implementation, it's also very prone to failure. 😞

@codecov
Copy link
codecov bot commented Sep 10, 2021

Codecov Report

Merging #677 (49b1d13) into master (07711f1) will increase coverage by 0.08%.
The diff coverage is 100.00%.

❗ Current head 49b1d13 differs from pull request most recent head c8d58f7. Consider uploading reports for the commit c8d58f7 to get more accurate results

@@            Coverage Diff             @@
##           master     #677      +/-   ##
==========================================
+ Coverage   85.60%   85.69%   +0.08%     
==========================================
  Files          83       83              
  Lines        1924     1936      +12     
  Branches      337      339       +2     
==========================================
+ Hits         1647     1659      +12     
  Misses        168      168              
  Partials      109      109              
Impacted Files Coverage Δ
...-plugin/src/rules/sort-ngmodule-metadata-arrays.ts 100.00% <100.00%> (ø)

@rafaelss95 rafaelss95 force-pushed the fix/675 branch 6 times, most recently from 9f5bcbf to 509898a Compare September 13, 2021 17:05
@JamesHenry
Copy link
Member

Hi @rafaelss95 thanks so much for this, please see my latest email for how I'd love to see this broken down, please let me know on there if you have any questions at all!

@JamesHenry JamesHenry closed this Sep 20, 2021
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.

2 participants
0