forked from microsoft/Agents-for-js
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
59 lines (58 loc) · 2.07 KB
/
Copy patheslint.config.js
File metadata and controls
59 lines (58 loc) · 2.07 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
import neostandard from 'neostandard'
import terminalTestCastRule from './eslint-rules/no-terminal-test-cast.js'
export default [
...neostandard({ ts: true, ignores: ['node_modules', '**/dist/**'] }),
{
files: ['packages/**/test/**/*.{ts,cts,mts}', 'test-agents/**/test/**/*.{ts,cts,mts}'],
plugins: {
local: {
rules: {
'no-terminal-test-cast': terminalTestCastRule
}
}
},
rules: {
'local/no-terminal-test-cast': 'error'
}
},
{
files: ['packages/*/src/**/*.{ts,tsx,cts,mts}'],
rules: {
'no-restricted-syntax': [
'error',
{
selector: "ThrowStatement > NewExpression[callee.name='Error']",
message: 'Use ExceptionHelper.generateException(Error, Errors.YourErrorDefinition) instead of throw new Error(...).'
},
{
selector: "ThrowStatement > NewExpression[callee.name='TypeError']",
message: 'Use ExceptionHelper.generateException(TypeError, Errors.YourErrorDefinition) instead of throw new TypeError(...).'
},
{
selector: "ThrowStatement > NewExpression[callee.name='ReferenceError']",
message: 'Use ExceptionHelper.generateException(ReferenceError, Errors.YourErrorDefinition) instead of throw new ReferenceError(...).'
},
{
selector: "ThrowStatement > NewExpression[callee.name='RangeError']",
message: 'Use ExceptionHelper.generateException(RangeError, Errors.YourErrorDefinition) instead of throw new RangeError(...).'
},
{
selector: "ThrowStatement > NewExpression[callee.name='SyntaxError']",
message: 'Use ExceptionHelper.generateException(SyntaxError, Errors.YourErrorDefinition) instead of throw new SyntaxError(...).'
}
],
},
},
{
files: ['packages/agents-telemetry/src/**/*.{ts,cts,mts}'],
languageOptions: {
parser: neostandard.plugins['typescript-eslint'].parser,
},
plugins: {
n: neostandard.plugins.n,
},
rules: {
'n/file-extension-in-import': ['error', 'always'],
},
}
]