master
1import js from '@eslint/js';
2import typescriptParser from '@typescript-eslint/parser';
3import astroEslintParser from 'astro-eslint-parser';
4import eslintPluginAstro from 'eslint-plugin-astro';
5import globals from 'globals';
6import tseslint from 'typescript-eslint';
7
8export default [
9 js.configs.recommended,
10 ...eslintPluginAstro.configs['flat/recommended'],
11 ...tseslint.configs.recommended,
12 {
13 languageOptions: {
14 globals: {
15 ...globals.browser,
16 ...globals.node,
17 },
18 },
19 },
20 {
21 files: ['**/*.astro'],
22 languageOptions: {
23 parser: astroEslintParser,
24 parserOptions: {
25 parser: '@typescript-eslint/parser',
26 extraFileExtensions: ['.astro'],
27 },
28 },
29 },
30 {
31 files: ['**/*.{js,jsx,astro}'],
32 rules: {
33 'no-mixed-spaces-and-tabs': ['error', 'smart-tabs'],
34 },
35 },
36 {
37 files: ['**/*.{ts,tsx}', '**/*.astro/*.js'],
38 languageOptions: {
39 parser: typescriptParser,
40 },
41 rules: {
42 'no-unused-vars': 'off',
43 '@typescript-eslint/no-unused-vars': [
44 'error',
45 {
46 argsIgnorePattern: '^_',
47 destructuredArrayIgnorePattern: '^_',
48 },
49 ],
50 '@typescript-eslint/no-non-null-assertion': 'off',
51 },
52 },
53 {
54 ignores: ['dist', 'node_modules', '.github', 'types.generated.d.ts', '.astro'],
55 },
56];