prettier-plugin-solidity 2.0.0-beta.5 → 2.0.0-beta.6

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prettier-plugin-solidity",
3
- "version": "2.0.0-beta.5",
3
+ "version": "2.0.0-beta.6",
4
4
  "description": "A Prettier Plugin for automatically formatting your Solidity code.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -80,15 +80,15 @@
80
80
  },
81
81
  "homepage": "https://github.com/prettier-solidity/prettier-plugin-solidity#readme",
82
82
  "engines": {
83
- "node": ">=16"
83
+ "node": ">=18"
84
84
  },
85
85
  "devDependencies": {
86
86
  "@babel/code-frame": "^7.26.2",
87
87
  "@types/jest": "^29.5.14",
88
88
  "@types/semver": "^7.5.8",
89
- "@typescript-eslint/eslint-plugin": "^8.18.1",
90
- "@typescript-eslint/parser": "^8.18.1",
91
- "c8": "^9.1.0",
89
+ "@typescript-eslint/eslint-plugin": "^8.19.1",
90
+ "@typescript-eslint/parser": "^8.19.1",
91
+ "c8": "^10.1.3",
92
92
  "cross-env": "^7.0.3",
93
93
  "eslint": "^9.17.0",
94
94
  "eslint-config-prettier": "^9.1.0",
@@ -105,11 +105,11 @@
105
105
  "ts-node": "^10.9.2",
106
106
  "typescript": "^5.7.2",
107
107
  "webpack": "^5.97.1",
108
- "webpack-cli": "^5.1.4"
108
+ "webpack-cli": "^6.0.1"
109
109
  },
110
110
  "dependencies": {
111
111
  "@nomicfoundation/slang": "0.18.3",
112
- "@solidity-parser/parser": "^0.18.0",
112
+ "@solidity-parser/parser": "^0.19.0",
113
113
  "semver": "^7.6.3"
114
114
  },
115
115
  "peerDependencies": {
@@ -12,8 +12,15 @@ export const ImportDirective = {
12
12
  let document;
13
13
 
14
14
  if (node.unitAlias) {
15
- // import "./Foo.sol" as Foo;
16
- document = [importPath, ' as ', node.unitAlias];
15
+ // First we look for '*' between the beginning of the import and the
16
+ // beginning of the importPath
17
+ document = options.originalText
18
+ .slice(options.locStart(node), options.locStart(node.pathLiteral))
19
+ .includes('*')
20
+ ? // import * as Bar from "./Bar.sol";
21
+ ['* as ', node.unitAlias, ' from ', importPath]
22
+ : // import "./Foo.sol" as Foo;
23
+ [importPath, ' as ', node.unitAlias];
17
24
  } else if (node.symbolAliases) {
18
25
  // import { Foo, Bar as Qux } from "./Foo.sol";
19
26
  const compiler = coerce(options.compiler);
@@ -19,6 +19,8 @@ const storageLocation = (node) =>
19
19
 
20
20
  const immutable = (node) => (node.isImmutable ? ' immutable' : '');
21
21
 
22
+ const transient = (node) => (node.isTransient ? ' transient' : '');
23
+
22
24
  const override = (node, path, print) => {
23
25
  if (!node.override) return '';
24
26
  if (node.override.length === 0) return [line, 'override'];
@@ -43,6 +45,7 @@ export const VariableDeclaration = {
43
45
  constantKeyword(node),
44
46
  storageLocation(node),
45
47
  immutable(node),
48
+ transient(node),
46
49
  override(node, path, print),
47
50
  name(node)
48
51
  ])