-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
99 lines (98 loc) · 2.19 KB
/
eslint.config.js
File metadata and controls
99 lines (98 loc) · 2.19 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
import globals from "globals";
import js from "@eslint/js";
import tseslint from "@typescript-eslint/eslint-plugin";
import tseslintParser from "@typescript-eslint/parser";
import reactPlugin from "eslint-plugin-react";
import astroPlugin from "eslint-plugin-astro";
import astroParser from "astro-eslint-parser";
export default [
js.configs.recommended,
{
ignores: ["dist/*"],
},
{
files: ["**/*.{js,mjs,cjs,ts,jsx,tsx,astro}"],
languageOptions: {
globals: {
...globals.browser,
...globals.es2021,
},
parser: tseslintParser,
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
ecmaFeatures: {
jsx: true,
},
},
},
plugins: {
"@typescript-eslint": tseslint,
},
rules: {
...tseslint.configs.recommended.rules,
},
},
{
files: ["**/*.{js,mjs,cjs,jsx,tsx}"],
plugins: {
react: reactPlugin,
},
rules: {
...reactPlugin.configs.recommended.rules,
"react/react-in-jsx-scope": "off",
},
settings: {
react: {
version: "detect",
},
},
},
{
files: ["**/*.astro"],
languageOptions: {
parser: astroParser,
parserOptions: {
parser: "@typescript-eslint/parser",
extraFileExtensions: [".astro"],
},
},
plugins: {
astro: astroPlugin,
},
processor: astroPlugin.processors["client-side-ts"],
rules: {
...astroPlugin.configs.recommended.rules,
},
},
{
files: ["**/*.mjs"],
languageOptions: {
globals: {
...globals.node,
},
},
},
{
files: ["**/*.astro/*.ts", "*.astro/*.ts"],
languageOptions: {
parser: tseslintParser,
parserOptions: {
project: null, // Disable project resolution for performance
},
},
rules: {
// Add any TypeScript-specific rules for client-side scripts here as we go
},
},
{
rules: {
"no-unused-vars": "warn",
"prefer-const": "error",
"no-console": "warn",
"react/prop-types": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-explicit-any": "warn",
},
},
];