From dc84327f8f9883f13fda455fc39e72d823456668 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20B=C3=B6hm?= Date: Sun, 25 Aug 2024 21:24:31 +0200 Subject: [PATCH] fix(eslint): ensure packages are installed Ensure all needed packages are installed at using Astro. --- .changeset/tiny-donuts-smell.md | 5 +++++ packages/eslint-config/src/configs/astro.ts | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 .changeset/tiny-donuts-smell.md diff --git a/.changeset/tiny-donuts-smell.md b/.changeset/tiny-donuts-smell.md new file mode 100644 index 0000000..0c99c5f --- /dev/null +++ b/.changeset/tiny-donuts-smell.md @@ -0,0 +1,5 @@ +--- +'@mheob/eslint-config': patch +--- + +Ensure all needed packages are installed at using Astro. diff --git a/packages/eslint-config/src/configs/astro.ts b/packages/eslint-config/src/configs/astro.ts index bc896bd..b348315 100644 --- a/packages/eslint-config/src/configs/astro.ts +++ b/packages/eslint-config/src/configs/astro.ts @@ -1,12 +1,14 @@ import { GLOB_ASTRO } from '../globs'; import type { OptionsFiles, OptionsOverrides, TypedFlatConfigItem } from '../types'; -import { interopDefault } from '../utils'; +import { ensurePackages, interopDefault } from '../utils'; export async function astro( options: OptionsFiles & OptionsOverrides = {}, ): Promise { const { files = [GLOB_ASTRO], overrides = {} } = options; + await ensurePackages(['eslint-plugin-astro', 'astro-eslint-parser', '@typescript-eslint/parser']); + const [pluginAstro, parserAstro, parserTs] = await Promise.all([ interopDefault(import('eslint-plugin-astro')), interopDefault(import('astro-eslint-parser')),