Skip to content

Commit

Permalink
Move pluginsSchema to separate file
Browse files Browse the repository at this point in the history
  • Loading branch information
webpro committed Nov 11, 2024
1 parent f4b253c commit 8e6fe9e
Show file tree
Hide file tree
Showing 2 changed files with 89 additions and 86 deletions.
87 changes: 1 addition & 86 deletions packages/knip/src/ConfigurationValidator.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { z } from 'zod';
import { pluginsSchema } from './schema/plugins.js';

const globSchema = z.union([z.string(), z.array(z.string())]);

Expand Down Expand Up @@ -77,92 +78,6 @@ export const pluginSchema = z.union([
}),
]);

const pluginsSchema = z.object({
astro: pluginSchema,
angular: pluginSchema,
ava: pluginSchema,
babel: pluginSchema,
c8: pluginSchema,
capacitor: pluginSchema,
changesets: pluginSchema,
commitizen: pluginSchema,
commitlint: pluginSchema,
cspell: pluginSchema,
cucumber: pluginSchema,
cypress: pluginSchema,
dotenv: pluginSchema,
eleventy: pluginSchema,
eslint: pluginSchema,
gatsby: pluginSchema,
'github-actions': pluginSchema,
'graphql-codegen': pluginSchema,
husky: pluginSchema,
jest: pluginSchema,
ladle: pluginSchema,
lefthook: pluginSchema,
'lint-staged': pluginSchema,
linthtml: pluginSchema,
'lockfile-lint': pluginSchema,
'lost-pixel': pluginSchema,
markdownlint: pluginSchema,
mocha: pluginSchema,
moonrepo: pluginSchema,
msw: pluginSchema,
nest: pluginSchema,
netlify: pluginSchema,
next: pluginSchema,
node: pluginSchema,
nodemon: pluginSchema,
'node-test-runner': pluginSchema,
'npm-package-json-lint': pluginSchema,
nuxt: pluginSchema,
nx: pluginSchema,
nyc: pluginSchema,
oclif: pluginSchema,
playwright: pluginSchema,
'playwright-ct': pluginSchema,
'playwright-test': pluginSchema,
postcss: pluginSchema,
preconstruct: pluginSchema,
prettier: pluginSchema,
'react-cosmos': pluginSchema,
'release-it': pluginSchema,
remark: pluginSchema,
remix: pluginSchema,
rollup: pluginSchema,
rsbuild: pluginSchema,
rspack: pluginSchema,
'semantic-release': pluginSchema,
sentry: pluginSchema,
'simple-git-hooks': pluginSchema,
'size-limit': pluginSchema,
storybook: pluginSchema,
stryker: pluginSchema,
stylelint: pluginSchema,
svelte: pluginSchema,
syncpack: pluginSchema,
tailwind: pluginSchema,
travis: pluginSchema,
'ts-node': pluginSchema,
tsup: pluginSchema,
tsx: pluginSchema,
typedoc: pluginSchema,
typescript: pluginSchema,
unbuild: pluginSchema,
unocss: pluginSchema,
'vercel-og': pluginSchema,
vue: pluginSchema,
vike: pluginSchema,
vite: pluginSchema,
vitest: pluginSchema,
'webdriver-io': pluginSchema,
webpack: pluginSchema,
wireit: pluginSchema,
wrangler: pluginSchema,
xo: pluginSchema,
yorkie: pluginSchema,
});

const baseWorkspaceConfigurationSchema = z.object({
entry: globSchema.optional(),
project: globSchema.optional(),
Expand Down
88 changes: 88 additions & 0 deletions packages/knip/src/schema/plugins.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
import { z } from 'zod';
import { pluginSchema } from '../ConfigurationValidator.js';

export const pluginsSchema = z.object({
astro: pluginSchema,
angular: pluginSchema,
ava: pluginSchema,
babel: pluginSchema,
c8: pluginSchema,
capacitor: pluginSchema,
changesets: pluginSchema,
commitizen: pluginSchema,
commitlint: pluginSchema,
cspell: pluginSchema,
cucumber: pluginSchema,
cypress: pluginSchema,
dotenv: pluginSchema,
eleventy: pluginSchema,
eslint: pluginSchema,
gatsby: pluginSchema,
'github-actions': pluginSchema,
'graphql-codegen': pluginSchema,
husky: pluginSchema,
jest: pluginSchema,
ladle: pluginSchema,
lefthook: pluginSchema,
'lint-staged': pluginSchema,
linthtml: pluginSchema,
'lockfile-lint': pluginSchema,
'lost-pixel': pluginSchema,
markdownlint: pluginSchema,
mocha: pluginSchema,
moonrepo: pluginSchema,
msw: pluginSchema,
nest: pluginSchema,
netlify: pluginSchema,
next: pluginSchema,
node: pluginSchema,
nodemon: pluginSchema,
'node-test-runner': pluginSchema,
'npm-package-json-lint': pluginSchema,
nuxt: pluginSchema,
nx: pluginSchema,
nyc: pluginSchema,
oclif: pluginSchema,
playwright: pluginSchema,
'playwright-ct': pluginSchema,
'playwright-test': pluginSchema,
postcss: pluginSchema,
preconstruct: pluginSchema,
prettier: pluginSchema,
'react-cosmos': pluginSchema,
'release-it': pluginSchema,
remark: pluginSchema,
remix: pluginSchema,
rollup: pluginSchema,
rsbuild: pluginSchema,
rspack: pluginSchema,
'semantic-release': pluginSchema,
sentry: pluginSchema,
'simple-git-hooks': pluginSchema,
'size-limit': pluginSchema,
storybook: pluginSchema,
stryker: pluginSchema,
stylelint: pluginSchema,
svelte: pluginSchema,
syncpack: pluginSchema,
tailwind: pluginSchema,
travis: pluginSchema,
'ts-node': pluginSchema,
tsup: pluginSchema,
tsx: pluginSchema,
typedoc: pluginSchema,
typescript: pluginSchema,
unbuild: pluginSchema,
unocss: pluginSchema,
'vercel-og': pluginSchema,
vue: pluginSchema,
vike: pluginSchema,
vite: pluginSchema,
vitest: pluginSchema,
'webdriver-io': pluginSchema,
webpack: pluginSchema,
wireit: pluginSchema,
wrangler: pluginSchema,
xo: pluginSchema,
yorkie: pluginSchema,
});

0 comments on commit 8e6fe9e

Please sign in to comment.