-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy patheslint.config.mjs
More file actions
58 lines (54 loc) · 1.68 KB
/
Copy patheslint.config.mjs
File metadata and controls
58 lines (54 loc) · 1.68 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
import tseslint from 'typescript-eslint';
import prettierConfig from 'eslint-config-prettier';
export default tseslint.config(
tseslint.configs.eslintRecommended,
...tseslint.configs.recommended,
prettierConfig,
{
files: ['src/**/*.ts', 'spec/**/*.ts'],
rules: {
// tslint member-ordering was disabled
// no equivalent needed
// tslint no-console was disabled
'no-console': 'off',
// tslint no-empty with allow-empty-catch and allow-empty-functions
'no-empty': ['error', { allowEmptyCatch: true }],
'@typescript-eslint/no-empty-function': 'off',
// tslint variable-name: allow leading underscore
'@typescript-eslint/naming-convention': [
'error',
{
selector: 'default',
format: ['camelCase', 'PascalCase', 'UPPER_CASE'],
leadingUnderscore: 'allow',
},
{
selector: 'typeLike',
format: ['PascalCase'],
},
{
// Type aliases may use camelCase (e.g. setupReplyQueueFnType is public API)
selector: 'typeAlias',
format: ['PascalCase', 'camelCase'],
},
{
selector: 'enumMember',
format: ['UPPER_CASE', 'PascalCase'],
},
{
// Object literal properties are often protocol/API-defined (e.g. STOMP headers
// like 'correlation-id', 'auto-delete') and must not be forced to camelCase.
selector: 'objectLiteralProperty',
format: null,
},
],
},
},
{
files: ['spec/**/*.ts'],
rules: {
// Spec files import Jasmine types and use test globals
'@typescript-eslint/no-unused-vars': 'off',
},
},
);