Skip to content

Update eslint rules #3162

Closed
Closed

Description

@antoinerg

Following @etpinard's #3158 (comment), we should probably update our linter syntax to reflect the current coding style.

In particular we should probably add "one-var": { "initialized": "never", "uninitialized": "consecutive" } and fix any possible errors.

Update: the "initialized" part got done in #3374

Activity

  1. changed the title [-]Update lint style[/-] [+]Update eslint rules[/+] on Oct 25, 2018
  2. etpinard commented on Oct 26, 2018

    @etpinard
    Contributor

    We should also add the camelcase rule with the {"properties": "never"} option. I've seen a few community developers defining snake-case variables in their PRs.

    Done in #3374

  3. alexcjohnson commented on Oct 26, 2018

    @alexcjohnson
  4. etpinard commented on Oct 26, 2018

    @etpinard
  5. etpinard commented on Oct 29, 2018

    @etpinard
    Contributor
  6. etpinard commented on Dec 21, 2018

    @etpinard
    Contributor

    from #3020


    consider enabling https://eslint.org/docs/rules/no-shadow - can save us from some very confusing bugs.

    As @etpinard mentions in #3017:

    That would require some work though, as no-shadow fails in more than 500 times in our codebase.

  7. etpinard commented on Jan 15, 2019

    @etpinard
    Contributor

    Potential new rule: /*eslint quote-props: ["error", "as-needed"]*/

    https://eslint.org/docs/rules/quote-props

    which fits the style in most (but not all!) of our src files.

  8. etpinard commented on Jan 21, 2019

    @etpinard
    Contributor

    Potential new rule: /*eslint padded-blocks: ["error", "never"]*/

    https://eslint.org/docs/rules/padded-blocks

    DONE in: #3697

  9. etpinard commented on Jan 24, 2019

    @etpinard
    Contributor

    Maybe update our no-multiple-empty-lines rule down to {"max": 1}

  10. archmoj commented on Apr 10, 2019

    @archmoj
    Contributor

    We previously started to dislike else statements sitting on new lines and tried to fix them in other PRs.
    lint-else

    To put all else and catch statements inline with the closing curly braces, I suggest we use "brace-style": [2, "1tbs", {"allowSingleLine": true}], instead of "brace-style": [0, "stroustrup", {"allowSingleLine": true}], then run npm run lint -- --fix on a separate PR (possibly now that we have only a few PRs open).
    We could then fix just a few edge cases where there is a comment on top of an else statement.

    DONE in: #3757

  11. etpinard commented on Apr 10, 2019

    @etpinard
  12. archmoj commented on Apr 17, 2019

    @archmoj
    Contributor
  13. etpinard commented on May 22, 2019

    @etpinard
    Contributor
  14. archmoj commented on May 22, 2019

    @archmoj
    Contributor

    Potential rule: https://eslint.org/docs/rules/max-statements-per-line

    I am a fan of it.
    Also we may limit the number of characters on each line using: https://eslint.org/docs/rules/max-len.

  15. archmoj commented on Jun 11, 2019

    @archmoj
    Contributor

    Potential rule: https://eslint.org/docs/rules/object-curly-spacing
    eslint object-curly-spacing: ["error", "always"]

  16. etpinard commented on Jul 23, 2019

    @etpinard
    Contributor

    https://eslint.org/docs/rules/no-prototype-builtins is now turned on by default in eslint v6, we turned it off in e61ee25 (as it made npm run lint fail in about ~20 places) but it might be nice turn it back on at some point

  17. archmoj commented on Aug 6, 2019

    @archmoj
    Contributor
  18. gvwilson commented on Jun 11, 2024

    @gvwilson
    Contributor

    Hi - this issue has been sitting for a while, so as part of our effort to tidy up our public repositories I'm going to close it. If it's still a concern, we'd be grateful if you could open a new issue (with a short reproducible example if appropriate) so that we can add it to our stack. Cheers - @gvwilson

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions