Skip to content

Commit

Permalink
fix(gatsby-cli): relax error location validation and ignore extra fie…
Browse files Browse the repository at this point in the history
…lds (#34559)
  • Loading branch information
pieh committed Dec 5, 2022
1 parent 7d9dded commit c275c20
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions packages/gatsby-cli/src/structured-errors/error-schema.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import Joi from "joi"
import { ILocationPosition, IStructuredError } from "./types"

export const Position: Joi.ObjectSchema<ILocationPosition> = Joi.object().keys({
line: Joi.number(),
column: Joi.number(),
})
export const Position: Joi.ObjectSchema<ILocationPosition> = Joi.object()
.keys({
line: Joi.number(),
column: Joi.number(),
})
.unknown()

export const errorSchema: Joi.ObjectSchema<IStructuredError> =
Joi.object().keys({
Expand All @@ -27,7 +29,7 @@ export const errorSchema: Joi.ObjectSchema<IStructuredError> =
location: Joi.object({
start: Position.required(),
end: Position,
}),
}).unknown(),
docsUrl: Joi.string().uri({
allowRelative: false,
relativeOnly: false,
Expand Down

0 comments on commit c275c20

Please sign in to comment.