Skip to content

Commit

Permalink
Merge pull request #368 from Financial-Times/allow-file-strings
Browse files Browse the repository at this point in the history
Allow prettier/eslint files options to be simple strings as well as arrays
  • Loading branch information
ivomurrell authored Mar 15, 2023
2 parents 3fe8ff1 + 3dc32c0 commit 22c05df
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/types/src/schema/eslint.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { z } from 'zod'

export const ESLintSchema = z.object({
files: z.string().array().default(['**/*.js']),
files: z.string().array().or(z.string()).default(['**/*.js']),
config: z.record(z.unknown()).optional(), // @deprecated: use options instead
options: z.record(z.unknown()).optional()
})
Expand Down
2 changes: 1 addition & 1 deletion lib/types/src/schema/prettier.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { z } from 'zod'

export const PrettierSchema = z.object({
files: z.string().array().default(['**/*.{js,jsx,ts,tsx}']),
files: z.string().array().or(z.string()).default(['**/*.{js,jsx,ts,tsx}']),
configFile: z.string().optional(),
ignoreFile: z.string().default('.prettierignore'),
configOptions: z.record(z.unknown()).default({
Expand Down

0 comments on commit 22c05df

Please sign in to comment.