Skip to content

Commit

Permalink
fix: eslint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
tricktron committed Feb 5, 2023
1 parent 1e89034 commit c51b12c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/languageserver/handlers/settingsHandlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { configure as configureHttpRequests, xhr } from 'request-light';
import { Connection, DidChangeConfigurationNotification, DocumentFormattingRequest } from 'vscode-languageserver';
import { convertErrorToTelemetryMsg } from '../../languageservice/utils/objects';
import { isRelativePath, relativeToAbsolutePath } from '../../languageservice/utils/paths';
import { checkSchemaURI, JSON_SCHEMASTORE_URL, KUBERNETES_SCHEMA_URL } from '../../languageservice/utils/schemaUrls';
import { checkSchemaURI, JSON_SCHEMASTORE_URL } from '../../languageservice/utils/schemaUrls';
import { LanguageService, LanguageSettings, SchemaPriority } from '../../languageservice/yamlLanguageService';
import { SchemaSelectionRequests } from '../../requestTypes';
import { Settings, SettingsState } from '../../yamlSettings';
Expand Down Expand Up @@ -338,7 +338,7 @@ export class SettingsHandler {
languageSettings.schemas.push({ uri, fileMatch: fileMatch, schema: schema, priority: priorityLevel });
}

if (uri.normalize().includes("kubernetes")) {
if (uri.normalize().includes('kubernetes')) {
if (fileMatch.constructor === Array) {
fileMatch.forEach((url) => {
this.yamlSettings.specificValidatorPaths.push(url);
Expand Down
19 changes: 7 additions & 12 deletions test/schemaValidation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1906,13 +1906,7 @@ obj:
});

it('custom kubernetes schema should return validation errors', (done) => {
const settingsHandler = new SettingsHandler(
{} as Connection,
languageService,
yamlSettings,
validationHandler,
telemetry
);
const settingsHandler = new SettingsHandler({} as Connection, languageService, yamlSettings, validationHandler, telemetry);
const initialSettings = languageSettingsSetup.withKubernetes(true).languageSettings;
const kubernetesSettings = settingsHandler.configureSchemas(
'https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.26.1-standalone-strict/all.json',
Expand All @@ -1925,11 +1919,12 @@ obj:
const content = `apiVersion: apps/v1\nkind: Deployment\nfoo: bar`;
const validator = parseSetup(content);
validator
.then(function (result) {
assert.equal(result.length, 1);
// eslint-disable-next-line
assert.equal(result[0].message, `Property foo is not allowed.`);
}).then(done, done);
.then(function (result) {
assert.equal(result.length, 1);
// eslint-disable-next-line
assert.equal(result[0].message, `Property foo is not allowed.`);
})
.then(done, done);
});
});
});

0 comments on commit c51b12c

Please sign in to comment.