forked from Lundalogik/lime-elements
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtslint.js
131 lines (118 loc) · 3.86 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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
module.exports = {
extends: [
'tslint:latest',
'tslint-react',
'tslint-eslint-rules',
'tslint-sonarts',
'tslint-plugin-prettier',
'tslint-config-prettier',
],
linterOptions: {
exclude: [
'src/components.d.ts',
'src/components/**/examples/**',
'src/**/*.spec.{ts,tsx}',
'src/**/*.e2e.{ts,tsx}',
'src/**/*.test-wrapper.{ts,tsx}',
],
},
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,
// It would be nice to have this enabled, but as long as tslint
// doesn't support whitelisting imports, enabling it will mean
// a minimum of one `tslint:disable-line:no-implicit-dependencies`
// comment in each file.
'no-implicit-dependencies': false,
'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': false,
'no-switch-case-fall-through': 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,
'prefer-conditional-expression': false,
// Variables
'no-shadowed-variable': true,
// Style
'object-literal-sort-keys': false,
'interface-name': false,
'array-type': [true, 'array-simple'],
// ECMAScript 6
'no-var-keyword': true,
'object-literal-shorthand': [true, 'never'],
'prefer-const': true,
'ter-arrow-body-style': false,
'arrow-return-shorthand': false,
'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': true,
'jsx-no-lambda': true,
'jsx-no-multiline-js': false,
'jsx-no-string-ref': true,
'jsx-self-close': true,
'jsx-use-translation-function': true,
'jsx-wrap-multiline': false,
},
};