-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy patheslint.config.mjs
34 lines (32 loc) · 1013 Bytes
/
eslint.config.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import { defineConfig } from 'eslint/config';
import globals from 'globals';
import js from '@eslint/js';
import { FlatCompat } from '@eslint/eslintrc';
import tsParser from '@typescript-eslint/parser';
import astroParser from 'astro-eslint-parser';
const compat = new FlatCompat({
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all,
});
export default defineConfig([
{
extends: compat.extends('eslint:recommended', 'plugin:astro/all'),
languageOptions: {
globals: { ...globals.node, ...globals.browser, dataLayer: false },
ecmaVersion: 'latest',
sourceType: 'module',
},
},
{
files: ['**/*.astro'],
languageOptions: {
parser: astroParser,
ecmaVersion: 5,
sourceType: 'script',
parserOptions: { parser: tsParser, extraFileExtensions: ['.astro'] },
},
rules: { 'astro/no-set-html-directive': 'off' },
processor: 'astro/client-side-ts',
},
{ files: ['**/*.ts'], languageOptions: { parser: tsParser } },
]);