n/no-deprecated-api
eslint-plugin-n
No autofixRecommended
eslint.config.js
import n from "eslint-plugin-n";
export default [
{
plugins: { n },
rules: {
"n/no-deprecated-api": "error",
},
},
];var fs = require("fs");
fs.exists("./foo.js", function() {}); /*ERROR: 'fs.exists' was deprecated since v4. Use 'fs.stat()' or 'fs.access()' instead.*/
// Also, it can report the following patterns.
var exists = require("fs").exists; /*ERROR: 'fs.exists' was deprecated since v4. Use 'fs.stat()' or 'fs.access()' instead.*/
const {exists} = require("fs"); /*ERROR: 'fs.exists' was deprecated since v4. Use 'fs.stat()' or 'fs.access()' instead.*/
// And other deprecated API below.const buffer = require("buffer")
const data = new buffer.Buffer(10) // OK since it's in ignoreModuleItems.const data = new Buffer(10) // OK since it's in ignoreGlobalItems.Examples from the ESLint documentation.
n/no-deprecated-api
eslint-plugin-n
import n from "eslint-plugin-n";
export default [
{
plugins: { n },
rules: {
"n/no-deprecated-api": "error",
},
},
];Oxlint does not have this rule.
nursery/noBufferConstructor
nursery · since 2.6.8
{
"linter": {
"rules": {
"nursery": {
"noBufferConstructor": "error"
}
}
}
}Require that process.exit() expressions use the same code path as throw
Disallow import declarations which import extraneous modules
Disallow string concatenation with __dirname, __filename, and import.meta paths