Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

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 11.2.0 to 11.2.1

17

lib/resolveGitRepo.js

@@ -28,6 +28,16 @@ 'use strict'

const determineGitDir = (cwd, relativeDir) => {
if (relativeDir) {
// the current working dir is inside the git top-level directory
return normalize(cwd.substring(0, cwd.lastIndexOf(relativeDir)))
} else {
// the current working dir is the top-level git directory
return normalize(cwd)
}
}
/**
* Resolve git directory and possible submodule paths
*/
const resolveGitRepo = async (cwd) => {
const resolveGitRepo = async (cwd = process.cwd()) => {
try {

@@ -42,3 +52,6 @@ debugLog('Resolving git repo from `%s`', cwd)

const gitDir = normalize(await execGit(['rev-parse', '--show-toplevel'], { cwd }))
// read the path of the current directory relative to the top-level directory
// don't read the toplevel directly, it will lead to an posix conform path on non posix systems (cygwin)
const gitRel = normalize(await execGit(['rev-parse', '--show-prefix']))
const gitDir = determineGitDir(cwd, gitRel)
const gitConfigDir = normalize(await resolveGitConfigDir(gitDir))

@@ -45,0 +58,0 @@

2

package.json
{
"name": "lint-staged",
"version": "11.2.0",
"version": "11.2.1",
"description": "Lint files staged by git",

@@ -5,0 +5,0 @@ "license": "MIT",

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