Skip to content

Commit 6f18a60

Browse files
authored
Merge pull request #786 from ShuyunFF2E/optimize-mly
Optimize mly
2 parents 61fdcc1 + e2990ef commit 6f18a60

67 files changed

Lines changed: 37539 additions & 28328 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintignore

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
dist/
22
docs/
33
loader/
4-
*.min.js
4+
*.min.js
5+
cloud-react-site/
6+
src/**/test/
7+
src/**/__test__/
8+
src/components/icon/libs/
9+
src/components/index.js
10+
scripts/
11+
*.config.js
12+
tests/

.eslintrc

Lines changed: 36 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
}
1515
},
1616
"rules": {
17+
"prefer-regex-literals": "off",
1718
"prefer-object-spread": 0,
1819
"react/jsx-props-no-spreading": 0,
1920
"react/destructuring-assignment": 0,
@@ -38,7 +39,6 @@
3839
"react/forbid-elements": [1, { "forbid": [] }],
3940

4041
//// -----
41-
"no-unused-vars": ["error", { "vars": "all" }],
4242
"indent": ["error", 2, { "SwitchCase": 1 }],
4343

4444
"react/jsx-no-target-blank": "error",
@@ -48,9 +48,8 @@
4848
"spaced-comment": ["error", "always"],
4949
"no-multi-spaces": "error",
5050
"no-unused-expressions": ["error", { "allowShortCircuit": true, "allowTernary": true }],
51-
"no-param-reassign": ["error", { "props": true }],
5251
"no-return-assign": "error",
53-
"max-len": ["error", { "code": 140, "comments": 140 }],
52+
"max-len": ["error", { "code": 200, "comments": 200 }],
5453
"quote-props": ["error", "as-needed"],
5554
"eqeqeq": "error",
5655
"new-cap": "error",
@@ -62,7 +61,7 @@
6261
"lines-between-class-members": ["error", "always", { "exceptAfterSingleLine": true }],
6362
"template-curly-spacing": ["error", "never"],
6463
"space-infix-ops": ["error"],
65-
"arrow-body-style": ["error", "as-needed"],
64+
"arrow-body-style": "off",
6665
"no-undef": "error",
6766
"no-multi-assign": "error",
6867
"no-nested-ternary": "error",
@@ -89,18 +88,47 @@
8988
// react (eslint-plugin-react required)
9089
"react/jsx-filename-extension": ["error", { "extensions": [".js", ".jsx"] }],
9190
"react/jsx-no-duplicate-props": ["error"],
92-
"react/jsx-indent-props": ["error", 2],
93-
"react/jsx-indent": ["error", 2],
91+
"react/jsx-indent-props": "off",
92+
"react/jsx-indent": "off",
93+
"no-promise-executor-return": "off",
94+
"no-param-reassign": "off",
95+
"class-methods-use-this": "off",
9496
"react/jsx-first-prop-new-line": [ "error", "multiline" ],
9597
"react/prop-types": "off",
9698
"react/no-children-prop": "off",
9799

98100
"react/no-string-refs": "off", // close temporally
99-
"react/no-array-index-key": "error",
101+
"react/no-array-index-key": "warn",
100102
"react/jsx-boolean-value": "error",
101103
"react/no-deprecated": "warn",
102104
"react/require-default-props": "off",
103-
"react/jsx-wrap-multilines": "off"
105+
"react/jsx-wrap-multilines": "off",
106+
"no-mixed-spaces-and-tabs": "off",
107+
"no-tabs": "off",
108+
"react/no-danger": "off",
109+
"react/no-unknown-property": "off",
110+
"react/no-unused-class-component-methods": "off",
111+
"no-unused-vars": "warn",
112+
"max-classes-per-file": "off",
113+
"react/jsx-no-useless-fragment": "off",
114+
"react/jsx-no-constructed-context-values": "off",
115+
"brace-style": "off",
116+
"default-param-last": "off",
117+
"no-use-before-define": "off",
118+
"prefer-const": "warn",
119+
"react/jsx-closing-tag-location": "off",
120+
"react/state-in-constructor": "warn",
121+
122+
// 函数组件配置
123+
"react/function-component-definition": [
124+
"warn",
125+
{
126+
"namedComponents": ["function-declaration", "arrow-function", "function-expression"],
127+
"unnamedComponents": ["arrow-function", "function-expression"]
128+
}
129+
],
130+
"react/prefer-stateless-function": "off",
131+
"react/jsx-one-expression-per-line": "off"
104132
},
105133
"globals": {
106134
"window": true,

.fatherrc.ts

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import NodePath from 'path';
22
import alias from '@rollup/plugin-alias';
3-
import { eslint } from 'rollup-plugin-eslint';
3+
// import { eslint } from 'rollup-plugin-eslint';
44
import copy from 'rollup-plugin-copy';
55
// import url from '@rollup/plugin-url';
66
import generatePackageJson from 'rollup-plugin-generate-package-json';
@@ -111,11 +111,11 @@ export default isBuild
111111
'shuyun-utils': '0.0.3',
112112
},
113113
}),
114-
eslint({
115-
throwOnError: true,
116-
include: [NodePath.resolve('src/components')],
117-
/* your options */
118-
}),
114+
// eslint({
115+
// throwOnError: false,
116+
// include: [NodePath.resolve('src/components')],
117+
// /* your options */
118+
// }),
119119
// url({
120120
// include: ['**/*.woff', '**/*.woff2'],
121121
// limit: Infinity,
@@ -234,11 +234,11 @@ export default isBuild
234234
'shuyun-utils': '0.0.3',
235235
},
236236
}),
237-
eslint({
238-
throwOnError: true,
239-
include: [NodePath.resolve('src/components')],
240-
/* your options */
241-
}),
237+
// eslint({
238+
// throwOnError: true,
239+
// include: [NodePath.resolve('src/components')],
240+
// /* your options */
241+
// }),
242242
// url({
243243
// include: ['**/*.woff', '**/*.woff2'],
244244
// limit: Infinity,
@@ -311,11 +311,11 @@ export default isBuild
311311
},
312312
},
313313
extraRollupPlugins: [
314-
eslint({
315-
throwOnError: true,
316-
include: [NodePath.resolve('src/components')],
317-
/* your options */
318-
}),
314+
// eslint({
315+
// throwOnError: true,
316+
// include: [NodePath.resolve('src/components')],
317+
// /* your options */
318+
// }),
319319
// url({
320320
// include: ['**/*.woff', '**/*.woff2'],
321321
// limit: Infinity,

.husky/_/.gitignore

Whitespace-only changes.

.husky/_/husky.sh

Lines changed: 0 additions & 36 deletions
This file was deleted.

.prettierignore

Lines changed: 0 additions & 7 deletions
This file was deleted.

.prettierrc

Lines changed: 0 additions & 11 deletions
This file was deleted.

README.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,8 @@ npm install
8181
### 开发调试
8282

8383
```bash
84-
# 启动开发服务器,;并且在另一个控制台启动 watch 命令
85-
npm start
86-
npm run watch
84+
# 启动开发服务器
85+
npm run dev
8786
```
8887

8988
### 构建
@@ -98,19 +97,18 @@ npm run docs:build
9897

9998
### 提交代码格式
10099

101-
> https://gitmoji.dev/
102-
103100
```bash
104101
git commit -m "feat: [组件名称]提交内容"
105102
git commit -m "fix: [组件名称]提交内容"
106103
```
107104

108-
## 🎯 浏览器支持
105+
**项目配置了代码保存前进行eslint格式化和代码提交前进行eslint校验,如果提交有问题,请联系管理员**
109106

110-
| [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png" alt="IE / Edge" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>IE / Edge | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png" alt="Firefox" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Firefox | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png" alt="Chrome" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Chrome | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png" alt="Safari" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Safari |
111-
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
112-
| Edge >= 79 | >= 59 | >= 56 | >= 12 |
107+
## 🎯 浏览器支持
113108

109+
| [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png" alt="Firefox" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Firefox | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png" alt="Chrome" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Chrome |
110+
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
111+
| >= 59 | >= 56 |
114112
## 🔗 相关链接
115113

116114
- [在线文档](https://cloud-react.shuyun.com/v1/cloud-react/common/button)

0 commit comments

Comments
 (0)