Skip to content

Commit 72b0566

Browse files
committed
move to typescript
1 parent d68db2a commit 72b0566

File tree

171 files changed

+12908
-14214
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

171 files changed

+12908
-14214
lines changed

.babelrc

Lines changed: 0 additions & 47 deletions
This file was deleted.

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
node_modules
22
dist
33
coverage
4+
storybook-static

.eslintrc.js

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
module.exports = {
22
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
3+
plugins: ['jest', '@typescript-eslint'],
34
extends: [
45
'plugin:react/recommended', // Uses the recommended rules from @eslint-plugin-react
56
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin
67
'prettier/@typescript-eslint', // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
78
'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.
89
'plugin:react-hooks/recommended',
10+
'plugin:jsx-a11y/recommended',
911
],
1012
parserOptions: {
1113
ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
@@ -35,23 +37,10 @@ module.exports = {
3537
overrides: [
3638
{
3739
files: ['**/*.js', '**/*.jsx'],
38-
plugins: ['jest', 'react-hooks', 'jsx-a11y'],
3940
rules: {
40-
'max-len': 0,
41-
'react/forbid-prop-types': 0,
42-
'import/no-extraneous-dependencies': 0,
43-
'no-confusing-arrow': ['error', { allowParens: true }],
44-
'arrow-parens': ['error', 'as-needed'],
45-
'react/jsx-filename-extension': [1, { extensions: ['.js', '.jsx'] }],
46-
'import/prefer-default-export': 0,
47-
'object-curly-newline': ['error', { consistent: true }],
48-
'implicit-arrow-linebreak': 0,
49-
'operator-linebreak': 0,
50-
'linebreak-style': 0,
51-
'arrow-body-style': 0,
52-
'react-hooks/rules-of-hooks': 'error', // Checks rules of Hooks
53-
'react-hooks/exhaustive-deps': 'warn', // Checks effect dependencies
54-
'react/jsx-props-no-spreading': 0,
41+
'@typescript-eslint/no-var-requires': 'off',
42+
'@typescript-eslint/explicit-module-boundary-types': 'off',
43+
'react/display-name': 'off',
5544
},
5645
},
5746
],

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ typings/
5959

6060
# dist
6161
dist/*
62-
!dist/index.js
6362

6463
# Storybook
6564
storybook-static

.storybook/main.js

Lines changed: 0 additions & 11 deletions
This file was deleted.

.storybook/main.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module.exports = {
2+
stories: ['../stories/**/*.stories.@(ts|tsx|js|jsx)'],
3+
addons: [
4+
'@storybook/addon-actions',
5+
'@storybook/addon-storysource',
6+
'@storybook/addon-links',
7+
'@storybook/addon-a11y',
8+
],
9+
};
File renamed without changes.

.stylelintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"processors": ["stylelint-processor-styled-components"],
33
"extends": [
4-
"stylelint-config-standard",
4+
"stylelint-config-recommended",
55
"stylelint-config-styled-components"
66
],
77
"rules": {

README.md

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,55 @@
1-
[![Build Status](https://travis-ci.org/jbetancur/react-data-table-component.svg?branch=master)](https://travis-ci.org/jbetancur/react-data-table-component) [![npm version](https://badge.fury.io/js/react-data-table-component.svg)](https://badge.fury.io/js/react-data-table-component) [![codecov](https://codecov.io/gh/jbetancur/react-data-table-component/branch/master/graph/badge.svg)](https://codecov.io/gh/jbetancur/react-data-table-component) [![Storybook](https://cdn.jsdelivr.net/gh/storybookjs/brand@master/badge/badge-storybook.svg)](https://jbetancur.github.io/react-data-table-component)
1+
[![Build Status](https://travis-ci.com/jbetancur/react-data-table-component.svg?branch=master)]( ) [![npm version](https://badge.fury.io/js/react-data-table-component.svg)](https://badge.fury.io/js/react-data-table-component) [![codecov](https://codecov.io/gh/jbetancur/react-data-table-component/branch/master/graph/badge.svg)](https://codecov.io/gh/jbetancur/react-data-table-component) [![Storybook](https://cdn.jsdelivr.net/gh/storybookjs/brand@master/badge/badge-storybook.svg)](https://jbetancur.github.io/react-data-table-component)
22

33
<!-- TOC -->
44

55
- [React Data Table Component](#react-data-table-component)
6-
- [Demo and Examples](#demo-and-examples)
7-
- [Key Features](#key-features)
8-
- [Requirements](#requirements)
9-
- [Installation](#installation)
10-
- [Logging Issues and Contributions](#logging-issues-and-contributions)
11-
- [API and Usage](#api-and-usage)
12-
- [Columns](#columns)
13-
- [column.hide media presets](#columnhide-media-presets)
14-
- [DataTable Properties](#datatable-properties)
15-
- [Basic](#basic)
16-
- [Row Selection](#row-selection)
17-
- [Row Expander](#row-expander)
18-
- [Sorting](#sorting)
19-
- [Pagination](#pagination)
20-
- [Header](#header)
21-
- [Header Context Menu when using Selectable Rows](#header-context-menu-when-using-selectable-rows)
22-
- [Progress Indicator](#progress-indicator)
23-
- [Theming and Customization](#theming-and-customization)
24-
- [Dark Mode Theme](#dark-mode-theme)
25-
- [Defining Your Own Theme Using `createTheme`](#defining-your-own-theme-using-createtheme)
26-
- [Overidding Styling using css-in-js](#overidding-styling-using-css-in-js)
27-
- [Conditional Row Styling](#conditional-row-styling)
28-
- [Example](#example)
29-
- [Conditional Style Object](#conditional-style-object)
30-
- [Basic Table](#basic-table)
31-
- [Selectable Rows](#selectable-rows)
32-
- [Clearing Selected Rows](#clearing-selected-rows)
33-
- [Overriding with Ui Component Library](#overriding-with-ui-component-library)
34-
- [Using Custom Checkboxes and Indeterminate State](#using-custom-checkboxes-and-indeterminate-state)
35-
- [Custom Cells](#custom-cells)
36-
- [Expandable Rows](#expandable-rows)
37-
- [UI Library Integration](#ui-library-integration)
38-
- [Optimizing for Performance and Caveats](#optimizing-for-performance-and-caveats)
39-
- [Passing non-primitive props (objects, arrays and functions)](#passing-non-primitive-props-objects-arrays-and-functions)
40-
- [Optimizing Class Components](#optimizing-class-components)
41-
- [Examples of Optimizations](#examples-of-optimizations)
42-
- [Optimizing Functional Components](#optimizing-functional-components)
43-
- [CSS Overrides](#css-overrides)
6+
- [Demo and Examples](#demo-and-examples)
7+
- [Key Features](#key-features)
8+
- [Requirements](#requirements)
9+
- [Installation](#installation)
10+
- [Logging Issues and Contributions](#logging-issues-and-contributions)
11+
- [API and Usage](#api-and-usage)
12+
- [Columns](#columns)
13+
- [column.hide media presets](#columnhide-media-presets)
14+
- [DataTable Properties](#datatable-properties)
15+
- [Basic](#basic)
16+
- [Row Selection](#row-selection)
17+
- [Row Expander](#row-expander)
18+
- [Sorting](#sorting)
19+
- [Pagination](#pagination)
20+
- [Header](#header)
21+
- [Header Context Menu when using Selectable Rows](#header-context-menu-when-using-selectable-rows)
22+
- [Progress Indicator](#progress-indicator)
23+
- [Theming and Customization](#theming-and-customization)
24+
- [Dark Mode Theme](#dark-mode-theme)
25+
- [Defining Your Own Theme Using `createTheme`](#defining-your-own-theme-using-createtheme)
26+
- [Overidding Styling using css-in-js](#overidding-styling-using-css-in-js)
27+
- [Conditional Row Styling](#conditional-row-styling)
28+
- [Example](#example)
29+
- [Conditional Style Object](#conditional-style-object)
30+
- [Basic Table](#basic-table)
31+
- [Selectable Rows](#selectable-rows)
32+
- [Clearing Selected Rows](#clearing-selected-rows)
33+
- [Overriding with Ui Component Library](#overriding-with-ui-component-library)
34+
- [Using Custom Checkboxes and Indeterminate State](#using-custom-checkboxes-and-indeterminate-state)
35+
- [Custom Cells](#custom-cells)
36+
- [Expandable Rows](#expandable-rows)
37+
- [UI Library Integration](#ui-library-integration)
38+
- [Optimizing for Performance and Caveats](#optimizing-for-performance-and-caveats)
39+
- [Passing non-primitive props (objects, arrays and functions)](#passing-non-primitive-props-objects-arrays-and-functions)
40+
- [Optimizing Class Components](#optimizing-class-components)
41+
- [Examples of Optimizations](#examples-of-optimizations)
42+
- [Optimizing Functional Components](#optimizing-functional-components)
43+
- [CSS Overrides](#css-overrides)
4444
- [Development](#development)
45-
- [Setup](#setup)
46-
- [Local development](#local-development)
47-
- [Including NPM packages](#including-npm-packages)
48-
- [Library dependencies -- <root_dir>/package.**json](#library-dependencies----root_dirpackagejson)
49-
- [Storybook dependencies -- <root_dir>/stories/package.json](#storybook-dependencies----root_dirstoriespackagejson)
50-
- [Lint](#lint)
51-
- [Test](#test)
52-
- [Build](#build)
45+
- [Setup](#setup)
46+
- [Local development](#local-development)
47+
- [Including NPM packages](#including-npm-packages)
48+
- [Library dependencies -- <root_dir>/package.**json](#library-dependencies----root_dirpackagejson)
49+
- [Storybook dependencies -- <root_dir>/stories/package.json](#storybook-dependencies----root_dirstoriespackagejson)
50+
- [Lint](#lint)
51+
- [Test](#test)
52+
- [Build](#build)
5353
- [Contributors](#contributors)
5454

5555
<!-- /TOC -->
@@ -250,7 +250,7 @@ When the breakpoint is reached the column will be hidden. These are the built-in
250250
|--------------------------|---------------------|----------|---------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
251251
| contextMessage | object | no | `{ singular: 'item', plural: 'items', message: 'selected' }` | override the context menu selected message when using `selectableRows` |
252252
| contextActions | component or array of components| no | | add context actions to the context menu when using `selectableRows` |
253-
| contextComponent | bool | no | false | Overide the default context menu when using `selectableRows` with your own custom componet. RDT will compose the `selectedCount` prop to your custom component. This will negate `contextMessage` and `contextActions` |
253+
| contextComponent | component | no | null | Overide the default context menu when using `selectableRows` with your own custom componet. RDT will compose the `selectedCount` prop to your custom component. This will negate `contextMessage` and `contextActions` |
254254
| noContextMenu | bool | no | false | Do not display the context menu when using `selectableRows` |
255255

256256
#### Progress Indicator

eslintrc-js.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
module.exports = {
2+
parser: 'babel-eslint',
3+
extends: ['plugin:jsx-a11y/recommended'],
4+
plugins: ['jest', 'react-hooks', 'jsx-a11y'],
5+
rules: {
6+
'max-len': 0,
7+
'react/forbid-prop-types': 0,
8+
'import/no-extraneous-dependencies': 0,
9+
'no-confusing-arrow': ['error', { allowParens: true }],
10+
'arrow-parens': ['error', 'as-needed'],
11+
'react/jsx-filename-extension': [1, { extensions: ['.js', '.jsx'] }],
12+
'import/prefer-default-export': 0,
13+
'object-curly-newline': ['error', { consistent: true }],
14+
'implicit-arrow-linebreak': 0,
15+
'operator-linebreak': 0,
16+
'linebreak-style': 0,
17+
'arrow-body-style': 0,
18+
'react-hooks/rules-of-hooks': 'error', // Checks rules of Hooks
19+
'react-hooks/exhaustive-deps': 'warn', // Checks effect dependencies
20+
'react/jsx-props-no-spreading': 0,
21+
'react/display-name': 0,
22+
},
23+
env: {
24+
'jest/globals': true,
25+
browser: true,
26+
},
27+
};

0 commit comments

Comments
 (0)