Comments (9)
@IcodeNet did @slapbox 's fix work? I am considering closing this one if its actually ok. If I don't hear back I'll assume its ok afterall
from es6-plato.
could be related to #108 , which was also about the "elvis operator"/ optional chaning
from es6-plato.
Do you have any luck with this?
from es6-plato.
Works for us under ESLint rules:
.eslintrc.js
parser: '@babel/eslint-parser',
parserOptions: {
sourceType: 'module',
ecmaVersion: 2021,
allowImportExportEverywhere: true,
ecmaFeatures: {
jsx: true,
impliedStrict: true,
},
},
and it might also be necessary to update your babel.config.js
or equivalent file. I'm guessing the Babel parser is automatically using that file.
babel.config.js
"plugins": [
"@babel/plugin-proposal-optional-chaining",
]
Technically that ?
is called the optional chaining operator.
If that doesn't do the trick I can look through our config a bit more to try to figure out if there's something we've added to handle this.
from es6-plato.
I've added a bit to that proposed remedy. I'm guessing that the babel.config.js
file is utilized by the Babel parser, so be sure you have the @babel/plugin-proposal-optional-chaining
installed and in your Babel config.
Whatever the issue, something in our config definitely fixes it and I'm happy to help anyone get it working.
The only thing in our codebase that really trips the parser up is that we use top level await.
from es6-plato.
@slapbox are you using rollup with that, or webpack 5? For a long time top level wasn't really worth supporting because even if you parsed it, couldn't use it. Decorators have also had a tumultuous history as well.
from es6-plato.
Webpack 5 here. Honestly it's still kind of a pain even for us, but less painful than writing self-executing async functions.
There's no way they were worth using before this year. You probably already know that [email protected] supports them via its "experiments.".
Strangely, for all the errors ES6-Plato throws while parsing code containing top level awaits, it still seems to complete fine. I need to check the output for one of those specific files when I can though and report back. We only use top-level in a couple files.
from es6-plato.
Hmmm... Our "fix" may not actually work. Looks like it still fails to parse those files. I'm honestly not sure how I could have overlooked it, but I can't get it working by moving backwards in our commit history so I have to assume human error here.
from es6-plato.
I fixed by replace "typhonjs-escomplex": "0.0.12" with "typhonjs-escomplex": "0.1.0". @slapbox
from es6-plato.
Related Issues (20)
- report in published package HOT 1
- misleading releases / tags HOT 5
- enable Travis CI HOT 1
- two lockfiles HOT 2
- Still maintained? Support for ES2020 HOT 6
- Lodash fails npm audit
- Latest version is not published on npm yet. HOT 6
- Typescript support
- [Feature Request]: Show standard lines of code over time, like is done with average lines of code
- globby 8.0.1 dependency is broken HOT 4
- Remove Grunt Casper entirely
- ES6 object shorthand function support HOT 1
- TypeError: Cannot read property 'sloc' of undefined HOT 1
- .eslintrc camelcase configuration error HOT 6
- Create new / missing tagged release(s) HOT 6
- Upgrade eslint to v6 HOT 1
- Lodash 4.17.11 has a security vulnerability HOT 3
- typhonjs-escomplex v0.1.0 causing errors HOT 2
- linting errors (eslint) not shown HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from es6-plato.