@putout/engine-parser 4.3.0 → 4.6.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.
@@ -8,15 +8,13 @@ const tenko = require('./parsers/tenko');
8
8
  const secondChance = require('./second-chance');
9
9
 
10
10
  const isObject = (a) => typeof a === 'object';
11
- const putoutEditorDefaults = {
12
- isTS: true,
13
- };
14
11
 
15
- module.exports = (source, parser, {isTS, isFlow} = putoutEditorDefaults) => {
12
+ module.exports = (source, parser, {isTS, isFlow, isJSX}) => {
16
13
  const options = {
17
14
  parser,
18
15
  isTS,
19
16
  isFlow,
17
+ isJSX,
20
18
  };
21
19
 
22
20
  return secondChance(customParse, source, options, {
package/lib/parse.js CHANGED
@@ -12,6 +12,7 @@ function parse(source, options) {
12
12
  parser,
13
13
  isTS,
14
14
  isFlow,
15
+ isJSX,
15
16
  } = options || {};
16
17
 
17
18
  const ast = recast.parse(source, {
@@ -19,18 +20,20 @@ function parse(source, options) {
19
20
  parser,
20
21
  isTS,
21
22
  isFlow,
23
+ isJSX,
22
24
  }),
23
25
  });
24
26
 
25
27
  return ast;
26
28
  }
27
29
 
28
- function getParser({parser = 'babel', isTS, isFlow}) {
30
+ function getParser({parser = 'babel', isTS, isFlow, isJSX}) {
29
31
  return {
30
32
  parse(source) {
31
33
  return toBabel(customParser(source, parser, {
32
34
  isTS,
33
35
  isFlow,
36
+ isJSX,
34
37
  }));
35
38
  },
36
39
  };
@@ -3,5 +3,6 @@
3
3
  module.exports = {
4
4
  allowReturnOutsideFunction: true,
5
5
  allowUndeclaredExports: true,
6
+ allowImportExportEverywhere: true,
6
7
  };
7
8
 
@@ -12,7 +12,6 @@ module.exports = [
12
12
  'numericSeparator',
13
13
  'exportDefaultFrom',
14
14
  'throwExpressions',
15
- 'topLevelAwait',
16
15
  ['recordAndTuple', {
17
16
  recordAndTupleSyntaxType: 'hash',
18
17
  syntaxType: 'hash',
package/package.json CHANGED
@@ -1,13 +1,17 @@
1
1
  {
2
2
  "name": "@putout/engine-parser",
3
- "version": "4.3.0",
3
+ "version": "4.6.0",
4
4
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
5
5
  "description": "putout parser",
6
6
  "homepage": "http://github.com/coderaiser/putout",
7
- "main": "lib/parser.js",
7
+ "main": "./lib/parser.js",
8
8
  "release": false,
9
9
  "tag": false,
10
10
  "changelog": false,
11
+ "exports": {
12
+ ".": "./lib/parser.js",
13
+ "./babel/options": "./lib/parsers/babel/options.js"
14
+ },
11
15
  "repository": {
12
16
  "type": "git",
13
17
  "url": "git://github.com/coderaiser/putout.git"
@@ -24,7 +28,7 @@
24
28
  },
25
29
  "dependencies": {
26
30
  "@babel/generator": "^7.12.5",
27
- "@babel/parser": "^7.12.5",
31
+ "@babel/parser": "^7.15.0",
28
32
  "@babel/template": "^7.10.4",
29
33
  "@babel/types": "^7.12.6",
30
34
  "@putout/recast": "^1.1.0",
@@ -42,10 +46,10 @@
42
46
  "acorn-jsx": "^5.0.2",
43
47
  "acorn-stage3": "^4.0.0",
44
48
  "c8": "^7.5.0",
45
- "eslint": "^7.0.0",
49
+ "eslint": "^8.0.1",
46
50
  "eslint-plugin-node": "^11.0.0",
47
- "eslint-plugin-putout": "^7.0.0",
48
- "espree": "^7.0.0",
51
+ "eslint-plugin-putout": "^11.0.0",
52
+ "espree": "^9.0.0",
49
53
  "esprima": "^4.0.1",
50
54
  "just-camel-case": "^4.0.2",
51
55
  "lerna": "^4.0.0",
@@ -53,7 +57,7 @@
53
57
  "montag": "^1.0.0",
54
58
  "nodemon": "^2.0.1",
55
59
  "putout": "*",
56
- "supertape": "^5.0.0",
60
+ "supertape": "^6.0.0",
57
61
  "tenko": "^2.0.0",
58
62
  "try-catch": "^3.0.0"
59
63
  },