File tree Expand file tree Collapse file tree 5 files changed +23
-10
lines changed Expand file tree Collapse file tree 5 files changed +23
-10
lines changed Original file line number Diff line number Diff line change @@ -3,11 +3,12 @@ const gulp = require('gulp')
33const del = require ( 'del' )
44const babel = require ( 'gulp-babel' )
55
6- gulp . task ( 'compile' , ( ) => {
7- return gulp . src ( 'src/**/*.js' )
6+ const path = 'src/**/*.js'
7+
8+ gulp . task ( 'default' , ( ) => {
9+ return gulp . src ( path )
810 . pipe ( babel ( ) )
911 . pipe ( gulp . dest ( 'dist' ) )
1012} )
1113
1214gulp . task ( 'clean' , ( ) => del ( [ 'dist' ] ) )
13- gulp . task ( 'default' , [ 'compile' ] )
Original file line number Diff line number Diff line change 88 " dist"
99 ],
1010 "scripts" : {
11- "gulp" : " gulp" ,
11+ "build" : " gulp" ,
12+ "prepublish" : " npm run build" ,
1213 "test" : " xo && ava"
1314 },
1415 "babel" : {
5354 "envs" : [
5455 " browser" ,
5556 " jsx"
56- ]
57+ ],
58+ "rules" : {
59+ "react/require-default-props" : 0 ,
60+ "react/no-unused-prop-types" : 0
61+ }
5762 },
5863 "devDependencies" : {
5964 "ava" : " 0.22.0" ,
Original file line number Diff line number Diff line change 1+ // Packages
12import React from 'react'
23import PropTypes from 'prop-types'
34
45export default class Frame extends React . Component {
56 static propTypes = {
67 children : PropTypes . any ,
78 component : PropTypes . any ,
8- duration : PropTypes . number , // eslint-disable-line react/no-unused-prop-types
9+ duration : PropTypes . number ,
910 onRender : PropTypes . func
1011 } ;
1112
@@ -25,12 +26,14 @@ export default class Frame extends React.Component {
2526 render ( ) {
2627 const { component} = this . props
2728 const props = { }
29+
2830 Object . keys ( this . props ) . forEach ( k => {
2931 if ( Frame . propTypes [ k ] ) {
3032 return
3133 }
3234 props [ k ] = this . props [ k ]
3335 } )
36+
3437 return React . createElement ( component , props , this . props . children )
3538 }
3639}
Original file line number Diff line number Diff line change 1+ // Utilities
12export { default as Keyframes } from './keyframes'
23export { default as Frame } from './frame'
Original file line number Diff line number Diff line change 1+ // Packages
12import React from 'react'
23import PropTypes from 'prop-types'
4+
5+ // Utilities
36import Frame from './frame'
47
58const noop = ( ) => { }
@@ -10,9 +13,9 @@ export default class Keyframes extends React.Component {
1013 component : PropTypes . any , // eslint-disable-line react/no-unused-prop-types
1114 delay : PropTypes . number ,
1215 loop : PropTypes . oneOfType ( [
13- React . PropTypes . string ,
14- React . PropTypes . number ,
15- React . PropTypes . bool
16+ PropTypes . string ,
17+ PropTypes . number ,
18+ PropTypes . bool
1619 ] ) ,
1720 onStart : PropTypes . func ,
1821 onEnd : PropTypes . func
@@ -75,7 +78,7 @@ export default class Keyframes extends React.Component {
7578
7679 const props = { }
7780 Object . keys ( this . props ) . forEach ( k => {
78- // don 't pass props which exist only on Keyframes
81+ // Don 't pass props which exist only on Keyframes
7982 if ( Keyframes . propTypes [ k ] && ! Frame . propTypes [ k ] ) {
8083 return
8184 }
You can’t perform that action at this time.
0 commit comments