I have a new project I want to use eslint9 for. I want a clean setup ans therefore utilize the new format.
As the project is a WebApp, it’s script/common.js and not module syntax.
I tried to set up eslint9 for this and got this pretty basic eslint.config.js file
module.exports = [
{
files: ["**/*.js"],
ignores: ["**/*.min.js"],
languageOptions: {
sourceType: "script",
},
rules: {
"no-unused-vars": "warn"
}
}
];
What I want is to include predefined rulesets, as I did in older iterations of eslint with
"extends": ["eslint:recommended", "google"],
But the only documentation I can find uses the module syntax and won’t work with my script project.
import js from "@eslint/js";
export default [
js.configs.recommended,
{
rules: {
"no-unused-vars": "warn"
}
}
];
How can I use eslint:recommended and Google in eslint 9 with commonjs syntax?
3