Skip to content

Commit

Permalink
feat!: use ecmaVersion latest
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
aladdin-add committed Apr 10, 2024
1 parent c25bce8 commit 59140bd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/eslint-config-airbnb-base/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module.exports = {
'./rules/strict',
].map(require.resolve),
parserOptions: {
ecmaVersion: 2018,
ecmaVersion: 'latest',
sourceType: 'module',
},
rules: {},
Expand Down

0 comments on commit 59140bd

Please sign in to comment.