Comments (21)
Same for generator comprehensions.
from babel-eslint.
Is there any plan to implement support for array/generator comprehensions?
It would be great ;)
Thanks for reply.
from babel-eslint.
Not sure if it's possible because it'd require patching too much of escope
and I'm not sure if it'd be possible. Patches are welcome :)
On Tuesday, 14 April 2015, Ondřej Ždych [email protected] wrote:
Is there any plan to implement support for array/generator comprehensions?
It would be great ;)
Thanks for reply.
—
Reply to this email directly or view it on GitHub
#9 (comment).
Sebastian McKenzie
from babel-eslint.
I guess this won't be too different from #72?
from babel-eslint.
For what it's worth, I've used this as a hack to work around this for now:
/*global cVar*///NOTE: "fix" linter errs for comprehension vars
from babel-eslint.
@KylePDavis that helps, thanks
from babel-eslint.
Hey everyone, does #114 fix your issues?
from babel-eslint.
Thanks, @hzoo, that does seem to fix the no-undef
rule complaints but it also seems to trigger block-scoped-var
complaints.
Example:
"use strict";
export default [for (i of global) String(i)];
//OR: (for (i of global) String(i));
Errors:
2:21 error "i" used outside of binding context block-scoped-var
2:41 error "i" used outside of binding context block-scoped-var
from babel-eslint.
Ah dang I probably added the variable in the wrong scope.. (most likely just need to move it up a level?) or it's not that straightforward haha.
from babel-eslint.
@KylePDavis yeah I'm not sure at the moment =/. I guess this is besides the point but if you are using babel (with let/const) which are already block scope then you wouldn't need the rule (block-scoped-var
) anymore right? Or is there something else that it catches?
from babel-eslint.
f921efa works great for me, only no-unused-vars
false-triggering now in my comprehensions code.
from babel-eslint.
@gaearon Can you give me a code snippet that is failing for you? I can add no-unused-vars
to the tests now.
from babel-eslint.
function getFirstAtom(stores) {
return new Map([
for (store of stores)
[store, undefined]
]);
}
getFirstAtom();
stores
parameter is reported to be unused.
Thanks a lot for the effort! Your work saved me a lot of headache in the past few weeks.
from babel-eslint.
Ah ok I didn't visit the node.right
(stores in your case). Shouldn't be too hard to fix.
Awesome! It's be fun contributing and learning all this stuff (btw react-hot-loader
has been great).
from babel-eslint.
@gaearon See if the next commit fixes it hzoo@8e254b7.
from babel-eslint.
@hzoo Works great. Thanks again.
from babel-eslint.
Still getting this issue with the below snippet, more specifically the block-scoped-var
function entries(obj) {
return (for (key of Object.keys(obj)) [key, obj[key]])
}
from babel-eslint.
Are you sure you're on the latest version? I don't get this problem any
more.
On Tue, 14 Jul 2015 at 22:27, Declan de Wet [email protected]
wrote:
Still getting this issue with the below snippet
function entries(obj) {
return (for (key of Object.keys(obj)) [key, obj[key]])
}—
Reply to this email directly or view it on GitHub
#9 (comment).
from babel-eslint.
@callumlocke yep:
from babel-eslint.
@declandewet can you make a seperate issue for this? The original issue was for no-undef
and this is for block-scoped-var
/
from babel-eslint.
from babel-eslint.
Related Issues (20)
- Latest Babel + flow generates "is not defined" errors on star imports HOT 3
- npm WARN [email protected] requires a peer of @babel/core@>=7.2.0 but none is installed HOT 3
- Disabling eslint on file does not work HOT 2
- Using decorator syntax doesn't pass eslint HOT 7
- There are no release notes for 10.1.0 HOT 2
- Imports from sibling directory not parsed using babel config HOT 2
- 11.0.0-beta.2 - Private method is not defined. (eslintno-undef) HOT 7
- eslint returns with parsing error unexpected token HOT 4
- How to use babel-eslint in a non-node JS environment (such as client environment, browser) HOT 6
- Breaking change in Node 13.13 HOT 2
- Typescript: parsing error when using "readonly" in interface HOT 2
- Expected indentation is forced for comments as well HOT 1
- Question: `11.0.0-beta2` Not installing all babel plugins (top level await) HOT 1
- no-unused-vars false positive with typescript types HOT 2
- Feature idea: have a way for eslint-plugin-prettier to share an AST with eslint HOT 4
- Missing 'ImportExpression' in visitorKeys HOT 4
- `RegExpLiteral` is not converted to `Literal` in an edge case HOT 2
- Template-literal rule attempting to run on nullish coalescing operations, and then crashing eslint HOT 1
- Error on 'extends' operator on generic type HOT 1
- works for me HOT 1
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 babel-eslint.