Closed cdfa closed 5 years ago
I just noticed that using the node resolver i do get different errors in a different import, so maybe it's not as babel resolver specific as I thought.
@rxts/eslint-plugin-mdx
only exports a parseForESLint
method for now, maybe I can add a parse
method for compatibility usage.
Closing in favour of https://github.com/benmosher/eslint-plugin-import/issues/1433
Hi, I'm getting a parse error on imports pointing to directories in MDX files. I'm using
@rxts/eslint-plugin-mdx
to parse the.mdx
files. It's possible another package is causing this, but all other imports in my.mdx
files work fine and I don't get the error with the default node resolver.I have his import in
FollowReveal.mdx
File structure:
where
index.js
just re-exports the other modules in the directoryError:
eslintrc.json:
```json { "parser": "babel-eslint", "extends": [ "eslint:recommended", "plugin:react/recommended", "plugin:jest/recommended", "plugin:jest/style", "plugin:eslint-comments/recommended", "plugin:array-func/all", "plugin:import/errors", "plugin:import/warnings", "prettier" ], "env": { "es6": true, "browser": true }, "plugins": ["react", "prettier", "json", "jest", "no-loops", "import"], "parserOptions": { "sourceType": "module" }, "settings": { "react": { "version": "detect" }, "import/resolver": "babel-module", "import/parsers": { "@rxts/eslint-plugin-mdx": [ ".mdx" ] } }, "rules": { ... }, "overrides": [ ..., { "files": ["*.mdx"], "extends": ["plugin:@rxts/mdx/recommended"], "globals": { "React": false }, "rules": { "lines-between-class-members": "off" // See https://github.com/mdx-js/mdx/issues/195 } } ] } ```.babelrc:
```json { "presets": [ [ "@babel/preset-env", { "modules": false } ], "@babel/preset-react" ], "plugins": [ "@babel/plugin-proposal-class-properties", [ "module-resolver", { "root": ["./"], "extensions": [".js", ".jsx", ".json"] } ] ] } ```