Repository: elm-tooling/elm-language-server
Pull request #422 (2020-12-28 22:22:59)

Complete elm-analyse.json and fix typo
Not sure if we really want this, but this surfaces what we didn't migrate. Might be nice for now and easily drop-able later.


Patch:
diff --git a/package-lock.json b/package-lock.json
index 4622b97..47a37fe 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -881,13 +881,13 @@
       "dev": true
     },
     "@typescript-eslint/eslint-plugin": {
-      "version": "4.11.0",
-      "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.11.0.tgz",
-      "integrity": "sha512-x4arJMXBxyD6aBXLm3W7mSDZRiABzy+2PCLJbL7OPqlp53VXhaA1HKK7R2rTee5OlRhnUgnp8lZyVIqjnyPT6g==",
+      "version": "4.11.1",
+      "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.11.1.tgz",
+      "integrity": "sha512-fABclAX2QIEDmTMk6Yd7Muv1CzFLwWM4505nETzRHpP3br6jfahD9UUJkhnJ/g2m7lwfz8IlswcwGGPGiq9exw==",
       "dev": true,
       "requires": {
-        "@typescript-eslint/experimental-utils": "4.11.0",
-        "@typescript-eslint/scope-manager": "4.11.0",
+        "@typescript-eslint/experimental-utils": "4.11.1",
+        "@typescript-eslint/scope-manager": "4.11.1",
         "debug": "^4.1.1",
         "functional-red-black-tree": "^1.0.1",
         "regexpp": "^3.0.0",
@@ -896,55 +896,55 @@
       }
     },
     "@typescript-eslint/experimental-utils": {
-      "version": "4.11.0",
-      "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.11.0.tgz",
-      "integrity": "sha512-1VC6mSbYwl1FguKt8OgPs8xxaJgtqFpjY/UzUYDBKq4pfQ5lBvN2WVeqYkzf7evW42axUHYl2jm9tNyFsb8oLg==",
+      "version": "4.11.1",
+      "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.11.1.tgz",
+      "integrity": "sha512-mAlWowT4A6h0TC9F+J5pdbEhjNiEMO+kqPKQ4sc3fVieKL71dEqfkKgtcFVSX3cjSBwYwhImaQ/mXQF0oaI38g==",
       "dev": true,
       "requires": {
         "@types/json-schema": "^7.0.3",
-        "@typescript-eslint/scope-manager": "4.11.0",
-        "@typescript-eslint/types": "4.11.0",
-        "@typescript-eslint/typescript-estree": "4.11.0",
+        "@typescript-eslint/scope-manager": "4.11.1",
+        "@typescript-eslint/types": "4.11.1",
+        "@typescript-eslint/typescript-estree": "4.11.1",
         "eslint-scope": "^5.0.0",
         "eslint-utils": "^2.0.0"
       }
     },
     "@typescript-eslint/parser": {
-      "version": "4.11.0",
-      "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.11.0.tgz",
-      "integrity": "sha512-NBTtKCC7ZtuxEV5CrHUO4Pg2s784pvavc3cnz6V+oJvVbK4tH9135f/RBP6eUA2KHiFKAollSrgSctQGmHbqJQ==",
+      "version": "4.11.1",
+      "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.11.1.tgz",
+      "integrity": "sha512-BJ3jwPQu1jeynJ5BrjLuGfK/UJu6uwHxJ/di7sanqmUmxzmyIcd3vz58PMR7wpi8k3iWq2Q11KMYgZbUpRoIPw==",
       "dev": true,
       "requires": {
-        "@typescript-eslint/scope-manager": "4.11.0",
-        "@typescript-eslint/types": "4.11.0",
-        "@typescript-eslint/typescript-estree": "4.11.0",
+        "@typescript-eslint/scope-manager": "4.11.1",
+        "@typescript-eslint/types": "4.11.1",
+        "@typescript-eslint/typescript-estree": "4.11.1",
         "debug": "^4.1.1"
       }
     },
     "@typescript-eslint/scope-manager": {
-      "version": "4.11.0",
-      "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.11.0.tgz",
-      "integrity": "sha512-6VSTm/4vC2dHM3ySDW9Kl48en+yLNfVV6LECU8jodBHQOhO8adAVizaZ1fV0QGZnLQjQ/y0aBj5/KXPp2hBTjA==",
+      "version": "4.11.1",
+      "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.11.1.tgz",
+      "integrity": "sha512-Al2P394dx+kXCl61fhrrZ1FTI7qsRDIUiVSuN6rTwss6lUn8uVO2+nnF4AvO0ug8vMsy3ShkbxLu/uWZdTtJMQ==",
       "dev": true,
       "requires": {
-        "@typescript-eslint/types": "4.11.0",
-        "@typescript-eslint/visitor-keys": "4.11.0"
+        "@typescript-eslint/types": "4.11.1",
+        "@typescript-eslint/visitor-keys": "4.11.1"
       }
     },
     "@typescript-eslint/types": {
-      "version": "4.11.0",
-      "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.11.0.tgz",
-      "integrity": "sha512-XXOdt/NPX++txOQHM1kUMgJUS43KSlXGdR/aDyEwuAEETwuPt02Nc7v+s57PzuSqMbNLclblQdv3YcWOdXhQ7g==",
+      "version": "4.11.1",
+      "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.11.1.tgz",
+      "integrity": "sha512-5kvd38wZpqGY4yP/6W3qhYX6Hz0NwUbijVsX2rxczpY6OXaMxh0+5E5uLJKVFwaBM7PJe1wnMym85NfKYIh6CA==",
       "dev": true
     },
     "@typescript-eslint/typescript-estree": {
-      "version": "4.11.0",
-      "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.11.0.tgz",
-      "integrity": "sha512-eA6sT5dE5RHAFhtcC+b5WDlUIGwnO9b0yrfGa1mIOIAjqwSQCpXbLiFmKTdRbQN/xH2EZkGqqLDrKUuYOZ0+Hg==",
+      "version": "4.11.1",
+      "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.11.1.tgz",
+      "integrity": "sha512-tC7MKZIMRTYxQhrVAFoJq/DlRwv1bnqA4/S2r3+HuHibqvbrPcyf858lNzU7bFmy4mLeIHFYr34ar/1KumwyRw==",
       "dev": true,
       "requires": {
-        "@typescript-eslint/types": "4.11.0",
-        "@typescript-eslint/visitor-keys": "4.11.0",
+        "@typescript-eslint/types": "4.11.1",
+        "@typescript-eslint/visitor-keys": "4.11.1",
         "debug": "^4.1.1",
         "globby": "^11.0.1",
         "is-glob": "^4.0.1",
@@ -954,12 +954,12 @@
       }
     },
     "@typescript-eslint/visitor-keys": {
-      "version": "4.11.0",
-      "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.11.0.tgz",
-      "integrity": "sha512-tRYKyY0i7cMk6v4UIOCjl1LhuepC/pc6adQqJk4Is3YcC6k46HvsV9Wl7vQoLbm9qADgeujiT7KdLrylvFIQ+A==",
+      "version": "4.11.1",
+      "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.11.1.tgz",
+      "integrity": "sha512-IrlBhD9bm4bdYcS8xpWarazkKXlE7iYb1HzRuyBP114mIaj5DJPo11Us1HgH60dTt41TCZXMaTCAW+OILIYPOg==",
       "dev": true,
       "requires": {
-        "@typescript-eslint/types": "4.11.0",
+        "@typescript-eslint/types": "4.11.1",
         "eslint-visitor-keys": "^2.0.0"
       }
     },
@@ -4309,9 +4309,9 @@
       "dev": true
     },
     "node-notifier": {
-      "version": "8.0.1",
-      "resolved": "https://registry.npmjs.org/node-notifier/-/node-notifier-8.0.1.tgz",
-      "integrity": "sha512-BvEXF+UmsnAfYfoapKM9nGxnP+Wn7P91YfXmrKnfcYCx6VBeoN5Ez5Ogck6I8Bi5k4RlpqRYaw75pAwzX9OphA==",
+      "version": "8.0.0",
+      "resolved": "https://registry.npmjs.org/node-notifier/-/node-notifier-8.0.0.tgz",
+      "integrity": "sha512-46z7DUmcjoYdaWyXouuFNNfUo6eFa94t23c53c+lG/9Cvauk4a98rAUp9672X5dxGdQmLpPzTxzu8f/OeEPaFA==",
       "dev": true,
       "optional": true,
       "requires": {
diff --git a/src/providers/diagnostics/elmDiagnosticsHelper.ts b/src/providers/diagnostics/elmDiagnosticsHelper.ts
index caaac55..e440bc7 100644
--- a/src/providers/diagnostics/elmDiagnosticsHelper.ts
+++ b/src/providers/diagnostics/elmDiagnosticsHelper.ts
@@ -1,4 +1,3 @@
-import path from "path";
 import { DiagnosticSeverity, Range } from "vscode-languageserver";
 import { URI, Utils } from "vscode-uri";
 import { Diagnostics } from "../../util/types/diagnostics";
diff --git a/src/providers/diagnostics/elmLsDiagnostics.ts b/src/providers/diagnostics/elmLsDiagnostics.ts
index fe88f8a..c57ce4e 100644
--- a/src/providers/diagnostics/elmLsDiagnostics.ts
+++ b/src/providers/diagnostics/elmLsDiagnostics.ts
@@ -25,16 +25,24 @@ import * as path from "path";
 interface IElmAnalyseJson {
   checks?: {
     BooleanCase?: boolean;
+    DebugLog?: boolean; // We don't support this
+    DebugTodo?: boolean; // We don't support this
     DropConcatOfLists?: boolean;
     DropConsOfItemAndList?: boolean;
-    ExposeAll?: boolean;
+    DuplicateImport?: boolean; // We don't support this as elm-format will fix this
+    DuplicateImportedVariable?: boolean; // We don't support this as elm-format will fix this
+    ExposeAll?: boolean; // We don't support this
+    FileLoadFailed?: boolean; // We don't support this as it makes no sense for us
     NoUncurriedPrefix?: boolean;
-    ImportAll?: boolean;
+    FunctionInLet?: boolean; // We don't support this
+    ImportAll?: boolean; // We don't support this
     MapNothingToNothing?: boolean;
-    NoTopLevelSignature?: boolean;
+    MultiLineRecordFormatting?: boolean; // We don't support this
+    NoTopLevelSignature?: boolean; // We don't support this as we get it via type inference already
     SingleFieldRecord?: boolean;
+    TriggerWords?: string[]; // We don't support this
     UnnecessaryListConcat?: boolean;
-    UnnecessaryParens?: boolean;
+    UnnecessaryParens?: boolean; // We don't support this as elm-format will fix these anyway
     UnnecessaryPortModule?: boolean;
     UnusedImport?: boolean;
     UnusedImportAlias?: boolean;
@@ -965,7 +973,7 @@ export class ElmLsDiagnostics {
     ) {
       diagnostics.push({
         range: this.getNodeRange(unusedPortMatches[0].captures[0].node),
-        message: `Module is definined as a \`port\` module, but does not define any ports.`,
+        message: `Module is defined as a \`port\` module, but does not define any ports.`,
         severity: DiagnosticSeverity.Warning,
         source: "ElmLS",
         data: { uri: tree.uri, code: "unnecessary_port_module" },


Test patch:
diff --git a/test/diagnosticTests/elmLsDiagnostics.test.ts b/test/diagnosticTests/elmLsDiagnostics.test.ts
index 955c7ae..fd1ed0c 100644
--- a/test/diagnosticTests/elmLsDiagnostics.test.ts
+++ b/test/diagnosticTests/elmLsDiagnostics.test.ts
@@ -1277,7 +1277,7 @@ foo =
   describe("unnecessary port module", () => {
     const diagnosticWithRange = (range: Range): IDiagnostic => {
       return {
-        message: `Module is definined as a \`port\` module, but does not define any ports.`,
+        message: `Module is defined as a \`port\` module, but does not define any ports.`,
         source: "ElmLS",
         severity: DiagnosticSeverity.Warning,
         range,