Some further ESLint cleanup, remove some unnecessary scripts and lines (#2984)
This commit is contained in:
parent
f762718330
commit
6d02c5a528
|
@ -1,4 +1,2 @@
|
|||
**/*_bundle.js
|
||||
node_modules/
|
||||
release/
|
||||
src/node_modules/
|
||||
node_modules
|
||||
dist
|
|
@ -27,10 +27,45 @@
|
|||
"no-process-env": 0,
|
||||
"no-var": 2,
|
||||
"react/no-find-dom-node": 2,
|
||||
"multiline-ternary": 0,
|
||||
"max-lines": ["warn", 650],
|
||||
"no-underscore-dangle": ["warn"],
|
||||
"@mattermost/use-external-link": 0
|
||||
"@mattermost/use-external-link": 0,
|
||||
"import/order": [
|
||||
2,
|
||||
{
|
||||
"newlines-between": "always",
|
||||
"groups": [
|
||||
"builtin",
|
||||
"external",
|
||||
"internal",
|
||||
"sibling",
|
||||
"parent",
|
||||
"index"
|
||||
],
|
||||
"pathGroups": [
|
||||
{
|
||||
"pattern": "@mattermost/**",
|
||||
"group": "external",
|
||||
"position": "after"
|
||||
},
|
||||
{
|
||||
"pattern": "(app|common|main|renderer){,/**}",
|
||||
"group": "external",
|
||||
"position": "after"
|
||||
},
|
||||
{
|
||||
"pattern": "types{,/**}",
|
||||
"group": "internal",
|
||||
"position": "after"
|
||||
}
|
||||
],
|
||||
"alphabetize": {
|
||||
"order": "asc",
|
||||
"caseInsensitive": true
|
||||
},
|
||||
"distinctGroup": true,
|
||||
"pathGroupsExcludedImportTypes": ["builtin"]
|
||||
}
|
||||
]
|
||||
},
|
||||
"overrides": [
|
||||
{
|
||||
|
@ -43,6 +78,16 @@
|
|||
"no-console": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": [
|
||||
"scripts/**/*",
|
||||
"babel.config.js",
|
||||
"webpack.config.*.js"
|
||||
],
|
||||
"rules": {
|
||||
"import/no-commonjs": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": [
|
||||
"e2e/**/*",
|
||||
|
@ -52,13 +97,14 @@
|
|||
"jest": true
|
||||
},
|
||||
"rules": {
|
||||
"babel/no-unused-expressions": "off", //TODO: rework tests to use correct notation
|
||||
"no-unused-expressions": 0, //TODO: rework tests to use correct notation
|
||||
"func-names": 0,
|
||||
"global-require": 0,
|
||||
"new-cap": 0,
|
||||
"prefer-arrow-callback": 0,
|
||||
"no-import-assign": 0,
|
||||
"no-only-tests/no-only-tests": "warn"
|
||||
"no-only-tests/no-only-tests": 1,
|
||||
"import/no-commonjs": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -72,58 +118,31 @@
|
|||
"webpack.config.base.js",
|
||||
"babel.config.js",
|
||||
"README.md",
|
||||
"scripts/watch_main_and_preload.js",
|
||||
"scripts/extract_dict.js",
|
||||
"scripts/manipulate_windows_zip.js",
|
||||
"scripts/check_build_config.js",
|
||||
"LICENSE.txt",
|
||||
"src/utils/util.ts",
|
||||
"src/main/contextMenu.ts",
|
||||
"src/renderer/updater.tsx",
|
||||
"src/main/badge.ts",
|
||||
"src/common/deepmerge.ts",
|
||||
"src/common/config/index.ts",
|
||||
"src/common/config/buildConfig.ts",
|
||||
"src/common/config/pastDefaultPreferences.ts",
|
||||
"src/common/config/upgradePreferences.ts",
|
||||
"src/common/config/RegistryConfig.ts",
|
||||
"src/common/osVersion.ts",
|
||||
"src/common/config/defaultPreferences.ts",
|
||||
"src/common/JsonFileManager.ts",
|
||||
"src/main/certificateStore.ts",
|
||||
"src/main/mainWindow.ts",
|
||||
"src/main/allowProtocolDialog.ts",
|
||||
"src/main/permissionRequestHandler.ts",
|
||||
"src/main/squirrelStartup.ts",
|
||||
"src/main/autoLaunch.ts",
|
||||
"src/main/PermissionManager.ts",
|
||||
"src/main/AutoLauncher.ts",
|
||||
"src/main/AppStateManager.ts",
|
||||
"src/main/menus/tray.ts",
|
||||
"src/main/CriticalErrorHandler.ts",
|
||||
"src/main/cookieManager.ts",
|
||||
"src/main/utils.ts",
|
||||
"src/main/downloadURL.ts",
|
||||
"src/main/SpellChecker.ts",
|
||||
"src/main/menus/app.ts",
|
||||
"src/main/preload/externalAPI.js",
|
||||
"src/renderer/components/RemoveServerModal.tsx",
|
||||
"src/renderer/components/MainPage.tsx",
|
||||
"src/renderer/components/HoveringURL.tsx",
|
||||
"src/renderer/components/AutoSaveIndicator.tsx",
|
||||
"src/renderer/components/MattermostView.tsx",
|
||||
"src/renderer/components/TabBar.tsx",
|
||||
"src/renderer/components/DestructiveConfirmModal.tsx",
|
||||
"src/renderer/components/ErrorView.tsx",
|
||||
"src/renderer/components/UpdaterPage.tsx",
|
||||
"src/renderer/components/PermissionRequestDialog.tsx",
|
||||
"src/renderer/components/Finder.tsx",
|
||||
"src/renderer/components/SettingsPage.tsx",
|
||||
"src/renderer/components/TeamListItem.tsx",
|
||||
"src/renderer/components/UpdaterPage/UpdaterPage.stories.tsx",
|
||||
"src/renderer/components/Button/Button.stories.tsx",
|
||||
"src/renderer/components/TeamList.tsx",
|
||||
"src/renderer/components/LoginModal.tsx",
|
||||
"src/renderer/components/NewServerModal.tsx",
|
||||
"src/renderer/settings.tsx",
|
||||
"src/renderer/index.tsx"
|
||||
|
|
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -24,4 +24,6 @@ fastlane/README.md
|
|||
fastlane/report.xml
|
||||
|
||||
*.provisionprofile
|
||||
*.tsbuildinfo
|
||||
*.tsbuildinfo
|
||||
|
||||
.eslintcache
|
2
.vscode/settings.json
vendored
2
.vscode/settings.json
vendored
|
@ -3,7 +3,7 @@
|
|||
"i18n"
|
||||
],
|
||||
"editor.codeActionsOnSave": {
|
||||
"source.fixAll.eslint": true
|
||||
"source.fixAll.eslint": "always",
|
||||
},
|
||||
"cSpell.words": [
|
||||
"appimage",
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
module.exports = (api) => { // eslint-disable-line import/no-commonjs
|
||||
module.exports = (api) => {
|
||||
api.cache.forever();
|
||||
return {
|
||||
presets: [
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
{
|
||||
"env": {
|
||||
"mocha": true
|
||||
},
|
||||
"globals": {
|
||||
"open_window": true
|
||||
},
|
||||
"rules": {
|
||||
"import/no-commonjs": 0,
|
||||
"func-names": 0,
|
||||
"global-require": 0,
|
||||
"max-nested-callbacks": 0,
|
||||
"no-eval": 0,
|
||||
"no-magic-numbers": 0,
|
||||
"no-unused-expressions": 0,
|
||||
"prefer-arrow-callback": 0
|
||||
}
|
||||
}
|
|
@ -306,7 +306,6 @@ module.exports = {
|
|||
|
||||
// execute the test only when `condition` is true
|
||||
shouldTest(it, condition) {
|
||||
// eslint-disable-next-line no-only-tests/no-only-tests
|
||||
return condition ? it : it.skip;
|
||||
},
|
||||
isOneOf(platforms) {
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
/* eslint-disable import/order */
|
||||
import bg from './bg.json';
|
||||
import de from './de.json';
|
||||
import en from './en.json';
|
||||
|
@ -22,8 +21,8 @@ import sv from './sv.json';
|
|||
import tr from './tr.json';
|
||||
import uk from './uk.json';
|
||||
import vi from './vi.json';
|
||||
import zhTW from './zh-TW.json';
|
||||
import zhCN from './zh-CN.json';
|
||||
import zhTW from './zh-TW.json';
|
||||
|
||||
export type Language = {
|
||||
value: string;
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
"check-types": "tsc",
|
||||
"prune": "ts-prune",
|
||||
"i18n-extract": "mmjstool -- i18n extract-desktop",
|
||||
"lint:js": "eslint --ignore-path .gitignore --ignore-pattern node_modules --ext .js --ext .jsx --ext .ts --ext .tsx .",
|
||||
"lint:js": "eslint --ext .js,.jsx,.tsx,.ts --cache .",
|
||||
"lint:js-quiet": "npm run lint:js -- --quiet",
|
||||
"fix:js": "npm run lint:js-quiet -- --fix",
|
||||
"test": "run-s lint:js test:unit test:e2e",
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
{
|
||||
"rules": {
|
||||
"import/no-commonjs": 0
|
||||
}
|
||||
}
|
|
@ -1,24 +0,0 @@
|
|||
// Copyright (c) 2015-2016 Yuya Ochiai
|
||||
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
// This file uses process.exit().
|
||||
/* eslint-disable no-process-exit */
|
||||
|
||||
const {spawn} = require('child_process');
|
||||
|
||||
const {path7za} = require('7zip-bin');
|
||||
|
||||
const cwd = process.argv[2];
|
||||
|
||||
spawn(path7za, ['e', '-y', '*.zip'], {
|
||||
cwd,
|
||||
stdio: 'inherit',
|
||||
}).on('error', (err) => {
|
||||
console.error(err);
|
||||
process.exit(1);
|
||||
}).on('close', (code) => {
|
||||
process.exit(code);
|
||||
});
|
||||
|
||||
/* eslint-enable no-process-exit */
|
|
@ -1,33 +0,0 @@
|
|||
// Copyright (c) 2015-2016 Yuya Ochiai
|
||||
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
|
||||
// See LICENSE.txt for license information.
|
||||
'use strict';
|
||||
|
||||
const spawnSync = require('child_process').spawnSync;
|
||||
const path = require('path');
|
||||
|
||||
const path7za = require('7zip-bin').path7za;
|
||||
|
||||
const pkg = require('../package.json');
|
||||
const appVersion = pkg.version;
|
||||
const name = pkg.name;
|
||||
|
||||
function disableInstallUpdate(zipPath) {
|
||||
const zipFullPath = path.resolve(__dirname, '..', zipPath);
|
||||
const appUpdaterConfigFile = 'app-updater-config.json';
|
||||
|
||||
const addResult = spawnSync(path7za, ['a', zipFullPath, appUpdaterConfigFile], {cwd: 'resources/windows'});
|
||||
if (addResult.status !== 0) {
|
||||
throw new Error(`7za a returned non-zero exit code for ${zipPath}`);
|
||||
}
|
||||
|
||||
const renameResult = spawnSync(path7za, ['rn', zipFullPath, appUpdaterConfigFile, `resources/${appUpdaterConfigFile}`]);
|
||||
if (renameResult.status !== 0) {
|
||||
throw new Error(`7za rn returned non-zero exit code for ${zipPath}`);
|
||||
}
|
||||
}
|
||||
|
||||
console.log('Manipulating 64-bit zip...');
|
||||
disableInstallUpdate(`release/${name}-${appVersion}-win-x64.zip`);
|
||||
console.log('Manipulating 32-bit zip...');
|
||||
disableInstallUpdate(`release/${name}-${appVersion}-win-ia32.zip`);
|
|
@ -1,9 +1,6 @@
|
|||
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
/* eslint-disable max-lines */
|
||||
'use strict';
|
||||
|
||||
import {dialog} from 'electron';
|
||||
|
||||
import ServerViewState from 'app/serverViewState';
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
/* eslint-disable max-lines */
|
||||
|
||||
import {BrowserWindow, desktopCapturer, systemPreferences, ipcMain} from 'electron';
|
||||
|
||||
import ServerViewState from 'app/serverViewState';
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
/* eslint-disable max-lines */
|
||||
|
||||
import classNames from 'classnames';
|
||||
import React, {Fragment} from 'react';
|
||||
import type {DropResult} from 'react-beautiful-dnd';
|
||||
|
|
|
@ -2,10 +2,6 @@
|
|||
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
// This file uses CommonJS.
|
||||
/* eslint-disable import/no-commonjs */
|
||||
'use strict';
|
||||
|
||||
const childProcess = require('child_process');
|
||||
const path = require('path');
|
||||
|
||||
|
@ -58,5 +54,3 @@ module.exports = {
|
|||
extensions: ['.ts', '.tsx', '.js', '.jsx', '.json'],
|
||||
},
|
||||
};
|
||||
|
||||
/* eslint-enable import/no-commonjs */
|
||||
|
|
|
@ -2,10 +2,6 @@
|
|||
// See LICENSE.txt for license information.
|
||||
// Copyright (c) 2015-2016 Yuya Ochiai
|
||||
|
||||
// This files uses CommonJS.
|
||||
/* eslint-disable import/no-commonjs */
|
||||
'use strict';
|
||||
|
||||
const CopyPlugin = require('copy-webpack-plugin');
|
||||
const {merge} = require('webpack-merge');
|
||||
|
||||
|
@ -42,5 +38,3 @@ module.exports = merge(base, {
|
|||
},
|
||||
target: 'electron-main',
|
||||
});
|
||||
|
||||
/* eslint-enable import/no-commonjs */
|
||||
|
|
|
@ -1,10 +1,6 @@
|
|||
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
// This file uses CommonJS.
|
||||
/* eslint-disable import/no-commonjs */
|
||||
'use strict';
|
||||
|
||||
const glob = require('glob');
|
||||
const {merge} = require('webpack-merge');
|
||||
|
||||
|
@ -15,5 +11,3 @@ module.exports = merge(test, {
|
|||
e2e: glob.sync('./e2e/performance/**/*.test.js'),
|
||||
},
|
||||
});
|
||||
|
||||
/* eslint-enable import/no-commonjs */
|
||||
|
|
|
@ -2,10 +2,6 @@
|
|||
// See LICENSE.txt for license information.
|
||||
// Copyright (c) 2015-2016 Yuya Ochiai
|
||||
|
||||
// This files uses CommonJS.
|
||||
/* eslint-disable import/no-commonjs */
|
||||
'use strict';
|
||||
|
||||
const {merge} = require('webpack-merge');
|
||||
|
||||
const base = require('./webpack.config.base');
|
||||
|
@ -24,5 +20,3 @@ module.exports = merge(base, {
|
|||
},
|
||||
target: 'electron-preload',
|
||||
});
|
||||
|
||||
/* eslint-enable import/no-commonjs */
|
||||
|
|
|
@ -2,10 +2,6 @@
|
|||
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
// This file uses CommonJS.
|
||||
/* eslint-disable import/no-commonjs */
|
||||
'use strict';
|
||||
|
||||
const path = require('path');
|
||||
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||
|
@ -175,5 +171,3 @@ module.exports = merge(base, {
|
|||
},
|
||||
target: 'web',
|
||||
});
|
||||
|
||||
/* eslint-enable import/no-commonjs */
|
||||
|
|
|
@ -1,10 +1,6 @@
|
|||
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
// This file uses CommonJS.
|
||||
/* eslint-disable import/no-commonjs */
|
||||
'use strict';
|
||||
|
||||
const path = require('path');
|
||||
|
||||
const glob = require('glob');
|
||||
|
@ -38,5 +34,3 @@ module.exports = merge(base, {
|
|||
},
|
||||
target: 'electron-main',
|
||||
});
|
||||
|
||||
/* eslint-enable import/no-commonjs */
|
||||
|
|
Loading…
Reference in a new issue