-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.js
103 lines (101 loc) · 2.35 KB
/
eslint.config.js
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
100
101
102
103
import eslintPluginAstro from "eslint-plugin-astro";
import astroEslintParser from "astro-eslint-parser";
import format from "eslint-plugin-format";
import js from "@eslint/js";
import tseslint from "typescript-eslint";
import typescriptParser from "@typescript-eslint/parser";
export default [
// add more generic rule sets here, such as:
js.configs.recommended,
...eslintPluginAstro.configs.recommended,
...tseslint.configs.recommended,
{
rules: {
// override/add rules settings here, such as:
// "astro/no-set-html-directive": "error"
"@typescript-eslint/no-require-imports": [
"error",
{
allow: ["^daisyui*"],
},
],
},
},
{
files: ["**/*.astro"],
languageOptions: {
parser: astroEslintParser,
parserOptions: {
parser: "@typescript-eslint/parser",
extraFileExtensions: [".astro"],
},
},
},
{
files: ["**/*.{js,jsx,astro}"],
rules: {
"no-mixed-spaces-and-tabs": ["error", "smart-tabs"],
},
},
{
// Define the configuration for `<script>` tag.
// Script in `<script>` is assigned a virtual file name with the `.js` extension.
files: ["**/*.{ts,tsx}", "**/*.astro/*.js"],
languageOptions: {
parser: typescriptParser,
},
rules: {
// Note: you must disable the base rule as it can report incorrect errors
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{
argsIgnorePattern: "^_",
destructuredArrayIgnorePattern: "^_",
},
],
"@typescript-eslint/no-non-null-assertion": "off",
},
},
// use Prettier to format CSS
{
files: ["**/*.css"],
languageOptions: {
parser: format.parserPlain,
},
plugins: {
format,
},
rules: {
"format/prettier": ["error", { parser: "css", tabWidth: 2 }],
},
},
// use dprint to format TOML
{
files: ["**/*.toml"],
languageOptions: {
parser: format.parserPlain,
},
plugins: {
format,
},
rules: {
"format/dprint": [
"error",
{ language: "toml", languageOptions: { indentWidth: 2 } },
],
},
},
// ignores
{
ignores: [
"dist",
"node_modules",
".github",
"types.generated.d.ts",
".astro",
".vercel",
"/paraglide",
],
},
];