Skip to content

tools: question about some ESLint config options #12566

Description

@vsemozhetbyt
  • Subsystem: tools
  1. Is it worth to set the option parserOptions.sourceType as module in the lib/.eslintrc.yaml? What are pros / cons / breaking changes?

  2. Why don't we use the option root as true in the main .eslintrc.yaml ?

    By default, ESLint will look for configuration files in all parent folders up to the root directory. This can be useful if you want all of your projects to follow a certain convention, but can sometimes lead to unexpected results. To limit ESLint to a specific project, place "root": true inside the eslintConfig field of the package.json file or in the .eslintrc.* file at your project’s root level. ESLint will stop looking in parent folders once it finds a configuration with "root": true.

    Would it spare the linter some fs churn / time?

cc @not-an-aardvark, @silverwind, @Trott

Activity

  1. added
    questionIssues asking questions about Node.js.
    toolsIssues and PRs related to the tools directory.
    on Apr 21, 2017
  2. gibfahn commented on Apr 21, 2017

    @gibfahn
    Member

    2. makes sense to me.

  3. vsemozhetbyt commented on Apr 21, 2017

    @vsemozhetbyt
    ContributorAuthor

    @gibfahn I think it can even prevent some murky bugs: if somebody forgetfully leaves some .eslintrc config in a parent directory above node repo directory, some node rules can be overwritten.

  4. silverwind commented on Apr 21, 2017

    @silverwind
    Contributor
    1. there's two issues that come with that option:
    • eslint complains about unneccessary 'use strict'; statements
    • eslint also complains about return in the top scope

    why do you want to enable it? We don't have any module files yet, do we?

    1. sounds like a good addition.
  5. vsemozhetbyt commented on Apr 21, 2017

    @vsemozhetbyt
    ContributorAuthor

    @silverwind

    1. Oh, it seems I've misunderstood the option. It means ES6 modules, right?
    2. should it be:
    root: true

    at the top of the main .eslintrc.yaml?

  6. silverwind commented on Apr 21, 2017

    @silverwind
    Contributor
    1. yes, it means import/export syntax
    2. yeah
  7. Fishrock123 commented on Apr 21, 2017

    @Fishrock123
    Contributor

    Is it worth to set the option parserOptions.sourceType as module in the lib/.eslintrc.yaml?

    No. That would be incorrect as those rules are for ES Modules, e.g. no top-level return as silverwind mentioned.

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

    questionIssues asking questions about Node.js.toolsIssues and PRs related to the tools directory.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions