@putout/engine-parser 11.3.0 → 11.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,15 +4,15 @@ const once = require('once');
4
4
 
5
5
  const initAcorn = once(() => {
6
6
  const {Parser} = require('acorn');
7
- const jsx = require('acorn-jsx');
7
+
8
8
  const stage3 = require('acorn-stage3');
9
+ const typescript = require('acorn-typescript').default;
9
10
 
10
- return Parser.extend(stage3, jsx());
11
+ return Parser.extend(typescript(), stage3);
11
12
  });
12
13
 
13
14
  module.exports.parse = function acornParse(source) {
14
15
  const parser = initAcorn();
15
-
16
16
  const options = {
17
17
  locations: true,
18
18
  comment: true,
@@ -21,6 +21,7 @@ module.exports.parse = function acornParse(source) {
21
21
  allowAwaitOutsideFunction: true,
22
22
  allowReturnOutsideFunction: true,
23
23
  allowImportExportEverywhere: true,
24
+ preserveParens: true,
24
25
  };
25
26
 
26
27
  const tokensToAvoidEsprima = Array.from(parser.tokenizer(source, options));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/engine-parser",
3
- "version": "11.3.0",
3
+ "version": "11.4.0",
4
4
  "type": "commonjs",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "🐊Putout parser",
@@ -47,8 +47,8 @@
47
47
  ],
48
48
  "devDependencies": {
49
49
  "acorn": "^8.1.1",
50
- "acorn-jsx": "^5.0.2",
51
50
  "acorn-stage3": "^4.0.0",
51
+ "acorn-typescript": "^1.4.13",
52
52
  "c8": "^10.0.0",
53
53
  "eslint": "^9.0.0",
54
54
  "eslint-plugin-n": "^17.0.0",