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

comment all errors, prevent duplicate rules #10

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

baruchadi
Copy link

What this PR addresses:

  • Should fix Bug with multiple violations on the same line #6 for the insertion of a comment
    • note if a comment already exists, it will ignore it (like previous behavior) and write its own comment underneath. Ideally we will look for comments that exist, and append to them
  • Added the ability to run for EVERY rule that is found to have an error or a warning attached to it by not omitting the rule param, i.e.:
    declare-eslint-bankruptcy ./my-dir --explanation "TODO: Fix ESLint Error (#12345)"

NOTE: my prettier went to town on these files, sorry about that!

@NickHeiner
Copy link
Owner

Hi! I appreciate the PR. This seems like a good thing to get in.

Would you mind resubmitting without your prettier changes? I had the code formatted the way I liked it, and also it makes the diff very hard to read. 😄

@baruchadi
Copy link
Author

Hey @NickHeiner ! I'm hoping to get around to it soon. Do you have a prettier config file you could check into the repo to make it easier to reformat and work on the repo without making major modifications?

@NickHeiner
Copy link
Owner

I don't use prettier for this project – formatting is handled by ESLint.

I'm guessing you have a "format on save" feature enabled on your editor – I'd just disable that. Then run yarn lint:fix to apply any style fixes, and then the styling will probably be good enough.

return `// eslint-disable-next-line ${rules.join(' ')}`;
function getEslintDisableComment(rules) {
const ruleSet = new Set(rules);
return `/* eslint-disable-next-line ${Array.from(ruleSet).join(', ')} */`;
Copy link
Author

Choose a reason for hiding this comment

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

using /* ... */ style comments made it easier to use regex to look for the new comments and fix broken comments in jsx

bin/index.js Show resolved Hide resolved
.options({
rule: {
alias: 'r',
array: true,
string: true,
demandOption: true,
Copy link
Author

Choose a reason for hiding this comment

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

removed demandOption from rule, if rule is not provided - run this for any rule

@baruchadi
Copy link
Author

hey @NickHeiner ! I finally got around to patching this fork, I added my reasoning for a few changes in separate comments. This PR should be a lot more review-able now 😛

@baruchadi
Copy link
Author

poke 👉 @NickHeiner

@NickHeiner
Copy link
Owner

NickHeiner commented May 29, 2022 via email

@NickHeiner
Copy link
Owner

This PR still has a ton of diff noise. 😄 Can you remove all extraneous formatting changes?

@chrbala
Copy link

chrbala commented Feb 11, 2023

I pulled apart the changes in the PR here to separate them from the formatting changes. From this, I made a commit that tests some of those changes. I'm not sure it's completely ready for a PR, since I didn't include this portion of the original PR.

@NickHeiner would you be able to drive this the rest of the way to completion?

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.

Bug with multiple violations on the same line
3 participants