Skip to content

Change the default ESLint config for common template to include "root": true #86

@anfriis

Description

@anfriis

Feature request

If this flag is not set, ESLint will automatically look for eslint config files in the directory of the file to be linted, and in successive parent directories all the way up to the root directory of the filesystem (reference). So if using your new package e.g. as a git submodule, the package's config can conflict with the parent project's config, causing ESLint to fail.

Why it is needed

The above mentioned issue happened when running yarn lint for my new package, that was included as a git submodule for my main project. I can't think of any primary use cases where you would want the eslint config of this package to search for configs in parent directories, at least it shouldn't be the default behaviour IMO.

Possible implementation

Add the "root": true flag to the default ESLint config in the package.json for the common template.

Code sample

anfriis@3a91f5f

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions