Skip to content

Commit 1511330

Browse files
committed
Update packages and jest environment
1 parent e66dc84 commit 1511330

11 files changed

+18167
-11908
lines changed

.eslintrc

+4-10
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
{
22
"parser": "babel-eslint",
33
"extends": [
4-
// "standard",
5-
// "standard-react",
6-
// "plugin:prettier/recommended",
7-
// "prettier/standard",
8-
// "prettier/react"
4+
"eslint:recommended",
5+
"plugin:react/recommended"
96
],
107
"env": {
8+
"browser": true,
119
"node": true
1210
},
1311
"parserOptions": {
@@ -26,12 +24,8 @@
2624
"react-hooks"
2725
],
2826
"rules": {
29-
"space-before-function-paren": 0,
3027
"react/prop-types": 0,
31-
"react/jsx-handler-names": 0,
32-
"react/jsx-fragments": 0,
33-
"react/no-unused-prop-types": 0,
34-
"import/export": 0,
28+
"react/display-name": 0,
3529
"react-hooks/rules-of-hooks": "error",
3630
"react-hooks/exhaustive-deps": "warn"
3731
}

babel.config.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
presets: ['@babel/preset-env', '@babel/preset-react'],
3+
};

example/package-lock.json

+11,620-7,450
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/src/App.test.js

-9
This file was deleted.

example/src/data/codeExamples.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1331,4 +1331,5 @@ export const installation = {
13311331
</>
13321332
};
13331333

1334-
export default [features, installation, usageExamples];
1334+
const codeExamples = [features, installation, usageExamples];
1335+
export default codeExamples;

example/src/data/documentation.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -771,4 +771,5 @@ const accessibility = {
771771
]
772772
};
773773

774-
export default [components, hooks, accessibility];
774+
const documentation = [components, hooks, accessibility];
775+
export default documentation;

example/src/data/styleGuide.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -224,4 +224,6 @@ const stylesProp = {
224224
</>
225225
}
226226

227-
export default [stylesheet, classNameProp, stylesProp];
227+
const styleGuide = [stylesheet, classNameProp, stylesProp];
228+
export default styleGuide;
229+

package-lock.json

+6,518-4,411
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+13-16
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@szhsin/react-menu",
3-
"version": "0.11.0",
3+
"version": "0.11.1",
44
"description": "React menu components",
55
"author": "Zheng Song",
66
"license": "MIT",
@@ -15,7 +15,7 @@
1515
"build": "microbundle-crl --no-compress --format cjs --css-modules false --sourcemap false",
1616
"start": "microbundle-crl watch --no-compress --format modern,cjs --css-modules false --sourcemap false",
1717
"prepare": "run-s build",
18-
"test": "run-s test:unit test:lint test:build",
18+
"test": "jest",
1919
"test:build": "run-s build",
2020
"test:lint": "eslint .",
2121
"test:unit": "cross-env CI=1 react-scripts test --env=jsdom",
@@ -29,27 +29,24 @@
2929
"prop-types": "^15.5.7"
3030
},
3131
"devDependencies": {
32+
"@babel/preset-env": "^7.12.1",
33+
"@babel/preset-react": "^7.12.1",
3234
"babel-eslint": "^10.0.3",
35+
"babel-jest": "^26.6.1",
3336
"cross-env": "^7.0.2",
34-
"eslint": "^6.8.0",
35-
"eslint-config-prettier": "^6.7.0",
36-
"eslint-config-standard": "^14.1.0",
37-
"eslint-config-standard-react": "^9.2.0",
38-
"eslint-plugin-import": "^2.18.2",
39-
"eslint-plugin-node": "^11.0.0",
40-
"eslint-plugin-prettier": "^3.1.1",
41-
"eslint-plugin-promise": "^4.2.1",
42-
"eslint-plugin-react": "^7.17.0",
43-
"eslint-plugin-react-hooks": "^4.1.0",
44-
"eslint-plugin-standard": "^4.0.1",
37+
"eslint": "^7.12.0",
38+
"eslint-plugin-react": "^7.21.5",
39+
"eslint-plugin-react-hooks": "^4.2.0",
4540
"gh-pages": "^2.2.0",
41+
"jest": "^26.6.1",
4642
"microbundle-crl": "^0.13.11",
4743
"npm-run-all": "^4.1.5",
4844
"prettier": "^2.0.4",
4945
"prop-types": "^15.7.2",
50-
"react": "^16.13.1",
51-
"react-dom": "^16.13.1",
52-
"react-scripts": "^3.4.1",
46+
"react": "^16.14.0",
47+
"react-dom": "^16.14.0",
48+
"react-scripts": "^4.0.0",
49+
"react-test-renderer": "^16.14.0",
5350
"sass": "^1.26.10"
5451
},
5552
"files": [

src/index.test.js

-7
This file was deleted.

src/utils/useActiveState.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export const useActiveState = (isHovering, customKey) => {
2222
e.currentTarget.releasePointerCapture(e.pointerId);
2323
}, []),
2424

25-
onLostPointerCapture: useCallback(e => {
25+
onLostPointerCapture: useCallback(() => {
2626
setActive(false);
2727
}, []),
2828

@@ -38,7 +38,7 @@ export const useActiveState = (isHovering, customKey) => {
3838
}
3939
}, [activeKeys]),
4040

41-
onBlur: useCallback(e => {
41+
onBlur: useCallback(() => {
4242
setActive(false);
4343
}, [])
4444
}

0 commit comments

Comments
 (0)