Skip to content

Commit 5b99927

Browse files
test new app
1 parent b0926ed commit 5b99927

19 files changed

+3652
-1655
lines changed
File renamed without changes.

React/.gitignore

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2-
3-
# dependencies
4-
/node_modules
5-
/.pnp
6-
.pnp.js
7-
8-
# testing
9-
/coverage
10-
11-
# production
12-
/build
13-
/dist/*
14-
15-
# misc
16-
.DS_Store
17-
.env.local
18-
.env.development.local
19-
.env.test.local
20-
.env.production.local
21-
1+
# Logs
2+
logs
3+
*.log
224
npm-debug.log*
235
yarn-debug.log*
246
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: 54 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,54 @@
1-
# React
2-
3-
Take a look at the following files of this example to see the required code:
4-
5-
Your files go here
6-
7-
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
8-
9-
## Available Scripts
10-
11-
In the project directory, you can run:
12-
13-
### `npm start`
14-
15-
Runs the app in the development mode.<br>
16-
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
17-
18-
The page will reload if you make edits.<br>
19-
You will also see any lint errors in the console.
20-
21-
### `npm run build`
22-
23-
Builds the app for production to the `build` folder.<br>
24-
It correctly bundles React in production mode and optimizes the build for the best performance.
25-
26-
The build is minified and the filenames include the hashes.<br>
27-
Your app is ready to be deployed!
28-
29-
See the section about [deployment](https://create-react-app.dev/docs/deployment/) for more information.
30-
31-
## Further help
32-
33-
You can learn more about React in the [Create React App documentation](https://create-react-app.dev/docs/getting-started/).
34-
35-
To get more help on DevExtreme submit an issue on [GitHub](https://github.com/DevExpress/devextreme/issues) or [Support Center](https://www.devexpress.com/Support/Center/Question/Create)
36-
37-
38-
1+
# React + TypeScript + Vite
2+
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) uses [Babel](https://babeljs.io/) for Fast Refresh
8+
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/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+
```js
15+
export default tseslint.config({
16+
extends: [
17+
// Remove ...tseslint.configs.recommended and replace with this
18+
...tseslint.configs.recommendedTypeChecked,
19+
// Alternatively, use this for stricter rules
20+
...tseslint.configs.strictTypeChecked,
21+
// Optionally, add this for stylistic rules
22+
...tseslint.configs.stylisticTypeChecked,
23+
],
24+
languageOptions: {
25+
// other options...
26+
parserOptions: {
27+
project: ['./tsconfig.node.json', './tsconfig.app.json'],
28+
tsconfigRootDir: import.meta.dirname,
29+
},
30+
},
31+
})
32+
```
33+
34+
You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
35+
36+
```js
37+
// eslint.config.js
38+
import reactX from 'eslint-plugin-react-x'
39+
import reactDom from 'eslint-plugin-react-dom'
40+
41+
export default tseslint.config({
42+
plugins: {
43+
// Add the react-x and react-dom plugins
44+
'react-x': reactX,
45+
'react-dom': reactDom,
46+
},
47+
rules: {
48+
// other rules...
49+
// Enable its recommended typescript rules
50+
...reactX.configs['recommended-typescript'].rules,
51+
...reactDom.configs.recommended.rules,
52+
},
53+
})
54+
```

React/index.html

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,13 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
33
<head>
4-
<meta charset="utf-8" />
5-
<link rel="icon" href="/favicon.ico" />
6-
<meta name="viewport" content="width=device-width, initial-scale=1" />
7-
<meta name="theme-color" content="#000000" />
8-
<meta
9-
name="description"
10-
content="Web site created using Vite"
11-
/>
12-
<link rel="apple-touch-icon" href="/logo192.png" />
13-
<!--
14-
manifest.json provides metadata used when your web app is installed on a
15-
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
16-
-->
17-
<link rel="manifest" href="/manifest.json" />
18-
19-
<title>React App</title>
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>
208
</head>
21-
<body class="dx-viewport">
22-
<noscript>You need to enable JavaScript to run this app.</noscript>
9+
<body>
2310
<div id="root"></div>
24-
<script type="module" src="/src/main.jsx"></script>
25-
11+
<script type="module" src="/src/main.tsx"></script>
2612
</body>
2713
</html>

React/kek.config.js

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
// import js from '@eslint/js'
2+
// import globals from 'globals'
3+
// import reactHooks from 'eslint-plugin-react-hooks'
4+
// import reactRefresh from 'eslint-plugin-react-refresh'
5+
// import tseslint from 'typescript-eslint'
6+
7+
// export default tseslint.config(
8+
// { ignores: ['dist'] },
9+
// {
10+
// extends: [js.configs.recommended, ...tseslint.configs.recommended],
11+
// files: ['**/*.{ts,tsx}'],
12+
// languageOptions: {
13+
// ecmaVersion: 2020,
14+
// globals: globals.browser,
15+
// },
16+
// plugins: {
17+
// 'react-hooks': reactHooks,
18+
// 'react-refresh': reactRefresh,
19+
// },
20+
// rules: {
21+
// ...reactHooks.configs.recommended.rules,
22+
// 'react-refresh/only-export-components': [
23+
// 'warn',
24+
// { allowConstantExport: true },
25+
// ],
26+
// },
27+
// },
28+
// )
29+
30+
31+
import eslintPluginReact from 'eslint-plugin-react';
32+
import eslintPluginJest from 'eslint-plugin-jest';
33+
import spellCheckConfig from 'eslint-config-devextreme/spell-check.js';
34+
import reactConfig from 'eslint-config-devextreme/react.js';
35+
import jestConfig from 'eslint-config-devextreme/jest.js';
36+
console.log('spellCheckConfig', spellCheckConfig);
37+
/** @type {import("eslint").Linter.FlatConfig[]} */
38+
export default [
39+
// Base spell check config
40+
41+
// React + TypeScript config
42+
{
43+
files: ['**/*.ts', '**/*.tsx'],
44+
languageOptions: {
45+
// parser: '@typescript-eslint/parser',
46+
parserOptions: {
47+
project: './tsconfig.json',
48+
ecmaVersion: 6,
49+
createDefaultProgram: true,
50+
},
51+
globals: {
52+
System: 'readonly',
53+
AzureGateway: 'readonly',
54+
AzureFileSystem: 'readonly',
55+
},
56+
},
57+
plugins: {
58+
react: eslintPluginReact,
59+
},
60+
settings: {
61+
react: {
62+
createClass: 'createReactClass',
63+
pragma: 'React',
64+
version: '16.2',
65+
flowVersion: '0.53',
66+
},
67+
propWrapperFunctions: ['forbidExtraProps'],
68+
},
69+
rules: {
70+
// Include rules from the devextreme/react config
71+
...reactConfig.rules,
72+
},
73+
},
74+
75+
// Jest-specific overrides
76+
{
77+
files: ['**/*.test.tsx'],
78+
plugins: {
79+
jest: eslintPluginJest,
80+
},
81+
rules: {
82+
...jestConfig.rules,
83+
},
84+
},
85+
];

0 commit comments

Comments
 (0)