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.

lines-around-comment ES2015 classes in new allowClassStart option

See original GitHub issue

Tell us about your environment

  • ESLint Version: v4.0.0-alpha.2
  • Node Version: v7.10.0
  • npm Version: 4.5.0

What parser (default, Babel-ESLint, etc.) are you using? default

Please show your full configuration: --env es6 --rule lines-around-comment:["error",{allowObjectStart:true}]

What did you do? Please include the actual source code causing the issue.

class A {
  /* test */
  constructor() {}

What did you expect to happen? No errors.

What actually happened? Please include the actual, raw output from ESLint. 2:3 error Expected line before comment lines-around-comment

For #2894 @gyandeeps added ES2015 classes to “allowBlockStart” via 9a2dcc2 disallowing an empty line before a comment block just within a class, but it seems like it would be more appropriate as part of its own “allowClassStart”.

This proposed change would better match the breaking change in #7879 by @alberto in e232464 where classes are treated differently than block statements. In particular, if someone had --rule padded-blocks:["error","never"] in addition to the above --rule lines-around-comment:["error",{allowObjectStart:true}], neither rule would be happy with a line or without a line, but if the code was using let A = { instead of a class, it would be fine.

I would think that moving class from allowBlockStart would also be a breaking change.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:4
  • Comments:15 (15 by maintainers)

github_iconTop GitHub Comments

platinumazurecommented, Jun 26, 2017

@Mardak @not-an-aardvark @ilyavolodin @ljharb Apologies, seems we’ve lost track of this.

Can anyone please summarize where we’re at and what our next steps should be? Thanks!

not-an-aardvarkcommented, Oct 13, 2017


Read more comments on GitHub >

github_iconTop Results From Across the Web

eslint @ 5.12.0 .. 5.16.0 - Package Diff
const loadedRules = this.linter.getRules();. + // Ajv validator with default schema will mutate original object, so we must clone it recursively. + this.options...
Read more >
Vue3.0 ESLint Rules 规则配置
Vue3.0 ESLint Rules 规则配置目前没发现其他需要额外添加的规则_1671465600.
Read more >
vscode - BARAN 的笔记
按钮5:重启⇧⌘F5;; 按钮6:停止⇧F5. VSCode launch.json常用变量. ${workspaceRoot}:VS Code当前打开的文件夹; ${file} ...
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 Post

No results found

github_iconTop Related Hashnode Post

No results found