Skip to content

setting environments in shared config? #666

@rhbecker

Description

@rhbecker

Hey, I'm still getting up to speed on eslint and your implementation of shared config, so apologies if any of this feedback isn't quite right. And I'm happy to generate PRs for anything you think work addressing ...

env configured in 3 files ...

  1. legacy.js

    a. 'browser': true
    b. 'node': true
    c. 'amd': false
    d. 'mocha': false
    e. 'jasmine': false

  2. rules/node.js: 'node': true

  3. rules/es6.js: 'es6': false

issues

  1. Why is legacy.js disabling amd, mocha, and jasmine? Aren't environments off until explicitly enabled?
  2. Why is legacy.js enabling browser and node? While these may be the most common usage contexts, that seems to overstep the role of this style-guide-based shared config, which might be used in a variety of circumstances. Even if that weren't the case, any "efficiency" gained in enabling both by default would seemingly be lost when most users then have to disable one or the other. Maybe I'm missing something?
  3. Similarly - and this may seem like an odd question - why is rules/node.js enabling node? The fact that legacy.js extends rules/node.js, and the fact that everything else extends legacy.js, means that node is always enabled. If the rules in rules/node.js are "safe" to be included everywhere, I think it makes sense to keep that rule set in the chain of extensions, but then I don't think it makes sense for the env to be configured in there. If the rules in rules/node.js are NOT "safe" to be included everywhere, its place in the extension chain needs to be altered, at which point, it might end up making sense to leave the env config in there, similar to how es6 env config makes sense as you have it, in a rule set only included in an extension chain used by those intending to use es6.
  4. Depending on how you respond to the prior 2 issues, this might be moot, but it seems redundant that node env is enabled in both legacy.js and rules/node.js.

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