Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixing linter errors
  • Loading branch information
zignd committed Aug 5, 2019
commit 869654d900b82babfe41d4979ad801c468b45ea7
8 changes: 5 additions & 3 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ async function cache(): Promise<void> {
}

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);
Expand Down Expand Up @@ -147,7 +147,7 @@ export async function activate(context: ExtensionContext): Promise<void> {
if (e.affectsConfiguration("html-css-class-completion.enableEmmetSupport")) {
const isEnabled = workspace.getConfiguration()
.get<boolean>("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");
Expand Down Expand Up @@ -186,7 +186,9 @@ export async function activate(context: ExtensionContext): Promise<void> {
});

// 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- ]*$)/));
});

Expand Down
8 changes: 4 additions & 4 deletions test/extension.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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", () => {
Expand All @@ -19,4 +19,4 @@ suite("Extension Tests", () => {
assert.equal(-1, [1, 2, 3].indexOf(5));
assert.equal(-1, [1, 2, 3].indexOf(0));
});
});
});
8 changes: 4 additions & 4 deletions test/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
module.exports = testRunner;
3 changes: 2 additions & 1 deletion tslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
],
"jsRules": {},
"rules": {
"no-console": false
"no-console": false,
"align": false
},
"rulesDirectory": []
}