Skip to content

Commit

Permalink
Add no-non-null-assertion ignore statements
Browse files Browse the repository at this point in the history
  • Loading branch information
amckinney committed Sep 6, 2024
1 parent 41d4242 commit bb50151
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export class FernDefinitionDirectory {
const sortedDirectories = Object.keys(root.directories).sort();
for (const directory of sortedDirectories) {
const nextPath = currentPath != null ? `${currentPath}${path.sep}${directory}` : directory;
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const nextDirectory = root.directories[directory]!;
walk(nextDirectory, nextPath);
}
Expand All @@ -36,6 +37,7 @@ export class FernDefinitionDirectory {

private getOrCreateFileRecursive(pathParts: string[]): RawSchemas.DefinitionFileSchema {
if (pathParts.length === 1) {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
return (this.files[RelativeFilePath.of(pathParts[0]!)] ??= {});
}
const [directory, ...remainingPath] = pathParts;
Expand All @@ -45,6 +47,7 @@ export class FernDefinitionDirectory {
if (!this.directories[directory]) {
this.directories[directory] = new FernDefinitionDirectory();
}
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
return this.directories[directory]!.getOrCreateFileRecursive(remainingPath);
}
}

0 comments on commit bb50151

Please sign in to comment.