Skip to content

Commit 25838f7

Browse files
authored
updates deps | fix type error on themes (jbetancur#983)
Updates eslint config
1 parent d52be97 commit 25838f7

File tree

12 files changed

+2825
-1879
lines changed

12 files changed

+2825
-1879
lines changed

.eslintrc.js

+17-9
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
module.exports = {
2-
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
2+
parser: '@typescript-eslint/parser',
3+
// Specifies the ESLint parser
34
plugins: ['jest', '@typescript-eslint'],
45
extends: [
5-
'plugin:react/recommended', // Uses the recommended rules from @eslint-plugin-react
6-
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin
7-
'plugin:prettier/recommended', // Enables eslint-plugin-prettier and displays prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
6+
'plugin:react/recommended',
7+
'plugin:@typescript-eslint/recommended',
8+
'plugin:prettier/recommended',
89
'plugin:react-hooks/recommended',
910
'plugin:jsx-a11y/recommended',
11+
'plugin:storybook/recommended',
1012
],
1113
parserOptions: {
12-
ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
13-
sourceType: 'module', // Allows for the use of imports
14+
ecmaVersion: 2018,
15+
// Allows for the parsing of modern ECMAScript features
16+
sourceType: 'module',
17+
// Allows for the use of imports
1418
ecmaFeatures: {
1519
jsx: true, // Allows for the parsing of JSX
1620
},
@@ -22,15 +26,19 @@ module.exports = {
2226
},
2327
rules: {
2428
'react/prop-types': 'off',
25-
'@typescript-eslint/no-unused-vars': ['error', { ignoreRestSiblings: true }],
29+
'@typescript-eslint/no-unused-vars': [
30+
'error',
31+
{
32+
ignoreRestSiblings: true,
33+
},
34+
],
2635
// '@typescript-eslint/ban-ts-comment': [{ 'ts-ignore': 'allow-with-description', minimumDescriptionLength: 10 }],
2736
'prettier/prettier': [
2837
'error',
2938
{
3039
singleQuote: true,
3140
},
32-
],
33-
// Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs
41+
], // Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs
3442
// e.g. "@typescript-eslint/explicit-function-return-type": "off",
3543
},
3644
overrides: [

.prettierrc.js

+6-7
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
module.exports = {
2-
semi: true,
3-
jsxBracketSameLine: false,
4-
trailingComma: 'all',
5-
singleQuote: true,
6-
printWidth: 120,
7-
tabWidth: 2,
8-
arrowParens: 'avoid',
2+
semi: true,
3+
trailingComma: 'all',
4+
singleQuote: true,
5+
printWidth: 120,
6+
tabWidth: 2,
7+
arrowParens: 'avoid',
98
};

eslintrc-js.js

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
module.exports = {
2-
parser: 'babel-eslint',
2+
parserOptions: {
3+
sourceType: 'module',
4+
allowImportExportEverywhere: false,
5+
ecmaFeatures: {
6+
globalReturn: false,
7+
},
8+
babelOptions: {
9+
configFile: './eslintrc-js.js',
10+
},
11+
},
312
extends: ['plugin:jsx-a11y/recommended'],
413
plugins: ['jest', 'react-hooks', 'jsx-a11y'],
514
rules: {

package.json

+36-35
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-data-table-component",
3-
"version": "7.4.5",
3+
"version": "7.4.6",
44
"description": "A simple to use declarative react based data table",
55
"main": "dist/index.cjs.js",
66
"module": "dist/index.es.js",
@@ -40,63 +40,64 @@
4040
"deploy-storybook": "gh-pages -d storybook-static"
4141
},
4242
"devDependencies": {
43+
"@babel/eslint-parser": "^7.16.5",
4344
"@material-ui/core": "^4.12.3",
4445
"@material-ui/icons": "^4.11.2",
45-
"@storybook/addon-a11y": "^6.3.12",
46-
"@storybook/addon-essentials": "^6.3.12",
47-
"@storybook/addon-storysource": "^6.3.12",
48-
"@storybook/addons": "^6.3.12",
49-
"@storybook/react": "^6.3.12",
50-
"@storybook/theming": "^6.3.12",
46+
"@storybook/addon-a11y": "^6.4.9",
47+
"@storybook/addon-essentials": "^6.4.9",
48+
"@storybook/addon-storysource": "^6.4.9",
49+
"@storybook/addons": "^6.4.9",
50+
"@storybook/react": "^6.4.9",
51+
"@storybook/theming": "^6.4.9",
5152
"@testing-library/react": "^12.1.2",
52-
"@types/faker": "^5.5.8",
53-
"@types/jest": "^27.0.2",
53+
"@types/faker": "^5.5.9",
54+
"@types/jest": "^27.0.3",
5455
"@types/lodash-es": "^4.17.5",
5556
"@types/lodash.orderby": "^4.6.6",
56-
"@types/node": "^16.10.3",
57-
"@types/react": "^17.0.27",
58-
"@types/react-dom": "^17.0.9",
59-
"@types/styled-components": "^5.1.15",
60-
"@typescript-eslint/eslint-plugin": "^4.33.0",
61-
"@typescript-eslint/parser": "^4.33.0",
62-
"axios": "^0.21.4",
63-
"babel-eslint": "^10.1.0",
57+
"@types/node": "^17.0.0",
58+
"@types/react": "^17.0.37",
59+
"@types/react-dom": "^17.0.11",
60+
"@types/styled-components": "^5.1.18",
61+
"@typescript-eslint/eslint-plugin": "^5.7.0",
62+
"@typescript-eslint/parser": "^5.7.0",
63+
"axios": "^0.24.0",
6464
"codecov": "^3.8.3",
65-
"eslint": "^7.32.0",
65+
"eslint": "^8.5.0",
6666
"eslint-config-prettier": "^8.3.0",
67-
"eslint-config-react-app": "^6.0.0",
68-
"eslint-plugin-import": "^2.24.2",
69-
"eslint-plugin-jest": "^25.0.1",
70-
"eslint-plugin-jsx-a11y": "^6.4.1",
67+
"eslint-config-react-app": "^7.0.0",
68+
"eslint-plugin-import": "^2.25.3",
69+
"eslint-plugin-jest": "^25.3.0",
70+
"eslint-plugin-jsx-a11y": "^6.5.1",
7171
"eslint-plugin-prettier": "^4.0.0",
72-
"eslint-plugin-react": "^7.26.1",
73-
"eslint-plugin-react-hooks": "^4.2.0",
72+
"eslint-plugin-react": "^7.27.1",
73+
"eslint-plugin-react-hooks": "^4.3.0",
74+
"eslint-plugin-storybook": "^0.5.3",
7475
"faker": "^5.5.3",
7576
"gh-pages": "^3.2.3",
76-
"jest": "^27.2.5",
77-
"jest-styled-components": "^7.0.5",
77+
"jest": "^27.4.5",
78+
"jest-styled-components": "^7.0.8",
7879
"jest-watch-typeahead": "^1.0.0",
7980
"lodash-es": "^4.17.21",
8081
"memoize-one": "^5.2.1",
8182
"moment": "^2.29.1",
82-
"prettier": "^2.4.1",
83+
"prettier": "^2.5.1",
8384
"react": "^17.0.2",
84-
"react-app-polyfill": "^2.0.0",
85+
"react-app-polyfill": "^3.0.0",
8586
"react-dom": "^17.0.2",
8687
"rimraf": "^3.0.2",
87-
"rollup": "^2.58.0",
88+
"rollup": "^2.61.1",
8889
"rollup-plugin-commonjs": "^10.1.0",
8990
"rollup-plugin-node-resolve": "^5.2.0",
9091
"rollup-plugin-terser": "^7.0.2",
91-
"rollup-plugin-typescript2": "^0.30.0",
92+
"rollup-plugin-typescript2": "^0.31.1",
9293
"rollup-plugin-visualizer": "^5.5.2",
93-
"styled-components": "^5.3.1",
94-
"stylelint": "^13.13.1",
95-
"stylelint-config-recommended": "^5.0.0",
94+
"styled-components": "^5.3.3",
95+
"stylelint": "^14.1.0",
96+
"stylelint-config-recommended": "^6.0.0",
9697
"stylelint-config-styled-components": "^0.1.1",
9798
"stylelint-processor-styled-components": "^1.10.0",
98-
"ts-jest": "^27.0.5",
99-
"typescript": "^4.4.3"
99+
"ts-jest": "^27.1.2",
100+
"typescript": "^4.5.4"
100101
},
101102
"dependencies": {
102103
"deepmerge": "^4.2.2"

src/DataTable/types.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ type ThemeStriped = {
294294
text: string;
295295
};
296296

297-
export type Themes = 'default' | 'light' | 'dark';
297+
export type Themes = string;
298298

299299
export interface Theme {
300300
text: ThemeText;

stories/DataTable/DelayedColumns.stories.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React, { useState, useEffect } from 'react';
22
import users from '../shared/users';
33
import DataTable from '../../src/index';
44

5-
export function Delayed() {
5+
export const Delayed = () => {
66
const [columns, setColumns] = useState([]);
77
const [pending, setPending] = React.useState(true);
88

@@ -31,8 +31,9 @@ export function Delayed() {
3131
}, []);
3232

3333
return <DataTable columns={columns} data={users} progressPending={pending} />;
34-
}
34+
};
3535

3636
export default {
3737
title: 'Columns/Delayed',
38+
Component: Delayed,
3839
};

stories/DataTable/material-ui/pagination.stories.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ function TablePaginationActions({ count, page, rowsPerPage, onChangePage }) {
7373
);
7474
}
7575

76-
const CustomMaterialPagination = ({ rowsPerPage, rowCount, onChangePage, onChangeRowsPerPage, currentPage }) => (
76+
export const CustomMaterialPagination = ({ rowsPerPage, rowCount, onChangePage, onChangeRowsPerPage, currentPage }) => (
7777
<TablePagination
7878
component="nav"
7979
count={rowCount}

stories/DataTable/pagination/remote.stories.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const columns = [
2121
},
2222
];
2323

24-
export function Remote() {
24+
export const Remote = () => {
2525
const [data, setData] = useState([]);
2626
const [loading, setLoading] = useState(false);
2727
const [totalRows, setTotalRows] = useState(0);
@@ -69,7 +69,7 @@ export function Remote() {
6969
onChangePage={handlePageChange}
7070
/>
7171
);
72-
}
72+
};
7373

7474
export default {
7575
title: 'Pagination/Remote',

stories/DataTable/selectableRows/rowMGMT.stories.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const columns = [
2323
},
2424
];
2525

26-
export function ManageSelections() {
26+
export const ManageSelections = () => {
2727
const [selectedRows, setSelectedRows] = React.useState([]);
2828
const [toggleCleared, setToggleCleared] = React.useState(false);
2929
const [data, setData] = React.useState(tableDataItems);
@@ -60,7 +60,7 @@ export function ManageSelections() {
6060
pagination
6161
/>
6262
);
63-
}
63+
};
6464

6565
export default {
6666
title: 'Selectable/Manage Selections',

stories/DataTable/sorting/basic.stories.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ const columns = [
2121
},
2222
];
2323

24-
export function Basic() {
24+
export const Basic = () => {
2525
return <DataTable title="Movie List" columns={columns} data={data} pagination />;
26-
}
26+
};
2727

2828
export default {
2929
title: 'Sorting/Basic',

stories/DataTable/sorting/remote.stories.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const columns = [
2525
},
2626
];
2727

28-
export function RemoteSort() {
28+
export const RemoteSort = () => {
2929
const [loading, setLoading] = useState(false);
3030
const [data, setData] = useState(initData);
3131

@@ -53,7 +53,7 @@ export function RemoteSort() {
5353
pagination
5454
/>
5555
);
56-
}
56+
};
5757

5858
export default {
5959
title: 'Sorting/Remote Sort',

0 commit comments

Comments
 (0)