Skip to content

Commit

Permalink
fix(eslint): ensure astro packages are installed (#200)
Browse files Browse the repository at this point in the history
  • Loading branch information
mheob authored Aug 26, 2024
1 parent 574ed8b commit 55b40a1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/tiny-donuts-smell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@mheob/eslint-config': patch
---

Ensure all needed packages are installed at using Astro.
4 changes: 3 additions & 1 deletion packages/eslint-config/src/configs/astro.ts
Original file line number Diff line number Diff line change
@@ -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<TypedFlatConfigItem[]> {
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')),
Expand Down

0 comments on commit 55b40a1

Please sign in to comment.