sonarjs/no-hardcoded-ip
eslint-plugin-sonarjs
No autofixRecommended
eslint.config.js
export default [
{
rules: {
"sonarjs/no-hardcoded-ip": "error",
},
},
];The documentation shows no incorrect example for this rule.
ip = process.env.IP_ADDRESS; // Compliant
const net = require('net');
var client = new net.Socket();
client.connect(80, ip, function() {
// ...
});Examples from the ESLint documentation.
sonarjs/no-hardcoded-ip
eslint-plugin-sonarjs
export default [
{
rules: {
"sonarjs/no-hardcoded-ip": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
Boolean expressions should not be gratuitous
Special identifiers should not be bound or assigned
React's useState hook should not be used directly in the render function or body of a component