Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update typescript-eslint to 2.6.0 #1702

Merged
merged 9 commits into from Oct 29, 2019
6 changes: 3 additions & 3 deletions eslint-bridge/package.json
Expand Up @@ -40,9 +40,9 @@
"typescript": "3.5.3"
},
"dependencies": {
"@typescript-eslint/eslint-plugin": "2.0.0",
"@typescript-eslint/experimental-utils": "2.0.0",
"@typescript-eslint/parser": "2.0.0",
"@typescript-eslint/eslint-plugin": "2.4.0",
"@typescript-eslint/experimental-utils": "2.4.0",
"@typescript-eslint/parser": "2.4.0",
"babel-eslint": "10.0.1",
"body-parser": "1.18.3",
"eslint": "5.16.0",
Expand Down
4 changes: 2 additions & 2 deletions eslint-bridge/src/parser.ts
Expand Up @@ -27,7 +27,7 @@ import * as VueJS from "vue-eslint-parser";
// still we might consider extending this range
// if everything which we need is working on older/newer versions
const TYPESCRIPT_MINIMUM_VERSION = "3.2.1";
const TYPESCRIPT_MAXIMUM_VERSION = "3.6.0";
const TYPESCRIPT_MAXIMUM_VERSION = "3.8.0";

export const PARSER_CONFIG_MODULE: Linter.ParserOptions = {
tokens: true,
Expand Down Expand Up @@ -59,7 +59,7 @@ export type Parse = (
export function loggerFn(msg: string) {
if (
msg.includes(
`WARNING: You are currently running a version of TypeScript which is not officially supported by typescript-estree.`,
`You are currently running a version of TypeScript which is not officially supported by`,
)
) {
const currentVersionMatch = msg.match(/YOUR TYPESCRIPT VERSION: (.+)\n/);
Expand Down
9 changes: 5 additions & 4 deletions eslint-bridge/tests/parser.test.ts
Expand Up @@ -14,6 +14,7 @@ import * as espree from "espree";
import { SourceCode } from "eslint";
import { ParsingError } from "../src/analyzer";
import visit from "../src/utils/visitor";
import * as path from "path";

describe("parseJavaScriptSourceFile", () => {
beforeEach(() => {
Expand Down Expand Up @@ -132,14 +133,14 @@ describe("parseTypeScriptSourceFile", () => {
});

it("should return ParsingError with undefined line when file is not part of typescript project", () => {
const file = __dirname + "/fixtures/ts-project/excluded.ts";
const file = path.join(path.basename(__dirname), "/fixtures/ts-project/excluded.ts");
const parsingError = parseTypeScriptSourceFile(`if (b == 0) {}`, file, [
__dirname + "/fixtures/ts-project/tsconfig.json",
]) as ParsingError;
expect(parsingError).toBeDefined();
expect(parsingError.line).toBeUndefined();
expect(parsingError.message).toEqual(
`If \"parserOptions.project\" has been set for @typescript-eslint/parser, ${file} must be included in at least one of the projects provided.`,
`\"parserOptions.project\" has been set for @typescript-eslint/parser.\nThe file does not match your project config: ${file}.\nThe file must be included in at least one of the projects provided.`,
);
});

Expand All @@ -166,11 +167,11 @@ describe("parseTypeScriptSourceFile", () => {

loggerFn(
`WARNING: You are currently running a version of TypeScript which is not officially supported by typescript-estree.
YOUR TYPESCRIPT VERSION: 3.6.0
YOUR TYPESCRIPT VERSION: 3.8.5
`,
);
expect(console.log).toHaveBeenCalledWith(
"WARN You are using version of TypeScript 3.6.0 which is not officially supported; supported versions >=3.2.1 <3.6.0",
"WARN You are using version of TypeScript 3.8.5 which is not officially supported; supported versions >=3.2.1 <3.8.0",
);

jest.resetAllMocks();
Expand Down