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

Breaking: typescript-estree to 7.0.0 and typescript to 3.2.1 #584

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ _test.js
.vscode
yarn.lock
.eslint-release-info.json
.idea
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ The following additional configuration options are available by specifying them

We will always endeavor to support the latest stable version of TypeScript.

The version of TypeScript currently supported by this parser is `~3.1.1`. This is reflected in the `devDependency` requirement within the package.json file, and it is what the tests will be run against. We have an open `peerDependency` requirement in order to allow for experimentation on newer/beta versions of TypeScript.
The version of TypeScript currently supported by this parser is `~3.2.1`. This is reflected in the `devDependency` requirement within the package.json file, and it is what the tests will be run against. We have an open `peerDependency` requirement in order to allow for experimentation on newer/beta versions of TypeScript.

If you use a non-supported version of TypeScript, the parser will log a warning to the console.

Expand Down
26 changes: 7 additions & 19 deletions analyze-scope.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,25 +239,6 @@ class Referencer extends OriginalReferencer {
super.MethodDefinition(node);
}

/**
* Override.
* Don't make variable if `kind === "type"`.
* It doesn't declare variables but declare types.
* @param {VariableDeclaration} node The VariableDeclaration node to visit.
* @returns {void}
*/
VariableDeclaration(node) {
if (node.kind !== "type") {
super.VariableDeclaration(node);
return;
}

// To detect typeof.
this.typeMode = true;
this.visitChildren(node);
this.typeMode = false;
}

/**
* Don't create the reference object for the key if not computed.
* @param {TSEmptyBodyFunctionDeclaration} node The TSEmptyBodyFunctionDeclaration node to visit.
Expand Down Expand Up @@ -337,6 +318,7 @@ class Referencer extends OriginalReferencer {
this.visit(returnType);
this.typeMode = upperTypeMode;
}

TSEmptyBodyDeclareFunction(node) {
this.TSEmptyBodyFunctionDeclaration(node);
}
Expand Down Expand Up @@ -556,6 +538,12 @@ class Referencer extends OriginalReferencer {
this.visit(body);
}

TSTypeAliasDeclaration(node) {
this.typeMode = true;
this.visitChildren(node);
this.typeMode = false;
}

/**
* Process the module block.
* @param {TSModuleBlock} node The TSModuleBlock node to visit.
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"dependencies": {
"eslint-scope": "^4.0.0",
"eslint-visitor-keys": "^1.0.0",
"typescript-estree": "5.3.0"
"typescript-estree": "^7.0.0"
},
"devDependencies": {
"eslint": "^4.19.1",
Expand All @@ -57,7 +57,7 @@
"npm-license": "0.3.3",
"shelljs": "0.8.2",
"shelljs-nodecli": "0.1.1",
"typescript": "~3.1.1"
"typescript": "~3.2.1"
},
"jest": {
"testEnvironment": "node",
Expand Down
4 changes: 2 additions & 2 deletions parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ exports.parseForESLint = function parseForESLint(code, options) {
enter: node => {
switch (node.type) {
// Just for backward compatibility.
case "DeclareFunction":
case "TSDeclareFunction":
if (!node.body) {
node.type = `TSEmptyBody${node.type}`;
node.type = "TSEmptyBodyDeclareFunction";
}
break;

Expand Down
1 change: 1 addition & 0 deletions tests/fixtures/ecma-features/bigIntLiterals/binary.src.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0b1n;
1 change: 1 addition & 0 deletions tests/fixtures/ecma-features/bigIntLiterals/decimal.src.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1n;
1 change: 1 addition & 0 deletions tests/fixtures/ecma-features/bigIntLiterals/hex.src.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0x1n;
1 change: 1 addition & 0 deletions tests/fixtures/ecma-features/bigIntLiterals/octal.src.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0o1n;
1 change: 1 addition & 0 deletions tests/fixtures/scope-analysis/type-alias.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
type foo = string
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
"devDependencies": {
"eslint": "4.19.1",
"jest": "23.1.0",
"typescript": "~3.1.1"
"typescript": "~3.2.1"
}
}
}
4 changes: 2 additions & 2 deletions tests/integration/jsdoc-indent-issues-344-422/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
"devDependencies": {
"eslint": "4.19.1",
"jest": "23.1.0",
"typescript": "~3.1.1"
"typescript": "~3.2.1"
}
}
}
4 changes: 2 additions & 2 deletions tests/integration/method-overloads-issue-389/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
"devDependencies": {
"eslint": "4.19.1",
"jest": "23.1.0",
"typescript": "~3.1.1"
"typescript": "~3.2.1"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
"devDependencies": {
"eslint": "4.19.1",
"jest": "23.1.0",
"typescript": "~3.1.1"
"typescript": "~3.2.1"
}
}
}
4 changes: 2 additions & 2 deletions tests/integration/range-error-indent-issue-333/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
"devDependencies": {
"eslint": "4.19.1",
"jest": "23.1.0",
"typescript": "~3.1.1"
"typescript": "~3.2.1"
}
}
}
Loading