hermes-transform 0.23.1 → 0.25.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.
@@ -12,10 +12,16 @@ exports.isValidModuleDeclarationParent = isValidModuleDeclarationParent;
12
12
  * LICENSE file in the root directory of this source tree.
13
13
  *
14
14
  *
15
- * @format
15
+ * @noformat
16
16
  */
17
- // $FlowFixMe[deprecated-type]
18
- function isModuleDeclaration(node) {
17
+ function isModuleDeclaration(node)
18
+ /*: node is (
19
+ | ImportDeclaration
20
+ | ExportNamedDeclaration
21
+ | ExportDefaultDeclaration
22
+ | ExportAllDeclaration
23
+ ) */
24
+ {
19
25
  return node.type === 'ImportDeclaration' || node.type === 'ExportNamedDeclaration' || node.type === 'ExportDefaultDeclaration' || node.type === 'ExportAllDeclaration';
20
26
  }
21
27
 
@@ -5,14 +5,34 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
7
  * @flow strict-local
8
- * @format
8
+ * @noformat
9
9
  */
10
10
 
11
- import type {ESNode, ModuleDeclaration, Statement} from 'hermes-estree';
11
+ import type {
12
+ ESNode,
13
+ // Used in flow comments
14
+ // eslint-disable-next-line no-unused-vars
15
+ ExportAllDeclaration,
16
+ // Used in flow comments
17
+ // eslint-disable-next-line no-unused-vars
18
+ ExportDefaultDeclaration,
19
+ // Used in flow comments
20
+ // eslint-disable-next-line no-unused-vars
21
+ ExportNamedDeclaration,
22
+ // Used in flow comments
23
+ // eslint-disable-next-line no-unused-vars
24
+ ImportDeclaration,
25
+ ModuleDeclaration,
26
+ Statement,
27
+ } from 'hermes-estree';
12
28
  import type {DetachedNode} from '../../../detachedNode';
13
29
 
14
- // $FlowFixMe[deprecated-type]
15
- function isModuleDeclaration(node: ESNode): boolean %checks {
30
+ function isModuleDeclaration(node: ESNode) /*: node is (
31
+ | ImportDeclaration
32
+ | ExportNamedDeclaration
33
+ | ExportDefaultDeclaration
34
+ | ExportAllDeclaration
35
+ ) */ {
16
36
  return (
17
37
  node.type === 'ImportDeclaration' ||
18
38
  node.type === 'ExportNamedDeclaration' ||
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hermes-transform",
3
- "version": "0.23.1",
3
+ "version": "0.25.0",
4
4
  "description": "Tools built on top of Hermes-ESTree to enable codebase transformation",
5
5
  "main": "dist/index.js",
6
6
  "license": "MIT",
@@ -12,14 +12,14 @@
12
12
  "@babel/code-frame": "^7.16.0",
13
13
  "esquery": "^1.4.0",
14
14
  "flow-enums-runtime": "^0.0.6",
15
- "hermes-eslint": "0.23.1",
16
- "hermes-estree": "0.23.1",
17
- "hermes-parser": "0.23.1",
15
+ "hermes-eslint": "0.25.0",
16
+ "hermes-estree": "0.25.0",
17
+ "hermes-parser": "0.25.0",
18
18
  "string-width": "4.2.3"
19
19
  },
20
20
  "peerDependencies": {
21
21
  "prettier": "^3.0.0 || ^2.7.1",
22
- "prettier-plugin-hermes-parser": "0.23.1"
22
+ "prettier-plugin-hermes-parser": "0.25.0"
23
23
  },
24
24
  "files": [
25
25
  "dist",