forked from bloomberg/stricli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.mjs
99 lines (87 loc) · 2.88 KB
/
eslint.config.mjs
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
import { fixupPluginRules } from "@eslint/compat";
import js from "@eslint/js";
import tsParser from "@typescript-eslint/parser";
import header from "eslint-plugin-header";
import _import from "eslint-plugin-import";
import ts from "typescript-eslint";
export default [
js.configs.recommended,
...ts.configs.strict,
{
plugins: {
header,
import: fixupPluginRules(_import),
},
linterOptions: {
reportUnusedDisableDirectives: true,
},
languageOptions: {
parser: tsParser,
},
rules: {
"header/header": [
"error",
"line",
" Copyright 2024 Bloomberg Finance L.P.\n Distributed under the terms of the Apache 2.0 license.",
0,
],
"no-restricted-imports": [
"error",
{
patterns: [
{
group: ["**/index"],
message: "Internal library code should never import from library root.",
},
],
},
],
"import/no-extraneous-dependencies": [
"error",
{
devDependencies: false,
},
],
"@typescript-eslint/no-import-type-side-effects": "error",
"@typescript-eslint/restrict-template-expressions": [
"error",
{
allowNumber: true,
},
],
"@typescript-eslint/consistent-type-definitions": "off",
"@typescript-eslint/no-invalid-void-type": "off",
"@typescript-eslint/require-await": "off",
},
},
{
files: ["tests/**/*.ts"],
languageOptions: {
parserOptions: {
parserService: true,
},
},
rules: {
"no-restricted-imports": [
"error",
{
patterns: [
{
group: ["**/src/*"],
message:
"Tests should always import from library root, except when testing internal-only code.",
},
],
},
],
"import/no-extraneous-dependencies": "off",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-empty-object-type": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-unsafe-argument": "off",
"@typescript-eslint/no-unused-expressions": "off",
"@typescript-eslint/no-unused-vars": "off",
},
},
];