prettier-plugin-solidity 1.4.1 → 1.4.2

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": "1.4.1",
3
+ "version": "1.4.2",
4
4
  "description": "A Prettier Plugin for automatically formatting your Solidity code.",
5
5
  "type": "module",
6
6
  "main": "./src/index.js",
@@ -84,33 +84,33 @@
84
84
  },
85
85
  "homepage": "https://github.com/prettier-solidity/prettier-plugin-solidity#readme",
86
86
  "engines": {
87
- "node": ">=16"
87
+ "node": ">=18"
88
88
  },
89
89
  "devDependencies": {
90
- "@babel/code-frame": "^7.22.10",
91
- "c8": "^9.0.0",
90
+ "@babel/code-frame": "^7.26.2",
91
+ "c8": "^10.1.3",
92
92
  "cross-env": "^7.0.3",
93
93
  "eslint": "^8.47.0",
94
94
  "eslint-config-airbnb-base": "^15.0.0",
95
- "eslint-config-prettier": "^9.0.0",
96
- "eslint-plugin-import": "^2.28.1",
97
- "esm-utils": "^4.1.2",
98
- "esmock": "^2.3.8",
99
- "jest": "^29.6.3",
95
+ "eslint-config-prettier": "^9.1.0",
96
+ "eslint-plugin-import": "^2.31.0",
97
+ "esm-utils": "^4.3.0",
98
+ "esmock": "^2.6.9",
99
+ "jest": "^29.7.0",
100
100
  "jest-light-runner": "^0.6.0",
101
101
  "jest-snapshot-serializer-ansi": "^2.1.0",
102
102
  "jest-snapshot-serializer-raw": "^2.0.0",
103
103
  "jest-watch-typeahead": "^2.2.2",
104
- "lines-and-columns": "^2.0.3",
105
- "prettier": "^3.1.1",
104
+ "lines-and-columns": "^2.0.4",
105
+ "prettier": "^3.3.3",
106
106
  "proxyquire": "^2.1.3",
107
- "solc": "^0.8.26",
108
- "webpack": "^5.88.2",
109
- "webpack-cli": "^5.1.4"
107
+ "solc": "^0.8.28",
108
+ "webpack": "^5.97.1",
109
+ "webpack-cli": "^6.0.1"
110
110
  },
111
111
  "dependencies": {
112
- "@solidity-parser/parser": "^0.18.0",
113
- "semver": "^7.5.4"
112
+ "@solidity-parser/parser": "^0.19.0",
113
+ "semver": "^7.6.3"
114
114
  },
115
115
  "peerDependencies": {
116
116
  "prettier": ">=2.3.0"
@@ -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
  ])