-
Notifications
You must be signed in to change notification settings - Fork 2
/
eslint.config.js
61 lines (56 loc) · 1.85 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
// Copyright Sebastian Wiesner <[email protected]>
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0.If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
// @ts-check
import eslint from "@eslint/js";
import tseslint from "typescript-eslint";
import eslintConfigPrettier from "eslint-config-prettier";
import gjsGuide from "./eslint.config.gjs-guide.js";
// Consider eslint-plugin-promise again once it supports flat config,
// see https://github.com/eslint-community/eslint-plugin-promise/issues/449
export default tseslint.config(
// See https://typescript-eslint.io/getting-started
eslint.configs.recommended,
...gjsGuide,
...tseslint.configs.strictTypeChecked,
...tseslint.configs.stylisticTypeChecked,
// See https://typescript-eslint.io/getting-started/typed-linting
{
languageOptions: {
parserOptions: {
projectService: true,
// @ts-ignore
tsconfigRootDir: import.meta.dirname,
},
},
},
// See https://github.com/prettier/eslint-config-prettier?tab=readme-ov-file#installation
eslintConfigPrettier,
{
linterOptions: {
reportUnusedDisableDirectives: "error",
},
rules: {
// .eslintrc.gjs-guide.yml enables this, but it has no use in typescript
// which ensures a consistent return value through its type checks.
"consistent-return": "off",
},
},
// Global ignores, see https://eslint.org/docs/latest/use/configure/configuration-files#globally-ignoring-files-with-ignores
// "ignores" must be the _only_ key in this object!
{
ignores: [
// eslint configs
"eslint.config.*",
// Build outputs
"build/**/*",
"dist/**/*",
// Packages
"node_modules/**",
// Vendored dependencies
"src/lib/vendor/**",
],
},
);