-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a317823
commit 78fec96
Showing
40 changed files
with
6,187 additions
and
4,736 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
module.exports = { | ||
env: { | ||
browser: true, | ||
es6: true, | ||
node: true, | ||
jest: true, | ||
}, | ||
ignorePatterns: ['setupTests.tsx','*.test.ts*', '*.stories.tsx'], | ||
extends: [ | ||
// non-ts recommended rules | ||
'eslint:recommended', | ||
// remove non-ts rules covered by typescript-eslint | ||
'plugin:@typescript-eslint/eslint-recommended', | ||
// ts recommended rules | ||
// can be slow | ||
'plugin:@typescript-eslint/recommended', | ||
// ts recommended rules that require tsconfig.json to be specified in parserOptions.project | ||
// can be slow | ||
'plugin:@typescript-eslint/recommended-requiring-type-checking', | ||
'prettier/@typescript-eslint', | ||
|
||
'plugin:react/recommended', | ||
'plugin:security/recommended', | ||
// remove rules covered by prettier | ||
'prettier/@typescript-eslint', | ||
'plugin:prettier/recommended', | ||
], | ||
globals: { | ||
Atomics: 'readonly', | ||
SharedArrayBuffer: 'readonly', | ||
}, | ||
parser: '@typescript-eslint/parser', | ||
parserOptions: { | ||
ecmaFeatures: { | ||
jsx: true, | ||
modules: true, | ||
}, | ||
ecmaVersion: 2018, | ||
sourceType: 'module', | ||
project: ['./tsconfig.json'], | ||
}, | ||
plugins: ['react', '@typescript-eslint'], | ||
rules: { | ||
"react/prop-types": 'off', | ||
'@typescript-eslint/ban-ts-ignore': 'off', | ||
'@typescript-eslint/ban-types': 'warn', | ||
'@typescript-eslint/interface-name-prefix': 'off', | ||
'@typescript-eslint/naming-convention': [ | ||
'warn', | ||
{ | ||
selector: 'function', | ||
format: ['camelCase', 'PascalCase'], | ||
}, | ||
], | ||
'@typescript-eslint/no-base-to-string': 'warn', | ||
'@typescript-eslint/no-empty-function': 'warn', | ||
'@typescript-eslint/no-explicit-any': 'warn', | ||
'@typescript-eslint/no-floating-promises': 'error', | ||
'@typescript-eslint/no-implied-eval': 'warn', | ||
'@typescript-eslint/no-inferrable-types': 'warn', | ||
'@typescript-eslint/no-misused-promises': 'error', | ||
'@typescript-eslint/no-non-null-assertion': 'warn', | ||
'@typescript-eslint/no-throw-literal': 'warn', | ||
'@typescript-eslint/no-unnecessary-boolean-literal-compare': 'warn', | ||
'@typescript-eslint/no-unnecessary-condition': 'warn', | ||
'@typescript-eslint/no-unnecessary-qualifier': 'warn', | ||
'@typescript-eslint/no-unnecessary-type-arguments': 'warn', | ||
'@typescript-eslint/no-unnecessary-type-assertion': 'warn', | ||
'@typescript-eslint/no-unsafe-assignment': 'warn', | ||
'@typescript-eslint/no-unsafe-call': 'warn', | ||
'@typescript-eslint/no-unsafe-member-access': 'warn', | ||
'@typescript-eslint/no-unsafe-return': 'warn', | ||
'@typescript-eslint/no-unused-vars-experimental': 'off', | ||
'@typescript-eslint/prefer-nullish-coalescing': 'warn', | ||
'@typescript-eslint/prefer-readonly': 'warn', | ||
// Ideally this would be on, but it has too many false positives. Should apply to arrays but seems to apply to everything, potentially a bug | ||
'@typescript-eslint/prefer-readonly-parameter-types': 'off', | ||
'@typescript-eslint/prefer-reduce-type-parameter': 'warn', | ||
'@typescript-eslint/prefer-regexp-exec': 'warn', | ||
'@typescript-eslint/promise-function-async': 'error', | ||
'@typescript-eslint/promise-function-async': 'error', | ||
'@typescript-eslint/require-array-sort-compare': 'warn', | ||
// require-await is incompatible with promise-function-async | ||
'@typescript-eslint/require-await': 'off', | ||
'@typescript-eslint/restrict-plus-operands': 'warn', | ||
'@typescript-eslint/restrict-template-expressions': [ | ||
'warn', | ||
{ | ||
allowNumber: true, | ||
allowBoolean: true, | ||
allowNullable: false, | ||
}, | ||
], | ||
'@typescript-eslint/strict-boolean-expressions': 'warn', | ||
'@typescript-eslint/switch-exhaustiveness-check': 'warn', | ||
// TODO: We use this in mocks in .spec.ts, perhaps syntax is incorrect? | ||
'@typescript-eslint/unbound-method': 'off', | ||
'react/jsx-pascal-case': [ | ||
'warn', | ||
{ | ||
ignore: [ | ||
'h1', | ||
'h2', | ||
'h3', | ||
'h4', | ||
'h5', | ||
'h6', | ||
'd1', | ||
'd2', | ||
'd3', | ||
'd4', | ||
'd5', | ||
'd6', | ||
], | ||
}, | ||
], | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: CI | ||
on: [push] | ||
jobs: | ||
build: | ||
name: Build, lint, and test on Node ${{ matrix.node }} and ${{ matrix.os }} | ||
|
||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
node: ['14.x'] | ||
os: [ubuntu-latest] | ||
|
||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v2 | ||
|
||
- name: Use Node ${{ matrix.node }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
|
||
- name: Install deps and build (with cache) | ||
uses: bahmutov/npm-install@v1 | ||
|
||
- name: Lint | ||
run: yarn lint | ||
|
||
- name: Test | ||
run: yarn test --ci --coverage --maxWorkers=2 | ||
|
||
- name: Build | ||
run: yarn build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
name: size | ||
on: [pull_request] | ||
jobs: | ||
size: | ||
runs-on: ubuntu-latest | ||
env: | ||
CI_JOB_NUMBER: 1 | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: andresz1/size-limit-action@v1 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,30 @@ | ||
*.log | ||
.DS_Store | ||
|
||
# See https://help.github.com/ignore-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
node_modules | ||
.cache | ||
.rts2_cache_cjs | ||
.rts2_cache_esm | ||
.rts2_cache_umd | ||
|
||
# builds | ||
build | ||
dist | ||
storybook-static | ||
.rpt2_cache | ||
lib | ||
lib-esm | ||
_bundles | ||
docs | ||
|
||
# misc | ||
.cache | ||
.DS_Store | ||
.env | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
.docz | ||
.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
.* | ||
**/tsconfig.json | ||
**/webpack.config.js | ||
node_modules | ||
src | ||
stories | ||
example | ||
lib | ||
lib-esm | ||
_bundles | ||
tsdx.config.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
dist | ||
|
||
.rpt2_cache | ||
lib | ||
lib-esm | ||
_bundles | ||
docs |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,16 @@ | ||
module.exports = { | ||
stories: ['../src/stories/**/*.stories.(ts|tsx|mdx)'], | ||
stories: ['../src/**/*.stories.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'], | ||
addons: [ | ||
'@storybook/preset-typescript', | ||
'@storybook/addon-actions', | ||
'@storybook/addon-links', | ||
'@storybook/addon-docs', | ||
'storybook-dark-mode' | ||
] | ||
{ | ||
name: '@storybook/addon-essentials', | ||
options: { | ||
backgrounds: false, | ||
}, | ||
}, | ||
], | ||
// https://storybook.js.org/docs/react/configure/typescript#mainjs-configuration | ||
typescript: { | ||
check: true, // type-check stories during Storybook build | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
import { addDecorator } from '@storybook/react' | ||
import { withTheme } from './WithTheme' | ||
|
||
addDecorator(withTheme) | ||
// https://storybook.js.org/docs/react/writing-stories/parameters#global-parameters | ||
export const parameters = { | ||
// https://storybook.js.org/docs/react/essentials/actions#automatically-matching-args | ||
actions: { argTypesRegex: '^on.*' }, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.