Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The plugin option documents do not match the code #26

Closed
bryanpizzillo opened this issue Mar 2, 2021 · 1 comment
Closed

The plugin option documents do not match the code #26

bryanpizzillo opened this issue Mar 2, 2021 · 1 comment

Comments

@bryanpizzillo
Copy link

I am using plugin version 3.0.0 with Gatsby 3.0.0. There is either a bug in the docs, or a bug in the code. The code expects the pluginConfig to have an options property, but pluginConfig IS the options property from gatsby-config. (const options = pluginOptions.options || {};)

Using the following config keeps the plugin defaults.

{
  resolve: 'gatsby-plugin-eslint',
  options: {
    stages: ['develop'],
    extensions: ['js', 'jsx', 'mdx'],
    exclude: ['node_modules', '.cache', 'public'],
   },
}

Using the following config actually uses my config

{
   resolve: 'gatsby-plugin-eslint',
   options: {
      options: {
         stages: ['develop'],
	extensions: ['js', 'jsx', 'mdx'],
	exclude: ['node_modules', '.cache', 'public'],
     },
   },
},

So either to docs are in error, or the code should be changed to const options = pluginOptions || {};. I assume the error is the latter.

bryanpizzillo added a commit to bryanpizzillo/gatsby-plugin-eslint that referenced this issue Mar 2, 2021
@mongkuen
Copy link
Owner

Thanks for opening this! I see where this was a problem and I'm glad you opened a PR!

Unfortunately there are deeper issues with using this plugin with V3 regarding eslint-loader and eslint-webpack-plugin that wasn't limited to just this particular fix to making this plugin work for V3.

Looking at Gatsby's source again, things have fully transitioned to eslint-webpack-plugin - so I've rewritten the plugin to be compatible with V3 with your suggestions in mind. Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants