# Migration: `@babel/eslint-parser` → espree (v9.0.0)

As of `9.0.0`, `@bitfactory/eslint-config` no longer uses `@babel/eslint-parser`. The base config and the `/vue` export now rely on ESLint's built-in parser (**espree**), which handles the config's `ecmaVersion: 2021` / `sourceType` settings natively (vue-eslint-parser defaults its `<script>` sub-parser to espree). This unblocks the ESLint 10 upgrade (v10.0.0) while keeping Node.js 20 support.

## What changed

- `@babel/eslint-parser` and `@babel/core` are no longer peer dependencies.
- The base config sets no `parser`; ESLint parses your JavaScript with espree.
- The `/vue` export no longer sets a `<script>` sub-parser; vue-eslint-parser uses espree by default. This was
  reversed in `14.0.0`, which gives `/vue` a TypeScript sub-parser so a Vue 2 SFC with `lang="ts"` is linted.

## What you need to do

- **Most projects: nothing.** Standard JavaScript (up to ES2021 syntax) - including `<script>` in `.vue` files - parses unchanged.
- **If you only installed `@babel/eslint-parser` / `@babel/core` for linting**, you can remove them from your `devDependencies`.
- **If your project relies on syntax espree cannot parse** (e.g. decorators or other stage-3 proposals), set your own `parser` in your flat config for the affected files, for example:

  ```js
  import babelParser from '@babel/eslint-parser';
  import bitfactory from '@bitfactory/eslint-config';

  export default [
      ...bitfactory,
      {
          files: ['**/*.{js,mjs,cjs}'],
          languageOptions: {
              parser: babelParser,
              parserOptions: { requireConfigFile: false },
          },
      },
  ];
  ```

  For `.vue` files, extend the `/vue` export (which sets `vue-eslint-parser` as the parser) and re-add the babel `<script>` sub-parser on top:

  ```js
  import bitfactoryVue from '@bitfactory/eslint-config/vue';
  import babelParser from '@babel/eslint-parser';

  export default [
      ...bitfactoryVue,
      {
          files: ['**/*.vue'],
          // vue-eslint-parser is already the parser via the /vue export;
          // this only overrides the <script> sub-parser.
          languageOptions: {
              parserOptions: { parser: babelParser },
          },
      },
  ];
  ```

## Why

`@babel/eslint-parser`'s ESLint-10-compatible line (`8.x`) requires `@babel/core@8`, which requires Node.js ≥22.18 - that would drop Node 20. Removing the parser keeps Node 20 supported through the ESLint 10 upgrade. See ADR-0001.
