"space-before-blocks" not working correctly
See original GitHub issueTell us about your environment
- ESLint Version: v7.6.0 (Currently used)
- Node Version: v12.16.2
- npm Version: v6.14.4
What parser (default, Babel-ESLint, etc.) are you using? @typescript-eslint/parser
Please show your full configuration:
Configuration
"space-before-blocks": [
"error",
"always"
],
What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.
cacheSkillRights(skillId: string, skillRights: SkillRights): void{
this.skillRightsCache[skillId] = cloneDeep(skillRights);
}
What did you expect to happen? Eslint raise ‘space-before-blocks’ error as there are no space after void and before ‘{’
What actually happened? Please include the actual, raw output from ESLint. Eslint passes successfully
Are you willing to submit a pull request to fix this bug? No
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:16 (12 by maintainers)
Top Results From Across the Web
space-before-blocks - ESLint - Pluggable JavaScript Linter
This rule will enforce consistency of spacing before blocks. It is only applied on blocks that don't begin on a new line. This...
Read more >space-before-blocks | typescript-eslint
Enforce consistent spacing before blocks. Some problems reported by this rule are automatically fixable by the --fix ESLint command line option.
Read more >Enforce only one space isntead of several when space-before ...
1 Answer 1 · It works, however it only works if there are spaces. It does not consider 'tabs' as incorrect space. That...
Read more >Change text alignment, indentation, and spacing in PowerPoint
To change the horizontal placement of text, in the Alignment box, choose Left, Center, Right, Justified, or Distributed. Justified adds spacing between ...
Read more >Troubleshoot issues with Gmail signatures - Google Support
Signature image not formatted correctly. If you're having problems formatting your signature image, try these solutions: Delete then re-upload the signature ...
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
This isn’t technically a bug, the rule works fine with JS code.
Core rules may or may not work well with TS code. Most of the rules work perfectly well, those that have some complex issues with TS code are usually extended in the typescript plugin.
The idea here is to just slightly change the logic where it doesn’t affect JS code and in a way that doesn’t look unreasonable for JS code, but will make the rule work well with TS code. We used to make such small changes before.
Marking this issue and the PR accepted as there are three 👍 from team members.