Skip to content

Commit

Permalink
feat: update jsx imports and eslint to support react v17
Browse files Browse the repository at this point in the history
  • Loading branch information
riiniii committed Jan 15, 2021
1 parent 6224ed5 commit 648566a
Show file tree
Hide file tree
Showing 106 changed files with 61 additions and 108 deletions.
2 changes: 2 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ module.exports = {
'react/jsx-one-expression-per-line': 'off',
'react/jsx-wrap-multilines': 'off',
'react/jsx-props-no-spreading': 'off',
"react/jsx-uses-react": "off",
"react/react-in-jsx-scope": "off",
'arrow-body-style': ['warn', 'as-needed'],
'no-param-reassign': ['error', { props: false }],
'import/prefer-default-export': 'off',
Expand Down
2 changes: 1 addition & 1 deletion src/components/Alert/Alert.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { Component, ReactNode, CSSProperties } from 'react'
import { Component, ReactNode, CSSProperties } from 'react'
import BootstrapAlert from 'react-bootstrap/Alert'

import { ColorVariant } from '../../interfaces'
Expand Down
3 changes: 2 additions & 1 deletion src/components/Badge/Badge.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { CSSProperties } from 'react'
import { CSSProperties } from 'react'
import * as React from 'react'
import BootstrapBadge from 'react-bootstrap/Badge'

import { ColorVariant } from '../../interfaces'
Expand Down
3 changes: 2 additions & 1 deletion src/components/Breadcrumb/Breadcrumb.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { CSSProperties } from 'react'
import { CSSProperties } from 'react'
import * as React from 'react'
import BootstrapBreadcrumb from 'react-bootstrap/Breadcrumb'

export interface BreadcrumbProps {
Expand Down
3 changes: 2 additions & 1 deletion src/components/Breadcrumb/BreadcrumbItem.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { CSSProperties } from 'react'
import { CSSProperties } from 'react'
import * as React from 'react'
import BootstrapBreadcrumbItem from 'react-bootstrap/BreadcrumbItem'

interface Props {
Expand Down
3 changes: 2 additions & 1 deletion src/components/Button/Button.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { CSSProperties } from 'react'
import { CSSProperties } from 'react'
import * as React from 'react'
import BootstrapButton from 'react-bootstrap/Button'

import { ButtonVariant } from '../../interfaces'
Expand Down
4 changes: 2 additions & 2 deletions src/components/Calendar/Calendar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import dayGridPlugin from '@fullcalendar/daygrid'
import interactionPlugin from '@fullcalendar/interaction'
import FullCalendar from '@fullcalendar/react'
import timeGridPlugin from '@fullcalendar/timegrid'
import React from 'react'
import { createRef } from 'react'

import Event from './interfaces'

Expand Down Expand Up @@ -64,7 +64,7 @@ const Calendar = (props: CalendarProps) => {
onNextClick,
onTodayClick,
} = props
const fullCalendarRef = React.createRef<FullCalendar>()
const fullCalendarRef = createRef<FullCalendar>()

const onNavClick = (to: 'prev' | 'next' | 'today') => {
const calendar = fullCalendarRef?.current?.getApi()
Expand Down
3 changes: 2 additions & 1 deletion src/components/Callout/Callout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import classNames from 'classnames'
import React, { CSSProperties, ReactElement } from 'react'
import { CSSProperties, ReactElement } from 'react'
import * as React from 'react'

import { ColorVariant } from '../../interfaces'

Expand Down
3 changes: 2 additions & 1 deletion src/components/Checkbox/Checkbox.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { CSSProperties } from 'react'
import { CSSProperties } from 'react'
import * as React from 'react'
import FormCheck from 'react-bootstrap/FormCheck'

interface Props {
Expand Down
3 changes: 2 additions & 1 deletion src/components/DateTimePicker/DateTimePicker.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as locales from 'date-fns/locale'
import React, { ReactNode, CSSProperties } from 'react'
import { ReactNode, CSSProperties } from 'react'
import * as React from 'react'
import InputGroup from 'react-bootstrap/InputGroup'
import DatePicker, { registerLocale, setDefaultLocale } from 'react-datepicker'

Expand Down
1 change: 0 additions & 1 deletion src/components/Dropdown/Dropdown.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import DropdownRB from 'react-bootstrap/Dropdown'
import DropdownButton from 'react-bootstrap/DropdownButton'

Expand Down
2 changes: 1 addition & 1 deletion src/components/Graph/BarGraph.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import ChartJs from 'chart.js'
import React, { Component } from 'react'
import { Component } from 'react'

import { Axis, Dataset } from './interfaces'
import * as util from './util'
Expand Down
2 changes: 1 addition & 1 deletion src/components/Graph/LineGraph.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import ChartJs from 'chart.js'
import React, { Component } from 'react'
import { Component } from 'react'

import { Axis, Dataset } from './interfaces'
import * as util from './util'
Expand Down
2 changes: 1 addition & 1 deletion src/components/Graph/PieGraph.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import ChartJs from 'chart.js'
import React, { Component } from 'react'
import { Component } from 'react'

import { Dataset } from './interfaces'
import * as util from './util'
Expand Down
3 changes: 2 additions & 1 deletion src/components/Icon/Icon.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { IconPrefix, IconName, SizeProp } from '@fortawesome/fontawesome-svg-core'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import React, { CSSProperties } from 'react'
import { CSSProperties } from 'react'
import * as React from 'react'

import { IconType } from './interfaces'

Expand Down
2 changes: 1 addition & 1 deletion src/components/Image/Image.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react'
import * as React from 'react'
import BootstrapImage from 'react-bootstrap/Image'

interface Props extends React.ImgHTMLAttributes<HTMLImageElement> {
Expand Down
4 changes: 2 additions & 2 deletions src/components/Label/Label.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import React, { CSSProperties } from 'react'
import { createElement, CSSProperties } from 'react'
import FormLabel from 'react-bootstrap/FormLabel'

interface Props {
Expand All @@ -25,7 +25,7 @@ interface Props {
* hidden text to be read explaing the input is required incase the title attribute
* is not supported by the screen reader
*/
const asterisk = React.createElement('i', { style: { color: 'red' } }, [
const asterisk = createElement('i', { style: { color: 'red' } }, [
<FontAwesomeIcon
icon="asterisk"
key="asterisk"
Expand Down
3 changes: 2 additions & 1 deletion src/components/List/List.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { CSSProperties } from 'react'
import { CSSProperties } from 'react'
import * as React from 'react'
import ListGroup from 'react-bootstrap/ListGroup'

interface Props {
Expand Down
3 changes: 2 additions & 1 deletion src/components/List/ListItem.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { CSSProperties } from 'react'
import { CSSProperties } from 'react'
import * as React from 'react'
import ListGroupItem from 'react-bootstrap/ListGroupItem'

import { ColorVariant } from '../../interfaces'
Expand Down
2 changes: 1 addition & 1 deletion src/components/Modal/Modal.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint react/prop-types: 0 */
import React, { ReactNode, CSSProperties } from 'react'
import { ReactNode, CSSProperties } from 'react'
import BootstrapModal from 'react-bootstrap/Modal'

import { Button, ButtonProps } from '../Button'
Expand Down
2 changes: 1 addition & 1 deletion src/components/Navbar/Navbar.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { SizeProp } from '@fortawesome/fontawesome-svg-core'
import React from 'react'
import * as React from 'react'
import Form from 'react-bootstrap/Form'
import FormControl from 'react-bootstrap/FormControl'
import Nav from 'react-bootstrap/Nav'
Expand Down
3 changes: 2 additions & 1 deletion src/components/Panel/Panel.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { useState } from 'react'
import { useState } from 'react'
import * as React from 'react'
import { Card, Collapse } from 'react-bootstrap'

import { ColorVariant } from '../../interfaces'
Expand Down
3 changes: 2 additions & 1 deletion src/components/Pill/Pill.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { CSSProperties } from 'react'
import { CSSProperties } from 'react'
import * as React from 'react'
import Badge from 'react-bootstrap/Badge'

import { ColorVariant } from '../../interfaces'
Expand Down
3 changes: 2 additions & 1 deletion src/components/Radio/Radio.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { ReactNode, CSSProperties } from 'react'
import { ReactNode, CSSProperties } from 'react'
import * as React from 'react'
import Form from 'react-bootstrap/Form'

interface Props {
Expand Down
2 changes: 1 addition & 1 deletion src/components/RichText/RichText.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Editor } from '@tinymce/tinymce-react'
import React from 'react'
import * as React from 'react'

import 'tinymce/tinymce'

Expand Down
1 change: 0 additions & 1 deletion src/components/Select/Select.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import { Typeahead } from 'react-bootstrap-typeahead'
import 'react-bootstrap-typeahead/css/Typeahead.css'

Expand Down
1 change: 0 additions & 1 deletion src/components/Spinner/Spinner.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* eslint react/jsx-props-no-spreading: "off" */
import React from 'react'
import * as Spinners from 'react-spinners'

import { SpinnerType, SpinnerSizeUnit } from './interfaces'
Expand Down
3 changes: 2 additions & 1 deletion src/components/Switch/Switch.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { CSSProperties } from 'react'
import { CSSProperties } from 'react'
import * as React from 'react'
import FormCheck from 'react-bootstrap/FormCheck'

interface Props {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Tab/Tab.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react'
import * as React from 'react'

import { Button } from '../Button'
import { IconType } from '../Icon/interfaces'
Expand Down
2 changes: 1 addition & 1 deletion src/components/Tab/TabsHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react'
import * as React from 'react'

interface Props {
/** The children to render */
Expand Down
2 changes: 1 addition & 1 deletion src/components/Table/Table.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react'
import * as React from 'react'
import { ButtonVariant } from 'src/interfaces'

import { Button } from '../Button'
Expand Down
3 changes: 2 additions & 1 deletion src/components/TextField/TextField.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { CSSProperties } from 'react'
import { CSSProperties } from 'react'
import * as React from 'react'
import Form from 'react-bootstrap/Form'

import { getControlSize } from '../../helpers/controlSize'
Expand Down
3 changes: 2 additions & 1 deletion src/components/TextInput/TextInput.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { CSSProperties } from 'react'
import { CSSProperties } from 'react'
import * as React from 'react'
import Form from 'react-bootstrap/Form'

interface Props {
Expand Down
2 changes: 0 additions & 2 deletions src/components/Toaster/components.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import * as React from 'react'

import { ToastProps } from './interfaces'

export const titleWithMessage = (title: ToastProps['title'], message: ToastProps['message']) => (
Expand Down
1 change: 0 additions & 1 deletion src/components/Toaster/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import * as React from 'react'
import { ToastContainer, toast, Slide } from 'react-toastify'

import { titleWithMessage, titleWithoutMessage } from './components'
Expand Down
3 changes: 2 additions & 1 deletion src/components/Typeahead/Typeahead.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { useState } from 'react'
import { useState } from 'react'
import * as React from 'react'
import { AsyncTypeahead } from 'react-bootstrap-typeahead'

interface Props {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Typography/Typography.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react'
import * as React from 'react'

interface Props {
/**
Expand Down
2 changes: 1 addition & 1 deletion src/components/VideoPlayer/VideoPlayer.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react'
import * as React from 'react'
import { Player } from 'video-react'
import 'video-react/dist/video-react.css'

Expand Down
4 changes: 3 additions & 1 deletion stories/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module.exports = {
rules: {
'import/no-extraneous-dependencies': 0,
'no-alert': 'off'
'no-alert': 'off',
"react/jsx-uses-react": "off",
"react/react-in-jsx-scope": "off"
},
}
1 change: 0 additions & 1 deletion stories/alerts.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Story, Meta } from '@storybook/react/types-6-0'
import React from 'react'

import { Alert, AlertProps } from '../src'

Expand Down
1 change: 0 additions & 1 deletion stories/badges.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Story, Meta } from '@storybook/react/types-6-0'
import React from 'react'

import { Badge, BadgeProps } from '../src'

Expand Down
1 change: 0 additions & 1 deletion stories/breadcrumbs.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Story, Meta } from '@storybook/react/types-6-0'
import React from 'react'

import { Breadcrumb, BreadcrumbItem, BreadcrumbProps } from '../src'

Expand Down
1 change: 0 additions & 1 deletion stories/buttons.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Story, Meta } from '@storybook/react/types-6-0'
import React from 'react'

import { Button, ButtonProps } from '../src'

Expand Down
1 change: 0 additions & 1 deletion stories/calendar.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Story, Meta } from '@storybook/react/types-6-0'
import moment from 'moment'
import React from 'react'

import { Calendar, CalendarProps, Toast, Toaster } from '../src'

Expand Down
1 change: 0 additions & 1 deletion stories/callout.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Story, Meta } from '@storybook/react/types-6-0'
import React from 'react'

import { Callout, CalloutProps } from '../src'

Expand Down
1 change: 0 additions & 1 deletion stories/checkbox.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { storiesOf } from '@storybook/react'
import React from 'react'

import { Checkbox } from '../src'

Expand Down
2 changes: 1 addition & 1 deletion stories/datetimepicker.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { storiesOf } from '@storybook/react'
import * as locales from 'date-fns/locale'
import React, { useState } from 'react'
import { useState } from 'react'

import { DateTimePicker, Dropdown } from '../src'

Expand Down
1 change: 0 additions & 1 deletion stories/dropdown.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { storiesOf } from '@storybook/react'
import React from 'react'
import ButtonToolbar from 'react-bootstrap/ButtonToolbar'

import { Dropdown } from '../src'
Expand Down
1 change: 0 additions & 1 deletion stories/graphs.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { storiesOf } from '@storybook/react'
import React from 'react'

import { LineGraph, PieGraph, BarGraph } from '../src'

Expand Down
1 change: 0 additions & 1 deletion stories/icons.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { storiesOf } from '@storybook/react'
import React from 'react'

import { Icon } from '../src'

Expand Down
1 change: 0 additions & 1 deletion stories/image.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { storiesOf } from '@storybook/react'
import React from 'react'

import { Image } from '../src'

Expand Down
1 change: 0 additions & 1 deletion stories/label.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { storiesOf } from '@storybook/react'
import React from 'react'

import { Label, TextInput } from '../src'

Expand Down
1 change: 0 additions & 1 deletion stories/layout.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { storiesOf } from '@storybook/react'
import React from 'react'

import { Container, Row, Column } from '../src/components/Layout'
import './layout.stories.css'
Expand Down
1 change: 0 additions & 1 deletion stories/lists.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { storiesOf } from '@storybook/react'
import React from 'react'

import { List, ListItem } from '../src'

Expand Down
2 changes: 1 addition & 1 deletion stories/modal.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { storiesOf } from '@storybook/react'
import React, { useState } from 'react'
import { useState } from 'react'

import { Modal, Button } from '../src'

Expand Down
1 change: 0 additions & 1 deletion stories/navbar.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { storiesOf } from '@storybook/react'
import React from 'react'

import { Navbar, Toaster, Toast } from '../src'

Expand Down
1 change: 0 additions & 1 deletion stories/panel.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { storiesOf } from '@storybook/react'
import React from 'react'

import { Panel } from '../src/components/Panel'

Expand Down
Loading

0 comments on commit 648566a

Please sign in to comment.