Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: enable linter for tsx files #1825

Merged
merged 1 commit into from
Oct 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
"build": "yarn build:types && yarn build:commonjs && yarn build:es && yarn build:umd && yarn build:umd:min",
"clean": "rimraf lib dist es coverage",
"api-types": "api-extractor run --local",
"format": "prettier --write \"{src,test}/**/*.{js,ts}\" \"docs/**/*.md\"",
"lint": "eslint src --ext ts,js test/utils test/components test/hooks",
"format": "prettier --write \"{src,test}/**/*.{js,ts,tsx}\" \"docs/**/*.md\"",
"lint": "eslint src --ext ts,tsx,js test/utils test/components test/hooks",
"prepare": "yarn clean && yarn build",
"pretest": "yarn lint",
"test": "jest",
Expand All @@ -56,7 +56,6 @@
"@types/use-sync-external-store": "^0.0.0",
"hoist-non-react-statics": "^3.3.2",
"loose-envify": "^1.4.0",
"prop-types": "^15.7.2",
"react-is": "^16.13.1",
"use-sync-external-store": "0.0.0-experimental-7d38e4fd8-20210930"
},
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useDispatch.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Action, ActionCreator, AnyAction, Dispatch, Store } from 'redux'
import { Action, AnyAction, Dispatch } from 'redux'
import { Context } from 'react'

import {
Expand Down
12 changes: 2 additions & 10 deletions src/types.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
/* eslint-disable no-unused-vars */
// TODO Ignoring all unused variables for now

import {
ClassAttributes,
Component,
ComponentClass,
ComponentType,
StatelessComponent,
Context,
NamedExoticComponent,
} from 'react'
import { ClassAttributes, ComponentClass, ComponentType } from 'react'

import { Action, ActionCreator, AnyAction, Dispatch, Store } from 'redux'
import { Action, AnyAction, Dispatch } from 'redux'

// import hoistNonReactStatics = require('hoist-non-react-statics');
import type { NonReactStatics } from 'hoist-non-react-statics'
Expand Down
3 changes: 1 addition & 2 deletions test/components/connect.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
/*eslint-disable react/prop-types*/

import React, { Component, MouseEvent, useLayoutEffect } from 'react'
import React, { Component, MouseEvent } from 'react'
import createClass from 'create-react-class'
import PropTypes from 'prop-types'
import { createStore, applyMiddleware } from 'redux'
import { Provider as ProviderMock, connect } from '../../src/index'
import * as rtl from '@testing-library/react'
Expand Down
11 changes: 1 addition & 10 deletions test/hooks/useSelector.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,9 @@ import {
connect,
createSelectorHook,
} from '../../src/index'
import { useReduxContext } from '../../src/hooks/useReduxContext'
import type { FunctionComponent, DispatchWithoutAction, ReactNode } from 'react'
import type { Store, AnyAction } from 'redux'
import type {
TypedUseSelectorHook,
ReactReduxContextValue,
Subscription,
} from '../../src/'
import type { TypedUseSelectorHook, ReactReduxContextValue } from '../../src/'

describe('React', () => {
describe('hooks', () => {
Expand Down Expand Up @@ -138,11 +133,7 @@ describe('React', () => {
}
})

let rootSubscription: Subscription

const Parent = () => {
const { subscription } = useReduxContext() as ReactReduxContextValue
rootSubscription = subscription
const count = useNormalSelector((s) => s.count)
return count === 1 ? <Child /> : null
}
Expand Down
1 change: 0 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9063,7 +9063,6 @@ __metadata:
jest: ^26.6.1
loose-envify: ^1.4.0
prettier: ^2.1.2
prop-types: ^15.7.2
react: 0.0.0-experimental-7d38e4fd8-20210930
react-dom: 0.0.0-experimental-7d38e4fd8-20210930
react-is: ^16.13.1
Expand Down