forked from modelcontextprotocol/mcpb
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.eslintrc.json
More file actions
131 lines (125 loc) · 3.62 KB
/
.eslintrc.json
File metadata and controls
131 lines (125 loc) · 3.62 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
{
"env": {
"es6": true
},
"extends": [
"eslint:recommended",
"prettier",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:import/recommended",
"plugin:import/typescript"
],
"plugins": ["@typescript-eslint", "import", "prettier", "simple-import-sort"],
"parser": "@typescript-eslint/parser",
"ignorePatterns": ["dist/*", "node_modules/*", "*.js"],
"parserOptions": {
"project": "./tsconfig.json"
},
"settings": {
"import/resolver": {
// Enables eslint-import-resolver-typescript
"typescript": {}
}
},
"rules": {
"prettier/prettier": "warn",
// Require all external imports to be declared as a dependency
"import/no-extraneous-dependencies": [
"error",
{
"packageDir": "./"
}
],
// Imports must not cause cyclical dependencies
"import/no-cycle": [
"error",
{ "allowUnsafeDynamicCyclicDependency": true }
],
"import/no-named-as-default-member": "off",
// Imports must be ordered appropriately
"simple-import-sort/imports": [
"error",
{
"groups": [
// Side effect imports.
["^\\u0000"],
// Node.js builtins prefixed with `node:`.
["^node:"],
// Packages.
// Things that start with a letter (or digit or underscore), or `@` followed by a letter.
["^@?\\w"],
// Absolute imports
["^@/"],
// Relative imports.
// Anything that starts with a dot.
["^\\."]
]
}
],
"simple-import-sort/exports": "error",
// Imports must be placed before non-import statements
"import/first": "error",
"import/newline-after-import": "error",
"import/no-duplicates": "error",
// Require a space at the start of comments
"spaced-comment": [
"error",
"always",
{
"markers": ["/"]
}
],
// Make sure switch-case doesn't accidentally fall-through https://eslint.org/docs/latest/rules/no-fallthrough
"no-fallthrough": "error",
"@typescript-eslint/ban-ts-comment": "warn",
"@typescript-eslint/consistent-type-imports": [
"error",
{
"prefer": "type-imports"
}
],
// Disallow annotating types where the type can be easily inferred
"@typescript-eslint/no-inferrable-types": [
"error",
{
"ignoreParameters": false,
"ignoreProperties": false
}
],
// Allow non-null assertions
"@typescript-eslint/no-non-null-assertion": "off",
// Disallow using 'any' explicitly in annotations
"@typescript-eslint/no-explicit-any": "error",
// Require promise outcomes to be properly handled
"@typescript-eslint/no-floating-promises": "error",
// Turn off base eslint rule in favor of typescript-eslint version
// to avoid getting eslint errors on type signatures
"no-unused-vars": "off",
// Disallow unused variables and imports
"@typescript-eslint/no-unused-vars": [
"warn",
{
"args": "after-used",
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_",
"ignoreRestSiblings": true,
"vars": "all",
"args": "after-used",
"destructuredArrayIgnorePattern": "^_"
}
],
// Disallow empty functions
// If a function is intentionally empty, adding a comment line
// inside the function body is enough to pass this rule
"@typescript-eslint/no-empty-function": "error"
},
"overrides": [
{
"files": ["test/**/*.ts"],
"parserOptions": {
"project": "./tsconfig.test.json"
}
}
]
}