Skip to content

Commit

Permalink
updates deps | fix type error on themes (#983)
Browse files Browse the repository at this point in the history
Updates eslint config
  • Loading branch information
jbetancur committed Dec 18, 2021
1 parent d52be97 commit 25838f7
Show file tree
Hide file tree
Showing 12 changed files with 2,825 additions and 1,879 deletions.
26 changes: 17 additions & 9 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
module.exports = {
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
parser: '@typescript-eslint/parser',
// Specifies the ESLint parser
plugins: ['jest', '@typescript-eslint'],
extends: [
'plugin:react/recommended', // Uses the recommended rules from @eslint-plugin-react
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin
'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.
'plugin:react/recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
'plugin:react-hooks/recommended',
'plugin:jsx-a11y/recommended',
'plugin:storybook/recommended',
],
parserOptions: {
ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
sourceType: 'module', // Allows for the use of imports
ecmaVersion: 2018,
// Allows for the parsing of modern ECMAScript features
sourceType: 'module',
// Allows for the use of imports
ecmaFeatures: {
jsx: true, // Allows for the parsing of JSX
},
Expand All @@ -22,15 +26,19 @@ module.exports = {
},
rules: {
'react/prop-types': 'off',
'@typescript-eslint/no-unused-vars': ['error', { ignoreRestSiblings: true }],
'@typescript-eslint/no-unused-vars': [
'error',
{
ignoreRestSiblings: true,
},
],
// '@typescript-eslint/ban-ts-comment': [{ 'ts-ignore': 'allow-with-description', minimumDescriptionLength: 10 }],
'prettier/prettier': [
'error',
{
singleQuote: true,
},
],
// Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs
], // Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs
// e.g. "@typescript-eslint/explicit-function-return-type": "off",
},
overrides: [
Expand Down
13 changes: 6 additions & 7 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
module.exports = {
semi: true,
jsxBracketSameLine: false,
trailingComma: 'all',
singleQuote: true,
printWidth: 120,
tabWidth: 2,
arrowParens: 'avoid',
semi: true,
trailingComma: 'all',
singleQuote: true,
printWidth: 120,
tabWidth: 2,
arrowParens: 'avoid',
};
11 changes: 10 additions & 1 deletion eslintrc-js.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
module.exports = {
parser: 'babel-eslint',
parserOptions: {
sourceType: 'module',
allowImportExportEverywhere: false,
ecmaFeatures: {
globalReturn: false,
},
babelOptions: {
configFile: './eslintrc-js.js',
},
},
extends: ['plugin:jsx-a11y/recommended'],
plugins: ['jest', 'react-hooks', 'jsx-a11y'],
rules: {
Expand Down
71 changes: 36 additions & 35 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-data-table-component",
"version": "7.4.5",
"version": "7.4.6",
"description": "A simple to use declarative react based data table",
"main": "dist/index.cjs.js",
"module": "dist/index.es.js",
Expand Down Expand Up @@ -40,63 +40,64 @@
"deploy-storybook": "gh-pages -d storybook-static"
},
"devDependencies": {
"@babel/eslint-parser": "^7.16.5",
"@material-ui/core": "^4.12.3",
"@material-ui/icons": "^4.11.2",
"@storybook/addon-a11y": "^6.3.12",
"@storybook/addon-essentials": "^6.3.12",
"@storybook/addon-storysource": "^6.3.12",
"@storybook/addons": "^6.3.12",
"@storybook/react": "^6.3.12",
"@storybook/theming": "^6.3.12",
"@storybook/addon-a11y": "^6.4.9",
"@storybook/addon-essentials": "^6.4.9",
"@storybook/addon-storysource": "^6.4.9",
"@storybook/addons": "^6.4.9",
"@storybook/react": "^6.4.9",
"@storybook/theming": "^6.4.9",
"@testing-library/react": "^12.1.2",
"@types/faker": "^5.5.8",
"@types/jest": "^27.0.2",
"@types/faker": "^5.5.9",
"@types/jest": "^27.0.3",
"@types/lodash-es": "^4.17.5",
"@types/lodash.orderby": "^4.6.6",
"@types/node": "^16.10.3",
"@types/react": "^17.0.27",
"@types/react-dom": "^17.0.9",
"@types/styled-components": "^5.1.15",
"@typescript-eslint/eslint-plugin": "^4.33.0",
"@typescript-eslint/parser": "^4.33.0",
"axios": "^0.21.4",
"babel-eslint": "^10.1.0",
"@types/node": "^17.0.0",
"@types/react": "^17.0.37",
"@types/react-dom": "^17.0.11",
"@types/styled-components": "^5.1.18",
"@typescript-eslint/eslint-plugin": "^5.7.0",
"@typescript-eslint/parser": "^5.7.0",
"axios": "^0.24.0",
"codecov": "^3.8.3",
"eslint": "^7.32.0",
"eslint": "^8.5.0",
"eslint-config-prettier": "^8.3.0",
"eslint-config-react-app": "^6.0.0",
"eslint-plugin-import": "^2.24.2",
"eslint-plugin-jest": "^25.0.1",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-config-react-app": "^7.0.0",
"eslint-plugin-import": "^2.25.3",
"eslint-plugin-jest": "^25.3.0",
"eslint-plugin-jsx-a11y": "^6.5.1",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-react": "^7.26.1",
"eslint-plugin-react-hooks": "^4.2.0",
"eslint-plugin-react": "^7.27.1",
"eslint-plugin-react-hooks": "^4.3.0",
"eslint-plugin-storybook": "^0.5.3",
"faker": "^5.5.3",
"gh-pages": "^3.2.3",
"jest": "^27.2.5",
"jest-styled-components": "^7.0.5",
"jest": "^27.4.5",
"jest-styled-components": "^7.0.8",
"jest-watch-typeahead": "^1.0.0",
"lodash-es": "^4.17.21",
"memoize-one": "^5.2.1",
"moment": "^2.29.1",
"prettier": "^2.4.1",
"prettier": "^2.5.1",
"react": "^17.0.2",
"react-app-polyfill": "^2.0.0",
"react-app-polyfill": "^3.0.0",
"react-dom": "^17.0.2",
"rimraf": "^3.0.2",
"rollup": "^2.58.0",
"rollup": "^2.61.1",
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-typescript2": "^0.30.0",
"rollup-plugin-typescript2": "^0.31.1",
"rollup-plugin-visualizer": "^5.5.2",
"styled-components": "^5.3.1",
"stylelint": "^13.13.1",
"stylelint-config-recommended": "^5.0.0",
"styled-components": "^5.3.3",
"stylelint": "^14.1.0",
"stylelint-config-recommended": "^6.0.0",
"stylelint-config-styled-components": "^0.1.1",
"stylelint-processor-styled-components": "^1.10.0",
"ts-jest": "^27.0.5",
"typescript": "^4.4.3"
"ts-jest": "^27.1.2",
"typescript": "^4.5.4"
},
"dependencies": {
"deepmerge": "^4.2.2"
Expand Down
2 changes: 1 addition & 1 deletion src/DataTable/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ type ThemeStriped = {
text: string;
};

export type Themes = 'default' | 'light' | 'dark';
export type Themes = string;

export interface Theme {
text: ThemeText;
Expand Down
5 changes: 3 additions & 2 deletions stories/DataTable/DelayedColumns.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { useState, useEffect } from 'react';
import users from '../shared/users';
import DataTable from '../../src/index';

export function Delayed() {
export const Delayed = () => {
const [columns, setColumns] = useState([]);
const [pending, setPending] = React.useState(true);

Expand Down Expand Up @@ -31,8 +31,9 @@ export function Delayed() {
}, []);

return <DataTable columns={columns} data={users} progressPending={pending} />;
}
};

export default {
title: 'Columns/Delayed',
Component: Delayed,
};
2 changes: 1 addition & 1 deletion stories/DataTable/material-ui/pagination.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ function TablePaginationActions({ count, page, rowsPerPage, onChangePage }) {
);
}

const CustomMaterialPagination = ({ rowsPerPage, rowCount, onChangePage, onChangeRowsPerPage, currentPage }) => (
export const CustomMaterialPagination = ({ rowsPerPage, rowCount, onChangePage, onChangeRowsPerPage, currentPage }) => (
<TablePagination
component="nav"
count={rowCount}
Expand Down
4 changes: 2 additions & 2 deletions stories/DataTable/pagination/remote.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const columns = [
},
];

export function Remote() {
export const Remote = () => {
const [data, setData] = useState([]);
const [loading, setLoading] = useState(false);
const [totalRows, setTotalRows] = useState(0);
Expand Down Expand Up @@ -69,7 +69,7 @@ export function Remote() {
onChangePage={handlePageChange}
/>
);
}
};

export default {
title: 'Pagination/Remote',
Expand Down
4 changes: 2 additions & 2 deletions stories/DataTable/selectableRows/rowMGMT.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const columns = [
},
];

export function ManageSelections() {
export const ManageSelections = () => {
const [selectedRows, setSelectedRows] = React.useState([]);
const [toggleCleared, setToggleCleared] = React.useState(false);
const [data, setData] = React.useState(tableDataItems);
Expand Down Expand Up @@ -60,7 +60,7 @@ export function ManageSelections() {
pagination
/>
);
}
};

export default {
title: 'Selectable/Manage Selections',
Expand Down
4 changes: 2 additions & 2 deletions stories/DataTable/sorting/basic.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ const columns = [
},
];

export function Basic() {
export const Basic = () => {
return <DataTable title="Movie List" columns={columns} data={data} pagination />;
}
};

export default {
title: 'Sorting/Basic',
Expand Down
4 changes: 2 additions & 2 deletions stories/DataTable/sorting/remote.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const columns = [
},
];

export function RemoteSort() {
export const RemoteSort = () => {
const [loading, setLoading] = useState(false);
const [data, setData] = useState(initData);

Expand Down Expand Up @@ -53,7 +53,7 @@ export function RemoteSort() {
pagination
/>
);
}
};

export default {
title: 'Sorting/Remote Sort',
Expand Down
Loading

0 comments on commit 25838f7

Please sign in to comment.