Niedzielski has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/371766 )

Change subject: Chore: combine linters
......................................................................

Chore: combine linters

Change-Id: I931473048eafae15d28d534282e51f2e819fb057
---
M .eslintrc.json
M package.json
M src/server/index.ts
M src/server/templates/page.ts
4 files changed, 20 insertions(+), 18 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/marvin refs/changes/66/371766/1

diff --git a/.eslintrc.json b/.eslintrc.json
index 086e06c..a9114c5 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -7,8 +7,15 @@
     "prettier"
   ],
   "rules": {
-    "prettier/prettier": "error"
+    "prettier/prettier": "error",
+
+    // https://github.com/eslint/typescript-eslint-parser#known-issues
+    "no-undef": 0,
+    "no-unused-vars": 0,
+    "no-useless-constructor": 0,
+    "space-infix-ops": 0
   },
+  "parser": "typescript-eslint-parser",
   "parserOptions": {
     "ecmaVersion": 2016,
     "sourceType": "module",
diff --git a/package.json b/package.json
index f52ba40..12c4dc8 100644
--- a/package.json
+++ b/package.json
@@ -11,16 +11,9 @@
     "server:build": "tsc -p src/server/tsconfig.json",
     "client:build": "webpack -p",
     "prod:build": "NODE_ENV=production run-s -s server:build client:build",
-    "format:ts": "prettier --write --parser typescript",
-    "format:ts:all": "npm run -s format:ts -- '{src,test}/**/*.{ts,tsx}'",
-    "format:js": "npm run -s lint -- --fix",
-    "format:js:all": "npm run -s format:js -- .",
-    "format:all": "run-s -s format:js:all format:ts:all",
-    "lint": "eslint --cache --max-warnings 0 --ext js,json",
-    "lint:ts": "prettier --parser typescript -l",
-    "lint:ts:all": "npm run -s lint:ts -- '{src,test}/**/*.{ts,tsx}'",
-    "lint:all": "npm run -s lint -- . && npm run -s lint:ts:all",
-    "pretest": "run-s -s lint:all prod:build",
+    "format": "npm run -s lint -- --fix",
+    "lint": "eslint --cache --max-warnings 0 --ext ts,tsx,js,json .",
+    "pretest": "run-s -s lint prod:build",
     "test": "mocha '{src,test}/**/*.test.{ts,js}'",
     "test:watch": "nodemon -e js,json,ts,tsx -q -x 'npm test'",
     "precommit": "npm run -s test"
diff --git a/src/server/index.ts b/src/server/index.ts
index 7452a0f..ac2f9ad 100644
--- a/src/server/index.ts
+++ b/src/server/index.ts
@@ -9,7 +9,7 @@
   if (process.env.NODE_ENV === "production") {
     throw e;
   } else {
-    console.error("Unable to load the static assets manifest file");
+    console.error("Unable to load the static assets manifest file"); // 
eslint-disable-line no-console
   }
 }
 
diff --git a/src/server/templates/page.ts b/src/server/templates/page.ts
index 9465595..584324f 100644
--- a/src/server/templates/page.ts
+++ b/src/server/templates/page.ts
@@ -1,21 +1,23 @@
 export interface AssetsManifest {
   [entrypoint: string]: {
-    [format: string]: string;
-  };
+    [format: string]: string
+  }
 }
 
 export interface PageParams {
   // Title of the page
-  title: string;
+  title: string,
   // HTML to render in the body of the page
-  body: string;
+  body: string,
   // Manifest of filename entry points to bundled assets.
-  assets: AssetsManifest;
+  assets: AssetsManifest
 }
 
 export default function page({ title, body = "", assets }: PageParams): string 
{
   const scripts = [];
-  assets.index && assets.index.js && scripts.push(assets.index.js);
+  if (assets.index && assets.index.js) {
+    scripts.push(assets.index.js);
+  }
 
   return `
 <!DOCTYPE html>

-- 
To view, visit https://gerrit.wikimedia.org/r/371766
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I931473048eafae15d28d534282e51f2e819fb057
Gerrit-PatchSet: 1
Gerrit-Project: marvin
Gerrit-Branch: master
Gerrit-Owner: Niedzielski <sniedziel...@wikimedia.org>
Gerrit-Reviewer: Sniedzielski <sniedziel...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to