From 59140bdf005acfdb8d9a35a13fa27a2c7c35b764 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=94=AF=E7=84=B6?= Date: Wed, 10 Apr 2024 20:45:01 +0800 Subject: [PATCH] feat!: use ecmaVersion latest The following code is often used when using @eslint/eslintrc with `eslint-config-airbnb-base`: ```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}); ``` However, `import.meta` is not supported in ecmaVersion: '2018'. This change allows users to be able to use it that way. --- packages/eslint-config-airbnb-base/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/eslint-config-airbnb-base/index.js b/packages/eslint-config-airbnb-base/index.js index 825456b8a4..909bf30634 100644 --- a/packages/eslint-config-airbnb-base/index.js +++ b/packages/eslint-config-airbnb-base/index.js @@ -10,7 +10,7 @@ module.exports = { './rules/strict', ].map(require.resolve), parserOptions: { - ecmaVersion: 2018, + ecmaVersion: 'latest', sourceType: 'module', }, rules: {},