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) (#34588)

Co-authored-by: Michal Piechowiak <[email protected]>
  • Loading branch information
gatsbybot and pieh authored Jan 25, 2022
1 parent e39f6cd commit ed1a9b5
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 ed1a9b5

Please sign in to comment.