forked from quoid/userscripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.js
60 lines (53 loc) · 1.83 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
/**
* @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 sveltePlugin from "eslint-plugin-svelte";
import svelteParser from "svelte-eslint-parser";
import prettier from "eslint-config-prettier";
import globals from "globals";
export default [
// https://eslint.org/docs/latest/use/configure/configuration-files-new#using-predefined-configurations
// https://github.com/eslint/eslint/tree/main/packages/js
js.configs.recommended,
// https://github.com/sveltejs/eslint-plugin-svelte
// currently no official svelte/recommended flat config
// flatten and call it through a custom config object
{
files: ["**/*.svelte"],
languageOptions: {
parser: svelteParser,
},
processor: "svelte/svelte",
plugins: {
svelte: sveltePlugin,
},
rules: {
...sveltePlugin.configs.base.overrides[0].rules,
...sveltePlugin.configs.recommended.rules,
},
},
// https://github.com/prettier/eslint-config-prettier
// turns off the conflict rules, put it last
prettier,
// custom config objects
// https://eslint.org/docs/latest/use/configure/configuration-files-new#globally-ignoring-files-with-ignores
{
ignores: ["**/dist/", "**/build/", "etc/", "xcode/", "public/"],
},
// https://eslint.org/docs/latest/use/configure/migration-guide#configuring-language-options
{
files: ["src/**/*.{js,svelte}"],
languageOptions: {
globals: {
...globals.browser,
...globals.webextensions,
},
},
},
];