/
tslint.js
115 lines (106 loc) · 3.37 KB
/
tslint.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
module.exports = {
extends: [
'tslint:latest',
'tslint-react',
'tslint-eslint-rules',
'tslint-sonarts',
'tslint-plugin-prettier',
'tslint-config-prettier',
],
linterOptions: {
exclude: ['src/components.d.ts'],
},
rules: {
prettier: true,
// See links for details:
// https://palantir.github.io/tslint/rules/
// https://github.com/buzinas/tslint-eslint-rules#rules-copied-from-the-eslint-website
//
// Possible Errors
'no-conditional-assignment': true,
'no-console': true,
'no-constant-condition': true,
'no-control-regex': true,
'no-debugger': true,
'no-duplicate-case': true,
'no-empty': true,
'no-empty-character-class': true,
'no-ex-assign': true,
'no-extra-boolean-cast': true,
'no-extra-semi': true,
'no-implicit-dependencies': [true],
'no-inner-declarations': true,
'no-invalid-regexp': true,
'no-regex-spaces': true,
'no-unexpected-multiline': true,
'no-unsafe-finally': true,
'ter-no-irregular-whitespace': true,
'ter-no-sparse-arrays': true,
'trailing-comma': [
true,
{
esSpecCompliant: true,
multiline: {
arrays: 'always',
functions: 'never',
objects: 'always',
typeLiterals: 'ignore',
},
},
],
'use-isnan': true,
'valid-jsdoc': true,
'valid-typeof': true,
// Best Practices
ban: [true, ['alert']],
curly: 'all',
'cyclomatic-complexity': ['warn', { max: 2 }],
forin: true,
'label-position': true,
'no-arg': true,
'no-construct': true,
'no-duplicate-variable': true,
'no-empty': true,
'no-eval': true,
'no-invalid-this': true,
'no-magic-numbers': true,
'no-multi-spaces': true,
'no-string-throw': true,
'no-submodule-imports': [true, '@stencil/core'],
'no-switch-case-fall-through': true,
'no-unused-expression': true,
'no-unused-expression': true,
radix: true,
'switch-default': true,
'ter-no-proto': true,
'ter-no-script-url': true,
'ter-no-self-compare': true,
'triple-equals': true,
// Variables
'no-shadowed-variable': true,
// Style
'arrow-return-shorthand': false,
'object-literal-sort-keys': false,
// ECMAScript 6
'no-var-keyword': true,
'object-literal-shorthand': [true, 'never'],
'prefer-const': true,
'ter-arrow-body-style': [true, 'always'],
'ter-prefer-arrow-callback': [true],
// See link for details:
// https://www.npmjs.com/package/tslint-react#rules
//
// JSX
// It seems like `jsx-key` is only relevant in React.
// Components built in Stencil will redraw the whole
// component on any change in the data.
'jsx-key': false,
'jsx-no-bind': false,
'jsx-no-lambda': false,
'jsx-no-multiline-js': false,
'jsx-no-string-ref': true,
'jsx-self-close': true,
'jsx-use-translation-function': false,
'jsx-wrap-multiline': true,
},
};