-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.mjs
58 lines (57 loc) · 1.5 KB
/
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import typescriptParser from "@typescript-eslint/parser";
import astroParser from "astro-eslint-parser";
import js from "@eslint/js";
import tsPlugin from "@typescript-eslint/eslint-plugin";
import prettierPlugin from "eslint-plugin-prettier";
import astroPlugin from "eslint-plugin-astro";
export default [
{
// Ignored directories and files
ignores: ["dist", "node_modules", ".github", "tmp", ".changeset"],
},
// Recommended configurations and global settings for JS and TS
js.configs.recommended,
{
files: ["**/*.js", "**/*.ts", "**/*.astro"], // Default file types
languageOptions: {
parser: typescriptParser,
ecmaVersion: 2022,
sourceType: "module",
globals: {
URL: "readonly",
process: "readonly",
console: "readonly",
fetch: "readonly",
},
},
plugins: {
"@typescript-eslint": tsPlugin,
prettier: prettierPlugin,
astro: astroPlugin,
},
rules: {
...js.configs.recommended.rules,
...tsPlugin.configs.recommended.rules,
...prettierPlugin.configs.recommended.rules,
...astroPlugin.configs.recommended.rules,
"@typescript-eslint/no-var-requires": "warn",
"@typescript-eslint/no-unused-vars": [
"warn",
{ varsIgnorePattern: "Props", ignoreRestSiblings: true },
],
},
},
{
files: ["**/*.astro"], // Specific configuration for Astro files
languageOptions: {
parser: astroParser,
parserOptions: {
parser: typescriptParser,
extraFileExtensions: [".astro"],
},
},
rules: {
"prettier/prettier": "off",
},
},
];