Skip to content

Commit 10fcc88

Browse files
committed
chore(lib): initial setup
1 parent 82fec54 commit 10fcc88

12 files changed

Lines changed: 1633 additions & 220 deletions

File tree

README.md

Lines changed: 2 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,3 @@
1-
# React + TypeScript + Vite
1+
# React QR Code Generator
22

3-
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
4-
5-
Currently, two official plugins are available:
6-
7-
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
8-
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
9-
10-
## Expanding the ESLint configuration
11-
12-
If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
13-
14-
- Configure the top-level `parserOptions` property like this:
15-
16-
```js
17-
export default tseslint.config({
18-
languageOptions: {
19-
// other options...
20-
parserOptions: {
21-
project: ['./tsconfig.node.json', './tsconfig.app.json'],
22-
tsconfigRootDir: import.meta.dirname,
23-
},
24-
},
25-
})
26-
```
27-
28-
- Replace `tseslint.configs.recommended` to `tseslint.configs.recommendedTypeChecked` or `tseslint.configs.strictTypeChecked`
29-
- Optionally add `...tseslint.configs.stylisticTypeChecked`
30-
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and update the config:
31-
32-
```js
33-
// eslint.config.js
34-
import react from 'eslint-plugin-react'
35-
36-
export default tseslint.config({
37-
// Set the react version
38-
settings: { react: { version: '18.3' } },
39-
plugins: {
40-
// Add the react plugin
41-
react,
42-
},
43-
rules: {
44-
// other rules...
45-
// Enable its recommended rules
46-
...react.configs.recommended.rules,
47-
...react.configs['jsx-runtime'].rules,
48-
},
49-
})
50-
```
3+
Coming soon...

lib/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export * from './types';
2+
export { ReactQRCodeGenerator } from './react-qr-code-generator';

lib/react-qr-code-generator.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import React from 'react';
2+
3+
import { ReactQRCodeGeneratorOptions } from './types';
4+
5+
export const ReactQRCodeGenerator = (options: ReactQRCodeGeneratorOptions) => {
6+
const { data } = options;
7+
return <>{data}</>;
8+
};

lib/types.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export interface ReactQRCodeGeneratorOptions {
2+
data: string;
3+
}

package.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,21 @@
1616
]
1717
},
1818
"dependencies": {
19+
"@tailwindcss/vite": "^4.0.0",
1920
"react": "^18.3.1",
20-
"react-dom": "^18.3.1"
21+
"react-dom": "^18.3.1",
22+
"tailwindcss": "^4.0.0"
2123
},
2224
"devDependencies": {
25+
"@commitlint/cli": "^19.6.1",
26+
"@commitlint/config-conventional": "^19.6.0",
2327
"@eslint/js": "^9.17.0",
2428
"@trivago/prettier-plugin-sort-imports": "^5.2.1",
29+
"@types/node": "^22.10.10",
2530
"@types/react": "^18.3.18",
2631
"@types/react-dom": "^18.3.5",
2732
"@vitejs/plugin-react": "^4.3.4",
33+
"commitizen": "^4.3.1",
2834
"eslint": "^9.17.0",
2935
"eslint-plugin-react-hooks": "^5.0.0",
3036
"eslint-plugin-react-refresh": "^0.4.16",

0 commit comments

Comments
 (0)