Skip to content

Commit 5be0c7f

Browse files
authored
refactor: fix lint errors (#823)
1 parent 597f983 commit 5be0c7f

8 files changed

+72
-31
lines changed

.eslintrc.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
parser: babel-eslint
1+
parser: '@typescript-eslint/parser'
22
extends:
33
- jason/react
44
- plugin:jsx-a11y/recommended
@@ -11,8 +11,9 @@ env:
1111
browser: true
1212
plugins:
1313
- jsx-a11y
14+
- '@typescript-eslint'
1415
rules:
15-
"@typescript-eslint/no-unused-vars":
16+
'@typescript-eslint/no-unused-vars':
1617
- error
1718
- ignoreRestSiblings: true
1819

.size-snapshot.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"lib/dist/react-transition-group.js": {
3-
"bundled": 101943,
4-
"minified": 26331,
5-
"gzipped": 8046
3+
"bundled": 98066,
4+
"minified": 26272,
5+
"gzipped": 8027
66
},
77
"lib/dist/react-transition-group.min.js": {
8-
"bundled": 58919,
9-
"minified": 18068,
10-
"gzipped": 5664
8+
"bundled": 55134,
9+
"minified": 17999,
10+
"gzipped": 5654
1111
}
1212
}

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@
8787
"@types/react": "^17.0.41",
8888
"@types/react-dom": "^17.0.14",
8989
"@typescript-eslint/eslint-plugin": "^4.26.1",
90+
"@typescript-eslint/parser": "4",
9091
"astroturf": "^0.10.4",
91-
"babel-eslint": "^10.1.0",
9292
"babel-loader": "^8.2.3",
9393
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
9494
"babel-preset-jason": "^6.2.0",

src/CSSTransition.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ class CSSTransition extends React.Component<Props> {
259259
}
260260

261261
render() {
262-
const { classNames: _, ...props } = this.props;
262+
const { classNames, ...props } = this.props;
263263

264264
return (
265265
<Transition

src/Transition.tsx

+14-14
Original file line numberDiff line numberDiff line change
@@ -610,20 +610,20 @@ class Transition extends React.Component<Props, State> {
610610
children,
611611
// filter props for `Transition`
612612
in: _in,
613-
mountOnEnter: _mountOnEnter,
614-
unmountOnExit: _unmountOnExit,
615-
appear: _appear,
616-
enter: _enter,
617-
exit: _exit,
618-
timeout: _timeout,
619-
addEndListener: _addEndListener,
620-
onEnter: _onEnter,
621-
onEntering: _onEntering,
622-
onEntered: _onEntered,
623-
onExit: _onExit,
624-
onExiting: _onExiting,
625-
onExited: _onExited,
626-
nodeRef: _nodeRef,
613+
mountOnEnter,
614+
unmountOnExit,
615+
appear,
616+
enter,
617+
exit,
618+
timeout,
619+
addEndListener,
620+
onEnter,
621+
onEntering,
622+
onEntered,
623+
onExit,
624+
onExiting,
625+
onExited,
626+
nodeRef,
627627
...childProps
628628
} = this.props;
629629

src/TransitionGroup.tsx

+1-6
Original file line numberDiff line numberDiff line change
@@ -120,12 +120,7 @@ class TransitionGroup extends React.Component<Props, State> {
120120
const { contextValue } = this.state;
121121
// @ts-expect-error FIXME: Type 'undefined' is not assignable to type 'ReactElement<any, string | JSXElementConstructor<any>>'.ts(2345)
122122
const children = values(this.state.children).map(childFactory);
123-
const {
124-
appear: _appear,
125-
enter: _enter,
126-
exit: _exit,
127-
...delegatingProps
128-
} = props;
123+
const { appear, enter, exit, ...delegatingProps } = props;
129124

130125
if (Component === null) {
131126
return (

test/SSR-test.js

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
*/
44

55
// test that import does not crash
6+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
67
import * as ReactTransitionGroup from '../src'; // eslint-disable-line no-unused-vars
78

89
describe('SSR', () => {

yarn.lock

+45-1
Original file line numberDiff line numberDiff line change
@@ -4118,6 +4118,16 @@
41184118
eslint-scope "^5.1.1"
41194119
eslint-utils "^3.0.0"
41204120

4121+
"@typescript-eslint/parser@4":
4122+
version "4.33.0"
4123+
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.33.0.tgz#dfe797570d9694e560528d18eecad86c8c744899"
4124+
integrity sha512-ZohdsbXadjGBSK0/r+d87X0SBmKzOq4/S5nzK6SBgJspFo9/CUDJ7hjayuze+JK7CZQLDMroqytp7pOcFKTxZA==
4125+
dependencies:
4126+
"@typescript-eslint/scope-manager" "4.33.0"
4127+
"@typescript-eslint/types" "4.33.0"
4128+
"@typescript-eslint/typescript-estree" "4.33.0"
4129+
debug "^4.3.1"
4130+
41214131
"@typescript-eslint/parser@^4.9.1":
41224132
version "4.26.1"
41234133
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.26.1.tgz#cecfdd5eb7a5c13aabce1c1cfd7fbafb5a0f1e8e"
@@ -4136,11 +4146,24 @@
41364146
"@typescript-eslint/types" "4.26.1"
41374147
"@typescript-eslint/visitor-keys" "4.26.1"
41384148

4149+
"@typescript-eslint/[email protected]":
4150+
version "4.33.0"
4151+
resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.33.0.tgz#d38e49280d983e8772e29121cf8c6e9221f280a3"
4152+
integrity sha512-5IfJHpgTsTZuONKbODctL4kKuQje/bzBRkwHE8UOZ4f89Zeddg+EGZs8PD8NcN4LdM3ygHWYB3ukPAYjvl/qbQ==
4153+
dependencies:
4154+
"@typescript-eslint/types" "4.33.0"
4155+
"@typescript-eslint/visitor-keys" "4.33.0"
4156+
41394157
"@typescript-eslint/[email protected]":
41404158
version "4.26.1"
41414159
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.26.1.tgz#9e7c523f73c34b04a765e4167ca5650436ef1d38"
41424160
integrity sha512-STyMPxR3cS+LaNvS8yK15rb8Y0iL0tFXq0uyl6gY45glyI7w0CsyqyEXl/Fa0JlQy+pVANeK3sbwPneCbWE7yg==
41434161

4162+
"@typescript-eslint/[email protected]":
4163+
version "4.33.0"
4164+
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.33.0.tgz#a1e59036a3b53ae8430ceebf2a919dc7f9af6d72"
4165+
integrity sha512-zKp7CjQzLQImXEpLt2BUw1tvOMPfNoTAfb8l51evhYbOEEzdWyQNmHWWGPR6hwKJDAi+1VXSBmnhL9kyVTTOuQ==
4166+
41444167
"@typescript-eslint/[email protected]":
41454168
version "4.26.1"
41464169
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.26.1.tgz#b2ce2e789233d62283fae2c16baabd4f1dbc9633"
@@ -4154,6 +4177,19 @@
41544177
semver "^7.3.5"
41554178
tsutils "^3.21.0"
41564179

4180+
"@typescript-eslint/[email protected]":
4181+
version "4.33.0"
4182+
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.33.0.tgz#0dfb51c2908f68c5c08d82aefeaf166a17c24609"
4183+
integrity sha512-rkWRY1MPFzjwnEVHsxGemDzqqddw2QbTJlICPD9p9I9LfsO8fdmfQPOX3uKfUaGRDFJbfrtm/sXhVXN4E+bzCA==
4184+
dependencies:
4185+
"@typescript-eslint/types" "4.33.0"
4186+
"@typescript-eslint/visitor-keys" "4.33.0"
4187+
debug "^4.3.1"
4188+
globby "^11.0.3"
4189+
is-glob "^4.0.1"
4190+
semver "^7.3.5"
4191+
tsutils "^3.21.0"
4192+
41574193
"@typescript-eslint/[email protected]":
41584194
version "4.26.1"
41594195
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.26.1.tgz#0d55ea735cb0d8903b198017d6d4f518fdaac546"
@@ -4162,6 +4198,14 @@
41624198
"@typescript-eslint/types" "4.26.1"
41634199
eslint-visitor-keys "^2.0.0"
41644200

4201+
"@typescript-eslint/[email protected]":
4202+
version "4.33.0"
4203+
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.33.0.tgz#2a22f77a41604289b7a186586e9ec48ca92ef1dd"
4204+
integrity sha512-uqi/2aSz9g2ftcHWf8uLPJA70rUv6yuMW5Bohw+bwcuzaxQIHaKFZCKGoGXIrc9vkTJ3+0txM73K0Hq3d5wgIg==
4205+
dependencies:
4206+
"@typescript-eslint/types" "4.33.0"
4207+
eslint-visitor-keys "^2.0.0"
4208+
41654209
"@webassemblyjs/[email protected]":
41664210
version "1.9.0"
41674211
resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.9.0.tgz#bd850604b4042459a5a41cd7d338cbed695ed964"
@@ -4959,7 +5003,7 @@ axobject-query@^2.2.0:
49595003
resolved "https://registry.yarnpkg.com/axobject-query/-/axobject-query-2.2.0.tgz#943d47e10c0b704aa42275e20edf3722648989be"
49605004
integrity sha512-Td525n+iPOOyUQIeBfcASuG6uJsDOITl7Mds5gFyerkWiX7qhUTdYUBlSgNMyVqtSJqwpt1kXGLdUt6SykLMRA==
49615005

4962-
babel-eslint@^10.0.3, babel-eslint@^10.1.0:
5006+
babel-eslint@^10.0.3:
49635007
version "10.1.0"
49645008
resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-10.1.0.tgz#6968e568a910b78fb3779cdd8b6ac2f479943232"
49655009
integrity sha512-ifWaTHQ0ce+448CYop8AdrQiBsGrnC+bMgfyKFdi6EsPLTAWG+QfyDeM6OH+FmWnKvEq5NnBMLvlBUPKQZoDSg==

0 commit comments

Comments
 (0)