Skip to content

Commit c5fc3d1

Browse files
committed
chore: vite integration, dependencies cleanup
1 parent ee4bbbf commit c5fc3d1

21 files changed

+1272
-7238
lines changed

.eslintrc.js

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
module.exports = {
2+
parser: '@typescript-eslint/parser',
3+
extends: ['eslint:recommended', 'plugin:react/recommended', 'plugin:@typescript-eslint/recommended'],
4+
plugins: ['@typescript-eslint', 'react-hooks', 'prettier'],
5+
parserOptions: {
6+
ecmaVersion: 2018,
7+
sourceType: 'module',
8+
ecmaFeatures: {
9+
jsx: true
10+
}
11+
},
12+
env: {
13+
browser: true,
14+
node: true,
15+
es6: true,
16+
jest: true
17+
},
18+
rules: {
19+
"no-control-regex": 0,
20+
'no-undef': 0,
21+
'no-unused-vars': 'off',
22+
'react/prop-types': 0,
23+
'@typescript-eslint/camelcase': 0,
24+
'@typescript-eslint/no-unused-vars': 1,
25+
'@typescript-eslint/no-use-before-define': 0,
26+
'@typescript-eslint/ban-ts-comment': 0,
27+
'@typescript-eslint/ban-ts-ignore': 0,
28+
'@typescript-eslint/explicit-member-accessibility': 0,
29+
'@typescript-eslint/member-delimiter-style': 0,
30+
'@typescript-eslint/no-empty-function': 0,
31+
'@typescript-eslint/no-explicit-any': 0,
32+
'@typescript-eslint/no-non-null-assertion': 'off',
33+
'react-hooks/rules-of-hooks': 'error',
34+
'react-hooks/exhaustive-deps': 'warn'
35+
},
36+
settings: {
37+
react: {
38+
version: 'detect'
39+
}
40+
}
41+
}

.gitignore

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,27 @@
1-
node_modules/
2-
docs-build/
3-
coverage/
4-
build/
1+
/node_modules
2+
/.pnp
3+
.pnp.js
4+
5+
# testing
6+
7+
/coverage
8+
9+
# production
10+
11+
/dist
12+
/docs-build
13+
14+
# misc
15+
16+
.eslintcache
17+
.DS_Store
18+
.env.local
19+
.env.development.local
20+
.env.test.local
21+
.env.production.local
22+
23+
npm-debug.log*
24+
yarn-debug.log*
25+
yarn-error.log\*
526
debug.log
6-
.out
27+
.out

.prettierignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.prettierrc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"printWidth": 160,
3+
"tabWidth": 4,
4+
"singleQuote": true,
5+
"semi": false,
6+
"trailingComma": "none",
7+
"bracketSpacing": true
8+
}

.storybook/main.ts

Lines changed: 21 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,22 @@
1-
module.exports = {
2-
stories: ["../src/**/*.stories.tsx"],
3-
addons: ["@storybook/addon-docs", "@storybook/addon-viewport", "@storybook/addon-a11y"],
4-
typescript: {
5-
reactDocgen: "react-docgen-typescript",
6-
reactDocgenTypescriptOptions: {
7-
compilerOptions: {
8-
outDir: "build",
9-
module: "esnext",
10-
target: "esnext",
11-
lib: ["es6", "dom", "es2016", "es2017"],
12-
sourceMap: true,
13-
allowJs: false,
14-
jsx: "react",
15-
declaration: true,
16-
forceConsistentCasingInFileNames: true,
17-
noImplicitReturns: true,
18-
noImplicitThis: true,
19-
noImplicitAny: true,
20-
strictNullChecks: true,
21-
suppressImplicitAnyIndexErrors: true,
22-
noUnusedLocals: false,
23-
noUnusedParameters: true,
24-
esModuleInterop: true
25-
}
1+
import type { StorybookConfig } from '@storybook/react-vite'
2+
import { withoutVitePlugins } from '@storybook/builder-vite'
3+
4+
const config: StorybookConfig = {
5+
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
6+
addons: ['@storybook/addon-links', '@storybook/addon-essentials', '@storybook/addon-onboarding', '@storybook/addon-interactions'],
7+
framework: {
8+
name: '@storybook/react-vite',
9+
options: {}
10+
},
11+
docs: {
12+
autodocs: 'tag'
13+
},
14+
viteFinal: async (config) => {
15+
return {
16+
...config,
17+
plugins: await withoutVitePlugins(config.plugins, ['vite:lib-inject-css'])
18+
}
2619
}
27-
},
28-
framework: {
29-
name: "@storybook/react-webpack5",
30-
options: {}
31-
},
32-
docs: {
33-
autodocs: true
34-
}
35-
};
20+
}
21+
22+
export default config

.storybook/preview.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
export const parameters = {
2-
a11y: {
3-
element: '#root',
4-
config: {},
5-
options: {},
6-
manual: true,
7-
},
8-
};
1+
import type { Preview } from '@storybook/react'
2+
3+
const preview: Preview = {
4+
parameters: {
5+
actions: { argTypesRegex: '^on[A-Z].*' },
6+
controls: {}
7+
}
8+
}
9+
10+
export default preview

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2022 Cristiano Raimondi
3+
Copyright (c) 2020 - 2023 Cristiano Raimondi
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

index.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>React Usage Bar</title>
8+
</head>
9+
<body>
10+
<div id="root"></div>
11+
<script type="module" src="/src/main.tsx"></script>
12+
</body>
13+
</html>

jsconfig.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"compilerOptions": {
3+
"target": "es2020",
4+
"allowSyntheticDefaultImports": false,
5+
"baseUrl": "./src",
6+
"paths": {
7+
"*": ["src/*"]
8+
}
9+
},
10+
"exclude": ["node_modules", "public", "build"]
11+
}
File renamed without changes.

0 commit comments

Comments
 (0)