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.

"space-before-blocks" not working correctly

See original GitHub issue

Tell 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:closed
  • Created 3 years ago
  • Reactions:4
  • Comments:16 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
mdjermanoviccommented, Aug 9, 2020

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.

0reactions
mdjermanoviccommented, Oct 19, 2020

Marking this issue and the PR accepted as there are three 👍 from team members.

Read more comments on GitHub >

github_iconTop 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 >

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