eslint-plugin-unicorn icon indicating copy to clipboard operation
eslint-plugin-unicorn copied to clipboard

`no-empty-file`: Added option to allow comments

Open AekoArray opened this issue 1 year ago • 10 comments

Hello, this is my first experience in open source. Could you see the implementation?

Fix https://github.com/sindresorhus/eslint-plugin-unicorn/issues/2218

Allow only comments in files

"unicorn/no-empty-file": {
    "allow": [
        "comments"
	]
}

AekoArray avatar Mar 25 '24 20:03 AekoArray

Thanks for contributing. There are linting issues that needs to be resolved.

sindresorhus avatar Mar 26 '24 01:03 sindresorhus

Hello! Can you please tell me how to fix linting issues? I tried running the command to update snapshots npm run test:js -- test/no-empty-file.mjs -u but it didn't help. Are there any other ways to fix them? @sindresorhus

AekoArray avatar Mar 27 '24 13:03 AekoArray

You need Node.js 20 to update snapshots https://github.com/sindresorhus/eslint-plugin-unicorn/blob/231529aee793251f30416b93dc3d5f9bfa27ee47/.github/workflows/main.yml#L44-L45

fisker avatar Mar 27 '24 16:03 fisker

You need Node.js 20 to update snapshots

https://github.com/sindresorhus/eslint-plugin-unicorn/blob/231529aee793251f30416b93dc3d5f9bfa27ee47/.github/workflows/main.yml#L44-L45

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. Also on the main branch I have the same issue with a "Integration Test 3"

AekoArray avatar Mar 28 '24 10:03 AekoArray

@fisker Hello, could you check this PR again please?

AekoArray avatar Apr 17 '24 17:04 AekoArray

@AekoArray Bump

sindresorhus avatar May 08 '24 19:05 sindresorhus

Maybe the option should be allowComments: true?

fisker avatar May 14 '24 12:05 fisker

Maybe the option should be allowComments: true?

Yeah, I was thinking that too 👍

sindresorhus avatar May 14 '24 13:05 sindresorhus

Can you remove .idea/* files?

fisker avatar Jun 04 '24 10:06 fisker

Bump :)

sindresorhus avatar Aug 20 '24 05:08 sindresorhus