Socket
Socket
Sign inDemoInstall

lint-staged

Package Overview
Dependencies
Maintainers
1
Versions
250
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lint-staged - npm Package Compare versions

Comparing version 15.2.4 to 15.2.5

5

lib/loadConfig.js

@@ -10,2 +10,3 @@ /** @typedef {import('./index').Logger} Logger */

import { dynamicImport } from './dynamicImport.js'
import { failedToLoadConfig } from './messages.js'
import { resolveConfig } from './resolveConfig.js'

@@ -121,6 +122,6 @@ import {

} catch (error) {
debugLog('Failed to load configuration!')
logger.error(error)
debugLog('Failed to load configuration from `%s` with error:\n', configPath, error)
logger.error(failedToLoadConfig(configPath))
return {}
}
}

@@ -88,1 +88,13 @@ import { inspect } from 'node:util'

export const CONFIG_STDIN_ERROR = chalk.redBright(`${error} Failed to read config from stdin.`)
export const failedToLoadConfig = (filepath) =>
chalk.redBright(`${error} Failed to read config from file "${filepath}".`)
export const failedToParseConfig = (
filepath,
error
) => `${chalk.redBright(`${error} Failed to parse config from file "${filepath}".`)}
${error}
See https://github.com/okonet/lint-staged#configuration.`

33

lib/validateConfig.js

@@ -7,3 +7,3 @@ /** @typedef {import('./index').Logger} Logger */

import { configurationError } from './messages.js'
import { configurationError, failedToParseConfig } from './messages.js'
import { ConfigEmptyError, ConfigFormatError } from './symbols.js'

@@ -27,10 +27,3 @@ import { validateBraces } from './validateBraces.js'

/**
* Runs config validation. Throws error if the config is not valid.
* @param {Object} config
* @param {string} configPath
* @param {Logger} logger
* @returns {Object} config
*/
export const validateConfig = (config, configPath, logger) => {
export const validateConfigLogic = (config, configPath, logger) => {
debugLog('Validating config from `%s`...', configPath)

@@ -105,8 +98,4 @@

logger.error(`Could not parse lint-staged config.
logger.error(failedToParseConfig(configPath, message))
${message}
See https://github.com/okonet/lint-staged#configuration.`)
throw new Error(message)

@@ -120,1 +109,17 @@ }

}
/**
* Runs config validation. Throws error if the config is not valid.
* @param {Object} config
* @param {string} configPath
* @param {Logger} logger
* @returns {Object} config
*/
export const validateConfig = (config, configPath, logger) => {
try {
return validateConfigLogic(config, configPath, logger)
} catch (error) {
logger.error(failedToParseConfig(configPath, error))
throw error
}
}
{
"name": "lint-staged",
"version": "15.2.4",
"version": "15.2.5",
"description": "Lint files staged by git",

@@ -39,12 +39,12 @@ "license": "MIT",

"dependencies": {
"chalk": "5.3.0",
"commander": "12.1.0",
"debug": "4.3.4",
"execa": "8.0.1",
"lilconfig": "3.1.1",
"listr2": "8.2.1",
"micromatch": "4.0.6",
"pidtree": "0.6.0",
"string-argv": "0.3.2",
"yaml": "2.4.2"
"chalk": "~5.3.0",
"commander": "~12.1.0",
"debug": "~4.3.4",
"execa": "~8.0.1",
"lilconfig": "~3.1.1",
"listr2": "~8.2.1",
"micromatch": "~4.0.7",
"pidtree": "~0.6.0",
"string-argv": "~0.3.2",
"yaml": "~2.4.2"
},

@@ -51,0 +51,0 @@ "devDependencies": {

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