Coder Social home page Coder Social logo

ASI about js HOT 2 CLOSED

bevacqua avatar bevacqua commented on August 15, 2024
ASI

from js.

Comments (2)

bevacqua avatar bevacqua commented on August 15, 2024

Well. Knowing to use ; before ( and [ if they come after a \n, and not to do return\nvalue is not necessarily something to be proud of. I'd rather have code be consistent (just using ; everywhere), than having to bother following those rules.

Not really FUD, the rules are obtuse. The solution proposed by standard, where the linter watches for these corner cases and tells you to patch them is pretty elegant, though. You're welcome to create a pull request citing this alternative

from js.

NadyaNayme avatar NadyaNayme commented on August 15, 2024

That's a rather over-complicated way of saying "never start a line with ( or [ "... The specifics aren't overly important in that regard as the simple and easy to remember rule would prevent the specific "gotchas!" although the specifics are still good to know to better your understanding of the Javascript parser.

Code would be consistent with or without ; as long as it picked one style and stuck with it. ;)

Again, I don't care which people decide to use. So long as the code base is consistent. I actually prefer using ; , however my reasoning to do so is aesthetic in purpose rather than being based on FUD (we're going to have to agree to disagree on the information surrounding ASI being FUD or not it seems)

I'll submit a PR as suggested sometime tomorrow that proposes using a linter to watch for the "gotcha!" as an easy-fix to any possible ASI issues of not using semi-colons.

from js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.