File tree Expand file tree Collapse file tree 6 files changed +16
-24
lines changed
Expand file tree Collapse file tree 6 files changed +16
-24
lines changed Original file line number Diff line number Diff line change 11{
2- "parser": "babel-eslint",
32 "env": {
43 "browser": true,
54 "node": true,
65 "jest": true
76 },
8- "extends": [
9- "eslint:recommended",
10- "plugin:react/recommended"
11- ],
12- "plugins": [
13- "react-hooks"
14- ],
7+ "extends": "airbnb",
158 "rules": {
16- "react-hooks/rules-of-hooks": "error"
17- },
18- "settings": {
19- "react": {
20- "version": "16.7.0-alpha"
21- }
9+ "consistent-return": 0,
10+ "react/jsx-one-expression-per-line": 0
2211 }
2312}
Original file line number Diff line number Diff line change 1+ const hooks = require ( '../src/index' ) . default ;
2+
13describe ( 'hooks test' , ( ) => {
24 it ( 'should be a function' , ( ) => {
3- expect ( require ( '../src/index' ) . default ) . toEqual ( expect . any ( Function ) ) ;
5+ expect ( hooks ) . toEqual ( expect . any ( Function ) ) ;
46 } ) ;
5- } ) ;
7+ } ) ;
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ export default function App() {
1010 < div >
1111 < h2 > DEMO of < span style = { { color : '#F44336' } } > @use-hooks/image-size</ span > </ h2 >
1212 < div >
13- < img src = { url } width = { 100 } height = { 100 } alt = "" />
13+ < img src = { url } width = { 100 } height = { 100 } alt = "" />
1414 < div > Natural size: { width } x { height } </ div >
1515 </ div >
1616 </ div >
File renamed without changes.
Original file line number Diff line number Diff line change 1111 "start" : " webpack-dev-server --progress --color" ,
1212 "build" : " webpack --env build" ,
1313 "example" : " webpack --env example" ,
14- "lint" : " eslint src" ,
15- "lint:fix" : " eslint src --fix" ,
14+ "lint" : " eslint src example " ,
15+ "lint:fix" : " eslint src example --fix" ,
1616 "prepublishOnly" : " npm run build"
1717 },
1818 "repository" : {
3333 "@babel/preset-env" : " ^7.2.0" ,
3434 "@babel/preset-react" : " ^7.0.0" ,
3535 "babel-core" : " ^7.0.0-bridge.0" ,
36- "babel-eslint" : " ^10.0.1" ,
3736 "babel-jest" : " ^23.6.0" ,
3837 "babel-loader" : " ^8.0.4" ,
3938 "eslint" : " ^5.10.0" ,
39+ "eslint-config-airbnb" : " ^17.1.0" ,
40+ "eslint-plugin-import" : " ^2.14.0" ,
41+ "eslint-plugin-jsx-a11y" : " ^6.1.2" ,
4042 "eslint-plugin-react" : " ^7.11.1" ,
41- "eslint-plugin-react-hooks" : " ^0.0.0" ,
4243 "html-webpack-plugin" : " ^3.2.0" ,
4344 "husky" : " ^1.2.0" ,
4445 "jest" : " ^23.6.0" ,
5455 }
5556 },
5657 "lint-staged" : {
57- "*.js " : [
58+ "*.{js,jsx} " : [
5859 " eslint --fix" ,
5960 " git add"
6061 ]
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ const path = require('path');
22const webpack = require ( 'webpack' ) ;
33const HtmlWebpackPlugin = require ( 'html-webpack-plugin' ) ;
44
5- module . exports = function ( env ) {
5+ module . exports = ( env ) => {
66 const isExample = env === 'example' ;
77 const isBuild = env === 'build' ;
88 const isDev = ! env ;
@@ -52,5 +52,5 @@ module.exports = function(env) {
5252 isDev && new webpack . NamedModulesPlugin ( ) ,
5353 isDev && new webpack . HotModuleReplacementPlugin ( ) ,
5454 ] . filter ( Boolean ) ,
55- }
55+ } ;
5656} ;
You can’t perform that action at this time.
0 commit comments