Skip to content

Commit

Permalink
Enable eslint import checks
Browse files Browse the repository at this point in the history
  • Loading branch information
ssbarnea committed May 18, 2022
1 parent 417a68e commit 37d936f
Show file tree
Hide file tree
Showing 9 changed files with 3,041 additions and 2,616 deletions.
2 changes: 2 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ module.exports = {
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:import/recommended',
'plugin:import/typescript',
'prettier',
],
rules: {
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ out/server
yarn-error.log
coverage
lib/
package-lock.json
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"coveralls": "3.1.1",
"eslint": "^7.2.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-prettier": "^3.1.4",
"http-proxy-agent": "^5.0.0",
"https-proxy-agent": "^5.0.0",
Expand All @@ -75,7 +76,7 @@
"test": "mocha --require ts-node/register --timeout 5000 --ui bdd ./test/*.test.ts",
"coverage": "nyc mocha --require ts-node/register --timeout 5000 --require source-map-support/register --recursive --ui bdd ./test/*.test.ts",
"coveralls": "nyc --reporter=lcov --reporter=text mocha --timeout 5000 --require ts-node/register --require source-map-support/register --recursive --ui bdd ./test/*.test.ts",
"lint": "eslint -c .eslintrc.js --ext .ts src test",
"lint": "eslint --max-warnings 0 -c .eslintrc.js --ext .ts src test",
"prettier-fix": "yarn prettier --write .",
"build": "yarn clean && yarn lint && yarn compile && yarn build:libs",
"build:libs": "yarn compile:umd && yarn compile:esm",
Expand Down
3 changes: 1 addition & 2 deletions src/languageservice/parser/yaml-documents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@

import { TextDocument } from 'vscode-languageserver-textdocument';
import { JSONDocument } from './jsonParser07';
import { Document, isNode, isPair, isScalar, LineCounter, visit, YAMLError } from 'yaml';
import { Document, isNode, isPair, isScalar, LineCounter, Node, visit, YAMLError } from 'yaml';
import { ASTNode, YamlNode } from '../jsonASTTypes';
import { defaultOptions, parse as parseYAML, ParserOptions } from './yamlParser07';
import { ErrorCode } from 'vscode-json-languageservice';
import { Node } from 'yaml';
import { convertAST } from './ast-converter';
import { YAMLDocDiagnostic } from '../utils/parseUtils';
import { isArrayEqual } from '../utils/arrUtils';
Expand Down
3 changes: 1 addition & 2 deletions src/languageservice/services/yamlCompletion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ import { stringifyObject, StringifySettings } from '../utils/json';
import { convertErrorToTelemetryMsg, isDefined, isString } from '../utils/objects';
import * as nls from 'vscode-nls';
import { setKubernetesParserOption } from '../parser/isKubernetes';
import { isInComment, isMapContainsEmptyPair } from '../utils/astUtils';
import { indexOf } from '../utils/astUtils';
import { indexOf, isInComment, isMapContainsEmptyPair } from '../utils/astUtils';
import { isModeline } from './modelineUtil';
import { getSchemaTypeName } from '../utils/schemaUtils';
import { YamlNode } from '../jsonASTTypes';
Expand Down
3 changes: 1 addition & 2 deletions src/languageservice/services/yamlValidation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@

import { Diagnostic, Position } from 'vscode-languageserver-types';
import { LanguageSettings } from '../yamlLanguageService';
import { YAMLDocument, YamlVersion } from '../parser/yamlParser07';
import { SingleYAMLDocument } from '../parser/yamlParser07';
import { YAMLDocument, YamlVersion, SingleYAMLDocument } from '../parser/yamlParser07';
import { YAMLSchemaService } from './yamlSchemaService';
import { YAMLDocDiagnostic } from '../utils/parseUtils';
import { TextDocument } from 'vscode-languageserver-textdocument';
Expand Down
3 changes: 1 addition & 2 deletions test/code-action-schema.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Copyright (c) Red Hat. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { SCHEMA_ID, setupLanguageService, setupSchemaIDTextDocument } from './utils/testHelper';
import { SCHEMA_ID, setupLanguageService, setupSchemaIDTextDocument, TEST_URI } from './utils/testHelper';
import { ServiceSetup } from './utils/serviceSetup';
import { TextDocumentIdentifier, CodeActionParams, CodeActionContext, TextEdit, Range } from 'vscode-languageserver';
import { expect } from 'chai';
Expand All @@ -11,7 +11,6 @@ import { ValidationHandler } from '../src/languageserver/handlers/validationHand
import { LanguageService } from '../src/languageservice/yamlLanguageService';
import { YamlCodeActions } from '../src/languageservice/services/yamlCodeActions';
import { TextDocument } from 'vscode-languageserver-textdocument';
import { TEST_URI } from './utils/testHelper';

describe('Schema Errors Code Action Tests', () => {
let languageSettingsSetup: ServiceSetup;
Expand Down
3 changes: 1 addition & 2 deletions test/documentSymbols.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@ import {
createExpectedDocumentSymbol,
createExpectedDocumentSymbolNoDetail,
} from './utils/verifyError';
import { DocumentSymbol, SymbolKind } from 'vscode-languageserver-types';
import { DocumentSymbol, SymbolKind, SymbolInformation } from 'vscode-languageserver-types';
import assert = require('assert');
import { ServiceSetup } from './utils/serviceSetup';
import { SymbolInformation } from 'vscode-languageserver-types';
import { SettingsState, TextDocumentTestManager } from '../src/yamlSettings';
import { LanguageHandlers } from '../src/languageserver/handlers/languageHandlers';

Expand Down
Loading

0 comments on commit 37d936f

Please sign in to comment.