1 | {
|
2 | // This file is published in the npm package, so projects using typescript-assistant can extend their rules from it.
|
3 | "extends": [
|
4 | "tslint:latest",
|
5 | "./tslint-enabled-microsoft-rules.json",
|
6 | "./tslint-sonarts-rules.json"
|
7 | ],
|
8 | "rules": {
|
9 | // Disabled due to errors:
|
10 | "align": false, // Rule is fixed, fixer/formatter is broken.
|
11 |
|
12 | // Standard tslint rules adjustments to AFAS requirements:
|
13 | "ban-types": {
|
14 | "options": [
|
15 | [ "Object", "Avoid using the `Object` type. Did you mean `object`?" ],
|
16 | [ "Boolean", "Avoid using the `Boolean` type. Did you mean `boolean`?" ],
|
17 | [ "Number", "Avoid using the `Number` type. Did you mean `number`?" ],
|
18 | [ "String", "Avoid using the `String` type. Did you mean `string`?" ],
|
19 | [ "Symbol", "Avoid using the `Symbol` type. Did you mean `symbol`?" ]
|
20 | ]
|
21 | },
|
22 | "max-line-length": [
|
23 | true,
|
24 | {
|
25 | "limit": 160,
|
26 | "ignore-pattern": "^x?it\\("
|
27 | }
|
28 | ],
|
29 | "object-literal-key-quotes": [
|
30 | true,
|
31 | "as-needed"
|
32 | ],
|
33 | "only-arrow-functions": [
|
34 | true,
|
35 | "allow-declarations",
|
36 | "allow-named-functions"
|
37 | ],
|
38 | "prefer-for-of": true,
|
39 | "trailing-comma": [
|
40 | true,
|
41 | {
|
42 | "multiline": "never",
|
43 | "singleline": "never"
|
44 | }
|
45 | ],
|
46 | "triple-equals": true,
|
47 | "quotemark": [
|
48 | true,
|
49 | "single",
|
50 | "avoid-escape"
|
51 | ],
|
52 | "whitespace": [
|
53 | true,
|
54 | "check-branch",
|
55 | "check-decl",
|
56 | "check-operator",
|
57 | "check-module",
|
58 | "check-separator",
|
59 | "check-type"
|
60 | ], // No "check-typecast".
|
61 | "use-default-type-parameter": true,
|
62 | "one-variable-per-declaration": [true, "ignore-for-loop"],
|
63 |
|
64 | // Disabled standard rules.
|
65 | "array-type": false,
|
66 | "arrow-parens": false,
|
67 | "ban-comma-operator": false,
|
68 | "completed-docs": false,
|
69 | "cyclomatic-complexity": false,
|
70 | "file-header": false,
|
71 | "interface-name": false,
|
72 | "match-default-export-name": false,
|
73 | "max-file-line-count": false,
|
74 | "newline-before-return": false,
|
75 | "no-angle-bracket-type-assertion": false,
|
76 | "no-any": false,
|
77 | "no-duplicate-imports": false, // Problems when creating stubs and importing Interfaces
|
78 | "no-empty-interface": false,
|
79 | "no-floating-promises": true,
|
80 | "no-implicit-dependencies": false, // TSA holds several of the dependencies for dependent projects, conflicting with this rule.
|
81 | "no-magic-numbers": false,
|
82 | "no-non-null-assertion": false,
|
83 | "no-object-literal-type-assertion": false,
|
84 | "no-sparse-arrays": false,
|
85 | "no-string-literal": false,
|
86 | "no-submodule-imports": false,
|
87 | "no-unnecessary-callback-wrapper": false, // does not add value
|
88 | "no-unsafe-any": false,
|
89 | "no-unused-expression": false,
|
90 | "no-use-before-declare": false,
|
91 | "no-void-expression": [
|
92 | true,
|
93 | "ignore-arrow-function-shorthand"
|
94 | ],
|
95 | "object-literal-shorthand": false,
|
96 | "object-literal-sort-keys": false,
|
97 | "ordered-imports": false,
|
98 | "prefer-conditional-expression": false,
|
99 | "prefer-const": false,
|
100 | "prefer-object-spread": false,
|
101 | "promise-function-async": false,
|
102 | "strict-boolean-expressions": false,
|
103 | "switch-default": false,
|
104 | "typedef": false,
|
105 | "unified-signatures": false,
|
106 |
|
107 | // Enabled non-standard rules.
|
108 | "file-name-casing": [
|
109 | true,
|
110 | "kebab-case"
|
111 | ],
|
112 | "linebreak-style": [true, "LF"],
|
113 | "no-default-export": true,
|
114 | "no-inferrable-types": true,
|
115 | "no-invalid-this": true,
|
116 | "no-mergeable-namespace": true,
|
117 | "no-null-keyword": true,
|
118 | "restrict-plus-operands": true,
|
119 | "prefer-template": true,
|
120 | "prefer-method-signature": true
|
121 | }
|
122 | }
|