Skip to content

Commit 98e0cfa

Browse files
committed
feat(compiler): added API IInlineCompiler.addPredefinedType
1 parent ad48503 commit 98e0cfa

18 files changed

+2132
-1489
lines changed

.eslintrc

Lines changed: 86 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"brace-style": "off",
2525
"@typescript-eslint/brace-style": ["error", "stroustrup", { "allowSingleLine": true }],
2626
"camelcase": "off",
27+
"max-len": ["error", 120],
2728
"@typescript-eslint/ban-types": ["error", {
2829
"types": {
2930

@@ -46,7 +47,6 @@
4647
}
4748
}],
4849
"no-extra-semi": "off",
49-
"prefer-const": "off",
5050
"@typescript-eslint/no-extra-semi": ["error"],
5151
"@typescript-eslint/no-base-to-string": ["warn"],
5252
"@typescript-eslint/await-thenable": ["error"],
@@ -58,26 +58,59 @@
5858
"@typescript-eslint/no-empty-function": "error",
5959
"@typescript-eslint/no-empty-interface": "error",
6060
"@typescript-eslint/prefer-for-of": "error",
61+
"@typescript-eslint/non-nullable-type-assertion-style": "error",
62+
"@typescript-eslint/object-curly-spacing": ["error", "always"],
63+
"@typescript-eslint/prefer-readonly": "error",
6164
"@typescript-eslint/prefer-nullish-coalescing": "error",
65+
"@typescript-eslint/prefer-literal-enum-member": ["error", {
66+
"allowBitwiseExpressions": true
67+
}],
6268
"@typescript-eslint/prefer-function-type": "error",
69+
"@typescript-eslint/prefer-reduce-type-parameter": "error",
6370
"@typescript-eslint/prefer-includes": "error",
6471
"@typescript-eslint/prefer-string-starts-ends-with": "error",
72+
"@typescript-eslint/prefer-return-this-type": "error",
6573
"@typescript-eslint/prefer-regexp-exec": "error",
6674
"@typescript-eslint/prefer-optional-chain": "error",
6775
"@typescript-eslint/no-extra-parens": "off",
6876
"@typescript-eslint/no-extra-non-null-assertion": "error",
6977
"@typescript-eslint/adjacent-overload-signatures": "error",
7078
"@typescript-eslint/no-for-in-array": "error",
7179
"@typescript-eslint/default-param-last": "error",
80+
"@typescript-eslint/no-invalid-void-type": "error",
81+
"no-loss-of-precision": "off",
82+
"@typescript-eslint/no-loss-of-precision": ["error"],
7283
"@typescript-eslint/explicit-member-accessibility": "error",
7384
"@typescript-eslint/explicit-function-return-type": ["error", {
7485
"allowExpressions": true
7586
}],
87+
"keyword-spacing": "off",
88+
"@typescript-eslint/consistent-indexed-object-style": ["error", "record"],
89+
"@typescript-eslint/keyword-spacing": ["error"],
90+
"no-magic-numbers": "off",
91+
"@typescript-eslint/no-magic-numbers": [
92+
"off",
93+
{
94+
"ignoreEnums": true,
95+
"ignoreNumericLiteralTypes": true
96+
}
97+
],
98+
"lines-between-class-members": "off",
99+
"@typescript-eslint/lines-between-class-members": ["error"],
76100
"@typescript-eslint/explicit-module-boundary-types": "error",
101+
"@typescript-eslint/no-confusing-non-null-assertion": "error",
102+
"@typescript-eslint/no-confusing-void-expression": "error",
77103
"@typescript-eslint/no-misused-new": "error",
78104
"@typescript-eslint/no-misused-promises": "error",
105+
"@typescript-eslint/no-non-null-asserted-optional-chain": "error",
79106
"@typescript-eslint/no-require-imports": "warn",
107+
"no-invalid-this": "off",
108+
"@typescript-eslint/no-invalid-this": ["error"],
80109
"@typescript-eslint/consistent-type-definitions": ["error", "interface"],
110+
"no-redeclare": "off",
111+
"@typescript-eslint/no-redeclare": ["error"],
112+
"no-duplicate-imports": "off",
113+
"@typescript-eslint/no-duplicate-imports": ["error"],
81114
"func-call-spacing": "off",
82115
"@typescript-eslint/func-call-spacing": ["error", "never"],
83116
"@typescript-eslint/no-namespace": ["error", {
@@ -97,19 +130,47 @@
97130
}],
98131
"no-unused-expressions": "off",
99132
"@typescript-eslint/no-unused-expressions": ["error"],
133+
// "@typescript-eslint/no-unsafe-argument": ["error"],
134+
// "@typescript-eslint/no-unsafe-call": ["error"],
135+
// "@typescript-eslint/no-unsafe-member-access": ["error"],
136+
// "@typescript-eslint/no-unsafe-assignment": ["error"],
100137
"no-useless-constructor": "off",
101138
"@typescript-eslint/no-useless-constructor": ["error"],
102139
"no-constant-condition":"off",
103140
"comma-spacing": "off",
104141
"@typescript-eslint/comma-spacing": ["error"],
142+
"@typescript-eslint/prefer-ts-expect-error": ["error"],
143+
"require-await": "off",
144+
"@typescript-eslint/require-await": ["error"],
145+
"@typescript-eslint/restrict-plus-operands": ["off", {
146+
"checkCompoundAssignments": true
147+
}],
105148
"@typescript-eslint/unified-signatures": ["error"],
106149
"semi": "off",
107150
"@typescript-eslint/semi": ["error"],
108-
"@typescript-eslint/no-use-before-define": ["error"],
151+
"@typescript-eslint/restrict-template-expressions": ["off", {
152+
"allowNumber": true,
153+
"allowString": true,
154+
"allowBoolean": false,
155+
"allowAny": false,
156+
"allowNullish": false
157+
}],
158+
"@typescript-eslint/return-await": ["error", "in-try-catch"],
159+
160+
"@typescript-eslint/no-use-before-define": ["error", {
161+
"enums": true,
162+
"functions": false,
163+
"classes": false,
164+
"variables": true
165+
}],
109166
"@typescript-eslint/no-unnecessary-type-assertion": ["error"],
167+
"@typescript-eslint/no-unnecessary-type-constraint": ["error"],
110168
"@typescript-eslint/no-unnecessary-type-arguments": ["error"],
169+
"@typescript-eslint/no-unnecessary-qualifier": ["error"],
111170
"@typescript-eslint/unbound-method": ["error"],
171+
"@typescript-eslint/switch-exhaustiveness-check": ["error"],
112172
"@typescript-eslint/type-annotation-spacing": ["error"],
173+
"@typescript-eslint/no-var-requires": ["error"],
113174
"@typescript-eslint/no-unnecessary-condition": ["off"],
114175
"@typescript-eslint/no-unnecessary-boolean-literal-compare": ["warn"],
115176
"@typescript-eslint/member-ordering": ["off"],
@@ -125,6 +186,12 @@
125186
"ignoreRestArgs": true
126187
}],
127188
"space-before-function-paren": "off",
189+
"space-unary-ops": ["error", {
190+
"words": true,
191+
"nonwords": false
192+
}],
193+
"arrow-spacing": ["error"],
194+
"space-infix-ops": ["error"],
128195
"@typescript-eslint/space-before-function-paren": ["error", {
129196
"anonymous": "never",
130197
"named": "never",
@@ -147,6 +214,12 @@
147214
"format": ["camelCase"],
148215
"leadingUnderscore": "forbid"
149216
},
217+
{
218+
"selector": "parameter",
219+
"format": ["camelCase"],
220+
"modifiers": ["unused"],
221+
"leadingUnderscore": "allow"
222+
},
150223
{
151224
"selector": "parameter",
152225
"format": ["camelCase"]
@@ -185,10 +258,19 @@
185258
"selector": "enumMember",
186259
"format": ["UPPER_CASE"]
187260
},
261+
{
262+
"selector": "objectLiteralProperty",
263+
"format": []
264+
},
188265
{
189266
"selector": "variable",
190267
"format": ["camelCase", "UPPER_CASE"]
191268
},
269+
{
270+
"selector": "variable",
271+
"modifiers": ["const"],
272+
"format": ["UPPER_CASE", "camelCase"]
273+
},
192274
{
193275
"selector": "typeParameter",
194276
"format": ["PascalCase"],
@@ -243,7 +325,8 @@
243325
],
244326
"quotes": [
245327
"error",
246-
"single"
328+
"single",
329+
{ "avoidEscape": true, "allowTemplateLiterals": true }
247330
]
248331
}
249332
}

CHANGES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## v1.1.0
44

5+
- Added API `IInlineCompiler.addPredefinedType`.
6+
7+
## v1.2.0
8+
59
- Allows characters `.:-` in predefined type names.
610
- Removed the distribution of AMD/SystemJS modules.
711
- Improved the output of `$.or` and `$.and`.

0 commit comments

Comments
 (0)