-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintrc.js
123 lines (119 loc) · 5.01 KB
/
.eslintrc.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
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
// Copyright (c) Aigonix. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
const allowTsxPascalParameters =
require('@dolittle/eslint-config')
.rules['@typescript-eslint/naming-convention']
.map(option => {
if (option.selector !== 'parameter') return option;
const { format, ...rest } = option;
return {
format: [...format, 'PascalCase'],
...rest,
};
});
module.exports = {
extends: [
'@dolittle',
'plugin:react/recommended',
],
root: true,
parserOptions: {
project: './Sources/*/tsconfig.json',
sourceType: 'module',
tsconfigRootDir: __dirname,
},
settings: {
react: {
version: 'detect',
},
},
rules: {
'@typescript-eslint/unified-signatures': 'off',
'import/no-extraneous-dependencies': 'off',
'eol-last': 'error',
//'no-multiple-empty-lines': ['error', { max: 1, maxEOF: 0 }],
'header/header': [
2,
'line',
[
' Copyright (c) Aigonix. All rights reserved.',
' Licensed under the MIT license. See LICENSE file in the project root for full license information.',
],
],
'jsdoc/require-param-name': 'error',
// 'jsdoc/require-param-type': 'error',
'jsdoc/check-alignment': 'error',
// 'jsdoc/check-indentation': 'error',
'jsdoc/valid-types': 'error',
// 'jsdoc/require-hyphen-before-param-description': 'error',
'jsdoc/check-line-alignment': 'error',
'jsdoc/require-returns-check': 'error',
'jsdoc/require-returns-description': 'error',
// 'jsdoc/require-returns-type': 'error',
'jsdoc/check-tag-names': 'error',
'jsdoc/check-param-names': 'error',
'jsdoc/check-types': 'error',
'jsdoc/empty-tags': 'error',
'jsdoc/no-bad-blocks': 'error',
'jsdoc/no-undefined-types': 'error',
'jsdoc/multiline-blocks': 'error',
'jsdoc/no-multi-asterisks': 'error',
'jsdoc/require-asterisk-prefix': 'error',
// 'jsdoc/require-description-complete-sentence': 'error',
// 'jsdoc/require-param': 'error',
// 'jsdoc/require-param-description': 'error',
'jsdoc/tag-lines': ['error', 'always', { count: 0 }],
// 'jsdoc/require-jsdoc': ['error', {
// require: {
// FunctionDeclaration: false
// },
// contexts: [
// 'ExportNamedDeclaration>TSTypeAliasDeclaration',
// 'ExportNamedDeclaration>TSInterfaceDeclaration',
// 'ExportNamedDeclaration>ClassDeclaration',
// 'ExportNamedDeclaration[declaration.type="TSDeclareFunction"]:not(ExportNamedDeclaration[declaration.type="TSDeclareFunction"] + ExportNamedDeclaration[declaration.type="TSDeclareFunction"])',
// 'ExportNamedDeclaration[declaration.type="FunctionDeclaration"]:not(ExportNamedDeclaration[declaration.type="TSDeclareFunction"] + ExportNamedDeclaration[declaration.type="FunctionDeclaration"])',
// 'MethodDefinition[accessibility!="private"][value.type="TSEmptyBodyFunctionExpression"]:not(MethodDefinition[value.type="TSEmptyBodyFunctionExpression"] + MethodDefinition[value.type="TSEmptyBodyFunctionExpression"])',
// 'MethodDefinition[accessibility!="private"][value.type="FunctionExpression"]:not(MethodDefinition[value.type="TSEmptyBodyFunctionExpression"] + MethodDefinition[value.type="FunctionExpression"])',
// ]
// }],
// 'jsdoc/require-returns': ['error', {
// contexts: [
// 'ArrowFunctionExpression',
// 'FunctionDeclaration',
// 'MethodDefinition[kind!="get"]'
// ]
// }],
// 'jsdoc/require-description': ['error', {
// descriptionStyle: 'body',
// contexts: ['any']
// }],
// Rules that are temoprarily disabled
// This is nice - but makes the linter horribly slow
// 'jsdoc/match-description': ['error', {
// matchDescription: '^(?:[^\\{]+|\\{@link [^\\}]+\\})+$',
// tags: {
// param: true
// },
// message: 'Descriptions must use {@link ...} for references to other types.'
// }],
},
overrides: [
{
files: ['**.tsx'],
rules: {
'@typescript-eslint/naming-convention': allowTsxPascalParameters,
},
},
{
files: ['**/for_*/**'],
rules: {
'@typescript-eslint/naming-convention': 'off',
'import/no-extraneous-dependencies': 'off',
'@typescript-eslint/no-unused-expressions': 'off',
'no-restricted-globals': 'off',
'jsdoc/require-jsdoc': 'off',
},
},
],
};