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 1
1
{
2
- "parser": "babel-eslint",
3
2
"env": {
4
3
"browser": true,
5
4
"node": true,
6
5
"jest": true
7
6
},
8
- "extends": [
9
- "eslint:recommended",
10
- "plugin:react/recommended"
11
- ],
12
- "plugins": [
13
- "react-hooks"
14
- ],
7
+ "extends": "airbnb",
15
8
"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
22
11
}
23
12
}
Original file line number Diff line number Diff line change
1
+ const hooks = require ( '../src/index' ) . default ;
2
+
1
3
describe ( 'hooks test' , ( ) => {
2
4
it ( 'should be a function' , ( ) => {
3
- expect ( require ( '../src/index' ) . default ) . toEqual ( expect . any ( Function ) ) ;
5
+ expect ( hooks ) . toEqual ( expect . any ( Function ) ) ;
4
6
} ) ;
5
- } ) ;
7
+ } ) ;
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ export default function App() {
10
10
< div >
11
11
< h2 > DEMO of < span style = { { color : '#F44336' } } > @use-hooks/image-size</ span > </ h2 >
12
12
< div >
13
- < img src = { url } width = { 100 } height = { 100 } alt = "" />
13
+ < img src = { url } width = { 100 } height = { 100 } alt = "" />
14
14
< div > Natural size: { width } x { height } </ div >
15
15
</ div >
16
16
</ div >
File renamed without changes.
Original file line number Diff line number Diff line change 11
11
"start" : " webpack-dev-server --progress --color" ,
12
12
"build" : " webpack --env build" ,
13
13
"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" ,
16
16
"prepublishOnly" : " npm run build"
17
17
},
18
18
"repository" : {
33
33
"@babel/preset-env" : " ^7.2.0" ,
34
34
"@babel/preset-react" : " ^7.0.0" ,
35
35
"babel-core" : " ^7.0.0-bridge.0" ,
36
- "babel-eslint" : " ^10.0.1" ,
37
36
"babel-jest" : " ^23.6.0" ,
38
37
"babel-loader" : " ^8.0.4" ,
39
38
"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" ,
40
42
"eslint-plugin-react" : " ^7.11.1" ,
41
- "eslint-plugin-react-hooks" : " ^0.0.0" ,
42
43
"html-webpack-plugin" : " ^3.2.0" ,
43
44
"husky" : " ^1.2.0" ,
44
45
"jest" : " ^23.6.0" ,
54
55
}
55
56
},
56
57
"lint-staged" : {
57
- "*.js " : [
58
+ "*.{js,jsx} " : [
58
59
" eslint --fix" ,
59
60
" git add"
60
61
]
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ const path = require('path');
2
2
const webpack = require ( 'webpack' ) ;
3
3
const HtmlWebpackPlugin = require ( 'html-webpack-plugin' ) ;
4
4
5
- module . exports = function ( env ) {
5
+ module . exports = ( env ) => {
6
6
const isExample = env === 'example' ;
7
7
const isBuild = env === 'build' ;
8
8
const isDev = ! env ;
@@ -52,5 +52,5 @@ module.exports = function(env) {
52
52
isDev && new webpack . NamedModulesPlugin ( ) ,
53
53
isDev && new webpack . HotModuleReplacementPlugin ( ) ,
54
54
] . filter ( Boolean ) ,
55
- }
55
+ } ;
56
56
} ;
You can’t perform that action at this time.
0 commit comments