module.exports = {
    // ...
    env: {
        es2020: true,
        node: true,
        'astro/astro': true,
    },
    extends: [
        // ...
        'plugin:astro/recommended',
        'prettier',
        'eslint:recommended',
        'plugin:tailwindcss/recommended',
    ],
    parserOptions: {
        ecmaVersion: 'latest',
        sourceType: 'module',
    },
    // ...
    overrides: [
        {
            // Define the configuration for `.astro` file.
            files: ['*.astro'],
            // Allows Astro components to be parsed.
            parser: 'astro-eslint-parser',
            // Parse the script in `.astro` as TypeScript by adding the following configuration.
            // It's the setting you need when using TypeScript.
            parserOptions: {
                parser: '@typescript-eslint/parser',
                extraFileExtensions: ['.astro'],
                sourceType: 'module',
            },
            rules: {
                // override/add rules settings here, such as:
                // "astro/no-set-html-directive": "error"
                'astro/no-conflict-set-directives': 'error',
                'astro/no-unused-define-vars-in-style': 'error',
            },
        },
        {
            files: ['**/*.astro/*.js', '*.astro/*.js'],
            env: {
                browser: true,
                es2020: true,
            },
            parserOptions: {
                sourceType: 'module',
            },
            rules: {
                // override/add rules settings here, such as:
                // "no-unused-vars": "error"

                // If you are using "prettier/prettier" rule,
                // you don't need to format inside <script> as it will be formatted as a `.astro` file.
                'prettier/prettier': 'off',
            },
        },
    ],
}
