require-bin-executable
September 1, 2026 ยท View on GitHub
๐ Require bin files to be executable by their owner.
๐ผ This rule is enabled in the โ
recommended config.
The bin field exposes executable commands. This rule requires every existing regular file it references to have the Unix owner execute bit, regardless of extension. Git uses this bit to record files as executable.
Use chmod u+x path/to/file to set the permission. To also record the file as executable in Git's index, use git update-index --chmod=+x path/to/file; this does not change the working-tree mode checked by the rule. On filesystems without Unix permissions, the check is best-effort.
The rule does nothing on Windows. It ignores missing, inaccessible, non-regular, virtual, and out-of-package targets, symlinks resolving outside the package, and directories.bin.
Examples
In both examples, cli.js exists beside package.json; only its permissions differ.
// โ
{
"bin": "cli.js"
}
cli.js is -rw-r--r--.
// โ
{
"bin": "cli.js"
}
cli.js is -rwxr--r--.