Skip to content

Conversation

@mgol
Copy link
Member

@mgol mgol commented Apr 8, 2020

The no-extra-semi rule:
https://eslint.org/docs/rules/no-extra-semi
disallows unnecessary semicolons, e.g. it forbids the following:

var x = 5;;

function foo() {
    // code
};

In jQuery we usually don't add a semicolon at the end of function declarations
but I found a few cases where we do, creating an inconsistency.

The no-irregular-whitespace rule:
https://eslint.org/docs/rules/no-irregular-whitespace
forbids most whitespaces that may be hard to notice in source. We have one such
occurrence in Core code that would be good to forbid.

Fixes #15

cc @jquery/core @Krinkle @leobalter

The no-extra-semi rule:
https://eslint.org/docs/rules/no-extra-semi
disallows unnecessary semicolons, e.g. it forbids the following:
```js
var x = 5;;

function foo() {
    // code
};
```

In jQuery we usually don't add a semicolon at the end of function declarations
but I found a few cases where we do, creating an inconsistency.

The no-irregular-whitespace rule:
https://eslint.org/docs/rules/no-irregular-whitespace
forbids most whitespaces that may be hard to notice in source. We have one such
occurrence in Core code that would be good to forbid.

Fixes jquery#15
@mgol mgol changed the title Enable no-extra-semi Enable no-extra-semi & no-irregular-whitespace Apr 8, 2020
@Krinkle
Copy link
Member

Krinkle commented Apr 8, 2020

@mgol Thanks, LGTM! Seems in line with the spirit of https://contribute.jquery.org/style-guide/js/ as well, although not explicitly spelled out there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable some eslint:recommended rules

4 participants