Browse code
Cleanup lint errors
Showing 2 changed files
... | ... |
@@ -1,26 +1,18 @@ |
1 |
-const fs = require("fs"); |
|
2 | 1 |
const path = require("path"); |
3 | 2 |
const webpack = require("webpack"); |
4 |
-const resolve = require("resolve"); |
|
5 | 3 |
const PnpWebpackPlugin = require("pnp-webpack-plugin"); |
6 | 4 |
const HtmlWebpackPlugin = require("html-webpack-plugin"); |
7 | 5 |
const CaseSensitivePathsPlugin = require("case-sensitive-paths-webpack-plugin"); |
8 | 6 |
const InlineChunkHtmlPlugin = require("react-dev-utils/InlineChunkHtmlPlugin"); |
9 | 7 |
const TerserPlugin = require("terser-webpack-plugin"); |
10 |
-const MiniCssExtractPlugin = require("mini-css-extract-plugin"); |
|
11 |
-const OptimizeCSSAssetsPlugin = require("optimize-css-assets-webpack-plugin"); |
|
12 |
-const safePostCssParser = require("postcss-safe-parser"); |
|
13 | 8 |
const ManifestPlugin = require("webpack-manifest-plugin"); |
14 | 9 |
const InterpolateHtmlPlugin = require("react-dev-utils/InterpolateHtmlPlugin"); |
15 | 10 |
const WorkboxWebpackPlugin = require("workbox-webpack-plugin"); |
16 | 11 |
const WatchMissingNodeModulesPlugin = require("react-dev-utils/WatchMissingNodeModulesPlugin"); |
17 | 12 |
const ModuleScopePlugin = require("react-dev-utils/ModuleScopePlugin"); |
18 |
-const getCSSModuleLocalIdent = require("react-dev-utils/getCSSModuleLocalIdent"); |
|
19 | 13 |
const paths = require("./paths"); |
20 | 14 |
const getClientEnvironment = require("./env"); |
21 | 15 |
const ModuleNotFoundPlugin = require("react-dev-utils/ModuleNotFoundPlugin"); |
22 |
-const ForkTsCheckerWebpackPlugin = require("react-dev-utils/ForkTsCheckerWebpackPlugin"); |
|
23 |
-const typescriptFormatter = require("react-dev-utils/typescriptFormatter"); |
|
24 | 16 |
|
25 | 17 |
// Source maps are resource heavy and can cause out of memory issue for large source files. |
26 | 18 |
const shouldUseSourceMap = process.env.GENERATE_SOURCEMAP !== "false"; |
... | ... |
@@ -40,9 +32,6 @@ module.exports = function(webpackEnv) { |
40 | 32 |
const publicPath = isEnvProduction |
41 | 33 |
? paths.servedPath |
42 | 34 |
: isEnvDevelopment && "/"; |
43 |
- // Some apps do not use client-side routing with pushState. |
|
44 |
- // For these, "homepage" can be set to "." to enable relative asset paths. |
|
45 |
- const shouldUseRelativeAssetPaths = publicPath === "./"; |
|
46 | 35 |
|
47 | 36 |
// `publicUrl` is just like `publicPath`, but we will provide it to our app |
48 | 37 |
// as %PUBLIC_URL% in `index.html` and `process.env.PUBLIC_URL` in JavaScript. |
... | ... |
@@ -1,4 +1,4 @@ |
1 |
-import { applyMiddleware, createStore, compose } from "redux"; |
|
1 |
+import { createStore } from "redux"; |
|
2 | 2 |
|
3 | 3 |
import installBrowserRouter from "./action-router"; |
4 | 4 |
import addChangeUrlEvent from "./change-url-event.js"; |
... | ... |
@@ -6,16 +6,16 @@ import addMissingHistoryEvents from "./history-events.js"; |
6 | 6 |
|
7 | 7 |
const console_log = console.log; |
8 | 8 |
console.log = () => {}; |
9 |
-function with_console(cb) { |
|
10 |
- console.log = console_log; |
|
11 |
- try { |
|
12 |
- cb(); |
|
13 |
- } catch (e) { |
|
14 |
- console.log = () => {}; |
|
15 |
- throw e; |
|
16 |
- } |
|
17 |
- console.log = () => {}; |
|
18 |
-} |
|
9 |
+// function with_console(cb) { |
|
10 |
+// console.log = console_log; |
|
11 |
+// try { |
|
12 |
+// cb(); |
|
13 |
+// } catch (e) { |
|
14 |
+// console.log = () => {}; |
|
15 |
+// throw e; |
|
16 |
+// } |
|
17 |
+// console.log = () => {}; |
|
18 |
+// } |
|
19 | 19 |
|
20 | 20 |
function createLocation(path) { |
21 | 21 |
return { |
... | ... |
@@ -62,7 +62,7 @@ function createFakeWindow(path = "/path/to/thing") { |
62 | 62 |
}); |
63 | 63 |
|
64 | 64 |
function prepareEvent(window, evName) { |
65 |
- if (evName == "popstate") { |
|
65 |
+ if (evName === "popstate") { |
|
66 | 66 |
window.location = popLocation(window); |
67 | 67 |
} |
68 | 68 |
} |
... | ... |
@@ -141,7 +141,7 @@ it("router doees not dispatch an action from url change that is caused by action |
141 | 141 |
["/somewhere/:id/:view", actionType, {}], |
142 | 142 |
["/somewhere/:id/default", actionType, { view: "home" }] |
143 | 143 |
]; |
144 |
- const { urlChanges, store, actionsDispatched, init } = setupTest( |
|
144 |
+ const { store, actionsDispatched } = setupTest( |
|
145 | 145 |
routesConfig |
146 | 146 |
); |
147 | 147 |
|
... | ... |
@@ -155,9 +155,6 @@ it("router doees not dispatch an action from url change that is caused by action |
155 | 155 |
it("popstate doesn't cause a pushstate", () => { |
156 | 156 |
//given |
157 | 157 |
const actionType = "THE_ACTION"; |
158 |
- const id = "1"; |
|
159 |
- const view = "home"; |
|
160 |
- const action = { type: actionType, id, view }; |
|
161 | 158 |
const routesConfig = [ |
162 | 159 |
["/somewhere/:id/:view", actionType, {}], |
163 | 160 |
["/somewhere/:id/default", actionType, { view: "home" }] |
... | ... |
@@ -165,9 +162,6 @@ it("popstate doesn't cause a pushstate", () => { |
165 | 162 |
|
166 | 163 |
const { |
167 | 164 |
urlChanges, |
168 |
- store, |
|
169 |
- actionsDispatched, |
|
170 |
- fireUrlChange, |
|
171 | 165 |
init, |
172 | 166 |
window |
173 | 167 |
} = setupTest(routesConfig, "/somewhere/foo/default"); |