Skip to content

Commit 170a113

Browse files
authoredSep 10, 2019
feat(ts): compat for typescript-eslint 2 (#114)
* feat(ts): compat for typescript-eslint 2 I based my changes on xojs/eslint-config-xo-typescript@1053f6b and the changelog: https://github.com/typescript-eslint/typescript-eslint/blob/master/CHANGELOG.md#200-2019-08-13 fixes #113 This doesn't seem to be tested anywhere, so :fingers_crossed: haha BREAKING CHANGE: /typescript requires typescript-eslint v2 now * haha prettier you old chap
1 parent 78270f8 commit 170a113

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed
 

Diff for: ‎rules/typescript.js

+8-3
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,18 @@ module.exports = {
33
plugins: ['@typescript-eslint'],
44
rules: {
55
'@typescript-eslint/adjacent-overload-signatures': ['error'],
6-
'@typescript-eslint/array-type': ['error', 'array-simple'],
6+
'@typescript-eslint/array-type': ['error', { default: 'array-simple' }],
77
'@typescript-eslint/ban-types': ['error'],
88
'@typescript-eslint/ban-ts-ignore': ['off'],
99
'@typescript-eslint/camelcase': ['error'],
1010
'@typescript-eslint/class-name-casing': ['error'],
11+
'@typescript-eslint/consistent-type-assertions': [
12+
'error',
13+
{
14+
assertionStyle: 'as',
15+
objectLiteralTypeAssertions: 'allow-as-parameter',
16+
},
17+
],
1118
'@typescript-eslint/explicit-function-return-type': ['off'],
1219
'@typescript-eslint/explicit-member-accessibility': ['error'],
1320
'@typescript-eslint/generic-type-naming': ['error', '^T[A-Z][a-zA-Z]+$'],
@@ -21,7 +28,6 @@ module.exports = {
2128
default: ['static-field'],
2229
},
2330
],
24-
'@typescript-eslint/no-angle-bracket-type-assertion': ['error'],
2531
'@typescript-eslint/no-array-constructor': ['error'],
2632
'@typescript-eslint/no-empty-interface': ['error'],
2733
'@typescript-eslint/no-explicit-any': ['off'],
@@ -31,7 +37,6 @@ module.exports = {
3137
'@typescript-eslint/no-misused-new': ['error'],
3238
'@typescript-eslint/no-namespace': ['error'],
3339
'@typescript-eslint/no-non-null-assertion': ['off'],
34-
'@typescript-eslint/no-object-literal-type-assertion': ['off'],
3540
'@typescript-eslint/no-parameter-properties': ['off'],
3641
'@typescript-eslint/no-require-imports': ['off'],
3742
'@typescript-eslint/no-this-alias': ['off'],

0 commit comments

Comments
 (0)
Please sign in to comment.