Lint the language service package
This commit is contained in:
@@ -40,7 +40,7 @@ function testFindToken(input: string): {
|
||||
parent: getTokenInfo(r.parent),
|
||||
key: getTokenInfo(r.keyToken),
|
||||
token: getTokenInfo(r.token),
|
||||
path: r.path.map(x => getTokenInfo(x)!)
|
||||
path: r.path.map(x => getTokenInfo(x)!) // eslint-disable-line @typescript-eslint/no-non-null-assertion
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ export function findToken(pos: Position, root?: TemplateToken): TokenResult {
|
||||
];
|
||||
|
||||
while (s.length > 0) {
|
||||
const result = s.shift()!;
|
||||
const result = s.shift()!; // eslint-disable-line @typescript-eslint/no-non-null-assertion
|
||||
const {parent, token, keyToken, path} = result;
|
||||
if (!token) {
|
||||
break;
|
||||
@@ -67,7 +67,7 @@ export function findToken(pos: Position, root?: TemplateToken): TokenResult {
|
||||
|
||||
// Position is in token, enqueue children if there are any
|
||||
switch (token.templateTokenType) {
|
||||
case TokenType.Mapping:
|
||||
case TokenType.Mapping: {
|
||||
const mappingToken = token as MappingToken;
|
||||
for (const {key, value} of mappingToken) {
|
||||
// If the position is within the key, immediately return it as the token.
|
||||
@@ -99,8 +99,8 @@ export function findToken(pos: Position, root?: TemplateToken): TokenResult {
|
||||
});
|
||||
}
|
||||
continue;
|
||||
|
||||
case TokenType.Sequence:
|
||||
}
|
||||
case TokenType.Sequence: {
|
||||
const sequenceToken = token as SequenceToken;
|
||||
for (const token of sequenceToken) {
|
||||
s.push({
|
||||
@@ -111,6 +111,7 @@ export function findToken(pos: Position, root?: TemplateToken): TokenResult {
|
||||
});
|
||||
}
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
@@ -43,8 +43,8 @@ function getLineCharCode(doc: TextDocument, lineNumber: number, index: number):
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
class SpacesDiffResult {
|
||||
public spacesDiff: number = 0;
|
||||
public looksLikeAlignment: boolean = false;
|
||||
public spacesDiff = 0;
|
||||
public looksLikeAlignment = false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -39,7 +39,8 @@ export async function fetchOrConvertWorkflowTemplate(
|
||||
if (!template) {
|
||||
template = await convertWorkflowTemplate(
|
||||
parsedWorkflow.context,
|
||||
parsedWorkflow.value!,
|
||||
// TODO: @joshmgross We can't assume that the value is non-null here
|
||||
parsedWorkflow.value!, // eslint-disable-line @typescript-eslint/no-non-null-assertion
|
||||
config?.fileProvider,
|
||||
options
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user