Skip to content
This repository has been archived by the owner on Jan 19, 2019. It is now read-only.

Commit

Permalink
[DEPS] Upgrade typescript-eslint-parser to 17.0.1 (#169)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
armano2 authored and bradzacher committed Nov 17, 2018
1 parent 1090947 commit f6041a6
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ versions.json
/packages/**/node_modules
/.vscode
.sublimelinterrc
yarn.lock
7 changes: 6 additions & 1 deletion lib/rules/no-type-alias.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,12 @@ module.exports = {
"in-intersections",
"in-unions-and-intersections"
];
const aliasTypes = ["TSLastTypeNode", "TSArrayType", "TSTypeReference"];
const aliasTypes = [
"TSLastTypeNode",
"TSArrayType",
"TSTypeReference",
"TSLiteralType"
];

//----------------------------------------------------------------------
// Helpers
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
"lint-staged": "^6.0.0",
"mocha": "^4.0.1",
"prettier": "^1.11.1",
"typescript": "~2.8.1",
"typescript-eslint-parser": "^15.0.0"
"typescript": "~2.9",
"typescript-eslint-parser": "^17.0.1"
},
"lint-staged": {
"*.js": [
Expand Down
35 changes: 35 additions & 0 deletions tests/lib/rules/explicit-member-accessibility.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,16 @@ class Test {
public getX () {
return this.x
}
}
`
},
{
filename: "test.ts",
code: `
class Test {
protected name: string
protected foo?: string
public "foo-bar"?: string
}
`
},
Expand Down Expand Up @@ -82,6 +92,31 @@ class Test {
column: 3
}
]
},
{
filename: "test.ts",
code: `
class Test {
x?: number
getX? () {
return this.x
}
}
`,
errors: [
{
message:
"Missing accessibility modifier on class property x.",
line: 3,
column: 3
},
{
message:
"Missing accessibility modifier on method definition getX.",
line: 4,
column: 3
}
]
}
]
});
1 change: 1 addition & 0 deletions tests/lib/rules/member-ordering.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ interface Foo {
D: string;
E: string;
F: string;
G?: string;
J();
K();
L();
Expand Down
11 changes: 11 additions & 0 deletions tests/lib/rules/no-type-alias.js
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,17 @@ type Foo<T> = {
};
`,
options: [{ allowMappedTypes: "in-intersections" }]
},
{
code: `export type ClassValue = string | number | ClassDictionary | ClassArray | undefined | null | false;`,
options: [
{
allowAliases: "in-unions-and-intersections",
allowCallbacks: true,
allowLiterals: "in-unions-and-intersections",
allowMappedTypes: "in-unions-and-intersections"
}
]
}
],
invalid: [
Expand Down

0 comments on commit f6041a6

Please sign in to comment.