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 1.0.7 to 1.0.8

.nyc_output/7acfa1b6bfb0affffec6cd2985af3f90.json

8

lib/common/identifier-naming.js

@@ -31,12 +31,4 @@

return !this.isUpperSnakeCase(text);
},
isSnakeCase (text) {
return match(text, /[a-z0-9]+[_a-z0-9]*/);
},
isNotSnakeCase (text) {
return !this.isSnakeCase(text);
}
};

@@ -47,36 +47,2 @@

findDownAllTypes(ctx, type) {
if (ctx && ctx.constructor.name === type) {
return [ctx];
} else if (ctx && ctx.children) {
let items = ctx
.children
.reduce(i => this.findDownAllTypes(i, type));
return items.length > 0 && items[0] || null;
} else {
return [];
}
}
findDown(ctx, nesting, itemIndex) {
for (let i = 0; i < nesting - 1; i += 1) {
ctx = ctx.getChild(0);
if (!ctx) {
return null;
}
}
if (nesting > 0) {
ctx = ctx.getChild(itemIndex);
if (!ctx) {
return null;
}
}
return ctx;
}
*findIdentifier(ctx) {

@@ -83,0 +49,0 @@ const children = ctx.children;

2

lib/rules/expression-align.js

@@ -40,3 +40,3 @@ const Reporter = require('./../reporter');

ctx.getSourceInterval(), SEVERITY.ERROR,
`Expression indentation is incorrect.${message && ' ' + message || ''}`,
`Expression indentation is incorrect. ${message}`,
'expression-indent'

@@ -43,0 +43,0 @@ );

@@ -273,8 +273,9 @@ const Reporter = require('./../reporter');

validate (linesWithError, ctx) {
const tokens = ctx.parser._input.tokens.filter(i => i.channel === 0);
const tokens = ctx.parser._input.tokens.filter(i => i.channel === 0 && i.type >= 0);
tokens.forEach(this.applyTokenIndent.bind(this));
for (let curLine in this.firstIndent) {
if (linesWithError.includes(curLine)) {
for (let curLineStr in this.firstIndent) {
const curLine = Number(curLineStr);
if (linesWithError.includes(Number(curLine))) {
continue;

@@ -284,5 +285,4 @@ }

const curIndent = this.firstIndent[curLine];
if (this.isNotValidForBaseIndent(curIndent)) {
this.makeReport(curLine + 1, curIndent);
this.makeReport(curLine, curIndent);
}

@@ -297,3 +297,3 @@ }

if (curIndent > column) {
if (curIndent > column || _.isUndefined(curIndent)) {
this.firstIndent[line] = column;

@@ -300,0 +300,0 @@ }

@@ -24,6 +24,2 @@ const Reporter = require('./../reporter');

exitAssemblyItem(ctx) {
this.validateQuotes(ctx);
}
exitDataSize(ctx) {

@@ -56,8 +52,3 @@ ctx.children && this.validateQuotes(ctx.children[2]);

this.makeReport(ctx);
return;
}
if (ctx.getText().endsWith(this.incorrectQuote)) {
this.makeReport(ctx);
}
}

@@ -64,0 +55,0 @@

@@ -119,3 +119,3 @@ const Reporter = require('./../reporter');

ctx.getSourceInterval(), SEVERITY.ERROR,
`Statement indentation is incorrect.${message && ' ' + message || ''}`,
`Statement indentation is incorrect. ${message}`,
'statement-indent'

@@ -122,0 +122,0 @@ );

{
"name": "solhint",
"version": "1.0.7",
"version": "1.0.8",
"description": "Solidity Code Linter",

@@ -5,0 +5,0 @@ "main": "solhint.js",

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc