[eslint-mdx] Make ESLint aware of common components
of MDXProvider
#1505
-
Hello! I am using an Here is an example <Link to="/">Click here to go back home</Link> I get the following error:
Clearly, ESLint has no idea about Is there a way I can add the Any help is greatly appreciated! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Just add https://eslint.org/docs/user-guide/configuring/language-options#using-configuration-files-1 If you're using mutilate components for some package, you can use the helper like following. const { getGlobals } = require('eslint-plugin-mdx/lib/helpers')
module.exports = {
overrides: [
{
files: '*.mdx',
globals: getGlobals(require(path of package of components'), {
// other globals
})
}
]
} You can check the helper source at https://github.com/mdx-js/eslint-mdx/blob/master/packages/eslint-plugin-mdx/src/helpers.ts |
Beta Was this translation helpful? Give feedback.
Just add
globals
setting for those files.https://eslint.org/docs/user-guide/configuring/language-options#using-configuration-files-1
If you're using mutilate components for some package, you can use the helper like following.
You can check the helper source at https://github.com/mdx-js/eslint-mdx/blob/master/packages/eslint-plugin-mdx/src/helpers.ts