Skip to content

Commit

Permalink
feat(babel-plugin-flow-runtime): support babel 7
Browse files Browse the repository at this point in the history
also:
* build flow-runtime with babel 7
* build babel-plugin-flow-runtime with babel 7
* build flow-runtime-validators with babel 7
* build flow-config-parser with babel 7
* fix flow 0.88 errors in babel-plugin-flow-runtime

There are still a bunch of flow 0.88 errors in flow-runtime.
  • Loading branch information
jedwards1211 committed Jan 13, 2019
1 parent 3eb1e23 commit 9ec3aac
Show file tree
Hide file tree
Showing 96 changed files with 9,831 additions and 16,189 deletions.
42 changes: 42 additions & 0 deletions .build/.flowconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
[ignore]

# Ugh
.*/node_modules/.*/src.*
.*/node_modules/binary-extensions/.*
.*/node_modules/fbjs/.*
.*/node_modules/url-regex/.*
.*/node_modules/spdx.*
.*/node_modules/builtin-modules.*
.*/node_modules/resolve.*
.*/test/.*json$

# Ignore tests
.*/node_modules/.*/test/.*

[include]

[libs]

[options]
module.system=node

munge_underscores=true

module.name_mapper='.*\(.css\)' -> 'empty/object'
module.name_mapper='.*\(.scss\)' -> 'empty/object'
module.name_mapper='.*\(.png\)' -> 'empty/object'

suppress_type=$FlowIssue
suppress_type=$FlowIgnore
suppress_type=$FlowFixme
suppress_type=$Fixme

suppress_comment=\\(.\\|\n\\)*\\@flowFixme.*
suppress_comment=\\(.\\|\n\\)*\\@flowIgnore.*
suppress_comment=\\(.\\|\n\\)*\\@flowIssue.*

esproposal.class_instance_fields=enable
esproposal.class_static_fields=enable
esproposal.decorators=ignore

[version]
10 changes: 6 additions & 4 deletions packages/babel-plugin-flow-runtime/.babelrc
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
{
"presets": [
["env", {
["@babel/preset-env", {
"targets": {
"browsers": ["last 2 versions"]
},
"exclude": [
"transform-regenerator"
]
}],
"stage-0",
"react"
"@babel/preset-react",
"@babel/preset-flow"
],
"plugins": [
"transform-decorators-legacy"
"@babel/plugin-proposal-object-rest-spread",
["@babel/plugin-proposal-decorators", { "legacy": true }],
["@babel/plugin-proposal-class-properties", { "loose" : true }]
]
}
1 change: 0 additions & 1 deletion packages/babel-plugin-flow-runtime/.flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,5 @@ suppress_comment=\\(.\\|\n\\)*\\@flowIssue.*
esproposal.class_instance_fields=enable
esproposal.class_static_fields=enable
esproposal.decorators=ignore
unsafe.enable_getters_and_setters=true

[version]
2 changes: 1 addition & 1 deletion packages/babel-plugin-flow-runtime/config/eslint.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ module.exports = {

// https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules
'jsx-a11y/aria-role': 'warn',
'jsx-a11y/img-has-alt': 'warn',
'jsx-a11y/alt-text': 'warn',
'jsx-a11y/img-redundant-alt': 'warn',
'jsx-a11y/no-access-key': 'warn',

Expand Down
23 changes: 0 additions & 23 deletions packages/babel-plugin-flow-runtime/flow-typed/mocha.js

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
// flow-typed signature: f73b2b98bfc1369d470d587fe99be64b
// flow-typed version: <<STUB>>/@babel/cli_v^7.2.0/flow_v0.88.0

/**
* This is an autogenerated libdef stub for:
*
* '@babel/cli'
*
* Fill this stub out by replacing all the `any` types.
*
* Once filled out, we encourage you to share your work with the
* community by sending a pull request to:
* https://github.com/flowtype/flow-typed
*/

declare module '@babel/cli' {
declare module.exports: any;
}

/**
* We include stubs for each file inside this npm package in case you need to
* require those files directly. Feel free to delete any files that aren't
* needed.
*/
declare module '@babel/cli/bin/babel-external-helpers' {
declare module.exports: any;
}

declare module '@babel/cli/bin/babel' {
declare module.exports: any;
}

declare module '@babel/cli/lib/babel-external-helpers' {
declare module.exports: any;
}

declare module '@babel/cli/lib/babel/dir' {
declare module.exports: any;
}

declare module '@babel/cli/lib/babel/file' {
declare module.exports: any;
}

declare module '@babel/cli/lib/babel/index' {
declare module.exports: any;
}

declare module '@babel/cli/lib/babel/options' {
declare module.exports: any;
}

declare module '@babel/cli/lib/babel/util' {
declare module.exports: any;
}

// Filename aliases
declare module '@babel/cli/bin/babel-external-helpers.js' {
declare module.exports: $Exports<'@babel/cli/bin/babel-external-helpers'>;
}
declare module '@babel/cli/bin/babel.js' {
declare module.exports: $Exports<'@babel/cli/bin/babel'>;
}
declare module '@babel/cli/index' {
declare module.exports: $Exports<'@babel/cli'>;
}
declare module '@babel/cli/index.js' {
declare module.exports: $Exports<'@babel/cli'>;
}
declare module '@babel/cli/lib/babel-external-helpers.js' {
declare module.exports: $Exports<'@babel/cli/lib/babel-external-helpers'>;
}
declare module '@babel/cli/lib/babel/dir.js' {
declare module.exports: $Exports<'@babel/cli/lib/babel/dir'>;
}
declare module '@babel/cli/lib/babel/file.js' {
declare module.exports: $Exports<'@babel/cli/lib/babel/file'>;
}
declare module '@babel/cli/lib/babel/index.js' {
declare module.exports: $Exports<'@babel/cli/lib/babel/index'>;
}
declare module '@babel/cli/lib/babel/options.js' {
declare module.exports: $Exports<'@babel/cli/lib/babel/options'>;
}
declare module '@babel/cli/lib/babel/util.js' {
declare module.exports: $Exports<'@babel/cli/lib/babel/util'>;
}
Loading

0 comments on commit 9ec3aac

Please sign in to comment.