From 042c558bb319cd7653ca8619dcb445b1b55de2f8 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Wed, 30 Oct 2019 12:13:53 -0700 Subject: [PATCH] eslint: Enable sort-imports rule. I figure we should enable this before we have lots of imports. Signed-off-by: Anders Kaseorg --- .eslintrc.json | 1 + static/js/portico/landing-page.js | 2 +- tools/webpack-helpers.ts | 2 +- tools/webpack.config.ts | 14 +++++++------- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 1070441267..578f120e8f 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -390,6 +390,7 @@ "radix": "error", "semi": "error", "semi-spacing": ["error", {"before": false, "after": true}], + "sort-imports": "error", "space-before-blocks": "error", "space-before-function-paren": [ "error", { diff --git a/static/js/portico/landing-page.js b/static/js/portico/landing-page.js index c7488ad230..e4a4a7b453 100644 --- a/static/js/portico/landing-page.js +++ b/static/js/portico/landing-page.js @@ -3,8 +3,8 @@ const ELECTRON_APP_URL_LINUX = "https://github.com/zulip/zulip-desktop/releases/ const ELECTRON_APP_URL_MAC = "https://github.com/zulip/zulip-desktop/releases/download/v" + ELECTRON_APP_VERSION + "/Zulip-" + ELECTRON_APP_VERSION + ".dmg"; const ELECTRON_APP_URL_WINDOWS = "https://github.com/zulip/zulip-desktop/releases/download/v" + ELECTRON_APP_VERSION + "/Zulip-Web-Setup-" + ELECTRON_APP_VERSION + ".exe"; +import { detect_user_os } from './tabbed-instructions.js'; import render_tabs from './team.js'; -import {detect_user_os} from './tabbed-instructions.js'; export function path_parts() { return window.location.pathname.split('/').filter(function (chunk) { diff --git a/tools/webpack-helpers.ts b/tools/webpack-helpers.ts index 128f47acfe..38fecbbf91 100644 --- a/tools/webpack-helpers.ts +++ b/tools/webpack-helpers.ts @@ -1,5 +1,5 @@ -import { basename, resolve } from 'path'; import { RuleSetRule, RuleSetUseItem } from 'webpack'; +import { basename, resolve } from 'path'; export const cacheLoader: RuleSetUseItem = { loader: 'cache-loader', diff --git a/tools/webpack.config.ts b/tools/webpack.config.ts index 05be5e84a8..d1e083042d 100644 --- a/tools/webpack.config.ts +++ b/tools/webpack.config.ts @@ -1,15 +1,15 @@ import { basename, resolve } from 'path'; +import { cacheLoader, getExposeLoaders } from './webpack-helpers'; import BundleTracker from 'webpack4-bundle-tracker'; -import webpack from 'webpack'; +import CleanCss from 'clean-css'; +import HtmlWebpackPlugin from 'html-webpack-plugin'; +import MiniCssExtractPlugin from 'mini-css-extract-plugin'; +import OptimizeCssAssetsPlugin from 'optimize-css-assets-webpack-plugin'; +import TerserPlugin from 'terser-webpack-plugin'; // The devServer member of webpack.Configuration is managed by the // webpack-dev-server package. We are only importing the type here. import _webpackDevServer from 'webpack-dev-server'; -import { getExposeLoaders, cacheLoader } from './webpack-helpers'; -import MiniCssExtractPlugin from 'mini-css-extract-plugin'; -import OptimizeCssAssetsPlugin from 'optimize-css-assets-webpack-plugin'; -import CleanCss from 'clean-css'; -import TerserPlugin from 'terser-webpack-plugin'; -import HtmlWebpackPlugin from 'html-webpack-plugin'; +import webpack from 'webpack'; const assets = require('./webpack.assets.json');