FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

tools: enable additional lint rules by Trott · Pull Request #5357 · nodejs/node · GitHub

/ node Public

tools: enable additional lint rules - #5357

Closed
Trott wants to merge 1 commit into
nodejs:masterfrom
Trott:moar-rules
Closed

tools: enable additional lint rules#5357
Trott wants to merge 1 commit into
nodejs:masterfrom
Trott:moar-rules

Conversation

Trott commented Feb 22, 2016

Copy link
Copy Markdown
Member

Enable additional likely-uncontroversial lint rules:

  • comma-dangle set to prohibit dangling commas on objects and arrays
    that are defined on a single line. Multi-line definitions can use or
    omit a trailing comma.
  • no-unused-labels Prohibits defining a label that is not used.
  • no-path-concat Prohibits string-concatenation using __dirname and
    __filename. Use path.join(), path.resolve(), or template strings
    instead.
  • no-new-symbol disallow use of new operator with Symbol object.
    Violating this rule would result in a TypeError at runtime.

Enable additional likely-uncontroversial lint rules:

* `comma-dangle` set to prohibit dangling commas on objects and arrays
that are defined on a single line. Multi-line definitions can use or
omit a trailing comma.

* `no-unused-labels` Prohibits defining a label that is not used.

* `no-path-concat` Prohibits string-concatenation using i`__dirname` and
`__filename`. Use `path.join()`, `path.resolve()`, or template strings
instead.

* `no-new-symbol` disallow use of `new` operator with `Symbol` object.
Violating this rule would result in a `TypeError` at runtime.`
Trott added tools Issues and PRs related to the tools directory. lts-watch-v4.x labels Feb 22, 2016

targos commented Feb 22, 2016

Copy link
Copy Markdown
Member

cjihrig commented Feb 22, 2016

Copy link
Copy Markdown
Contributor

rvagg commented Feb 23, 2016

Copy link
Copy Markdown
Member

I had to look up comma-dangle to see what the implications are, for anyone else interested: http://eslint.org/docs/rules/comma-dangle

The following patterns are considered problems when configured "only-multiline":

/*eslint comma-dangle: [1, "only-multiline"]*/

var foo = { bar: "baz", qux: "quux", };

var arr = [1,2,];

var arr = [1,
    2,];

But things like this are still OK:

var foo = {
    bar: "baz",
    qux: "quux",
};

var arr = [1,
    2];

I can't find the previous discussion about dangling commas, if you know where it was would you mind @-mentioning anyone that objected to disallowing dangling commas (my recollection of that discussion) to give them a chance to weigh in here @Trott?

LGTM

Trott commented Feb 23, 2016

Copy link
Copy Markdown
Member Author

@rvagg Sure! Although the objection was to the default comma-dangle behavior which flagged about 80 or so lines of our current code base. This far more lenient version flags zero lines of our current code base.

Should be non-controversial, I think, but just in case, as requested by @rvagg, @-mentioning previous objectors: @Fishrock123 @bnoordhuis

Previous discussion is here: #5091

Copy link
Copy Markdown
Contributor

I'm ok with only-multiline.

Trott added a commit to Trott/io.js that referenced this pull request Feb 24, 2016
Enable additional likely-uncontroversial lint rules:

* `comma-dangle` set to prohibit dangling commas on objects and arrays
that are defined on a single line. Multi-line definitions can use or
omit a trailing comma.

* `no-unused-labels` Prohibits defining a label that is not used.

* `no-path-concat` Prohibits string-concatenation using i`__dirname` and
`__filename`. Use `path.join()`, `path.resolve()`, or template strings
instead.

* `no-new-symbol` disallow use of `new` operator with `Symbol` object.
Violating this rule would result in a `TypeError` at runtime.`

PR-URL: nodejs#5357
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>

Trott commented Feb 24, 2016

Copy link
Copy Markdown
Member Author

Landed in 9534f6d

Trott closed this Feb 24, 2016
rvagg pushed a commit that referenced this pull request Feb 27, 2016
Enable additional likely-uncontroversial lint rules:

* `comma-dangle` set to prohibit dangling commas on objects and arrays
that are defined on a single line. Multi-line definitions can use or
omit a trailing comma.

* `no-unused-labels` Prohibits defining a label that is not used.

* `no-path-concat` Prohibits string-concatenation using i`__dirname` and
`__filename`. Use `path.join()`, `path.resolve()`, or template strings
instead.

* `no-new-symbol` disallow use of `new` operator with `Symbol` object.
Violating this rule would result in a `TypeError` at runtime.`

PR-URL: #5357
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
rvagg pushed a commit that referenced this pull request Feb 27, 2016
Enable additional likely-uncontroversial lint rules:

* `comma-dangle` set to prohibit dangling commas on objects and arrays
that are defined on a single line. Multi-line definitions can use or
omit a trailing comma.

* `no-unused-labels` Prohibits defining a label that is not used.

* `no-path-concat` Prohibits string-concatenation using i`__dirname` and
`__filename`. Use `path.join()`, `path.resolve()`, or template strings
instead.

* `no-new-symbol` disallow use of `new` operator with `Symbol` object.
Violating this rule would result in a `TypeError` at runtime.`

PR-URL: #5357
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Fishrock123 mentioned this pull request Mar 1, 2016
5 tasks
MylesBorins pushed a commit that referenced this pull request Mar 17, 2016
Enable additional likely-uncontroversial lint rules:

* `comma-dangle` set to prohibit dangling commas on objects and arrays
that are defined on a single line. Multi-line definitions can use or
omit a trailing comma.

* `no-unused-labels` Prohibits defining a label that is not used.

* `no-path-concat` Prohibits string-concatenation using i`__dirname` and
`__filename`. Use `path.join()`, `path.resolve()`, or template strings
instead.

* `no-new-symbol` disallow use of `new` operator with `Symbol` object.
Violating this rule would result in a `TypeError` at runtime.`

PR-URL: #5357
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
MylesBorins pushed a commit that referenced this pull request Mar 21, 2016
Enable additional likely-uncontroversial lint rules:

* `comma-dangle` set to prohibit dangling commas on objects and arrays
that are defined on a single line. Multi-line definitions can use or
omit a trailing comma.

* `no-unused-labels` Prohibits defining a label that is not used.

* `no-path-concat` Prohibits string-concatenation using i`__dirname` and
`__filename`. Use `path.join()`, `path.resolve()`, or template strings
instead.

* `no-new-symbol` disallow use of `new` operator with `Symbol` object.
Violating this rule would result in a `TypeError` at runtime.`

PR-URL: #5357
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Trott deleted the moar-rules branch January 13, 2022 22:42
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tools Issues and PRs related to the tools directory.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants


Back | FazBrowse Home | New Git URL