Skip to content
This repository has been archived by the owner on Aug 19, 2022. It is now read-only.

Commit

Permalink
Merge bfe40d4 into 4cac024
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanmarks committed Aug 30, 2019
2 parents 4cac024 + bfe40d4 commit 40f14ba
Show file tree
Hide file tree
Showing 26 changed files with 2,555 additions and 1,656 deletions.
54 changes: 44 additions & 10 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,22 +1,56 @@
{
"plugins": [
"transform-decorators-legacy"
"@babel/plugin-transform-destructuring",
[
"@babel/plugin-proposal-decorators",
{
"legacy": true
}
],
[
"@babel/plugin-proposal-class-properties",
{
"loose": true,
},
],
],
"presets": [
["env", { "modules": false }],
"stage-1",
"react"
[
"@babel/preset-env",
{
"modules": false
}
],
"@babel/preset-flow",
"@babel/preset-react"
],
"env": {
"commonjs": {
"plugins": [
"@babel/plugin-transform-destructuring",
[
"@babel/plugin-proposal-decorators",
{
"legacy": true
}
],
[
"@babel/plugin-proposal-class-properties",
{
"loose": true,
},
],
],
"presets": [
"env",
"stage-1",
"react"
[
"@babel/preset-env",
{
"modules": "commonjs"
}
],
"@babel/preset-flow",
"@babel/preset-react"
],
"plugins": [
"transform-decorators-legacy"
]
}
}
}
58 changes: 37 additions & 21 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
parser: "babel-eslint"

ecmaFeatures:
jsx: true
modules: true
parserOptions:
ecmaVersion: 2018
sourceType: "module"
ecmaFeatures:
jsx: true

plugins: ["react", "flow-vars", "prettier"]
plugins: ["react", "flowtype", "prettier", "react-hooks"]

settings:
react:
pragma: "React"
version: "detect"

env:
browser: true
Expand Down Expand Up @@ -137,20 +144,20 @@ rules:
# #
###########################################################################

no-catch-shadow: 2 # disallow the catch clause parameter name being the same as a
# variable in the outer scope
no-delete-var: 2 # disallow deletion of variables
no-label-var: 2 # disallow labels that share a name with a variable
no-shadow: 2 # disallow declaration of variables already declared in the
# outer scope
no-shadow-restricted-names: 2 # disallow shadowing of names such as arguments
no-undef: 2 # disallow use of undeclared variables unless mentioned in a
# /*global */ block
no-undef-init: 2 # disallow use of undefined when initializing variables
no-undefined: 0 # disallow use of undefined variable
no-unused-vars: 2 # disallow declaration of variables that are not used in
# the code
no-use-before-define: 2 # disallow use of variables before they are defined
no-catch-shadow: 2 # disallow the catch clause parameter name being the same as a
# variable in the outer scope
no-delete-var: 2 # disallow deletion of variables
no-label-var: 2 # disallow labels that share a name with a variable
no-shadow: 2 # disallow declaration of variables already declared in the
# outer scope
no-shadow-restricted-names: 2 # disallow shadowing of names such as arguments
no-undef: 2 # disallow use of undeclared variables unless mentioned in a
# /*global */ block
no-undef-init: 2 # disallow use of undefined when initializing variables
no-undefined: 0 # disallow use of undefined variable
no-unused-vars: 2 # disallow declaration of variables that are not used in
# the code
no-use-before-define: [2, { "functions": false }] # disallow use of variables before they are defined
no-var: 2

###########################################################################
Expand Down Expand Up @@ -260,11 +267,11 @@ rules:

###########################################################################
# #
# Flow vars #
# Flowtype #
# #
###########################################################################
flow-vars/define-flow-type: 2
flow-vars/use-flow-type: 2
flowtype/define-flow-type: 2
flowtype/use-flow-type: 2


###########################################################################
Expand All @@ -280,3 +287,12 @@ rules:
"parser": "babylon"
}
]


###########################################################################
# #
# React Hooks #
# #
###########################################################################
react-hooks/rules-of-hooks: 2
react-hooks/exhaustive-deps: 2
1 change: 1 addition & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
.*/node_modules/watchify/.*
.*/node_modules/webpack-dev-server/.*
.*/node_modules/webpack/.*
.*/node_modules/hoist-non-react-statics/.*

[include]
src
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ addons:
chrome: stable

node_js:
- "6"
- "8"
- "10"
- "12"

# Use container-based Travis infrastructure.
sudo: false
Expand Down
4 changes: 2 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Test against this version of Node.js
environment:
matrix:
- nodejs_version: "6"
- nodejs_version: "8"
- nodejs_version: "10"
- nodejs_version: "12"

# Install scripts. (runs after repo cloning)
install:
Expand All @@ -18,7 +18,7 @@ test_script:
# Run tests
- yarn run build
- yarn run test-ie


# Don't actually build.
build: off
Expand Down
12 changes: 12 additions & 0 deletions interfaces/hoist-non-react-statics.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
declare module 'hoist-non-react-statics' {
/*
S - source component statics
TP - target component props
SP - additional source component props
*/
declare module.exports: <TP, SP, S>(
target: React$ComponentType<TP>,
source: React$ComponentType<SP> & S,
blacklist?: {[key: $Keys<S>]: boolean}
) => React$ComponentType<TP> & $Shape<S>;
}
6 changes: 3 additions & 3 deletions interfaces/inline-style-prefixer.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ declare function createDynamicPrefixer(
): typeof InlineStylePrefixer;

declare module 'inline-style-prefixer' {
declare var exports: typeof InlineStylePrefixer;
declare module.exports: typeof InlineStylePrefixer;
}

declare module 'inline-style-prefixer/static/createPrefixer' {
declare var exports: typeof createStaticPrefixer;
declare module.exports: typeof createStaticPrefixer;
}

declare module 'inline-style-prefixer/dynamic/createPrefixer' {
declare var exports: typeof createDynamicPrefixer;
declare module.exports: typeof createDynamicPrefixer;
}
48 changes: 27 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
"postpublish": "publishr postpublish -V",
"version-dry-run": "publishr dry-run -V",
"build": "npm run clean && builder concurrent --buffer build-lib build-dist build-es",
"build-babel": "babel src --ignore \"/__tests__/,/__mocks__/\"",
"build-lib": "builder run --env \"{\\\"BABEL_ENV\\\":\\\"commonjs\\\"}\" build-babel -- -d lib",
"build-babel": "babel src --ignore \"**/__tests__/*\",\"**/__mocks__/*\"",
"build-lib": "builder run --env \"{\\\"BABEL_ENV\\\":\\\"commonjs\\\"}\" build-babel -- -d lib --verbose",
"build-dist-dev": "webpack",
"build-dist-prod": "webpack --config=webpack.config.minified.js",
"build-dist": "builder concurrent --buffer build-dist-dev build-dist-prod",
Expand Down Expand Up @@ -54,41 +54,46 @@
},
"license": "MIT",
"dependencies": {
"babel-cli": "^6.24.0",
"babel-core": "^6.24.0",
"babel-loader": "^7.1.2",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-preset-env": "^1.6.1",
"babel-preset-react": "^6.23.0",
"babel-preset-stage-1": "^6.22.0",
"@babel/cli": "^7.0.0",
"@babel/core": "^7.0.0",
"@babel/plugin-proposal-class-properties": "^7.0.0",
"@babel/plugin-proposal-decorators": "^7.0.0",
"@babel/plugin-transform-destructuring": "^7.0.0",
"@babel/preset-env": "^7.0.0",
"@babel/preset-flow": "^7.0.0",
"@babel/preset-react": "^7.0.0",
"babel-loader": "^8.0.0",
"builder": "^3.2.3",
"exenv": "^1.2.1",
"hoist-non-react-statics": "3.3.0",
"inline-style-prefixer": "^4.0.0",
"prop-types": "^15.5.8",
"publishr": "^1.0.0",
"rimraf": "^2.6.1",
"webpack": "^3.10.0"
},
"peerDependencies": {
"react": "^15.3.0 || ^16.0.0"
"react": "^16.8.0"
},
"devDependencies": {
"babel-eslint": "^7.1.1",
"@babel/node": "^7.0.0",
"babel-eslint": "^10.0.1",
"babel-plugin-istanbul": "^5.1.0",
"caniuse-api": "^2.0.0",
"chai": "^3.5.0",
"color": "^1.0.3",
"core-js": "^2.5.3",
"coveralls": "^2.12.0",
"enzyme": "^3.5.1",
"enzyme-adapter-react-16": "^1.4.0",
"eslint": "^3.17.1",
"eslint-plugin-flow-vars": "^0.5.0",
"eslint-plugin-prettier": "^2.0.1",
"eslint-plugin-react": "^6.10.0",
"enzyme": "^3.10.0",
"enzyme-adapter-react-16": "^1.14.0",
"eslint": "^5.16.0",
"eslint-plugin-flowtype": "3.9.1",
"eslint-plugin-prettier": "^3.1.0",
"eslint-plugin-react": "^7.13.0",
"eslint-plugin-react-hooks": "1.6.0",
"express": "^4.15.2",
"express-http-proxy": "^0.11.0",
"flow-bin": "^0.53.1",
"flow-bin": "^0.100.0",
"inject-loader": "^3.0.1",
"jsdom": "^12.0.0",
"jsdom-global": "^3.0.2",
Expand All @@ -106,16 +111,17 @@
"nodemon": "^1.11.0",
"object-assign": "^4.1.1",
"prettier": "^1.15.3",
"react": "^16.6.3",
"react-dom": "^16.6.3",
"react-test-renderer": "^16.6.3",
"react": "^16.8.3",
"react-dom": "^16.8.3",
"react-test-renderer": "^16.8.3",
"sinon": "^1.17.7",
"sinon-chai": "^2.8.0",
"webpack-dev-server": "^2.11.1"
},
"publishr": {
"dependencies": [
"^babel-",
"^@babel/",
"^builder$",
"^publishr$",
"^rimraf$",
Expand Down
Loading

0 comments on commit 40f14ba

Please sign in to comment.