lint-staged
Advanced tools
Comparing version 15.2.9 to 15.2.10
@@ -9,8 +9,8 @@ import path from 'node:path' | ||
import { | ||
GitError, | ||
RestoreOriginalStateError, | ||
ApplyEmptyCommitError, | ||
GetBackupStashError, | ||
GitError, | ||
HideUnstagedChangesError, | ||
RestoreMergeStatusError, | ||
RestoreOriginalStateError, | ||
RestoreUnstagedChangesError, | ||
@@ -17,0 +17,0 @@ } from './symbols.js' |
@@ -5,6 +5,6 @@ import debug from 'debug' | ||
import { | ||
GIT_ERROR, | ||
NO_CONFIGURATION, | ||
PREVENTED_EMPTY_COMMIT, | ||
GIT_ERROR, | ||
RESTORE_STASH_EXAMPLE, | ||
NO_CONFIGURATION, | ||
} from './messages.js' | ||
@@ -11,0 +11,0 @@ import { printTaskOutput } from './printTaskOutput.js' |
@@ -9,5 +9,2 @@ /** @typedef {import('./index').Logger} Logger */ | ||
import { dynamicImport } from './dynamicImport.js' | ||
import { failedToLoadConfig } from './messages.js' | ||
import { resolveConfig } from './resolveConfig.js' | ||
import { | ||
@@ -19,2 +16,5 @@ CONFIG_FILE_NAMES, | ||
} from './configFiles.js' | ||
import { dynamicImport } from './dynamicImport.js' | ||
import { failedToLoadConfig } from './messages.js' | ||
import { resolveConfig } from './resolveConfig.js' | ||
@@ -21,0 +21,0 @@ const debugLog = debug('lint-staged:loadConfig') |
@@ -15,3 +15,3 @@ import path from 'node:path' | ||
*/ | ||
const resolveRelativeGitDir = async (cwd = process.cwd()) => { | ||
const resolveRelativeGitDir = async (cwd) => { | ||
/** | ||
@@ -18,0 +18,0 @@ * Absolute repo top-level directory |
import chalk from 'chalk' | ||
import debug from 'debug' | ||
import { execa, execaCommand } from 'execa' | ||
import debug from 'debug' | ||
import pidTree from 'pidtree' | ||
import { parseArgsStringToArgv } from 'string-argv' | ||
import pidTree from 'pidtree' | ||
@@ -7,0 +7,0 @@ import { error, info } from './figures.js' |
@@ -20,5 +20,5 @@ /** @typedef {import('./index').Logger} Logger */ | ||
FAILED_GET_STAGED_FILES, | ||
NOT_GIT_REPO, | ||
NO_STAGED_FILES, | ||
NO_TASKS, | ||
NOT_GIT_REPO, | ||
SKIPPED_GIT_ERROR, | ||
@@ -30,2 +30,3 @@ skippingBackup, | ||
import { resolveGitRepo } from './resolveGitRepo.js' | ||
import { searchConfigs } from './searchConfigs.js' | ||
import { | ||
@@ -36,9 +37,8 @@ applyModificationsSkipped, | ||
getInitialState, | ||
shouldHidePartiallyStagedFiles, | ||
restoreOriginalStateEnabled, | ||
restoreOriginalStateSkipped, | ||
restoreUnstagedChangesSkipped, | ||
shouldHidePartiallyStagedFiles, | ||
} from './state.js' | ||
import { GitRepoError, GetStagedFilesError, GitError, ConfigNotFoundError } from './symbols.js' | ||
import { searchConfigs } from './searchConfigs.js' | ||
import { ConfigNotFoundError, GetStagedFilesError, GitError, GitRepoError } from './symbols.js' | ||
@@ -45,0 +45,0 @@ const debugLog = debug('lint-staged:runAll') |
@@ -7,2 +7,3 @@ /** @typedef {import('./index').Logger} Logger */ | ||
import { CONFIG_FILE_NAMES } from './configFiles.js' | ||
import { execGit } from './execGit.js' | ||
@@ -13,3 +14,2 @@ import { loadConfig } from './loadConfig.js' | ||
import { validateConfig } from './validateConfig.js' | ||
import { CONFIG_FILE_NAMES } from './configFiles.js' | ||
@@ -16,0 +16,0 @@ const debugLog = debug('lint-staged:searchConfigs') |
@@ -6,6 +6,6 @@ import EventEmitter from 'events' | ||
ApplyEmptyCommitError, | ||
TaskError, | ||
GitError, | ||
RestoreOriginalStateError, | ||
GitError, | ||
RestoreUnstagedChangesError, | ||
TaskError, | ||
} from './symbols.js' | ||
@@ -12,0 +12,0 @@ |
{ | ||
"name": "lint-staged", | ||
"version": "15.2.9", | ||
"version": "15.2.10", | ||
"description": "Lint files staged by git", | ||
@@ -45,3 +45,3 @@ "license": "MIT", | ||
"listr2": "~8.2.4", | ||
"micromatch": "~4.0.7", | ||
"micromatch": "~4.0.8", | ||
"pidtree": "~0.6.0", | ||
@@ -54,16 +54,19 @@ "string-argv": "~0.3.2", | ||
"@changesets/cli": "2.27.7", | ||
"@commitlint/cli": "19.3.0", | ||
"@commitlint/config-conventional": "19.2.2", | ||
"@commitlint/cli": "19.4.1", | ||
"@commitlint/config-conventional": "19.4.1", | ||
"@eslint/js": "9.9.1", | ||
"consolemock": "1.1.0", | ||
"cross-env": "7.0.3", | ||
"eslint": "8.57.0", | ||
"eslint": "9.9.1", | ||
"eslint-config-prettier": "9.1.0", | ||
"eslint-plugin-import": "2.29.1", | ||
"eslint-plugin-node": "11.1.0", | ||
"eslint-plugin-jest": "28.8.1", | ||
"eslint-plugin-n": "17.10.2", | ||
"eslint-plugin-prettier": "5.2.1", | ||
"husky": "9.1.4", | ||
"eslint-plugin-simple-import-sort": "12.1.1", | ||
"husky": "9.1.5", | ||
"jest": "29.7.0", | ||
"jest-snapshot-serializer-ansi": "2.1.0", | ||
"mock-stdin": "1.0.0", | ||
"prettier": "3.3.3" | ||
"prettier": "3.3.3", | ||
"semver": "7.6.3" | ||
}, | ||
@@ -70,0 +73,0 @@ "keywords": [ |
@@ -296,2 +296,4 @@ # 🚫💩 lint-staged | ||
This will result in _lint-staged_ running `eslint --fix file-1.js file-2.js`, when you have staged files `file-1.js`, `file-2.js` and `README.md`. | ||
Pass arguments to your commands separated by space as you would do in the shell. See [examples](#examples) below. | ||
@@ -313,2 +315,4 @@ | ||
This will result in _lint-staged_ running `eslint file-1.js file-2.js`, when you have staged files `file-1.js`, `file-2.js` and `README.md`, and if it passes, `prettier --write file-1.js file-2.js`. | ||
## Using JS configuration files | ||
@@ -322,2 +326,12 @@ | ||
To summarize, by default _lint-staged_ automatically adds the list of matched staged files to your command, but when building the command using JS functions it is expected to do this manually. For example: | ||
```js | ||
export default { | ||
'*.js': (stagedFiles) => [`eslint .`, `prettier --write ${stagedFiles.join(' ')}`], | ||
} | ||
``` | ||
This will result in _lint-staged_ first running `eslint .` (matching _all_ files), and if it passes, `prettier --write file-1.js file-2.js`, when you have staged files `file-1.js`, `file-2.js` and `README.md`. | ||
### Function signature | ||
@@ -324,0 +338,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
122100
984
19
Updatedmicromatch@~4.0.8