Match-id-0a12c789c69d5b24eecc870733e1c05c1fdd97ce

This commit is contained in:
* 2023-07-28 18:29:07 +08:00
commit 75fb52ef9b
22 changed files with 111 additions and 25 deletions

10
.editorconfig Normal file
View File

@ -0,0 +1,10 @@
root = true
[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
indent_size = 2
indent_style = space
trim_trailing_whitespace = true

3
.eslintignore Normal file
View File

@ -0,0 +1,3 @@
**/node_modules
build/
*.d.ts

74
.eslintrc.js Normal file
View File

@ -0,0 +1,74 @@
/*
* Copyright (c) 2020 Huawei Technologies Co.,Ltd.
*
* openGauss is licensed under Mulan PSL v2.
* You can use this software according to the terms and conditions of the Mulan PSL v2.
* You may obtain a copy of Mulan PSL v2 at:
*
* http://license.coscl.org.cn/MulanPSL2
*
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
* See the Mulan PSL v2 for more details.
*/
module.exports = {
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'prettier',
],
root: true,
plugins: ['jest', 'no-for-of-loops', 'no-function-declare-after-return', 'react', '@typescript-eslint'],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 8,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
modules: true,
experimentalObjectRestSpread: true,
},
},
env: {
browser: true,
jest: true,
node: true,
es6: true,
},
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-empty-function': 'off',
semi: ['warn', 'always'],
quotes: ['warn', 'single'],
'accessor-pairs': 'off',
'brace-style': ['error', '1tbs'],
'func-style': ['warn', 'declaration', { allowArrowFunctions: true }],
'max-lines-per-function': 'off',
'object-curly-newline': 'off',
// 尾随逗号
'comma-dangle': ['error', 'only-multiline'],
'no-constant-condition': 'off',
'no-for-of-loops/no-for-of-loops': 'error',
'no-function-declare-after-return/no-function-declare-after-return': 'error',
},
globals: {
isDev: true,
isTest: true,
},
overrides: [
{
files: ['scripts/__tests__/**/*.js'],
globals: {
container: true,
},
},
],
};

View File

@ -13,7 +13,7 @@
"@babel/plugin-proposal-export-default-from": "^7.18.6", "@babel/plugin-proposal-export-default-from": "^7.18.6",
"@babel/plugin-transform-react-jsx": "^7.21.0", "@babel/plugin-transform-react-jsx": "^7.21.0",
"@babel/runtime": "7.6.2", "@babel/runtime": "7.6.2",
"inula": "0.0.52", "inulajs": "^0.0.3",
"antd": "^4.0.0", "antd": "^4.0.0",
"axios": "^0.21.0", "axios": "^0.21.0",
"classnames": "^2.2.6", "classnames": "^2.2.6",

View File

@ -8,7 +8,7 @@ import config from '../utils/config';
// @ts-ignore // @ts-ignore
const { queryRouteList, queryUserInfo } = api; const { queryRouteList, queryUserInfo } = api;
import { createStore } from 'inula'; import { createStore } from 'inulajs';
const goDashboard = history => { const goDashboard = history => {
if (pathToRegexp(['/', '/login']).exec(window.location.pathname)) { if (pathToRegexp(['/', '/login']).exec(window.location.pathname)) {

View File

@ -2,7 +2,7 @@ import { parse } from 'qs';
import api from '../../services'; import api from '../../services';
import { pathToRegexp } from 'path-to-regexp'; import { pathToRegexp } from 'path-to-regexp';
import { createStore } from 'inula'; import { createStore } from 'inulajs';
const { queryDashboard, queryWeather } = api; const { queryDashboard, queryWeather } = api;
const avatar = '//cdn.antd-admin.zuiidea.com/bc442cf0cc6f7940dcc567e465048d1a8d634493198c4-sPx5BR_fw236.jpeg'; const avatar = '//cdn.antd-admin.zuiidea.com/bc442cf0cc6f7940dcc567e465048d1a8d634493198c4-sPx5BR_fw236.jpeg';

View File

@ -1,5 +1,5 @@
import api from '../../services'; import api from '../../services';
import { createStore } from 'inula'; import { createStore } from 'inulajs';
const { queryUserList, createUser, removeUser, updateUser, removeUserList } = api; const { queryUserList, createUser, removeUser, updateUser, removeUserList } = api;

View File

@ -11,9 +11,9 @@ let alias = {
config: path.resolve('src/admin/utils/config'), config: path.resolve('src/admin/utils/config'),
themes: path.resolve('src/admin/themes'), themes: path.resolve('src/admin/themes'),
utils: path.resolve('src/admin/utils'), utils: path.resolve('src/admin/utils'),
react: 'inula', // 新增 react: 'inulajs', // 新增
'react-dom': 'inula', // 新增 'react-dom': 'inulajs', // 新增
'react/jsx-dev-runtime': 'inula/jsx-dev-runtime', 'react/jsx-dev-runtime': 'inulajs/jsx-dev-runtime',
}; };
// https://vitejs.dev/config/ // https://vitejs.dev/config/

View File

@ -12,7 +12,7 @@ module.exports = {
'@babel/preset-react', '@babel/preset-react',
{ {
runtime: 'automatic', // 新增 runtime: 'automatic', // 新增
importSource: 'inula', // 新增 importSource: 'inulajs', // 新增
}, },
], ],
], ],

View File

@ -43,7 +43,7 @@
"dependencies": { "dependencies": {
"@ant-design/icons": "^5.1.4", "@ant-design/icons": "^5.1.4",
"@babel/plugin-proposal-export-default-from": "^7.18.6", "@babel/plugin-proposal-export-default-from": "^7.18.6",
"inula": "0.0.38", "inulajs": "^0.0.3",
"antd": "^4.0.0", "antd": "^4.0.0",
"axios": "^1.4.0", "axios": "^1.4.0",
"classnames": "^2.2.6", "classnames": "^2.2.6",

View File

@ -1,4 +1,4 @@
import inula from 'inula'; import inula from 'inulajs';
import { BrowserRouter } from 'react-router-dom'; import { BrowserRouter } from 'react-router-dom';
import 'antd/dist/antd.css'; import 'antd/dist/antd.css';

View File

@ -5,7 +5,7 @@ import api from '../services';
// @ts-ignore // @ts-ignore
const { queryRouteList, logoutUser, queryUserInfo } = api; const { queryRouteList, logoutUser, queryUserInfo } = api;
import { createStore } from 'inula'; import { createStore } from 'inulajs';
const goDashboard = history => { const goDashboard = history => {
if (pathToRegexp(['/', '/login']).exec(window.location.pathname)) { if (pathToRegexp(['/', '/login']).exec(window.location.pathname)) {

View File

@ -1,6 +1,6 @@
import { parse } from 'qs'; import { parse } from 'qs';
import api from '../../services'; import api from '../../services';
import { createStore } from 'inula'; import { createStore } from 'inulajs';
const { queryDashboard, queryWeather } = api; const { queryDashboard, queryWeather } = api;
const avatar = '//cdn.antd-admin.zuiidea.com/bc442cf0cc6f7940dcc567e465048d1a8d634493198c4-sPx5BR_fw236.jpeg'; const avatar = '//cdn.antd-admin.zuiidea.com/bc442cf0cc6f7940dcc567e465048d1a8d634493198c4-sPx5BR_fw236.jpeg';

View File

@ -1,5 +1,5 @@
import api from '../../services'; import api from '../../services';
import { createStore } from 'inula'; import { createStore } from 'inulajs';
const { queryUserList, createUser, removeUser, updateUser, removeUserList } = api; const { queryUserList, createUser, removeUser, updateUser, removeUserList } = api;

View File

@ -14,9 +14,8 @@ module.exports = {
themes: path.resolve('src/themes'), themes: path.resolve('src/themes'),
utils: path.resolve('src/utils'), utils: path.resolve('src/utils'),
react: 'inula', // 新增 react: 'inulajs', // 新增
'react-dom': 'inula', // 新增 'react-dom': 'inulajs', // 新增
inula: 'inula', // 新增
}, },
}, },
rules: [ rules: [

View File

@ -10,7 +10,7 @@
"author": "", "author": "",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"inula": "^0.0.44" "inulajs": "^0.0.3"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.21.4", "@babel/core": "^7.21.4",

View File

@ -1,4 +1,4 @@
import inula from 'inula'; import inula from 'inulajs';
import './index.css'; import './index.css';
function App() { function App() {

View File

@ -1,9 +1,9 @@
import react from '@vitejs/plugin-react'; import react from '@vitejs/plugin-react';
let alias = { let alias = {
react: 'inula', // 新增 react: 'inulajs', // 新增
'react-dom': 'inula', // 新增 'react-dom': 'inulajs', // 新增
'react/jsx-dev-runtime': 'inula/jsx-dev-runtime', 'react/jsx-dev-runtime': 'inulajs/jsx-dev-runtime',
}; };
export default { export default {

View File

@ -10,7 +10,7 @@
"author": "", "author": "",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"inula": "^0.0.44" "inulajs": "^0.0.3"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.21.4", "@babel/core": "^7.21.4",

View File

@ -1,4 +1,4 @@
import inula from 'inula'; import inula from 'inulajs';
import './styles.css'; import './styles.css';
class App extends inula.Component { class App extends inula.Component {

View File

@ -1,4 +1,4 @@
import inula from 'inula'; import inula from 'inulajs';
import App from './App'; import App from './App';
inula.render(<App />, document.getElementById('root')); inula.render(<App />, document.getElementById('root'));

View File

@ -21,7 +21,7 @@ module.exports = {
'@babel/preset-react', '@babel/preset-react',
{ {
runtime: 'automatic', // 新增 runtime: 'automatic', // 新增
importSource: 'inula', // 新增 importSource: 'inulajs', // 新增
}, },
], ],
], ],