Skip to content

Commit

Permalink
fix: fix lint error
Browse files Browse the repository at this point in the history
  • Loading branch information
DiamondYuan committed May 12, 2021
1 parent 49fc971 commit fb3254e
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 22 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ dist/
coverage/
node_modules/
chrome/js/icon.js
releases/
10 changes: 6 additions & 4 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
module.exports = {
extends: [
'@diamondyuan/react-typescript',
'prettier',
],
extends: ['@diamondyuan/react-typescript', 'prettier'],
plugins: ['prettier'],
rules: {
'no-use-before-define': 'off',
'arrow-body-style': 'off',
'no-redeclare': 'off',
'@typescript-eslint/no-redeclare': 'off',
'@typescript-eslint/no-use-before-define': ['error'],
'prettier/prettier': 'error',
},
settings: {
Expand Down
18 changes: 12 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"dev:ff": "TARGET_BROWSER=Firefox NODE_ENV=development webpack --config webpack/webpack.dev.js --watch",
"release": "node script/ci.js",
"release:ff": "bash script/release_ff.sh",
"lint": "eslint --ext .js,.ts,.tsx --ignore-pattern bad.* .",
"lint": "eslint --ext .js,.ts,.tsx .",
"lint-staged": "lint-staged",
"format": "node script/formatLocaleMessage.js"
},
Expand All @@ -27,9 +27,6 @@
"dependencies": {
"@ant-design/compatible": "^1.0.8",
"@ant-design/icons": "^4.2.2",
"@formily/antd": "^2.0.0-beta.28",
"@formily/core": "^2.0.0-beta.28",
"@formily/react": "^2.0.0-beta.28",
"@shihengtech/hooks": "^0.0.7",
"@web-clipper/area-selector": "^0.1.3",
"@web-clipper/chrome-promise": "^0.1.2",
Expand All @@ -49,6 +46,7 @@
"dayjs": "^1.10.4",
"dva": "^2.6.0-beta.19",
"dva-loading": "^3.0.19",
"dva-logger": "^1.0.0",
"dva-model-creator": "^0.4.3",
"filenamify": "^4.1.0",
"hypermd": "^0.3.11",
Expand All @@ -74,7 +72,7 @@
"umi-request": "^1.2.15"
},
"devDependencies": {
"@diamondyuan/eslint": "^7.0.4",
"@diamondyuan/eslint-config-react-typescript": "^7.0.1",
"@types/chrome": "^0.0.91",
"@types/classnames": "^2.2.9",
"@types/codemirror": "^0.0.76",
Expand All @@ -97,13 +95,21 @@
"@types/showdown": "^1.9.3",
"@types/tldjs": "^2.3.0",
"@types/webpack-env": "^1.13.9",
"@typescript-eslint/eslint-plugin": "^2.11.0",
"@typescript-eslint/parser": "^2.11.0",
"babel-eslint": "^10.0.3",
"clean-webpack-plugin": "^0.1.19",
"compressing": "^1.4.0",
"copy-webpack-plugin": "^5.1.1",
"css-loader": "^1.0.0",
"enzyme": "^3.6.0",
"enzyme-adapter-react-16": "^1.14.0",
"eslint-plugin-prettier": "^3.4.0",
"eslint": "^6.7.2",
"eslint-config-prettier": "^6.7.0",
"eslint-import-resolver-webpack": "^0.12.0",
"eslint-plugin-prettier": "^3.1.1",
"eslint-plugin-react": "^7.17.0",
"eslint-plugin-react-hooks": "^2.3.0",
"html-webpack-plugin": "^3.2.0",
"identity-obj-proxy": "^3.0.0",
"jest": "^24.9.0",
Expand Down
1 change: 1 addition & 0 deletions src/common/hooks/useVerifiedAccount.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ const useVerifiedAccount = ({ form, services, initAccount }: UseVerifiedAccountP
loadAccount={loadAccount}
/>
);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [accountStatus.verified, form, initAccount, loadAccount, service.form]);

const okText = useMemo(() => {
Expand Down
1 change: 1 addition & 0 deletions src/components/RepositorySelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ interface RepositorySelectProps extends SelectProps<string> {
const RepositorySelect: React.FC<RepositorySelectProps> = ({ repositories, ...props }, ref) => {
const [searchKey, _setSearchKey] = useState<string>();

// eslint-disable-next-line react-hooks/exhaustive-deps
const setSearchKey = useCallback(debounce(_setSearchKey, repositories.length > 100 ? 500 : 0), [
_setSearchKey,
repositories,
Expand Down
2 changes: 1 addition & 1 deletion src/components/avatar/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Avatar } from 'antd';
import React from 'react';
import { Avatar } from 'antd';
import IconFont from '@/components/IconFont';

interface IconAvatarProps {
Expand Down
15 changes: 6 additions & 9 deletions src/service/webRequest/common/webRequestIPC.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,12 @@ export class WebRequestChannel implements IServerChannel {
export class WebRequestChannelClient implements IWebRequestService {
constructor(private channel: IChannel) {}

startChangeHeader = async (option: WebRequestBlockOption): Promise<WebBlockHeader> => {
return this.channel.call('startChangeHeader', option);
};
startChangeHeader = async (option: WebRequestBlockOption): Promise<WebBlockHeader> =>
this.channel.call('startChangeHeader', option);

end = async (webBlockHeader: WebBlockHeader): Promise<void> => {
return this.channel.call('end', webBlockHeader);
};
end = async (webBlockHeader: WebBlockHeader): Promise<void> =>
this.channel.call('end', webBlockHeader);

requestInBackground = async <T>(url: string, options: RequestInBackgroundOptions): Promise<T> => {
return this.channel.call('requestInBackground', [url, options]);
};
requestInBackground = async <T>(url: string, options: RequestInBackgroundOptions): Promise<T> =>
this.channel.call('requestInBackground', [url, options]);
}
4 changes: 2 additions & 2 deletions webpack/webpack.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ const WebpackCreateExtensionManifestPlugin = require('webpack-create-extension-m
const fs = require('fs');
const getVersion = require('./getVersion');

const distFiles = fs.readdirSync(resolve('dist')).filter(o => o !== '.gitkeep');

function resolve(dir) {
return path.join(__dirname, '..', dir);
}

const distFiles = fs.readdirSync(resolve('dist')).filter(o => o !== '.gitkeep');

const packageJson = JSON.parse(fs.readFileSync(resolve('package.json'), 'utf8'));

let manifestExtra = {
Expand Down

0 comments on commit fb3254e

Please sign in to comment.