Skip to content

Commit

Permalink
fix: fix style & add eslint (#180)
Browse files Browse the repository at this point in the history
  • Loading branch information
hetao92 authored Apr 12, 2022
1 parent 5d1a028 commit 976a886
Show file tree
Hide file tree
Showing 19 changed files with 34 additions and 13 deletions.
7 changes: 7 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ module.exports = {
'sourceType': 'module'
},
plugins: [
"unused-imports",
'eslint-plugin-react',
'eslint-plugin-import',
'eslint-plugin-jsdoc',
Expand All @@ -33,6 +34,12 @@ module.exports = {
}
},
rules: {
"no-unused-vars": "off",
"unused-imports/no-unused-imports": "error",
"unused-imports/no-unused-vars": [
"warn",
{ "vars": "all", "varsIgnorePattern": "^_", "args": "after-used", "argsIgnorePattern": "^_" }
],
'arrow-spacing': [
'error',
{
Expand Down
1 change: 0 additions & 1 deletion app/components/Avatar/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import _ from 'lodash';
import React, { useEffect, useState } from 'react';
import { Avatar as AntAvatar } from 'antd';

Expand Down
2 changes: 1 addition & 1 deletion app/pages/Console/FavoriteBtn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const FavoriteBtn = (props: IProps) => {
dataSource={data}
renderItem={(item: string) => (
<List.Item
style={{ cursor: 'pointer' }}
style={{ cursor: 'pointer', wordBreak: 'break-all' }}
onClick={() => handleSelect(item)}
>
{renderStr(item)}
Expand Down
2 changes: 1 addition & 1 deletion app/pages/Console/HistoryBtn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const HistoryBtn = (props: IProps) => {
dataSource={data}
renderItem={(item: string) => (
<List.Item
style={{ cursor: 'pointer' }}
style={{ cursor: 'pointer', wordBreak: 'break-all' }}
onClick={() => handleSelect(item)}
>
{renderStr(item)}
Expand Down
1 change: 1 addition & 0 deletions app/pages/Console/OutputBox/index.module.less
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
word-break: break-all;
}
.errorInfo {
background-color: #fff2f0;
Expand Down
1 change: 0 additions & 1 deletion app/pages/Import/FileUpload/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Button, Checkbox, Popconfirm, Table, Upload } from 'antd';
import _ from 'lodash';
import React, { useEffect, useState } from 'react';
import intl from 'react-intl-universal';
import Icon from '@app/components/Icon';
Expand Down
1 change: 0 additions & 1 deletion app/pages/Import/TaskCreate/PasswordInputModal/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Button, Input, Modal } from 'antd';
import _ from 'lodash';
import React, { useState } from 'react';
import intl from 'react-intl-universal';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Select, Table } from 'antd';
import _ from 'lodash';
import React from 'react';
import intl from 'react-intl-universal';
import { CloseOutlined } from '@ant-design/icons';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Select, Table } from 'antd';
import _ from 'lodash';
import React from 'react';
import intl from 'react-intl-universal';
import { CloseOutlined } from '@ant-design/icons';
Expand Down
1 change: 0 additions & 1 deletion app/pages/Import/TaskCreate/SchemaConfig/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Button, Collapse } from 'antd';
import _ from 'lodash';
import React from 'react';
import { CloseOutlined } from '@ant-design/icons';
import { observer } from 'mobx-react-lite';
Expand Down
1 change: 0 additions & 1 deletion app/pages/Import/TaskCreate/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Button, Col, Form, Input, Row, Select, message } from 'antd';
import _ from 'lodash';
import React, { useEffect, useState } from 'react';
import Breadcrumb from '@app/components/Breadcrumb';
import { observer } from 'mobx-react-lite';
Expand Down
1 change: 0 additions & 1 deletion app/pages/Import/TaskList/TaskItem/LogModal/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Button, Modal, Tabs } from 'antd';
import _ from 'lodash';
import React, { useEffect, useRef, useState } from 'react';
import intl from 'react-intl-universal';
import Icon from '@app/components/Icon';
Expand Down
1 change: 0 additions & 1 deletion app/pages/Import/TaskList/TemplateModal/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Button, Form, Input, Modal, Spin, Upload, message } from 'antd';
import _ from 'lodash';
import React, { useEffect, useState } from 'react';
import intl from 'react-intl-universal';
import Icon from '@app/components/Icon';
Expand Down
1 change: 0 additions & 1 deletion app/pages/Import/TaskList/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Button, message } from 'antd';
import _ from 'lodash';
import React, { useCallback, useEffect, useRef, useState } from 'react';
import { useHistory } from 'react-router-dom';
import intl from 'react-intl-universal';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@
:global(.ant-col > .ant-form-item) {
margin-bottom: 0;
}
:global(.ant-col) {
word-break: break-all;
padding-right: 8px;
}
}
.itemStringLength {
position: absolute;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
:global(.ant-col > .ant-form-item) {
margin-bottom: 0;
}
:global(.ant-col) {
word-break: break-all;
padding-right: 8px;
}
}
.itemStringLength {
position: absolute;
Expand Down
1 change: 0 additions & 1 deletion app/pages/Schema/SpaceCreate/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Button, Col, Form, Input, Row, Select, message } from 'antd';
import _ from 'lodash';
import React, { useEffect, useMemo, useState } from 'react';
import Breadcrumb from '@app/components/Breadcrumb';
import { observer } from 'mobx-react-lite';
Expand Down
15 changes: 15 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
"eslint-plugin-prefer-arrow": "^1.2.2",
"eslint-plugin-prettier": "^3.3.0",
"eslint-plugin-react": "^7.22.0",
"eslint-plugin-unused-imports": "^2.0.0",
"file-loader": "^6.2.0",
"html-webpack-plugin": "^5.5.0",
"husky": "^7.0.0",
Expand Down

0 comments on commit 976a886

Please sign in to comment.