From 869654d900b82babfe41d4979ad801c468b45ea7 Mon Sep 17 00:00:00 2001 From: Zignd Date: Mon, 5 Aug 2019 00:03:10 -0300 Subject: [PATCH] Fixing linter errors --- src/extension.ts | 8 +++++--- test/extension.test.ts | 8 ++++---- test/index.ts | 8 ++++---- tslint.json | 3 ++- 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/src/extension.ts b/src/extension.ts index 49ad70d..2c0b93b 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -79,7 +79,7 @@ async function cache(): Promise { } function provideCompletionItemsGenerator(languageSelector: string, classMatchRegex: RegExp, - classPrefix: string = "", splitChar: string = " ") { + classPrefix: string = "", splitChar: string = " ") { return languages.registerCompletionItemProvider(languageSelector, { provideCompletionItems(document: TextDocument, position: Position): CompletionItem[] { const start: Position = new Position(position.line, 0); @@ -147,7 +147,7 @@ export async function activate(context: ExtensionContext): Promise { if (e.affectsConfiguration("html-css-class-completion.enableEmmetSupport")) { const isEnabled = workspace.getConfiguration() .get("html-css-class-completion.enableEmmetSupport"); - isEnabled ? enableEmmetSupport(emmetDisposables) : disableEmmetSupport(emmetDisposables); + isEnabled ? enableEmmetSupport(emmetDisposables) : disableEmmetSupport(emmetDisposables); } } catch (err) { err = new VError(err, "Failed to automatically reload the extension after the configuration change"); @@ -186,7 +186,9 @@ export async function activate(context: ExtensionContext): Promise { }); // HTML based extensions - ["html", "django-html", "razor", "php", "blade", "vue", "twig", "markdown", "erb", "handlebars", "ejs"].forEach((extension) => { + ["html", "django-html", "razor", "php", "blade", "vue", + "twig", "markdown", "erb", "handlebars", "ejs", + ].forEach((extension) => { context.subscriptions.push(provideCompletionItemsGenerator(extension, /class=["|']([\w- ]*$)/)); }); diff --git a/test/extension.test.ts b/test/extension.test.ts index 5c4a4da..bbfe553 100644 --- a/test/extension.test.ts +++ b/test/extension.test.ts @@ -4,12 +4,12 @@ // // The module 'assert' provides assertion methods from node -import * as assert from 'assert'; +import * as assert from "assert"; // You can import and use all API from the 'vscode' module // as well as import your extension to test it -import * as vscode from 'vscode'; -import * as myExtension from '../src/extension'; +import * as vscode from "vscode"; +import * as myExtension from "../src/extension"; // Defines a Mocha test suite to group tests of similar kind together suite("Extension Tests", () => { @@ -19,4 +19,4 @@ suite("Extension Tests", () => { assert.equal(-1, [1, 2, 3].indexOf(5)); assert.equal(-1, [1, 2, 3].indexOf(0)); }); -}); \ No newline at end of file +}); diff --git a/test/index.ts b/test/index.ts index 50bae45..78e6119 100644 --- a/test/index.ts +++ b/test/index.ts @@ -10,13 +10,13 @@ // to report the results back to the caller. When the tests are finished, return // a possible error to the callback or null if none. -var testRunner = require('vscode/lib/testrunner'); +let testRunner = require("vscode/lib/testrunner"); // You can directly control Mocha options by uncommenting the following lines // See https://github.com/mochajs/mocha/wiki/Using-mocha-programmatically#set-options for more info testRunner.configure({ - ui: 'tdd', // the TDD UI is being used in extension.test.ts (suite, test, etc.) - useColors: true // colored output from test results + ui: "tdd", // the TDD UI is being used in extension.test.ts (suite, test, etc.) + useColors: true, // colored output from test results }); -module.exports = testRunner; \ No newline at end of file +module.exports = testRunner; diff --git a/tslint.json b/tslint.json index 0a27bf7..37b0ca0 100644 --- a/tslint.json +++ b/tslint.json @@ -5,7 +5,8 @@ ], "jsRules": {}, "rules": { - "no-console": false + "no-console": false, + "align": false }, "rulesDirectory": [] } \ No newline at end of file