Skip to content

Commit 63fbe64

Browse files
authored
chore: prepare (#46)
* chore: add husky * chore: update deps * chore: update deps * chore: update prettier
1 parent 5243122 commit 63fbe64

16 files changed

+38
-29
lines changed

.eslintrc.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable import/no-extraneous-dependencies */
21
module.exports = {
32
extends: [require.resolve('@umijs/fabric/dist/eslint')],
43
rules: {

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npx lint-staged

docs/examples/basic.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import React from 'react';
21
import classNames from 'classnames';
32
import CSSMotion from 'rc-motion';
3+
import React from 'react';
44
import './basic.less';
55

66
interface DemoState {

docs/examples/deadline.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import React from 'react';
21
import classNames from 'classnames';
32
import CSSMotion from 'rc-motion';
3+
import React from 'react';
44
import './basic.less';
55

66
interface DemoState {

docs/examples/list.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import React from 'react';
21
import classNames from 'classnames';
32
import { CSSMotionList } from 'rc-motion';
3+
import React from 'react';
44
import './list.less';
55

66
interface DemoState {

docs/examples/ssr.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1+
import classNames from 'classnames';
2+
import CSSMotion from 'rc-motion';
3+
import { genCSSMotion } from 'rc-motion/es/CSSMotion';
14
import React from 'react';
25
import { hydrate } from 'react-dom';
36
import ReactDOMServer from 'react-dom/server';
4-
import classNames from 'classnames';
5-
import { genCSSMotion } from 'rc-motion/es/CSSMotion';
6-
import CSSMotion from 'rc-motion';
77
import './basic.less';
88

99
const ServerCSSMotion = genCSSMotion(false);

docs/examples/transition-inside-debug.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import React from 'react';
21
import CSSMotion from 'rc-motion';
2+
import React from 'react';
33
import './transition-inside-debug.less';
44

55
export default function TransitionInsideDebug() {

package.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,19 @@
3232
"docs:deploy": "gh-pages -d .doc",
3333
"lint": "eslint src/ --ext .tsx,.ts",
3434
"now-build": "npm run docs:build",
35+
"prepare": "husky install",
3536
"prepublishOnly": "npm run compile && np --yolo --no-publish",
3637
"prettier": "prettier --write \"**/*.{js,jsx,tsx,ts,less,md,json}\"",
3738
"postpublish": "npm run docs:deploy",
3839
"start": "dumi dev",
3940
"test": "rc-test"
4041
},
42+
"lint-staged": {
43+
"**/*.{js,jsx,tsx,ts,md,json}": [
44+
"prettier --write",
45+
"git add"
46+
]
47+
},
4148
"dependencies": {
4249
"@babel/runtime": "^7.11.1",
4350
"classnames": "^2.2.1",
@@ -48,7 +55,6 @@
4855
"@testing-library/jest-dom": "^5.16.4",
4956
"@testing-library/react": "^13.0.0",
5057
"@types/classnames": "^2.2.9",
51-
"@types/enzyme": "^3.10.5",
5258
"@types/jest": "^26.0.8",
5359
"@types/react": "^16.9.2",
5460
"@types/react-dom": "^16.9.0",
@@ -57,6 +63,8 @@
5763
"dumi": "^2.0.18",
5864
"eslint": "^7.0.0",
5965
"father": "^4.1.2",
66+
"husky": "^8.0.3",
67+
"lint-staged": "^14.0.1",
6068
"np": "^6.2.4",
6169
"prettier": "^2.1.1",
6270
"rc-test": "^7.0.14",

src/CSSMotionList.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
/* eslint react/prop-types: 0 */
22
import * as React from 'react';
3-
import OriginCSSMotion from './CSSMotion';
43
import type { CSSMotionProps } from './CSSMotion';
5-
import { supportTransition } from './util/motion';
4+
import OriginCSSMotion from './CSSMotion';
5+
import type { KeyObject } from './util/diff';
66
import {
7+
diffKeys,
8+
parseKeys,
79
STATUS_ADD,
810
STATUS_KEEP,
911
STATUS_REMOVE,
1012
STATUS_REMOVED,
11-
diffKeys,
12-
parseKeys,
1313
} from './util/diff';
14-
import type { KeyObject } from './util/diff';
14+
import { supportTransition } from './util/motion';
1515

1616
const MOTION_PROP_NAMES = [
1717
'eventProps',

src/hooks/useDomMotionEvents.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import * as React from 'react';
22
import { useRef } from 'react';
33

4-
import { animationEndName, transitionEndName } from '../util/motion';
54
import type { MotionEvent } from '../interface';
5+
import { animationEndName, transitionEndName } from '../util/motion';
66

77
export default (
88
callback: (event: MotionEvent) => void,

0 commit comments

Comments
 (0)