Lint-staged is a popular npm package that helps developers automatically lint files that are staged in Git, ensuring code quality and consistency before committing changes. Comparing versions 4.2.0 and 4.1.3, several key differences emerge that developers should be aware of.
Both versions share the same core dependencies, including chalk, execa, listr, and lodash, indicating a consistent approach to handling tasks like terminal styling, executing commands, managing task lists, and general utility functions. However, the devDependencies section reveals notable changes. Version 4.2.0 introduces husky as a development dependency, which simplifies the process of setting up Git hooks to automatically run lint-staged before commits. This addition streamlines the developer workflow, making it easier to enforce linting rules.
Another significant change is the removal of npm-check and pre-commit from the devDependencies in version 4.2.0. While npm-check helps identify outdated dependencies, and pre-commit assists in running tasks before commits, the integration of husky likely replaces the functionality provided by pre-commit, offering a more focused and efficient approach to Git hook management. The release of version 4.2.0 was on September 15, 2017 which comes a week after version 4.1.3.
For developers, upgrading to version 4.2.0 offers the benefit of simplified Git hook management with husky, potentially leading to a cleaner development setup.
All the vulnerabilities related to the version 4.2.0 of the package
Regular Expression Denial of Service (ReDoS) in cross-spawn
Versions of the package cross-spawn before 7.0.5 are vulnerable to Regular Expression Denial of Service (ReDoS) due to improper input sanitization. An attacker can increase the CPU usage and crash the program by crafting a very large and well crafted string.