Socket
Socket
Sign inDemoInstall

solhint

Package Overview
Dependencies
Maintainers
1
Versions
85
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

solhint - npm Package Compare versions

Comparing version 5.0.1 to 5.0.2

lib/rules/naming/imports-order.js

1

conf/rulesets/solhint-all.js

@@ -53,2 +53,3 @@ /*

],
'imports-order': 'warn',
'modifier-name-mixedcase': 'warn',

@@ -55,0 +56,0 @@ 'named-parameters-mapping': 'warn',

28

lib/rules/naming/func-named-parameters.js

@@ -39,2 +39,6 @@ const BaseChecker = require('../base-checker')

},
{
description: 'abi.encodeX call with four UNNAMED parameters',
code: 'abi.encodePacked(_senderAddress, 1e18, _tokenAddress, _receiverAddress )',
},
],

@@ -71,13 +75,25 @@ bad: [

if (qtyArgs !== 0) {
if (qtyNamed === 0 && qtyArgs > this.maxUnnamedArguments) {
this.error(
node,
`Named parameters missing. MIN unnamed argumenst is ${this.maxUnnamedArguments}`
)
if (!this.isAbiCall(node)) {
if (qtyArgs !== 0) {
if (qtyNamed === 0 && qtyArgs > this.maxUnnamedArguments) {
this.error(
node,
`Named parameters missing. MIN unnamed arguments is ${this.maxUnnamedArguments}`
)
}
}
}
}
isAbiCall(node) {
if (node.expression.type === 'MemberAccess') {
if (node.expression.expression.type === 'Identifier') {
if (node.expression.expression.name === 'abi') {
return true
}
}
}
}
}
module.exports = FunctionNamedParametersChecker

@@ -14,2 +14,3 @@ const ConstNameSnakecaseChecker = require('./const-name-snakecase')

const FoundryTestFunctionsChecker = require('./foundry-test-functions')
const ImportsOrderChecker = require('./imports-order')

@@ -31,3 +32,4 @@ module.exports = function checkers(reporter, config) {

new FoundryTestFunctionsChecker(reporter, config),
new ImportsOrderChecker(reporter, config),
]
}

@@ -23,3 +23,3 @@ const BaseChecker = require('../base-checker')

description:
'Main key of mapping is enforced. On nested mappings other naming are not neccesary',
'Main key of mapping is enforced. On nested mappings other naming are not necessary',
code: 'mapping(address owner => mapping(address => uint256)) public tokenBalances;',

@@ -26,0 +26,0 @@ },

{
"name": "solhint",
"version": "5.0.1",
"version": "5.0.2",
"description": "Solidity Code Linter",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -30,3 +30,3 @@ const linter = require('../../../lib/index')

report,
`Named parameters missing. MIN unnamed argumenst is ${
`Named parameters missing. MIN unnamed arguments is ${
minUnnamed < DEFAULT_MIN_UNNAMED_ARGUMENTS ? DEFAULT_MIN_UNNAMED_ARGUMENTS : minUnnamed

@@ -94,3 +94,3 @@ }`

report,
`Named parameters missing. MIN unnamed argumenst is ${DEFAULT_MIN_UNNAMED_ARGUMENTS}`
`Named parameters missing. MIN unnamed arguments is ${DEFAULT_MIN_UNNAMED_ARGUMENTS}`
)

@@ -111,5 +111,5 @@ })

report,
`Named parameters missing. MIN unnamed argumenst is ${DEFAULT_MIN_UNNAMED_ARGUMENTS}`
`Named parameters missing. MIN unnamed arguments is ${DEFAULT_MIN_UNNAMED_ARGUMENTS}`
)
})
})
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc