n/hashbang
eslint-plugin-n
Safe autofixRecommended
eslint.config.js
import n from "eslint-plugin-n";
export default [
{
plugins: { n },
rules: {
"n/hashbang": "error",
},
},
];console.log("hello"); /*error This file needs hashbang "#!/usr/bin/env node".*/#!/usr/bin/env node /*error This file must not have Unicode BOM.*/
console.log("hello");
// If this file has Unicode BOM.#!/usr/bin/env node /*error This file must have Unix linebreaks (LF).*/
console.log("hello");
// If this file has Windows' linebreaks (CRLF).#!/usr/bin/env node
console.log("hello");console.log("hello");Examples from the ESLint documentation.
n/hashbang
eslint-plugin-n
import n from "eslint-plugin-n";
export default [
{
plugins: { n },
rules: {
"n/hashbang": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
Disallow require() expressions which import extraneous modules
Disallow import declarations which import missing modules
Disallow require() expressions which import missing modules
Disallow import declarations which import private modules
Disallow require() expressions which import private modules