forked from quoid/userscripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.js
67 lines (60 loc) · 1.88 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
/**
* @file ESLint project configuration (New flat config)
* @see {@link https://eslint.org/docs/latest/use/configure/configuration-files-new}
* @see {@link https://eslint.org/docs/latest/use/configure/migration-guide}
* @see {@link https://eslint.org/docs/latest/extend/plugin-migration-flat-config}
* @see {@link https://eslint.org/blog/2022/08/new-config-system-part-1/}
* @see {@link https://eslint.org/blog/2022/08/new-config-system-part-2/}
*/
import js from "@eslint/js";
import globals from "globals";
import eslintPluginSvelte from "eslint-plugin-svelte";
import eslintConfigPrettier from "eslint-config-prettier";
export default [
/**
* @see {@link https://eslint.org/docs/latest/use/configure/configuration-files-new#using-predefined-configurations}
* @see {@link https://github.com/eslint/eslint/tree/main/packages/js}
*/
js.configs.recommended,
/**
* @see {@link https://github.com/sveltejs/eslint-plugin-svelte}
*/
...eslintPluginSvelte.configs["flat/recommended"],
...eslintPluginSvelte.configs["flat/prettier"],
/**
* @see {@link https://github.com/prettier/eslint-config-prettier}
* turns off the conflict rules, put it last
*/
eslintConfigPrettier,
/** custom config objects */
/** @see {@link https://eslint.org/docs/latest/use/configure/configuration-files-new#globally-ignoring-files-with-ignores} */
{
ignores: ["**/dist/", "**/build/", "etc/", "xcode/", "public/"],
},
/** @see {@link https://eslint.org/docs/latest/use/configure/migration-guide#configuring-language-options} */
{
files: ["scripts/**/*.js"],
languageOptions: {
globals: {
...globals.node,
},
},
},
{
files: ["src/{app,dev}/**/*.{js,svelte}"],
languageOptions: {
globals: {
...globals.browser,
},
},
},
{
files: ["src/ext/**/*.{js,svelte}"],
languageOptions: {
globals: {
...globals.browser,
...globals.webextensions,
},
},
},
];