question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Rule proposal: `no-empty-file`

See original GitHub issue

There seems to be all kinds of “empty” rules for block statements, destructuring, functions, lines between things, etc., but interestingly nothing for entirely empty files, unless I am completely overlooking something (please correct me if I am wrong and I will humbly 🤦‍♂️).

I am more than happy to submit a PR if approved.

Description

Disallow empty files.

Disallow files containing absolutely nothing, only whitespace, or only comments.

Fail

No space or all whitespace


Only Return characters / new lines (or combination thereof)

\n
\r
\r\n

Only comments

// comment
/* comment */

Pass

const value = 'string';

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:4
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
manovotnycommented, Aug 12, 2021

@fisker awesome! I’ll get started on an implementation. Good note on the Vue SFC too. I’ll add it to the list.

0reactions
manovotnycommented, Aug 12, 2021

@fisker I think I agree. Everything else seems to be singular in unicorn too. Things aren’t named arrays, ternaries, etc. Singular it is.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Proposed rule: Modernization of Beneficial Ownership Reporting
Specifically, we are proposing to amend Item 6 to Schedule 13D, codified at Rule. 13d-101, to remove any implication that a person is...
Read more >
Create a list with empty files and a list with not empty files
Using this list, I'm trying to skip empty files using the method explained by @nrussell How to skip empty files when importing text...
Read more >
Empty File Handling : Do Not Create Message - SAP Community
You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify...
Read more >
Frequently Asked Questions (FAQs) On Proposal Preparation ...
The Proposal File Update module, however, may not be used for ... The only exceptions to the rule for research proposals ... fields...
Read more >
Aerosol Can Waste - NDEE Publications - Nebraska.gov
Empty aerosol cans that are household waste are not considered hazardous ... Title 128 – Nebraska Hazardous Waste Regulations, Chapter 2, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found