New Rule: `no-empty-static-block`
See original GitHub issueRule details
Restricts empty static blocks
Related ECMAScript feature
https://github.com/tc39/proposal-class-static-block
What type of rule is this?
Enforces a formatting/stylistic preference
Example code
class Foo {
static {
}
}
Why should this rule be in the core instead of a plugin?
Static blocks is a core feature of ECMAScript
Participation
- I am willing to submit a pull request to implement this rule.
Additional comments
https://github.com/eslint/eslint/issues/15016
no-empty (or no-empty-function?)neither, possibly a new rule.
Issue Analytics
- State:
- Created a year ago
- Reactions:4
- Comments:7 (6 by maintainers)
Top Results From Across the Web
no-empty-static-block - ESLint - Pluggable JavaScript Linter
Rule Details. This rule disallows empty static blocks. This rule ignores static blocks which contain a comment. Examples of incorrect code for this...
Read more >Different static blocks executed in java with an empty main ...
The static block in class Developer is not executed. Is there any logical explanation? java · Share. Share ...
Read more >ECMAScript class static initialization blocks - TC39
This proposal defines new syntax to perform privleged static initialization of a class. See the proposal repository for background material and ...
Read more >Static Block in Java | Use, Example - Scientech Easy
2. If the static block is not present in the program, JVM invokes the main method first. How many times Dot class file...
Read more >CSS static code analysis: Empty blocks should be removed
Unique rules to find Bugs and Code Smells in your CSS code ... Empty blocks should be removed. Code Smell · Strings should...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I support this 👍
I’m 👍🏻 for supporting this rule as well.