-
-
Notifications
You must be signed in to change notification settings - Fork 209
Bug report: Always errors for use strict #228
Comments
Thanks for the report! I think this is due to the introduction of the |
I double checked with eslint on their gitter and per nzakas they only want to support ESTree. |
I'm also facing this. |
We can definitely change directive to estree b/c that's what we've had to do for everything else anyway. If you are using modules you shouldn't need use strict since they are all in strict mode right? |
@hzoo Yeah. My code is a mix of these things right now as I'm running in my tests with Babel and other files with plain Node. I should change to use modules anyways and setup the server to run with babel :D |
I think I was just trying to copy whatever was needed from the babylon AST to estree since it uses File instead of Program but looking at what you posted I wouldn't need to add that line since estree doesn't use that anyway. |
@hzoo 👍 |
Ok still have to convert Directive to an ExpressionStatement that has a Literal - It's getting pretty annoying to do this manually. Maybe we can use some more babel utilities to make it easier. |
Sorry, I am not sure I can follow the discussion. Any hints for |
The AST is different so we have to convert it in https://github.com/babel/acorn-to-esprima/blob/master/src/toAST.js. Not much you can do other than using a different version or not using the rule. |
Yes. I am using a different version currently. But how to And I am not sure the meaning of Thanks very much. |
Oh I just meant turning off the rule AST: https://en.wikipedia.org/wiki/Abstract_syntax_tree You'll just have to wait for a fix. |
Thanks. I will check them out later on. |
It is a bit annoying, but it shouldn't be too bad. Want me to take a crack at it? (I sort of already did it before just to test things out.) |
WIP fix for this: babel/acorn-to-esprima@master...jmm:directives. I believe |
Yeah. Also, all that code needs cleanup - would be nice to be able to use more babel methods instead of stuff like |
FYI, |
Huh, so putting "Fixes {{someuser}}/{{somerepo}}#123" in a PR in a different repo closes the referenced issue when merged? Maybe just if they're under the same org? |
Yeah since you have colloborator access to the org |
Oh ok, I'll have to be more careful with that. But since you merged and published babel/acorn-to-esprima#5 it is fixed now ✨. |
Versions
.eslintrc
a.js
Reproduce error
Note
"use strict"
,"use strict";
'use strict'
and'use strict';
. None of them work.Babel-eslint v4.1.6
. No such bug occurThe text was updated successfully, but these errors were encountered: