parcel-bundler / parcel

The zero configuration build tool for the web. 📦🚀
https://parceljs.org
MIT License
43.43k stars 2.26k forks source link

export-default-from proposal is enabled #9473

Open char0n opened 9 months ago

char0n commented 9 months ago

Here is an example:

const from = 3;
export default from;

@parcel/transformer-js: Unexpected token ;. Expected a string literal


The code uses reserved keyword from, but in this context it's completely valid JavaScript.

mischnic commented 9 months ago

I'm not entirely sure why, Parcel has the export-default-from proposal enabled: https://github.com/parcel-bundler/parcel/blob/cd447dc4edaa3a6ff6b40fbfd41998656dad3515/packages/transformers/js/core/src/lib.rs#L549 and according to that, what you're seeing is the correct behaviour... https://github.com/tc39/proposal-export-default-from/issues/2

char0n commented 9 months ago

Hi @mischnic,

Ahh, interesting that parcel is implementing Stage 1 proposals. Anyway it's clear now why it happens. Thanks! I've adopted naming changes withing the code to void situation however the proposal endup.