Skip to content

Commit e014c22

Browse files
authored
chore: add READMEs (#2)
1 parent 15f951b commit e014c22

File tree

2 files changed

+19
-46
lines changed

2 files changed

+19
-46
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<p align="center">
2+
<a href="https://sanity.io">
3+
<img src="https://cdn.sanity.io/images/3do82whm/next/1dfce9dde7a62ccaa8e8377254a1e919f6c07ad3-128x128.svg" />
4+
</a>
5+
<h1 align="center">Sanity SDK Examples</h1>
6+
</p>
7+
8+
Example implementations of the Sanity React SDK.

sdk-explorer/README.md

Lines changed: 11 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,15 @@
1-
# React + TypeScript + Vite
1+
<p align="center">
2+
<a href="https://sanity.io">
3+
<img src="https://cdn.sanity.io/images/3do82whm/next/1dfce9dde7a62ccaa8e8377254a1e919f6c07ad3-128x128.svg" />
4+
</a>
5+
<h1 align="center">Sanity SDK Explorer</h1>
6+
</p>
27

3-
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
8+
An app for exploring all features of the Sanity React SDK.
49

5-
Currently, two official plugins are available:
10+
## Getting started
611

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-
})
12+
```bash
13+
pnpm install
14+
pnpm dev
5015
```

0 commit comments

Comments
 (0)