Skip to content

Commit 723651e

Browse files
Add @typescript-eslint/parser and typescript-eslint to user tests (#119)
1 parent c0147a1 commit 723651e

File tree

7 files changed

+50
-0
lines changed

7 files changed

+50
-0
lines changed

userTests/typescript-eslint-parser/fixtures/project/file.ts

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const something = () => {};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"compilerOptions": { "types": ["node"] }
3+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import * as parser from "@typescript-eslint/parser";
2+
import * as path from "path";
3+
4+
const code = `
5+
import { something } from '__PLACEHOLDER__';
6+
7+
something();
8+
`;
9+
10+
const fixturesDirectory = path.resolve(__dirname, "fixtures");
11+
const projectDirectory = path.resolve(fixturesDirectory, "project");
12+
13+
parser
14+
.parseAndGenerateServices(code, {
15+
comment: true,
16+
filePath: path.resolve(projectDirectory, "file.ts"),
17+
loc: true,
18+
moduleResolver: path.resolve(fixturesDirectory, "./moduleResolver.js"),
19+
project: "./tsconfig.json",
20+
range: true,
21+
tokens: true,
22+
tsconfigRootDir: projectDirectory,
23+
})
24+
.services.program.getSemanticDiagnostics();
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"name": "typescript-eslint-parser-test",
3+
"version": "1.0.0",
4+
"description": "",
5+
"main": "index.js",
6+
"author": "",
7+
"license": "Apache-2.0",
8+
"dependencies": {
9+
"@typescript-eslint/parser": "latest",
10+
"typescript": "latest"
11+
}
12+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"compilerOptions": {
3+
"strict": true,
4+
"types": []
5+
}
6+
}

userTests/typescript-eslint/test.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"cloneUrl": "https://github.com/typescript-eslint/typescript-eslint.git",
3+
"types": []
4+
}

0 commit comments

Comments
 (0)