diff --git a/README.md b/README.md index f2c4442..97b92d1 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/package.json b/package.json index fc21e87..f24b437 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "dependencies": { "eslint-scope": "^4.0.0", "eslint-visitor-keys": "^1.0.0", - "typescript-estree": "5.3.0" + "typescript-estree": "^6.0.0" }, "devDependencies": { "eslint": "^4.19.1", @@ -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", diff --git a/tests/fixtures/ecma-features/bigIntLiterals/binary.src.js b/tests/fixtures/ecma-features/bigIntLiterals/binary.src.js new file mode 100644 index 0000000..2b13801 --- /dev/null +++ b/tests/fixtures/ecma-features/bigIntLiterals/binary.src.js @@ -0,0 +1 @@ +0b1n; diff --git a/tests/fixtures/ecma-features/bigIntLiterals/decimal.src.js b/tests/fixtures/ecma-features/bigIntLiterals/decimal.src.js new file mode 100644 index 0000000..fe03424 --- /dev/null +++ b/tests/fixtures/ecma-features/bigIntLiterals/decimal.src.js @@ -0,0 +1 @@ +1n; diff --git a/tests/fixtures/ecma-features/bigIntLiterals/hex.src.js b/tests/fixtures/ecma-features/bigIntLiterals/hex.src.js new file mode 100644 index 0000000..204f239 --- /dev/null +++ b/tests/fixtures/ecma-features/bigIntLiterals/hex.src.js @@ -0,0 +1 @@ +0x1n; diff --git a/tests/fixtures/ecma-features/bigIntLiterals/octal.src.js b/tests/fixtures/ecma-features/bigIntLiterals/octal.src.js new file mode 100644 index 0000000..f2ce84f --- /dev/null +++ b/tests/fixtures/ecma-features/bigIntLiterals/octal.src.js @@ -0,0 +1 @@ +0o1n; diff --git a/tests/integration/declared-empty-body-functions-issue-162/package.json b/tests/integration/declared-empty-body-functions-issue-162/package.json index 9029571..4944126 100644 --- a/tests/integration/declared-empty-body-functions-issue-162/package.json +++ b/tests/integration/declared-empty-body-functions-issue-162/package.json @@ -8,6 +8,6 @@ "devDependencies": { "eslint": "4.19.1", "jest": "23.1.0", - "typescript": "~3.1.1" + "typescript": "~3.2.1" } -} \ No newline at end of file +} diff --git a/tests/integration/jsdoc-indent-issues-344-422/package.json b/tests/integration/jsdoc-indent-issues-344-422/package.json index 9029571..4944126 100644 --- a/tests/integration/jsdoc-indent-issues-344-422/package.json +++ b/tests/integration/jsdoc-indent-issues-344-422/package.json @@ -8,6 +8,6 @@ "devDependencies": { "eslint": "4.19.1", "jest": "23.1.0", - "typescript": "~3.1.1" + "typescript": "~3.2.1" } -} \ No newline at end of file +} diff --git a/tests/integration/method-overloads-issue-389/package.json b/tests/integration/method-overloads-issue-389/package.json index 9029571..4944126 100644 --- a/tests/integration/method-overloads-issue-389/package.json +++ b/tests/integration/method-overloads-issue-389/package.json @@ -8,6 +8,6 @@ "devDependencies": { "eslint": "4.19.1", "jest": "23.1.0", - "typescript": "~3.1.1" + "typescript": "~3.2.1" } -} \ No newline at end of file +} diff --git a/tests/integration/no-redeclare-overloaded-functions-issue-402/package.json b/tests/integration/no-redeclare-overloaded-functions-issue-402/package.json index 9029571..4944126 100644 --- a/tests/integration/no-redeclare-overloaded-functions-issue-402/package.json +++ b/tests/integration/no-redeclare-overloaded-functions-issue-402/package.json @@ -8,6 +8,6 @@ "devDependencies": { "eslint": "4.19.1", "jest": "23.1.0", - "typescript": "~3.1.1" + "typescript": "~3.2.1" } -} \ No newline at end of file +} diff --git a/tests/integration/range-error-indent-issue-333/package.json b/tests/integration/range-error-indent-issue-333/package.json index 9029571..4944126 100644 --- a/tests/integration/range-error-indent-issue-333/package.json +++ b/tests/integration/range-error-indent-issue-333/package.json @@ -8,6 +8,6 @@ "devDependencies": { "eslint": "4.19.1", "jest": "23.1.0", - "typescript": "~3.1.1" + "typescript": "~3.2.1" } -} \ No newline at end of file +} diff --git a/tests/lib/__snapshots__/ecma-features.js.snap b/tests/lib/__snapshots__/ecma-features.js.snap index 00a985d..9b4e20c 100644 --- a/tests/lib/__snapshots__/ecma-features.js.snap +++ b/tests/lib/__snapshots__/ecma-features.js.snap @@ -9142,6 +9142,398 @@ Object { } `; +exports[`ecmaFeatures fixtures/bigIntLiterals/binary.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 4, + ], + "raw": "0b1n", + "type": "BigIntLiteral", + "value": "0b1", + }, + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "ExpressionStatement", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 4, + ], + "type": "Identifier", + "value": "0b1n", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/bigIntLiterals/decimal.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 2, + ], + "raw": "1n", + "type": "BigIntLiteral", + "value": "1", + }, + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "ExpressionStatement", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 4, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 2, + ], + "type": "Identifier", + "value": "1n", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 3, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/bigIntLiterals/hex.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 4, + ], + "raw": "0x1n", + "type": "BigIntLiteral", + "value": "0x1", + }, + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "ExpressionStatement", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 4, + ], + "type": "Identifier", + "value": "0x1n", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/bigIntLiterals/octal.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 4, + ], + "raw": "0o1n", + "type": "BigIntLiteral", + "value": "0o1", + }, + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "ExpressionStatement", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 4, + ], + "type": "Identifier", + "value": "0o1n", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + exports[`ecmaFeatures fixtures/binaryLiterals/invalid.src 1`] = `"';' expected."`; exports[`ecmaFeatures fixtures/binaryLiterals/lowercase.src 1`] = ` diff --git a/visitor-keys.js b/visitor-keys.js index 40a5e49..c036ea6 100644 --- a/visitor-keys.js +++ b/visitor-keys.js @@ -23,6 +23,7 @@ module.exports = Evk.unionWith({ CallExpression: ["callee", "typeParameters", "arguments"], // Additional Nodes. + BigIntLiteral: [], ClassProperty: ["decorators", "key", "typeAnnotation", "value"], Decorator: ["expression"], TSAbstractClassProperty: ["decorators", "key", "typeAnnotation", "value"],