-
EnvironmentNode version: v20.12.2 What parser are you using?Default (Espree) What did you do?Configurationimport globals from "globals";
import path from "path";
import { fileURLToPath } from "url";
import { FlatCompat } from "@eslint/eslintrc";
import pluginJs from "@eslint/js";
// mimic CommonJS variables -- not needed if using CommonJS
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({baseDirectory: __dirname, recommendedConfig: pluginJs.configs.recommended});
export default [
{languageOptions: { globals: globals.browser }},
...compat.extends("airbnb-base"),
]; class Rectangle {
#height = 0;
#width;
constructor(height, width) {
this.#height = height;
this.#width = width;
}
} What did you expect to happen?It should complain only about unused variables and lack of linebreaks between class members. What actually happened?It throws a cryptic error stating Link to Minimal Reproducible Examplehttps://github.com/gingkapls/eslint-issue-minimal Participation
Additional commentsCommenting out the The configuration was created using
This behaviour is peculiar since there is a warning when trying to use airbnb-base with eslint v9, but there's no such warning for running it with a flat config on eslint v8, especially when it's provided as an option during the recommend way of installing. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
As the message indicates, this is a parsing error, which means that ESLint is not properly configured to accept the latest syntax. Most likely is that airbnb-base has different versions for ESLint 8 vs. ESLint 9. In either case, you'll need to contact the maintainers of that plugin for help. |
Beta Was this translation helpful? Give feedback.
As the message indicates, this is a parsing error, which means that ESLint is not properly configured to accept the latest syntax.
Most likely is that airbnb-base has different versions for ESLint 8 vs. ESLint 9.
In either case, you'll need to contact the maintainers of that plugin for help.