zertosh / eslint-plugin-flow-vars Goto Github PK
View Code? Open in Web Editor NEWSolves the problem of false positives with `no-undef` and `no-unused-vars` when using babel-eslint
Solves the problem of false positives with `no-undef` and `no-unused-vars` when using babel-eslint
When updating, it would be really useful to have a list of the changes included in each release somewhere. This will make it easier to know how to best handle the update (e.g. enable new rules).
Hi, great package. Works as advertised.
I have no idea if this can be implemented but it would be cool to suppress this:
import { Foo } from './foo.js';
import type { Bar } from './foo.js'; // <- ESLint warns for duplicate import
At the moment, we explicitly suppress the warning with // eslint-disable-next-line no-duplicate-imports
I'm getting following warnings for the exact setup as in README
1:1 warning Definition for rule 'flow-vars/define-flow-type' was not found flow-vars/define-flow-type
1:1 warning Definition for rule 'flow-vars/use-flow-type' was not found flow-vars/use-flow-type
Did I miss something?
This plugin stopped working with newest eslint and babel-eslint.
This is what I got:
Cannot read property 'type' of undefined
TypeError: Cannot read property 'type' of undefined
at isFunction (/usr/local/lib/node_modules/eslint/lib/rules/no-use-before-define.js:49:28)
at isFunctionOrOuterClass (/usr/local/lib/node_modules/eslint/lib/rules/no-use-before-define.js:74:12)
at /usr/local/lib/node_modules/eslint/lib/rules/no-use-before-define.js:162:17
at Array.forEach (native)
at findVariablesInScope (/usr/local/lib/node_modules/eslint/lib/rules/no-use-before-define.js:149:26)
at EventEmitter.findVariables (/usr/local/lib/node_modules/eslint/lib/rules/no-use-before-define.js:184:9)
at emitOne (events.js:83:20)
at EventEmitter.emit (events.js:170:7)
at NodeEventGenerator.leaveNode (/usr/local/lib/node_modules/eslint/lib/util/node-event-generator.js:51:22)
at CodePathAnalyzer.leaveNode (/usr/local/lib/node_modules/eslint/lib/code-path-analysis/code-path-analyzer.js:611:23)
If I either stop using no-use-before-define
or the flow-vars
rule, this error stop appearing; however, if I remove the flow-vars
rules, I get all the annoying "errors" from eslint that this module is for.
Thanks for this very useful library. Great to have seamless linting of flow-annotated code!
ESLint is complaining that $Shape is not defined (no-undef)
. See http://sitr.us/2015/05/31/advanced-features-in-flow.html for a list of useful (although still undocumented) advanced types in flow.
Hey,
For fixing the false positive problem with eslint shouting about no-undef
and no-unused-vars
this plugin is working great. Much appreciated!
I wonder what it would take to get eslint to check for untyped arguments and return values? Does that fall within the scope of this plugin?
For example, code like this…
function multiplyByTwo(number) {
return number * 2;
}
… would run against these additional rules …
{
"flow-vars/no-argument-type": 2,
"flow-vars/no-return-type": 2
}
… with this result:
1:15 error Function arguments must have type annotations flow-vars/no-argument-type
1:19 error Function return value must have a type annotation flow-vars/no-return-type
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.