Skip to content

ember new in v3.15.1 resolves an older major version of eslint than v.3.14.0 did #9005

Closed

Description

@happycollision

Edit: This is wrong. Further investigation revealed the problem was with specifically the octane build in 3.14.0, which apparently did not include ember-cli-eslint. So the real workaround for any folks who find this is to remove ember-cli-eslint and alter the test script as suggested in https://github.com/emberjs/rfcs/blob/master/text/0121-remove-ember-cli-eslint.md

Problem

Running ember new <some-name> --yarn with ember-cli v3.15.1 results in [email protected]. Running the same command in ember-cli v3.14.0 results in [email protected].

Reproduction

  1. With v3.15.1 (maybe also with v3.15.0?), run ember new old-eslint --yarn (maybe you don't even need --yarn)

Expected

Eslint version is 6.x

Actual

Eslint version is 5.x

Repercussions

This breaks .eslintrc.js files for those of us that modify by adding an extends rule to an overrides object. I am guessing you didn't notice because you removed the thing that would have tripped you up in d0359cc. There are likely other bugs created for people who modify their configs as well.

In my particular case, because this pulls in an old version of eslint, I get Unexpected top-level property "overrides[1].extends" with a config that includes:

  overrides: [
    // Typescript files
    {
      files: ['**/*.ts'],
      parser: '@typescript-eslint/parser',
      excludedFiles: ['node_modules/**'],
      plugins: ['@typescript-eslint'],
      extends: ['plugin:@typescript-eslint/recommended', 'prettier', 'prettier/@typescript-eslint'],
      rules: {
       ...
      },
    },

Adding the following to my package.json fixes the issue:

  "resolutions": {
    "eslint": "6.7.1"
  },

Output from ember version --verbose && npm --version && yarn --version:

ember-cli: 3.15.1
http_parser: 2.8.0
node: 10.15.0
v8: 6.8.275.32-node.45
uv: 1.23.2
zlib: 1.2.11
ares: 1.15.0
modules: 64
nghttp2: 1.34.0
napi: 3
openssl: 1.1.0j
icu: 62.1
unicode: 11.0
cldr: 33.1
tz: 2018e
os: darwin x64
6.4.1
1.19.2

Activity

  1. happycollision commented on Jan 3, 2020

    @happycollision
    Author

    Hmm. The resolutions thing fixes yarn lint:js but still fails when I run ember test. This is only tangential to this bug, but I will document my continued workarounds as I discover them anyway.

  2. happycollision commented on Jan 3, 2020

    @happycollision
    Author

    The package that seems to be pulling the eslint version down is broccoli-lint-eslint which is pulled in from ember-cli-eslint. Oddly, my 3.14.0 app did not include ember-cli-eslint. Perhaps because I initiated with the octane blueprint? So I guess the workaround is actually to remove ember-cli-eslint

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