-
Notifications
You must be signed in to change notification settings - Fork 92
/
Copy patheslint.config.js
47 lines (46 loc) · 1.34 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
import eslint from "@eslint/js";
import tseslint from "typescript-eslint";
import tsdoc from "eslint-plugin-tsdoc";
import vitest from "@vitest/eslint-plugin";
import globals from "globals";
import prettier from "eslint-config-prettier";
export default tseslint.config([
{ ignores: ["dist/", "tests/env/", "coverage/", "playgrounds/", "docs/"] },
eslint.configs.recommended,
{
files: ["**/*.js"],
languageOptions: { globals: globals.node },
},
// TSDoc
{
files: ["src/**/*.ts"],
plugins: { tsdoc },
rules: { "tsdoc/syntax": "error" },
},
// TypeScript
{
files: ["**/*.ts"],
extends: [tseslint.configs.recommendedTypeChecked],
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
rules: {
"@typescript-eslint/no-unused-vars": [
"error",
// argsIgnorePattern: https://eslint.org/docs/latest/rules/no-unused-vars#argsignorepattern
// varsIgnorePattern: https://eslint.org/docs/latest/rules/no-unused-vars#varsignorepattern
{ args: "all", argsIgnorePattern: "^_", varsIgnorePattern: "^_" },
],
},
},
// Vitest
{
files: ["tests/**/*.test.ts"],
extends: [vitest.configs.recommended],
},
// Disable any style linting, as prettier takes care of that separately
prettier,
]);