Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace deprecated babel-eslint with new @babel/eslint-parser #9307

Closed
NullVoxPopuli opened this issue Aug 28, 2020 · 6 comments · Fixed by #10142
Closed

Replace deprecated babel-eslint with new @babel/eslint-parser #9307

NullVoxPopuli opened this issue Aug 28, 2020 · 6 comments · Fixed by #10142

Comments

@NullVoxPopuli
Copy link
Contributor

This is mostly a tracking issue as I am not in a place to open a PR for this atm, but,

here in the app blueprint: https://github.com/ember-cli/ember-cli/blob/master/blueprints/app/files/package.json#L29
we're still using babel-eslint,
but, per, https://github.com/babel/babel-eslint, the eslint parser for babel has moved into their monorepo as https://github.com/babel/babel/tree/master/eslint/babel-eslint-parser

@SergeAstapov
Copy link
Contributor

I would assume biggest show-stopper here is

@babel/eslint-parser requires @babel/core@>=7.2.0 and a valid Babel configuration file to run. If you do not have this already set up, please see the Babel Usage Guide.

because Ember CLI projects do not have dedicated Babel configuration file and may use ember-cli-babel@6.

@bmish
Copy link
Member

bmish commented May 10, 2021

I started an implementation in #9532:

  • I think we can use requireConfigFile: false to avoid needing a Babel config file
  • But I'm not sure what to do about the requirement for having @babel/core v7+ as a peer dependency since we don't include Babel as a dependency in the blueprint at all right now...

@tehhowch
Copy link

we don't include Babel as a dependency in the blueprint at all right now

Perhaps not explicitly, but the default blueprint adds it to new projects. It shouldn't be a surprise to users, either, as the Ember CLI intro explicitly states

Out of the box, your application will include:

  • A development server.
  • Template compilation.
  • JavaScript and CSS minification.
  • Modern features via Babel.

If one runs ember new my-app, the resulting package lockfile requires @babel/core due to embroider, broccoli-babel-transpiler, ember-auto-import, ember-cli, ember-cli-babel, and workerpool.

So moving it into package.json as a devDep or peerDep will just now be explicitly stating the dependency exists, rather than it being a transitive dependency.

@bmish
Copy link
Member

bmish commented May 11, 2021

@tehhowch great point! In fact, I just noticed that a bunch of other dependencies in a fresh Ember app already have an unmet peer dependency on @babel/core, so I think we can ignore this given that it's most certainly a transitive dependency (and I think ember-cli-babel is intended to be a wrapper around / manage the version of @babel/core anyway). CC: @rwjblue

warning "ember-resolver > babel-plugin-debug-macros@0.3.4" has unmet peer dependency "@babel/core@^7.0.0".
warning "ember-maybe-import-regenerator > ember-cli-babel > babel-plugin-debug-macros@0.2.0" has unmet peer dependency "@babel/core@^7.0.0-beta.42".
warning "ember-source > @babel/plugin-transform-block-scoping@7.14.1" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "@glimmer/component > ember-cli-typescript > @babel/plugin-transform-typescript@7.5.5" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "ember-data > @ember-data/private-build-infra > ember-cli-typescript > @babel/plugin-transform-typescript@7.8.7" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "ember-load-initializers > ember-cli-typescript > @babel/plugin-transform-typescript@7.4.5" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "ember-source > @babel/plugin-transform-object-assign@7.12.13" has unmet peer dependency "@babel/core@^7.0.0-0".

I have moved my PR #9532 into ready-for-review.

@ctjhoa
Copy link
Contributor

ctjhoa commented Oct 15, 2021

Relates to emberjs/ember-cli-babel#366

@ctjhoa
Copy link
Contributor

ctjhoa commented Nov 4, 2021

Another PR #9669

ctjhoa pushed a commit to concordnow/ember-aria-tabs that referenced this issue Nov 22, 2021
Need to ignore eslint 8 until Ember community fix their issue
ember-cli/ember-cli#9307
ctjhoa pushed a commit to concordnow/ember-casl that referenced this issue Nov 22, 2021
Need to ignore eslint 8 until Ember community fix their issue
ember-cli/ember-cli#9307
ctjhoa pushed a commit to concordnow/tinymce-ember that referenced this issue Nov 22, 2021
Need to ignore eslint 8 until Ember community fix their issue
ember-cli/ember-cli#9307
ctjhoa pushed a commit to concordnow/ember-sidenotes that referenced this issue Nov 22, 2021
Need to ignore eslint 8 until Ember community fix their issue
ember-cli/ember-cli#9307
ctjhoa pushed a commit to concordnow/ember-content-loader that referenced this issue Nov 22, 2021
Need to ignore eslint 8 until Ember community fix their issue
ember-cli/ember-cli#9307
jacobq added a commit to jacobq/repro-ember-drag-drop-on-ember4-embroider-app that referenced this issue Feb 28, 2022
Upgrading it seems to break stuff with babel-parser. See:

* ember-cli/ember-cli#9307
* ember-cli/ember-cli#9669
simonihmig added a commit to embroider-build/addon-blueprint that referenced this issue May 25, 2022
Using `ecmaVersion: 'latest'` (introduced in #6) seems to not work at all, due to `babel-eslint` being outdated und unmaintained. This replaces it with is successor `@babel/eslint-parser`.

There has been some discussion about doing the same in the main blueprint (see ember-cli/ember-cli#9307 and emberjs/rfcs#817), but in our case the switch should be easy, for example as we already have a `babel.config.js`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants