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

Commit ca4b08f

Browse files
committed
add test for #435
1 parent 7ce5d61 commit ca4b08f

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed

tests/lib/scope-analysis.js

+21-3
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,10 @@ describe("TypeScript scope analysis", () => {
172172
});
173173
}
174174

175-
test("https://github.com/eslint/typescript-eslint-parser/issues/416", () => {
176-
const linter = new Linter();
177-
linter.defineParser("typescript-eslint-parser", parser);
175+
const linter = new Linter();
176+
linter.defineParser("typescript-eslint-parser", parser);
178177

178+
test("https://github.com/eslint/typescript-eslint-parser/issues/416", () => {
179179
const code = `
180180
export type SomeThing = {
181181
id: string;
@@ -191,4 +191,22 @@ export type SomeThing = {
191191

192192
assert.deepStrictEqual(messages, []);
193193
});
194+
195+
test("https://github.com/eslint/typescript-eslint-parser/issues/435", () => {
196+
const code = `
197+
interface Foo {
198+
bar: string
199+
}
200+
const bar = 'blah'
201+
`;
202+
const config = {
203+
parser: "typescript-eslint-parser",
204+
rules: {
205+
"no-use-before-define": "error"
206+
}
207+
};
208+
const messages = linter.verify(code, config, { filename: "issue435.ts" });
209+
210+
assert.deepStrictEqual(messages, []);
211+
});
194212
});

0 commit comments

Comments
 (0)