-
Notifications
You must be signed in to change notification settings - Fork 174
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: add explanation for ignore directives #1229
feat: add explanation for ignore directives #1229
Conversation
Looks like a good start. Please run |
bfee7fc
to
6f195a9
Compare
According to "ban-types" riles, `Object` is one of types to ignore
hi @bartlomieju, BTW, There are two things I have zero confidence.
let comment_text =
IGNORE_COMMENT_CODE_RE.replace_all(&comment_text_without_reason, ","); About adding |
// deno-lint-ignore no-explicit-any no-empty no-debugger -- reason for ignoring | ||
function foo(): any {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good, I have only one worry - it will be easy to make comments over 80 or 100 characters with explanation. I wonder if we could figure out a way to make these comment multi-line.
Could you try to add a test case for something like:
// deno-lint-ignore no-explicit-any no-empty no-debugger -- super, duper, very long
// reason for ignoring
function foo(): any {}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried the test case you gave. it was able to be passed.
but dlint
with real TS file did not work.
Do you want to finish multi-line issue in this PR? Or we can open a new issue for it with new PR.
P.s. A small question: Is it common to add comments under 'lint ignore' (Is it common in Node.js)? I personally have never seen it before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, we can do multi-line support in a follow up. Let's land it as is.
Yeah, these seems fine 👍 |
Sorry, I pressed the button accidentally. I didn't intend to rush you 😓. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, nice work @chengr4!
Hi,
This is my first contribute in deno codebase. I feel nervous and hope it can go well.
This PR is for #1076.
Please check my updates and slowly guide me to the right direction 🙏. Thanks in advance
TODO
test_parse_global_ignore_directives
(done at 2024.01.20)