Skip to content

Commit 72472e9

Browse files
committed
chore: enable linter for tsx files
1 parent 7c45b58 commit 72472e9

File tree

6 files changed

+7
-27
lines changed

6 files changed

+7
-27
lines changed

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
"build": "yarn build:types && yarn build:commonjs && yarn build:es && yarn build:umd && yarn build:umd:min",
3232
"clean": "rimraf lib dist es coverage",
3333
"api-types": "api-extractor run --local",
34-
"format": "prettier --write \"{src,test}/**/*.{js,ts}\" \"docs/**/*.md\"",
35-
"lint": "eslint src --ext ts,js test/utils test/components test/hooks",
34+
"format": "prettier --write \"{src,test}/**/*.{js,ts,tsx}\" \"docs/**/*.md\"",
35+
"lint": "eslint src --ext ts,tsx,js test/utils test/components test/hooks",
3636
"prepare": "yarn clean && yarn build",
3737
"pretest": "yarn lint",
3838
"test": "jest",
@@ -56,7 +56,6 @@
5656
"@types/use-sync-external-store": "^0.0.0",
5757
"hoist-non-react-statics": "^3.3.2",
5858
"loose-envify": "^1.4.0",
59-
"prop-types": "^15.7.2",
6059
"react-is": "^16.13.1",
6160
"use-sync-external-store": "0.0.0-experimental-7d38e4fd8-20210930"
6261
},

src/hooks/useDispatch.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Action, ActionCreator, AnyAction, Dispatch, Store } from 'redux'
1+
import { Action, AnyAction, Dispatch } from 'redux'
22
import { Context } from 'react'
33

44
import {

src/types.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,9 @@
11
/* eslint-disable no-unused-vars */
22
// TODO Ignoring all unused variables for now
33

4-
import {
5-
ClassAttributes,
6-
Component,
7-
ComponentClass,
8-
ComponentType,
9-
StatelessComponent,
10-
Context,
11-
NamedExoticComponent,
12-
} from 'react'
4+
import { ClassAttributes, ComponentClass, ComponentType } from 'react'
135

14-
import { Action, ActionCreator, AnyAction, Dispatch, Store } from 'redux'
6+
import { Action, AnyAction, Dispatch } from 'redux'
157

168
// import hoistNonReactStatics = require('hoist-non-react-statics');
179
import type { NonReactStatics } from 'hoist-non-react-statics'

test/components/connect.spec.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
/*eslint-disable react/prop-types*/
22

3-
import React, { Component, MouseEvent, useLayoutEffect } from 'react'
3+
import React, { Component, MouseEvent } from 'react'
44
import createClass from 'create-react-class'
5-
import PropTypes from 'prop-types'
65
import { createStore, applyMiddleware } from 'redux'
76
import { Provider as ProviderMock, connect } from '../../src/index'
87
import * as rtl from '@testing-library/react'

test/hooks/useSelector.spec.tsx

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,9 @@ import {
1010
connect,
1111
createSelectorHook,
1212
} from '../../src/index'
13-
import { useReduxContext } from '../../src/hooks/useReduxContext'
1413
import type { FunctionComponent, DispatchWithoutAction, ReactNode } from 'react'
1514
import type { Store, AnyAction } from 'redux'
16-
import type {
17-
TypedUseSelectorHook,
18-
ReactReduxContextValue,
19-
Subscription,
20-
} from '../../src/'
15+
import type { TypedUseSelectorHook, ReactReduxContextValue } from '../../src/'
2116

2217
describe('React', () => {
2318
describe('hooks', () => {
@@ -138,11 +133,7 @@ describe('React', () => {
138133
}
139134
})
140135

141-
let rootSubscription: Subscription
142-
143136
const Parent = () => {
144-
const { subscription } = useReduxContext() as ReactReduxContextValue
145-
rootSubscription = subscription
146137
const count = useNormalSelector((s) => s.count)
147138
return count === 1 ? <Child /> : null
148139
}

yarn.lock

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9063,7 +9063,6 @@ __metadata:
90639063
jest: ^26.6.1
90649064
loose-envify: ^1.4.0
90659065
prettier: ^2.1.2
9066-
prop-types: ^15.7.2
90679066
react: 0.0.0-experimental-7d38e4fd8-20210930
90689067
react-dom: 0.0.0-experimental-7d38e4fd8-20210930
90699068
react-is: ^16.13.1

0 commit comments

Comments
 (0)