-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patheslint.config.js
More file actions
80 lines (77 loc) · 1.82 KB
/
eslint.config.js
File metadata and controls
80 lines (77 loc) · 1.82 KB
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
/*!
* Copyright (c) 2024, Rahul Gupta and Multipart Fetch contributors.
*
* 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 http://mozilla.org/MPL/2.0/.
*
* SPDX-License-Identifier: MPL-2.0
*/
import js from "@eslint/js";
import { includeIgnoreFile } from "@eslint/compat";
import globals from "globals";
import prettier from "eslint-config-prettier";
import vitest from "@vitest/eslint-plugin";
import markdown from "@eslint/markdown";
import * as regexpPlugin from "eslint-plugin-regexp";
import noOnlyTests from "eslint-plugin-no-only-tests";
import path from "node:path";
import { fileURLToPath } from "node:url";
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const gitignorePath = path.resolve(__dirname, ".gitignore");
export default [
includeIgnoreFile(gitignorePath),
{
ignores: ["docs/**"],
},
{
files: ["src/**/*.js"],
languageOptions: {
globals: {
...globals.browser,
},
},
},
{
files: [".husky/*.js", "scripts/**/*.js", "*.config.js"],
languageOptions: {
globals: {
...globals.node,
},
},
},
{
...js.configs.recommended,
files: ["**/*.js"],
},
prettier,
{
files: ["**/*.js"],
...regexpPlugin.configs["flat/recommended"],
},
{
files: ["**/*.test.js"],
languageOptions: {
globals: {
...globals.browser,
},
},
plugins: {
vitest,
noOnlyTests,
},
rules: {
...vitest.configs.recommended.rules,
"no-sparse-arrays": "off",
"noOnlyTests/no-only-tests": ["error", { fix: true }],
},
},
{
files: ["**/*.md"],
plugins: {
markdown,
},
language: "markdown/gfm",
},
];