Lint the language service package
This commit is contained in:
@@ -10,5 +10,6 @@ export const RootContext = "root";
|
||||
*/
|
||||
export function getDescription(context: string, key: string): string | undefined {
|
||||
// The inferred type doesn't quite match the actual type, use any to work around that
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any
|
||||
return (descriptions as any)[context]?.[key]?.description;
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ export function getJobsContext(workflowContext: WorkflowContext): DescriptionDic
|
||||
|
||||
const outputs = job.outputs || new data.Null();
|
||||
if (outputs instanceof MappingToken) {
|
||||
jobContext.add("outputs", createOutputsContext(outputs as MappingToken), getDescription("jobs", "outputs"));
|
||||
jobContext.add("outputs", createOutputsContext(outputs), getDescription("jobs", "outputs"));
|
||||
}
|
||||
|
||||
jobsContext.add(job.id.toString(), jobContext);
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
||||
import {data, DescriptionDictionary} from "@github/actions-expressions";
|
||||
import {Job} from "@github/actions-workflow-parser/model/workflow-template";
|
||||
import {BasicExpressionToken} from "@github/actions-workflow-parser/templates/tokens/basic-expression-token";
|
||||
|
||||
@@ -121,7 +121,7 @@ function matrixProperties(matrix: MappingToken, mode: Mode): Map<string, Set<str
|
||||
|
||||
case "exclude":
|
||||
break;
|
||||
default:
|
||||
default: {
|
||||
if (!isSequence(pair.value)) {
|
||||
properties.set(key, undefined);
|
||||
continue;
|
||||
@@ -137,6 +137,7 @@ function matrixProperties(matrix: MappingToken, mode: Mode): Map<string, Set<str
|
||||
|
||||
properties.set(key, values);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user