Skip to content

Commit 721c58e

Browse files
armano2JamesHenry
authored andcommitted
[DEPS] Upgrade typescript-eslint-parser to 17.0.1 (typescript-eslint#169)
* Upgrade typescript-eslint-parser to 16.0.1 * Add test case * typescript-eslint-parser 17.0.1 Add addition tests for eslint/typescript-eslint-parser#491
1 parent b5a19ec commit 721c58e

File tree

6 files changed

+56
-3
lines changed

6 files changed

+56
-3
lines changed

Diff for: packages/eslint-plugin-typescript/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ versions.json
1414
/packages/**/node_modules
1515
/.vscode
1616
.sublimelinterrc
17+
yarn.lock

Diff for: packages/eslint-plugin-typescript/lib/rules/no-type-alias.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,12 @@ module.exports = {
9191
"in-intersections",
9292
"in-unions-and-intersections"
9393
];
94-
const aliasTypes = ["TSLastTypeNode", "TSArrayType", "TSTypeReference"];
94+
const aliasTypes = [
95+
"TSLastTypeNode",
96+
"TSArrayType",
97+
"TSTypeReference",
98+
"TSLiteralType"
99+
];
95100

96101
//----------------------------------------------------------------------
97102
// Helpers

Diff for: packages/eslint-plugin-typescript/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
"lint-staged": "^6.0.0",
3535
"mocha": "^4.0.1",
3636
"prettier": "^1.11.1",
37-
"typescript": "~2.8.1",
38-
"typescript-eslint-parser": "^15.0.0"
37+
"typescript": "~2.9",
38+
"typescript-eslint-parser": "^17.0.1"
3939
},
4040
"lint-staged": {
4141
"*.js": [

Diff for: packages/eslint-plugin-typescript/tests/lib/rules/explicit-member-accessibility.js

+35
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,16 @@ class Test {
3030
public getX () {
3131
return this.x
3232
}
33+
}
34+
`
35+
},
36+
{
37+
filename: "test.ts",
38+
code: `
39+
class Test {
40+
protected name: string
41+
protected foo?: string
42+
public "foo-bar"?: string
3343
}
3444
`
3545
},
@@ -82,6 +92,31 @@ class Test {
8292
column: 3
8393
}
8494
]
95+
},
96+
{
97+
filename: "test.ts",
98+
code: `
99+
class Test {
100+
x?: number
101+
getX? () {
102+
return this.x
103+
}
104+
}
105+
`,
106+
errors: [
107+
{
108+
message:
109+
"Missing accessibility modifier on class property x.",
110+
line: 3,
111+
column: 3
112+
},
113+
{
114+
message:
115+
"Missing accessibility modifier on method definition getX.",
116+
line: 4,
117+
column: 3
118+
}
119+
]
85120
}
86121
]
87122
});

Diff for: packages/eslint-plugin-typescript/tests/lib/rules/member-ordering.js

+1
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ interface Foo {
161161
D: string;
162162
E: string;
163163
F: string;
164+
G?: string;
164165
J();
165166
K();
166167
L();

Diff for: packages/eslint-plugin-typescript/tests/lib/rules/no-type-alias.js

+11
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,17 @@ type Foo<T> = {
496496
};
497497
`,
498498
options: [{ allowMappedTypes: "in-intersections" }]
499+
},
500+
{
501+
code: `export type ClassValue = string | number | ClassDictionary | ClassArray | undefined | null | false;`,
502+
options: [
503+
{
504+
allowAliases: "in-unions-and-intersections",
505+
allowCallbacks: true,
506+
allowLiterals: "in-unions-and-intersections",
507+
allowMappedTypes: "in-unions-and-intersections"
508+
}
509+
]
499510
}
500511
],
501512
invalid: [

0 commit comments

Comments
 (0)