Skip to content

Commit 1167c4c

Browse files
authored
Feat 4.x lint (#368)
* feat: lint config * style: eslint fix * style: stylelint fix
1 parent c78bed1 commit 1167c4c

File tree

117 files changed

+1231
-1342
lines changed

Some content is hidden

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

117 files changed

+1231
-1342
lines changed

.dumi/global.less

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
@import 'antd/dist/antd.css';
1+
@import "antd/dist/antd.css";

.dumi/pages/index/index.scss

+2-11
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,34 @@
1-
@import '../../theme/style/const.scss';
1+
@import "../../theme/style/const.scss";
22

33
.dtc-homepage {
4-
background-color: #ebf5fd;
4+
background-color: #EBF5FD;
55
height: calc(100vh - 64px);
66
display: flex;
77
flex-direction: column;
88
justify-content: center;
99
text-align: center;
10-
1110
.dtc-homepage-title {
1211
font-size: 70px;
1312
color: $basic-black-color;
1413
user-select: none;
1514
margin-bottom: 12px;
1615
line-height: 1.15;
1716
}
18-
1917
.dtc-homepage-badges {
2018
margin-bottom: 12px;
21-
2219
img:not(:last-child) {
2320
margin-inline-end: 20px;
2421
}
2522
}
26-
2723
.dtc-homepage-description {
2824
color: $basic-black-color;
2925
font-size: 30px;
3026
}
31-
3227
.dtc-homepage-btnGroups {
3328
margin: 12px auto 0;
3429
display: grid;
3530
grid-gap: 18px;
3631
grid-template-columns: 1fr 1fr;
37-
3832
> .ant-btn {
3933
font-size: 20px;
4034
height: 40px;
@@ -46,15 +40,12 @@
4640
@media only screen and (max-width: 767px) {
4741
.dtc-homepage {
4842
height: calc(100vh - 52px);
49-
5043
.dtc-homepage-title {
5144
font-size: 60px;
5245
}
53-
5446
.dtc-homepage-description {
5547
font-size: 26px;
5648
}
57-
5849
.dtc-homepage-btnGroups {
5950
> .ant-btn {
6051
font-size: 16px;

.dumi/pages/index/index.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import React from 'react';
2-
import { Link, Helmet } from 'dumi';
3-
import { Button } from 'antd';
42
import { GithubOutlined } from '@ant-design/icons';
3+
import { Button } from 'antd';
4+
import { Helmet, Link } from 'dumi';
5+
56
import './index.scss';
67

78
export default function Homepage() {

.dumi/theme/layouts/DocLayout.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.dumi-default-doc-layout {
2-
background: #ebf5fd;
2+
background: #EBF5FD;
33
}
44

55
.dumi-default-doc-layout > main {

.dumi/theme/layouts/DocLayout.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React from 'react';
22
import DumiDocLayout from 'dumi/theme-default/layouts/DocLayout';
3+
34
import 'dumi/theme-default/layouts/DocLayout/index.less';
45
import './DocLayout.scss';
56

.dumi/theme/slots/Footer/index.scss

+2-9
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,34 @@
1-
@import '../../style/const.scss';
1+
@import "../../style/const.scss";
22

33
.dtc-footer {
44
margin-top: 16px;
55
background: rgb(250, 250, 252);
6-
76
.dtc-footer-links {
87
padding-top: 20px;
98
display: flex;
109
flex-wrap: wrap;
1110
justify-content: center;
12-
1311
.dtc-footer-rows {
1412
width: 200px;
1513
flex-shrink: 0;
1614
display: flex;
1715
flex-direction: column;
18-
1916
.dtc-footer-rows-title {
2017
line-height: 28px;
2118
font-size: 14px;
22-
color: #8b8fa8;
19+
color: #8B8FA8;
2320
}
24-
2521
.dtc-footer-col {
2622
line-height: 28px;
27-
2823
> a {
2924
color: $basic-black-color;
3025
}
3126
}
3227
}
3328
}
34-
3529
.dtc-footer-divider {
3630
margin: 0 48px;
3731
}
38-
3932
.dtc-footer-copyright {
4033
text-align: center;
4134
font-size: 14px;

.dumi/theme/slots/Footer/index.tsx

+11-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React from 'react';
22
import { Divider } from 'antd';
33
import { useSiteData } from 'dumi';
4+
45
import './index.scss';
56

67
export default function Footer() {
@@ -14,6 +15,7 @@ export default function Footer() {
1415
<a
1516
href="https://github.com/DTStack/dt-react-component/blob/master/CHANGELOG.md"
1617
target="_blank"
18+
rel="noreferrer"
1719
>
1820
更新日志
1921
</a>
@@ -22,6 +24,7 @@ export default function Footer() {
2224
<a
2325
href="https://github.com/DTStack/dt-react-component/issues"
2426
target="_blank"
27+
rel="noreferrer"
2528
>
2629
报告 Bug
2730
</a>
@@ -30,25 +33,29 @@ export default function Footer() {
3033
<div className="dtc-footer-rows">
3134
<span className="dtc-footer-rows-title">相关链接</span>
3235
<div className="dtc-footer-col">
33-
<a href="https://www.dtstack.com/" target="_blank">
36+
<a href="https://www.dtstack.com/" target="_blank" rel="noreferrer">
3437
袋鼠云
3538
</a>
3639
</div>
3740
<div className="dtc-footer-col">
38-
<a href="http://ued.dtstack.cn/" target="_blank">
41+
<a href="http://ued.dtstack.cn/" target="_blank" rel="noreferrer">
3942
数栈前端团队
4043
</a>
4144
</div>
4245
<div className="dtc-footer-col">
43-
<a href="https://4x.ant.design/index-cn" target="_blank">
46+
<a href="https://4x.ant.design/index-cn" target="_blank" rel="noreferrer">
4447
Ant Design 4
4548
</a>
4649
</div>
4750
</div>
4851
<div className="dtc-footer-rows">
4952
<span className="dtc-footer-rows-title">社区</span>
5053
<div className="dtc-footer-col">
51-
<a href="https://github.com/DTStack/dt-react-component" target="_blank">
54+
<a
55+
href="https://github.com/DTStack/dt-react-component"
56+
target="_blank"
57+
rel="noreferrer"
58+
>
5259
Github
5360
</a>
5461
</div>

.dumi/theme/slots/Header/index.scss

+5-11
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,44 @@
1-
@import '../../style/const.scss';
1+
@import "../../style/const.scss";
22

33
@media only screen and (min-width: 767px) {
44
#root {
55
// reset dumi style
66
.dumi-default-header {
77
background-color: rgba(255, 255, 255, 0.75);
8-
box-shadow: 0 1px 2px 0 rgb(0 0 0 / 3%), 0 1px 6px -1px rgb(0 0 0 / 2%),
9-
0 2px 4px 0 rgb(0 0 0 / 2%);
8+
box-shadow:
9+
0 1px 2px 0 rgba(0, 0, 0, 0.03),
10+
0 1px 6px -1px rgba(0, 0, 0, 0.02),
11+
0 2px 4px 0 rgba(0, 0, 0, 0.02);
1012
}
11-
1213
.dumi-default-header-content {
1314
height: 64px;
1415
max-width: 100vw;
1516
}
16-
1717
.dumi-default-header-left {
1818
width: auto;
1919
}
20-
2120
.dumi-default-header-right {
2221
justify-content: end;
2322
align-items: center;
2423
gap: 14px;
2524
}
26-
2725
.dumi-default-logo {
2826
font-size: 18px;
2927
font-weight: 600;
3028
color: $basic-black-color;
31-
3229
img {
3330
height: 40px;
3431
}
3532
}
36-
3733
.dumi-default-navbar > li {
3834
font-size: $navbar-font-size;
3935
padding: 0 $navbar-font-size;
40-
4136
&:not(:last-child) {
4237
margin-inline-end: 0;
4338
}
4439
a {
4540
color: $basic-black-color;
4641
}
47-
4842
a.active {
4943
color: $primary-color;
5044
}

.dumi/theme/slots/Header/index.tsx

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import React, { useState } from 'react';
2+
import { CloseOutlined, GithubOutlined, MenuOutlined } from '@ant-design/icons';
3+
import { Button, Tooltip } from 'antd';
24
import { useRouteMeta } from 'dumi';
5+
import LangSwitch from 'dumi/theme-default/slots/LangSwitch';
36
import Logo from 'dumi/theme-default/slots/Logo';
47
import Navbar from 'dumi/theme-default/slots/Navbar';
5-
import SearchBar from 'dumi/theme-default/slots/SearchBar';
6-
import LangSwitch from 'dumi/theme-default/slots/LangSwitch';
78
import RtlSwitch from 'dumi/theme-default/slots/RtlSwitch';
8-
import { Button, Tooltip } from 'antd';
9-
import { CloseOutlined, MenuOutlined, GithubOutlined } from '@ant-design/icons';
9+
import SearchBar from 'dumi/theme-default/slots/SearchBar';
10+
1011
import { useMobile } from '../../hooks';
1112
import 'dumi/theme-default/slots/Header/index.less';
1213
import './index.scss';
@@ -39,6 +40,7 @@ export default function Header() {
3940
className="dtc-github-icon"
4041
href="https://github.com/DTStack/dt-react-component"
4142
target="_blank"
43+
rel="noreferrer"
4244
>
4345
Github
4446
</a>
@@ -50,7 +52,7 @@ export default function Header() {
5052
icon={<GithubOutlined />}
5153
href="https://github.com/DTStack/dt-react-component"
5254
target="_blank"
53-
></Button>
55+
/>
5456
</Tooltip>
5557
)}
5658
</section>

.dumi/theme/slots/Sidebar/index.scss

+4-9
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1-
@import '../../style/const.scss';
1+
@import "../../style/const.scss";
22

33
@media only screen and (min-width: 767px) {
44
.dumi-default-sidebar {
55
height: 100vh;
66
max-height: calc(100vh - 64px);
7-
background-color: #fff;
7+
background-color: #FFF;
88
top: 64px;
99
width: 275px;
10-
border-right: 1px solid #f2f2f2;
10+
border-right: 1px solid #F2F2F2;
1111
padding-right: 0;
1212
padding-left: 0;
13-
1413
> dl {
1514
> dt {
1615
padding: 2px 16px;
@@ -19,30 +18,26 @@
1918
font-size: 13px;
2019
margin: 2px 0;
2120
}
22-
2321
> dd {
2422
height: 40px;
2523
line-height: 40px;
2624
font-size: $sidebar-font-size;
2725
margin: 4px;
2826
box-sizing: content-box;
2927
padding: 0;
30-
3128
> a {
3229
font-size: inherit;
3330
line-height: inherit;
3431
padding: 0 12px;
3532
margin: 0;
3633
border-radius: 8px;
3734
color: $basic-black-color;
38-
3935
&:hover {
4036
background-color: rgba(0, 0, 0, 0.06);
4137
}
42-
4338
&.active {
4439
color: inherit;
45-
background-color: #bae0ff;
40+
background-color: #BAE0FF;
4641
font-weight: normal;
4742
}
4843
}

.dumi/theme/slots/Sidebar/index.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React from 'react';
2-
import { useSidebarData, NavLink } from 'dumi';
32
import { Tooltip } from 'antd';
3+
import { NavLink, useSidebarData } from 'dumi';
4+
45
import { useMobile } from '../../hooks';
56
import 'dumi/theme-default/slots/Sidebar/index.less';
67
import './index.scss';

.dumi/theme/slots/Toc/index.scss

-2
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33
.dumi-default-doc-layout-toc-wrapper > h4 {
44
display: none;
55
}
6-
76
.dumi-default-toc {
87
border-inline-start-width: 2px;
9-
108
> li > a.active {
119
margin-inline-start: -2px;
1210
border-inline-start-width: 2px;

.dumi/theme/slots/Toc/index.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React from 'react';
22
import DumiToc from 'dumi/theme-default/slots/Toc';
3+
34
import 'dumi/theme-default/slots/Toc/index.less';
45
import './index.scss';
56

.dumi/theme/style/const.scss

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$primary-color: #1d78ff;
2-
$basic-black-color: #3d446e;
1+
$primary-color: #1D78FF;
2+
$basic-black-color: #3D446E;
33
$navbar-font-size: 16px;
44
$sidebar-font-size: 14px;

.eslintignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
.dumi/tmp

.eslintrc.js

-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
module.exports = {
22
extends: [require.resolve('ko-lint-config/.eslintrc')],
3-
rules: {
4-
'@typescript-eslint/ban-ts-comment': 'warn',
5-
},
63
};

.stylelintignore

-1
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
.dumi/**/*.scss

0 commit comments

Comments
 (0)