
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
eslint-plugin-github-commit-hash
Advanced tools
An ESLint plugin to ensure GitHub dependencies in package.json contain a commit hash.
An ESLint plugin to ensure GitHub dependencies in package.json contain a commit hash.
To use this ESLint plugin, install it as a development dependency:
npm install eslint-plugin-github-commit-hash --save-dev
Add github-commit-hash to the plugins section of your ESLint configuration file (e.g., .eslintrc.js):
module.exports = {
plugins: [
'github-commit-hash',
],
overrides: [
{
files: ['package.json'],
parser: 'jsonc-eslint-parser',
rules: {
'github-commit-hash/check-git-commit-hash': 'error',
},
},
],
};
This configuration will enable the rule that checks for commit hashes in GitHub dependencies within your package.json file.
This rule checks that all GitHub dependencies in your package.json file include a commit hash.
{
"dependencies": {
"@example/test": "github:example/test#123456"
}
}
{
"devDependencies": {
"@example/test": "github:example/test#abcd1234"
}
}
{
"dependencies": {
"@example/test": "github:example/test"
}
}
{
"devDependencies": {
"@example/test": "github:example/test"
}
}
Clone the repository and install the dependencies:
git clone https://github.com/JustSamuel/eslint-plugin-github-commit-hash.git
cd eslint-plugin-github-commit-hash
npm install
Compile the TypeScript code:
npm run build
Run the tests to ensure your code works as expected:
npm run test
Contributions are welcome! Please feel free to submit a pull request or open an issue if you have any suggestions or improvements.
This plugin was developed using the excellent jsonc-eslint-parser package and with great inspiration from eslint-plugin-package-json. I would be delighted if this would one day find its way into eslint-plugin-package-json itself.
FAQs
An ESLint plugin to ensure GitHub dependencies in package.json contain a commit hash.
The npm package eslint-plugin-github-commit-hash receives a total of 62 weekly downloads. As such, eslint-plugin-github-commit-hash popularity was classified as not popular.
We found that eslint-plugin-github-commit-hash demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.