Skip to content

Commit 678a452

Browse files
authored
Merge pull request #7 from DevExpress-Examples/React
Update the React example
2 parents d0a48c6 + 410b09d commit 678a452

29 files changed

Lines changed: 12932 additions & 0 deletions

React/.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
/dist/*
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?

React/README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# React + TypeScript + Vite + DevExtreme
2+
3+
For more information about this example check the [Readme](../README.md).
4+
5+
## Build and Lint
6+
7+
Install dependencies:
8+
```sh
9+
npm install
10+
```
11+
12+
Start dev server:
13+
```sh
14+
npm run dev
15+
```
16+
Open: http://localhost:5173/
17+
18+
Build production bundle:
19+
```sh
20+
npm run build
21+
```
22+
23+
Run linter:
24+
```sh
25+
npm run lint
26+
```
27+
28+
## Further help
29+
30+
React docs: https://react.dev/learn
31+
Vite docs: https://vite.dev/
32+
DevExtreme React docs: https://js.devexpress.com/React/Documentation
33+
34+
To get more help with DevExtreme, submit a ticket through the [Support Center](https://supportcenter.devexpress.com/ticket/create).

React/eslint.config.js

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import path from 'path';
2+
import { fileURLToPath } from 'url';
3+
import tsParser from '@typescript-eslint/parser';
4+
import spellCheck from 'eslint-config-devextreme/spell-check';
5+
import reactConfig from 'eslint-config-devextreme/react';
6+
7+
const __filename = fileURLToPath(import.meta.url);
8+
const __dirname = path.dirname(__filename);
9+
10+
export default [
11+
{
12+
ignores: ['node_modules/**', 'build/**', 'dist/**', 'eslint.config.js', '*.config.ts', 'stylelint.config.mjs'],
13+
},
14+
...spellCheck,
15+
...reactConfig,
16+
{
17+
rules: {
18+
'import/prefer-default-export': 'off',
19+
},
20+
},
21+
{
22+
files: ['**/*.ts', '**/*.tsx'],
23+
languageOptions: {
24+
parserOptions: {
25+
project: './tsconfig.app.json',
26+
tsconfigRootDir: __dirname,
27+
},
28+
},
29+
settings: {
30+
react: {
31+
version: '18.2',
32+
},
33+
},
34+
},
35+
{
36+
files: ['**/*.ts', '**/*.tsx'],
37+
rules: {
38+
'react/react-in-jsx-scope': 'off',
39+
'import/no-extraneous-dependencies': ['error', {
40+
devDependencies: [
41+
'**/vitest.config.ts',
42+
'**/vite.config.ts',
43+
'**/*.test.tsx',
44+
'**/setupTests.ts',
45+
],
46+
}],
47+
},
48+
},
49+
];

React/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>Vite + React + TS</title>
8+
</head>
9+
<body>
10+
<div id="root"></div>
11+
<script type="module" src="/src/main.tsx"></script>
12+
</body>
13+
</html>

0 commit comments

Comments
 (0)