babel / babel-eslint

:tokyo_tower: A wrapper for Babel's parser used for ESLint (renamed to @babel/eslint-parser)
https://github.com/babel/babel/tree/main/eslint/babel-eslint-parser
MIT License
2.96k stars 208 forks source link

Ignores parserOverride plugin option #783

Closed nfantone closed 5 years ago

nfantone commented 5 years ago

Following, babeljs.io recommendation I forked @babel/parser and created my own to add some custom syntax. My source files are building and compiling fine after setting things up with a .babelrc.js file looking like:

const { parse } = require('../my-babel-fork/packages/babel-parser/lib');

module.exports = {
  plugins: [
    {
      parserOverride(code, opts) {
        return parse(code, opts);
      }
    }
  ]
};

However, babel-eslint seems to be completely ignoring the plugin option and keeps using the original @babel/parser instance. I know that for a fact because if a remove node_modules/@babel/parser and symlink that to my fork, it starts linting correctly, recognising new syntax and clearing all errors.

I also tried setting the parserOverride option directly inside parserOptions.babel to no avail.

Am I missing something? Is there any way to make this work? Thanks in advance!

nfantone commented 5 years ago

Just noticed changes introduced in latest 11.0.0-beta.0 which seem to address my issue. Closing!