sonarjs/no-hardcoded-passwords
eslint-plugin-sonarjs
No autofixRecommended
eslint.config.js
export default [
{
rules: {
"sonarjs/no-hardcoded-passwords": "error",
},
},
];The documentation shows no incorrect example for this rule.
var mysql = require('mysql');
var connection = mysql.createConnection({
host: process.env.MYSQL_URL,
user: process.env.MYSQL_USERNAME,
password: process.env.MYSQL_PASSWORD,
database: process.env.MYSQL_DATABASE
});
connection.connect();Examples from the ESLint documentation.
sonarjs/no-hardcoded-passwords
eslint-plugin-sonarjs
export default [
{
rules: {
"sonarjs/no-hardcoded-passwords": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
Boolean expressions should not be gratuitous
React's useState hook should not be used directly in the render function or body of a component
Special identifiers should not be bound or assigned
"if/else if" chains and "switch" cases should not have the same condition