Socket
Socket
Sign inDemoInstall

solhint

Package Overview
Dependencies
Maintainers
4
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 2.1.0 to 2.1.1

test/common/config-file.js

3

lib/common/errors.js
class ConfigMissingError extends Error {
constructor(configName) {
const message = `Failed to load config "${configName}" to extend from.`
let message = `Failed to load a solhint's config file.`
if (configName) message = `Failed to load config "${configName}" to extend from.`
super(message)

@@ -5,0 +6,0 @@ }

@@ -33,3 +33,7 @@ const path = require('path')

const loadConfig = () => {
const loadConfig = configFile => {
if (configFile && !fs.existsSync(configFile)) {
throw new Error(`The config file passed as a parameter does not exist`)
}
// Use cosmiconfig to get the config from different sources

@@ -51,4 +55,11 @@ const appDirectory = fs.realpathSync(process.cwd())

if (configFile) {
cosmiconfigOptions.searchPlaces.push(configFile)
}
const explorer = cosmiconfig(moduleName, cosmiconfigOptions)
const searchedFor = explorer.searchSync(appDirectory)
if (!searchedFor) {
throw new ConfigMissingError()
}
return searchedFor.config || createEmptyConfig()

@@ -55,0 +66,0 @@ }

{
"name": "solhint",
"version": "2.1.0",
"version": "2.1.1",
"description": "Solidity Code Linter",

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

@@ -128,6 +128,6 @@ #!/usr/bin/env node

try {
config = loadConfig()
config = loadConfig(program.config)
} catch (e) {
console.log(e.message)
process.exit(0)
process.exit(1)
}

@@ -134,0 +134,0 @@

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