diff --git a/userTests/typescript-eslint-parser/fixtures/project/file.ts b/userTests/typescript-eslint-parser/fixtures/project/file.ts new file mode 100644 index 0000000..e69de29 diff --git a/userTests/typescript-eslint-parser/fixtures/project/something.ts b/userTests/typescript-eslint-parser/fixtures/project/something.ts new file mode 100644 index 0000000..3a56b4d --- /dev/null +++ b/userTests/typescript-eslint-parser/fixtures/project/something.ts @@ -0,0 +1 @@ +export const something = () => {}; diff --git a/userTests/typescript-eslint-parser/fixtures/project/tsconfig.json b/userTests/typescript-eslint-parser/fixtures/project/tsconfig.json new file mode 100644 index 0000000..92c0a75 --- /dev/null +++ b/userTests/typescript-eslint-parser/fixtures/project/tsconfig.json @@ -0,0 +1,3 @@ +{ + "compilerOptions": { "types": ["node"] } +} diff --git a/userTests/typescript-eslint-parser/index.ts b/userTests/typescript-eslint-parser/index.ts new file mode 100644 index 0000000..bd0dd79 --- /dev/null +++ b/userTests/typescript-eslint-parser/index.ts @@ -0,0 +1,24 @@ +import * as parser from "@typescript-eslint/parser"; +import * as path from "path"; + +const code = ` +import { something } from '__PLACEHOLDER__'; + +something(); +`; + +const fixturesDirectory = path.resolve(__dirname, "fixtures"); +const projectDirectory = path.resolve(fixturesDirectory, "project"); + +parser + .parseAndGenerateServices(code, { + comment: true, + filePath: path.resolve(projectDirectory, "file.ts"), + loc: true, + moduleResolver: path.resolve(fixturesDirectory, "./moduleResolver.js"), + project: "./tsconfig.json", + range: true, + tokens: true, + tsconfigRootDir: projectDirectory, + }) + .services.program.getSemanticDiagnostics(); diff --git a/userTests/typescript-eslint-parser/package.json b/userTests/typescript-eslint-parser/package.json new file mode 100644 index 0000000..a3eb469 --- /dev/null +++ b/userTests/typescript-eslint-parser/package.json @@ -0,0 +1,12 @@ +{ + "name": "typescript-eslint-parser-test", + "version": "1.0.0", + "description": "", + "main": "index.js", + "author": "", + "license": "Apache-2.0", + "dependencies": { + "@typescript-eslint/parser": "latest", + "typescript": "latest" + } +} diff --git a/userTests/typescript-eslint-parser/tsconfig.json b/userTests/typescript-eslint-parser/tsconfig.json new file mode 100644 index 0000000..6895316 --- /dev/null +++ b/userTests/typescript-eslint-parser/tsconfig.json @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "strict": true, + "types": [] + } +} diff --git a/userTests/typescript-eslint/test.json b/userTests/typescript-eslint/test.json new file mode 100644 index 0000000..9d17d06 --- /dev/null +++ b/userTests/typescript-eslint/test.json @@ -0,0 +1,4 @@ +{ + "cloneUrl": "https://github.com/typescript-eslint/typescript-eslint.git", + "types": [] +}