From 6894015954db74ce198382029a8d35d8f93e1b78 Mon Sep 17 00:00:00 2001 From: Egor fureunoir Gorbunov Date: Sun, 1 Jun 2025 18:25:27 +0300 Subject: [PATCH] Features: 1) Add `astro-eslint-parser` as a new devDependency; Fixes: Extra: 1) Refactor ESLint configuration to simplify overrides with modular imports for Astro and Vue; 2) Format ESLint config for consistency. --- storefront/eslint.config.mjs | 126 +++++++++++------------------------ storefront/package-lock.json | 1 + storefront/package.json | 1 + 3 files changed, 41 insertions(+), 87 deletions(-) diff --git a/storefront/eslint.config.mjs b/storefront/eslint.config.mjs index 91d61066..719b512d 100644 --- a/storefront/eslint.config.mjs +++ b/storefront/eslint.config.mjs @@ -1,96 +1,48 @@ -module.exports = { - root: true, - env: { - browser: true, - node: true, - es2021: true, - }, - parserOptions: { - ecmaVersion: 2021, - sourceType: 'module', - // Allow ESLint to recognize .vue and .astro files - extraFileExtensions: ['.vue', '.astro'], - }, - extends: [ - // Basic recommended rules from ESLint - 'eslint:recommended', +import astroPlugin from 'eslint-plugin-astro'; +import astroParser from 'astro-eslint-parser'; +import vuePlugin from 'eslint-plugin-vue'; +import vueParser from 'vue-eslint-parser'; - // Vue 3 best practices (uses vue-eslint-parser under the hood) - 'plugin:vue/vue3-recommended', // :contentReference[oaicite:0]{index=0} - - // TypeScript support (if you’re using TS in .js/.ts or inside .vue/.astro) - 'plugin:@typescript-eslint/recommended', - - // Astro’s own recommended ruleset - 'plugin:astro/recommended', // :contentReference[oaicite:1]{index=1} - ], - plugins: [ - 'vue', - '@typescript-eslint', - 'astro', - ], - rules: { - // Customize global rules here (if needed). For example: - // '@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }], - }, - overrides: [ - // ————— Override for `.astro` files ————— +export default [ { - files: ['*.astro'], - parser: 'astro-eslint-parser', - parserOptions: { - // Inside