From 3fdd0d976558e1c26cda85cc7e164f60881a4f84 Mon Sep 17 00:00:00 2001 From: Erik Marks Date: Thu, 5 Sep 2024 22:09:37 -0700 Subject: [PATCH] refactor: (WIP) Enable ts-check in yarn.config.js --- yarn.config.cjs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/yarn.config.cjs b/yarn.config.cjs index 81b614246..6b9cf9fd1 100644 --- a/yarn.config.cjs +++ b/yarn.config.cjs @@ -1,11 +1,12 @@ +// @ts-check // This file is used to define, among other configuration, rules that Yarn will // execute when you run `yarn constraints`. These rules primarily check the // manifests of each package in the monorepo to ensure they follow a standard // format, but also check the presence of certain files as well. -/** @type {import('@yarnpkg/types')} */ const { defineConfig } = require('@yarnpkg/types'); const { readFile } = require('fs/promises'); +// @ts-expect-error lodash is not a valid module, but that's OK const { get } = require('lodash'); const { basename, resolve } = require('path'); const semver = require('semver'); @@ -23,10 +24,10 @@ const noPackageJson = ['extension']; /** * Aliases for the Yarn type definitions, to make the code more readable. * - * @typedef {import('@yarnpkg/types').Yarn} Yarn - * @typedef {import('@yarnpkg/types').Yarn.Constraints.Workspace} Workspace + * @typedef {import('@yarnpkg/types').Yarn.Constraints.Context['Yarn']} Yarn * @typedef {import('@yarnpkg/types').Yarn.Constraints.Dependency} Dependency * @typedef {import('@yarnpkg/types').Yarn.Constraints.DependencyType} DependencyType + * @typedef {import('@yarnpkg/types').Yarn.Constraints.Workspace} Workspace */ module.exports = defineConfig({