Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update some configuration for development experience #40

Closed
Keith-CY opened this issue Nov 24, 2022 · 3 comments
Closed

Update some configuration for development experience #40

Keith-CY opened this issue Nov 24, 2022 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@Keith-CY
Copy link
Member

  1. add a format npm script and run it with staging files on committing;
  2. update prettier to remove semicolons.
@Keith-CY
Copy link
Member Author

PR: #44

@homura
Copy link
Contributor

homura commented Nov 24, 2022

Using semi will make the code style consistent, so it is recommended to use semi

Certain ECMAScript statements (empty statement, variable statement, expression statement, do-while statement, continue statement, break statement, return statement, and throw statement) must be terminated with semicolons

https://262.ecma-international.org/5.1/#sec-7.9

@Keith-CY
Copy link
Member Author

Keith-CY commented Nov 24, 2022

Using semi will make the code style consistent, so it is recommended to use semi

Certain ECMAScript statements (empty statement, variable statement, expression statement, do-while statement, continue statement, break statement, return statement, and throw statement) must be terminated with semicolons

262.ecma-international.org/5.1/#sec-7.9

This is just a matter of code style and has been agreed upon by other members.

The title of the section referenced above is Automatic Section Insertion which is known as ASI that specifies how the semicolon should be inserted by interpreter. The conclusion of this section These situations are described by saying that semicolons are automatically inserted into the source code token stream in those situations. also proves it.

And the specification/TC39 committee has no bias on the code style

Ref: tc39/ecma262#1062 (review)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

No branches or pull requests

2 participants