This repository has been archived by the owner on Apr 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* init * Add typescript (#880) * add typescript * fix * fin * actions * actions * fix pnpm * silence error * Add ts build (#881) * add ts build * add ts build * clean up unused files and dependencies (#882) * add storybook (#883) * fix ci * clean up * add banner * clean up * fix
- Loading branch information
Showing
60 changed files
with
21,460 additions
and
18,821 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
module.exports = { | ||
root: true, | ||
extends: ['plugin:@typescript-eslint/recommended', 'plugin:react-hooks/recommended', 'plugin:ssr-friendly/recommended', 'plugin:storybook/recommended', 'plugin:prettier/recommended'], | ||
parser: '@typescript-eslint/parser', | ||
parserOptions: { | ||
ecmaFeatures: { | ||
jsx: true, | ||
}, | ||
ecmaVersion: 2018, | ||
sourceType: 'module', | ||
project: './tsconfig.json', | ||
}, | ||
plugins: ['import', 'prettier', '@typescript-eslint', 'ssr-friendly'], | ||
rules: { | ||
/** | ||
* Allow empty arrow functions `() => {}`, while keeping other empty functions restricted | ||
* @see https://eslint.org/docs/latest/rules/no-empty-function#allow-arrowfunctions | ||
*/ | ||
'@typescript-eslint/no-empty-function': ['error', { allow: ['arrowFunctions'] }], | ||
'@typescript-eslint/ban-ts-comment': 1, | ||
'no-const-assign': 'error', | ||
/** Restrict imports from devDependencies since they are not included in library build. peerDependencies are ok */ | ||
'import/no-extraneous-dependencies': [ | ||
'error', | ||
{ | ||
devDependencies: false, | ||
peerDependencies: true | ||
} | ||
], | ||
/** | ||
* Enforce import order with empty lines between import group | ||
* @see https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/order.md | ||
*/ | ||
'import/order': [ | ||
'error', | ||
{ | ||
groups: [ | ||
'builtin', | ||
'external', | ||
'internal', | ||
['parent', 'sibling', 'index'] | ||
], | ||
pathGroups: [ | ||
{ | ||
pattern: '@/**', | ||
group: 'internal' | ||
} | ||
], | ||
'newlines-between': 'always' | ||
} | ||
], | ||
/** | ||
* Disallow combined module and type imports like this `import React, {FC} from 'react'`. | ||
* Eslint will try to split into type and module imports instead | ||
* @see https://typescript-eslint.io/rules/consistent-type-imports/ | ||
*/ | ||
'@typescript-eslint/consistent-type-imports': 'error', | ||
'import/no-cycle': 'error', | ||
'prettier/prettier': ['error', { | ||
"semi": true, | ||
"singleQuote": true, | ||
"jsxSingleQuote": false, | ||
"trailingComma": "es5", | ||
"bracketSpacing": false, | ||
"jsxBracketSameLine": true, | ||
"arrowParens": "avoid" | ||
}] | ||
}, | ||
overrides: [ | ||
{ | ||
/* Allow devDependencies imports for tests and config files */ | ||
files: ['*.js'], | ||
rules: { | ||
'@typescript-eslint/no-var-requires': 0, | ||
}, | ||
}, | ||
{ | ||
/* Allow devDependencies imports for tests and config files */ | ||
files: ['**/*.spec.*', '**/testUtils/*.*', '**/*.js', '**/setupTests.ts', '**/*.stories.*'], | ||
rules: { | ||
'import/no-extraneous-dependencies': [ | ||
'error', | ||
{ | ||
devDependencies: true, | ||
peerDependencies: true, | ||
}, | ||
], | ||
}, | ||
}, | ||
], | ||
}; | ||
// @typescript-eslint/no-var-requires |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,3 +31,4 @@ template.json | |
|
||
# documentation | ||
storybook-static | ||
dist |
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 |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
. "$(dirname "$0")/_/husky.sh" | ||
|
||
npx lint-staged | ||
npm run lint:types |
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,6 +1,6 @@ | ||
{ | ||
"*.js": [ | ||
"eslint --fix --quiet" | ||
"*.{js,ts,tsx}": [ | ||
"eslint --fix" | ||
], | ||
"*.css": [ | ||
"stylelint --fix --quiet" | ||
|
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 +1 @@ | ||
v16 | ||
v18 |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import type { StorybookConfig } from "@storybook/react-webpack5"; | ||
|
||
const config: StorybookConfig = { | ||
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"], | ||
addons: [ | ||
"@storybook/addon-links", | ||
"@storybook/addon-essentials", | ||
"@storybook/preset-create-react-app", | ||
"@storybook/addon-interactions", | ||
], | ||
framework: { | ||
name: "@storybook/react-webpack5", | ||
options: {}, | ||
}, | ||
docs: { | ||
autodocs: "tag", | ||
}, | ||
staticDirs: ["../public"], | ||
}; | ||
export default config; |
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import type { Preview } from "@storybook/react"; | ||
|
||
const preview: Preview = { | ||
parameters: { | ||
actions: { argTypesRegex: "^on[A-Z].*" }, | ||
controls: { | ||
matchers: { | ||
color: /(background|color)$/i, | ||
date: /Date$/i, | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
export default preview; |
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.