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
no-empty-file
: Added option to allow comments
#2300
base: main
Are you sure you want to change the base?
Conversation
no-empty-file
: Added option to allow comments
Thanks for contributing. There are linting issues that needs to be resolved. |
Hello! Can you please tell me how to fix linting issues? I tried running the command to update snapshots |
You need Node.js 20 to update snapshots eslint-plugin-unicorn/.github/workflows/main.yml Lines 44 to 45 in 231529a
|
Thank you! This helped solve the linting problem. Could you please help with "Integration Test 3"? Another PR has the same problem with this test. |
@fisker Hello, could you check this PR again please? |
@@ -15,9 +15,17 @@ const isTripleSlashDirective = node => | |||
const hasTripeSlashDirectives = comments => | |||
comments.some(currentNode => isTripleSlashDirective(currentNode)); | |||
|
|||
const isProgramFileEmpty = node => node.type === 'Program' && node.body.length === 0; | |||
|
|||
const isAllowOnlyCommentsFile = (option, node) => option.allow.includes('comments') && isProgramFileEmpty(node); |
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 have difficult to understand this, shouldn't it be something like allowComments && hasComment
?
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 feel /* comment */ {}
won't pass, but it should.
@AekoArray Bump |
Hello, this is my first experience in open source. Could you see the implementation?
Fix #2218
Allow only comments in files