Skip to content

Commit 2a921cc

Browse files
refactor: ⚡ move to tsup (#539)
1 parent b37541a commit 2a921cc

25 files changed

+1277
-2324
lines changed

.eslintrc.cjs

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,41 +3,51 @@ module.exports = {
33
env: {
44
browser: true,
55
es2021: true,
6-
node: true
6+
node: true,
77
},
88
parser: "@typescript-eslint/parser",
9-
plugins: ["@typescript-eslint", "simple-import-sort"],
9+
plugins: ["@typescript-eslint", "prettier", "simple-import-sort"],
1010
extends: [
1111
"eslint:recommended",
12-
"plugin:react/recommended",
1312
"plugin:@typescript-eslint/eslint-recommended",
1413
"plugin:@typescript-eslint/recommended",
15-
"prettier"
14+
"plugin:react/recommended",
15+
"plugin:storybook/recommended",
1616
],
1717
rules: {
18-
"no-useless-escape": "off",
19-
"no-case-declarations": "off",
2018
"@typescript-eslint/ban-ts-comment": "off",
2119
"@typescript-eslint/ban-ts-ignore": "off",
2220
"@typescript-eslint/camelcase": "off",
23-
"@typescript-eslint/no-unused-vars": ["error", { ignoreRestSiblings: true }],
2421
"@typescript-eslint/explicit-function-return-type": "off",
22+
"@typescript-eslint/explicit-module-boundary-types": "off",
2523
"@typescript-eslint/interface-name-prefix": "off",
2624
"@typescript-eslint/no-empty-interface": "off",
2725
"@typescript-eslint/no-explicit-any": "off",
28-
"react/jsx-key": "off",
29-
"react/prop-types": "off",
26+
"@typescript-eslint/no-unused-vars": [
27+
"error",
28+
{
29+
ignoreRestSiblings: true,
30+
},
31+
],
32+
"no-case-declarations": "off",
33+
"no-console": [
34+
"error",
35+
{
36+
allow: ["warn", "error", "debug"],
37+
},
38+
],
39+
"no-useless-escape": "off",
40+
"prettier/prettier": "error",
3041
"react/display-name": "off",
42+
"react/jsx-key": "off",
3143
"react/no-children-prop": "off",
32-
"@typescript-eslint/explicit-module-boundary-types": "off",
33-
"simple-import-sort/imports": "error",
44+
"react/prop-types": "off",
3445
"simple-import-sort/exports": "error",
35-
36-
"no-console": ["error", { allow: ["warn", "error", "debug"] }]
46+
"simple-import-sort/imports": "error",
3747
},
3848
settings: {
3949
react: {
40-
version: "detect"
41-
}
42-
}
50+
version: "detect",
51+
},
52+
},
4353
};

.husky/pre-commit

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

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
12
1+
16

.storybook/main.js

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
module.exports = {
2-
stories: ["../stories/**/*.stories.@(ts|tsx|js|jsx)"],
2+
stories: [
3+
"../stories/**/*.stories.mdx",
4+
"../stories/**/*.stories.@(js|jsx|ts|tsx)",
5+
],
36
addons: [
4-
"@storybook/addon-essentials",
5-
"@storybook/addon-knobs",
67
"@storybook/addon-links",
8+
"@storybook/addon-essentials",
79
{
8-
name: "storybook-addon-turbo-build",
10+
name: '@storybook/addon-docs',
911
options: {
10-
optimizationLevel: 2,
12+
configureJSX: true,
13+
transcludeMarkdown: true,
1114
},
1215
},
1316
],
14-
// https://storybook.js.org/docs/react/configure/typescript#mainjs-configuration
15-
typescript: {
16-
check: true, // type-check stories during Storybook build
17-
reactDocgen: "none",
18-
},
17+
framework: "@storybook/react",
1918
};

.storybook/package.json

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

.storybook/preview.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
// https://storybook.js.org/docs/react/writing-stories/parameters#global-parameters
21
export const parameters = {
3-
// https://storybook.js.org/docs/react/essentials/actions#automatically-matching-args
4-
actions: { argTypesRegex: "^on.*" },
5-
};
2+
actions: { argTypesRegex: "^on[A-Z].*" },
3+
controls: {
4+
matchers: {
5+
color: /(background|color)$/i,
6+
date: /Date$/,
7+
},
8+
},
9+
}

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ yarn add react-multi-select-component # yarn
2323

2424
## 📦 Example
2525

26-
![Example](docs/images/preview.gif)
26+
![Example](https://user-images.githubusercontent.com/5774849/150685427-6025d7d3-ddfc-4787-a856-241c4cc100cb.gif)
2727

2828
```tsx
2929
import React, { useState } from "react";
@@ -55,7 +55,7 @@ const Example = () => {
5555
export default Example;
5656
```
5757

58-
More examples can be found [here ↗](./docs/recipes)
58+
More examples can be found [here ↗](https://react-multi-select-component.pages.dev/)
5959

6060
## 👀 Props
6161

babel.config.js

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

docs/images/custom-value.gif

-62.7 KB
Binary file not shown.

docs/images/preview.gif

-101 KB
Binary file not shown.

0 commit comments

Comments
 (0)