Skip to content
This repository was archived by the owner on Jan 9, 2023. It is now read-only.

Commit c8c0eba

Browse files
committed
fix: fix broken deps and updates scripts
1 parent 5d6cbcf commit c8c0eba

13 files changed

Lines changed: 69 additions & 83 deletions

File tree

.eslintrc.js

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module.exports = {
2-
ignorePatterns: ['commitlint.config.js'],
2+
ignorePatterns: ['commitlint.config.js', 'stories/.eslintrc.js', '.eslintrc.js'],
33
env: {
44
browser: true,
55
es6: true,
@@ -52,19 +52,17 @@ module.exports = {
5252
'no-nested-ternary': 'off',
5353
'import/no-unresolved': 'off',
5454
'import/extensions': ['error', 'never'],
55-
'import/order': ["error", {
56-
"groups": [
57-
"external",
58-
["sibling","parent","internal"],
59-
"builtin",
60-
"unknown",
61-
],
62-
"newlines-between": "always",
63-
"alphabetize": {
64-
"order": 'asc',
65-
"caseInsensitive": true,
55+
'import/order': [
56+
'error',
57+
{
58+
groups: ['external', ['sibling', 'parent', 'internal'], 'builtin', 'unknown'],
59+
'newlines-between': 'always',
60+
alphabetize: {
61+
order: 'asc',
62+
caseInsensitive: true,
63+
},
6664
},
67-
}],
65+
],
6866
curly: ['error', 'all'],
6967
},
7068
}

package.json

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"commit": "npx git-cz",
2222
"dev": "tsdx watch",
2323
"build": "tsdx build",
24+
"update": "npx npm-check -u",
2425
"prepublishOnly": "npm run build",
2526
"test": "tsdx test --env=jsdom",
2627
"test:ci": "cross-env CI=true tsdx test --env=jsdom",
@@ -35,8 +36,8 @@
3536
},
3637
"peerDependencies": {
3738
"bootstrap": "~4.5.0",
38-
"react": "~16.9.0",
39-
"react-bootstrap": "~1.0.0-beta.14"
39+
"react": "~16.13.0",
40+
"react-bootstrap": "~1.0.1"
4041
},
4142
"husky": {
4243
"hooks": {
@@ -76,16 +77,16 @@
7677
"@types/enzyme": "~3.10.3",
7778
"@types/jest": "~26.0.0",
7879
"@types/lodash": "^4.14.149",
79-
"@types/node": "~13.13.3",
80+
"@types/node": "~14.0.13",
8081
"@types/react": "~16.9.17",
8182
"@types/react-dom": "~16.9.1",
8283
"@types/react-table": "^7.0.4",
8384
"@types/sinon": "~9.0.0",
8485
"@types/storybook__addon-info": "~5.2.0",
8586
"@types/tinymce": "~4.5.23",
86-
"@typescript-eslint/eslint-plugin": "~2.34.0",
87-
"@typescript-eslint/parser": "~3.2.0",
88-
"autoprefixer": "~9.7.3",
87+
"@typescript-eslint/eslint-plugin": "~3.3.0",
88+
"@typescript-eslint/parser": "~3.3.0",
89+
"autoprefixer": "~9.8.0",
8990
"awesome-typescript-loader": "~5.2.1",
9091
"babel-loader": "~8.1.0",
9192
"bootstrap": "~4.5.0",
@@ -96,20 +97,20 @@
9697
"cz-conventional-changelog": "~3.2.0",
9798
"enzyme": "~3.11.0",
9899
"enzyme-adapter-react-16": "~1.15.2",
99-
"eslint": "~6.8.0",
100+
"eslint": "~7.2.0",
100101
"eslint-config-airbnb": "~18.1.0",
101-
"eslint-config-prettier": "~6.10.0",
102+
"eslint-config-prettier": "~6.11.0",
102103
"eslint-plugin-import": "~2.21.1",
103104
"eslint-plugin-jest": "~23.13.1",
104105
"eslint-plugin-jsx-a11y": "~6.2.3",
105106
"eslint-plugin-prettier": "~3.1.1",
106-
"eslint-plugin-react": "~7.19.0",
107+
"eslint-plugin-react": "~7.20.0",
107108
"eslint-plugin-react-hooks": "~4.0.1",
108109
"husky": "~4.2.0",
109110
"jest-canvas-mock": "~2.2.0",
110111
"lint-staged": "~10.2.0",
111112
"node-sass": "~4.14.1",
112-
"prettier": "~1.19.1",
113+
"prettier": "~2.0.5",
113114
"react": "~16.13.0",
114115
"react-bootstrap": "~1.0.0-beta.16",
115116
"react-docgen": "~5.3.0",
@@ -119,36 +120,36 @@
119120
"sass-loader": "~8.0.0",
120121
"semantic-release": "~17.0.3",
121122
"sinon": "~9.0.0",
122-
"tsdx": "~0.13.0",
123-
"tslib": "~1.12.0",
123+
"tsdx": "~0.13.2",
124+
"tslib": "~2.0.0",
124125
"typescript": "~3.8.2"
125126
},
126127
"dependencies": {
127128
"@fortawesome/fontawesome-common-types": "~0.2.28",
128129
"@fortawesome/fontawesome-svg-core": "~1.2.25",
129130
"@fortawesome/free-regular-svg-icons": "~5.13.0",
130-
"@fortawesome/free-solid-svg-icons": "~5.12.0",
131+
"@fortawesome/free-solid-svg-icons": "~5.13.0",
131132
"@fortawesome/react-fontawesome": "~0.1.9",
132-
"@fullcalendar/core": "~4.3.1",
133-
"@fullcalendar/daygrid": "~4.3.0",
134-
"@fullcalendar/interaction": "~4.4.0",
135-
"@fullcalendar/react": "~4.3.0",
136-
"@fullcalendar/timegrid": "~4.3.0",
133+
"@fullcalendar/core": "~4.4.2",
134+
"@fullcalendar/daygrid": "~4.4.2",
135+
"@fullcalendar/interaction": "~4.4.2",
136+
"@fullcalendar/react": "~4.4.2",
137+
"@fullcalendar/timegrid": "~4.4.2",
137138
"@tinymce/tinymce-react": "~3.6.0",
138-
"@types/react-bootstrap-typeahead": "^3.4.5",
139+
"@types/react-bootstrap-typeahead": "^3.4.6",
139140
"@types/react-datepicker": "~2.11.0",
140141
"babel-jest": "^26.0.1",
141142
"chart.js": "~2.9.3",
142143
"date-fns": "^2.9.0",
143144
"formik": "~2.1.0",
144145
"lodash": "^4.17.15",
145146
"moment": "~2.26.0",
146-
"react-bootstrap-typeahead": "^4.0.0",
147+
"react-bootstrap-typeahead": "^4.2.3",
147148
"react-datepicker": "~3.0.0",
148-
"react-spinners": "~0.8.0",
149-
"react-table": "^7.0.0",
149+
"react-spinners": "~0.8.3",
150+
"react-table": "~7.2.0",
150151
"react-toastify": "~5.5.0",
151-
"tinymce": "~5.3.0",
152+
"tinymce": "~5.3.2",
152153
"video-react": "~0.14.1"
153154
},
154155
"jest": {

src/components/Graph/BarGraph.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ interface Props {
3232
/**
3333
* A customizable Bar Graph component built on chart.js
3434
*/
35-
class BarGraph extends Component<Props, {}> {
35+
class BarGraph extends Component<Props, Record<string, unknown>> {
3636
graph: ChartJs | null
3737

3838
chart: HTMLCanvasElement | null

src/components/Graph/LineGraph.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ interface Props {
3232
/**
3333
* A customizable Line Graph component built on chart.js
3434
*/
35-
class LineGraph extends Component<Props, {}> {
35+
class LineGraph extends Component<Props, Record<string, unknown>> {
3636
graph: ChartJs | null
3737

3838
chart: HTMLCanvasElement | null

src/components/Graph/PieGraph.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ interface Props {
2525
/**
2626
* A customizable Pie Graph component built on chart.js
2727
*/
28-
class PieGraph extends Component<Props, {}> {
28+
class PieGraph extends Component<Props, Record<string, unknown>> {
2929
graph: ChartJs | null
3030

3131
chart: HTMLCanvasElement | null

src/components/RichText/RichText.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ const RichText = (props: Props) => {
5858
// skin & content_css are set to 'false' to avoid tinyMCE looking to fetch files when they are already imported above.
5959
skin: false,
6060
// eslint disabled on next line due to TinyMCE option attribute naming.
61-
// eslint-disable-next-line @typescript-eslint/camelcase
6261
content_css: false,
6362
plugins: [`autolink lists link table paste charmap`],
6463
toolbar: [

src/components/Table/Table.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ function Table({ data, tableProperties }: Props) {
3838
useFilters,
3939
useSortBy,
4040
usePagination,
41-
) as TableInstance<object>
41+
) as TableInstance<Record<string, unknown>>
4242

4343
return (
4444
<>

src/components/Table/helper.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,15 @@ export const generateColumns = (columns: CustomColumn[]) => {
8080
element.undefinedMeansFalse === false
8181
? element.customTrueIcon
8282
? element.customFalseIcon
83-
? ({ row }: CellProps<object>) => (
83+
? ({ row }: CellProps<Record<string, unknown>>) => (
8484
<>
8585
{row.values[element.accessor] === true && element.customTrueIcon}
8686
{row.values[element.accessor] === false && element.customFalseIcon}
8787
{row.values[element.accessor] !== true &&
8888
row.values[element.accessor] !== false && <div />}
8989
</>
9090
)
91-
: ({ row }: CellProps<object>) => (
91+
: ({ row }: CellProps<Record<string, unknown>>) => (
9292
<>
9393
{row.values[element.accessor] === true && element.customTrueIcon}
9494
{row.values[element.accessor] === false && (
@@ -99,7 +99,7 @@ export const generateColumns = (columns: CustomColumn[]) => {
9999
</>
100100
)
101101
: element.customFalseIcon
102-
? ({ row }: CellProps<object>) => (
102+
? ({ row }: CellProps<Record<string, unknown>>) => (
103103
<>
104104
{row.values[element.accessor] === true && (
105105
<div style={{ color: 'green' }}>true</div>
@@ -109,7 +109,7 @@ export const generateColumns = (columns: CustomColumn[]) => {
109109
row.values[element.accessor] !== false && <div />}
110110
</>
111111
)
112-
: ({ row }: CellProps<object>) => (
112+
: ({ row }: CellProps<Record<string, unknown>>) => (
113113
<>
114114
{row.values[element.accessor] === true && (
115115
<div style={{ color: 'green' }}>true</div>
@@ -123,13 +123,13 @@ export const generateColumns = (columns: CustomColumn[]) => {
123123
)
124124
: element.customTrueIcon
125125
? element.customFalseIcon
126-
? ({ row }: CellProps<object>) => (
126+
? ({ row }: CellProps<Record<string, unknown>>) => (
127127
<>
128128
{row.values[element.accessor] === true && element.customTrueIcon}
129129
{row.values[element.accessor] !== true && element.customFalseIcon}
130130
</>
131131
)
132-
: ({ row }: CellProps<object>) => (
132+
: ({ row }: CellProps<Record<string, unknown>>) => (
133133
<>
134134
{row.values[element.accessor] === true && element.customTrueIcon}
135135
{row.values[element.accessor] !== true && (
@@ -138,15 +138,15 @@ export const generateColumns = (columns: CustomColumn[]) => {
138138
</>
139139
)
140140
: element.customFalseIcon
141-
? ({ row }: CellProps<object>) => (
141+
? ({ row }: CellProps<Record<string, unknown>>) => (
142142
<>
143143
{row.values[element.accessor] === true && (
144144
<div style={{ color: 'green' }}>true</div>
145145
)}
146146
{row.values[element.accessor] !== true && element.customFalseIcon}
147147
</>
148148
)
149-
: ({ row }: CellProps<object>) => (
149+
: ({ row }: CellProps<Record<string, unknown>>) => (
150150
<>
151151
{row.values[element.accessor] === true && (
152152
<div style={{ color: 'green' }}>true</div>
@@ -181,7 +181,7 @@ export const generateColumns = (columns: CustomColumn[]) => {
181181
el = {
182182
Header: element.title || element.accessor || '',
183183
accessor: element.accessor || '',
184-
Cell: ({ row }: CellProps<object>) => {
184+
Cell: ({ row }: CellProps<Record<string, unknown>>) => {
185185
let resultingStyle = {}
186186
let applyStyle = true
187187
if (element.styles && element.styles.length) {

src/components/Table/interfaces.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,22 +29,22 @@ export interface ColumnStyle {
2929
type StyleObject = Record<string, any>
3030

3131
export interface DefaultColumnFilterOptions {
32-
column: TableColumn<object>
32+
column: TableColumn<Record<string, unknown>>
3333
}
3434

3535
interface CustomFilters {
3636
filterPlaceholder?: string
3737
}
3838

39-
interface TableColumn<D extends object = {}>
39+
interface TableColumn<D extends Record<string, unknown> = Record<string, unknown>>
4040
extends ColumnInstance<D>,
4141
UseSortByColumnProps<D>,
4242
UseFiltersColumnProps<D>,
4343
CustomFilters {}
4444

4545
export type Element = any
4646

47-
export type Data = object
47+
export type Data = Record<string, unknown>
4848

4949
interface CustomSubColumn {
5050
headerClassName?: string

test/icon.test.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,7 @@ describe('Icon', () => {
99
it('onClick event prop is activated when clicked', () => {
1010
const spy = sinon.spy()
1111
const wrapper = mount(<Icon icon="appointment" onClick={spy} />)
12-
wrapper
13-
.find(FontAwesomeIcon)
14-
.first()
15-
.simulate('click')
12+
wrapper.find(FontAwesomeIcon).first().simulate('click')
1613
expect(spy.calledOnce).toBe(true)
1714
})
1815

0 commit comments

Comments
 (0)