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.

no-extra-semi exception or new option

See original GitHub issue

http://eslint.org/docs/rules/no-extra-semi

  • ESLint 2.9.0
  • being able to safely concatenate several JS files into one and use no-extra-semi at the same time

If the first character of the file—excluding the eventual preceding whitespace—is ; it should be ignored. cf http://stackoverflow.com/q/1873983/248058

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:2
  • Comments:22 (16 by maintainers)

github_iconTop GitHub Comments

1reaction
platinumazurecommented, May 30, 2016

Let’s be careful not to mis-characterize each other’s comments.

@Mouvedia I think by “appeal to authority”, @michaelficarra was referring to the Stack Overflow link, but I don’t think you were actually trying to cite it as an authority (rather, you were more likely just using it as a reference). As much as possible, we should try to assume positive intent and assume that @michaelficarra was just trying to say we needed to test it ourselves.

And I think it’s good for all of us to understand that @michaelficarra and @Mouvedia are coming from different (but equally valid) places here. @Mouvedia is talking about the common experience of concatenation and left out a few subconscious assumptions. @michaelficarra is talking about corner cases that are still nonetheless worth considering. The challenge is to find some common ground. 😄

My personal take (bearing in mind I’m not on the core team) is that even if semicolon prefixing might not be sufficient, it is still commonly done and might deserve some consideration. I also don’t think that no-extra-semi was designed to flag for this particular anti-pattern, and so it doesn’t seem right that it should take on this extra responsibility. I could see a new rule for ensuring that the beginning of file allows for safe concatenation. At this point, though, I still think there is merit in a rule option to avoid a semicolon from being flagged at the beginning of the file by the no-extra-semi rule specifically.

0reactions
nzakascommented, Jun 1, 2016

Okay, there’s no consensus on the team so we can’t move forward with this.

@Mouvedia as @byk mentioned, you can always take the rule and modify it to do what you want for your own project.

Read more comments on GitHub >

github_iconTop Results From Across the Web

no-extra-semi - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >
naming-convention | typescript-eslint
Options ​. This rule accepts an array of objects, with each object describing a different naming convention. Each property will be described in...
Read more >
No-multi-spaces - ESLint - W3cubDocs
This option is an object that expects property names to be AST node types as defined by ESTree. The easiest way to determine...
Read more >
Eslint custom rule live preview - javascript - Stack Overflow
... url: "https://eslint.org/docs/rules/no-extra-semi", }, fixable: "code", schema: [], // no options messages: { suggestComment: "Test ...
Read more >
JS Guidelines - cPanel Style Guide
ESLint Style Rules, Use this configuration with the --fix option to fix style ... (If you overwrite the exception, it loses the ability...
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