mongkuen / gatsby-plugin-eslint

Gatsby plugin to add support for ESLint
MIT License
13 stars 14 forks source link

Doesn't work in a project with the name "public" #11

Closed fcaldera closed 4 years ago

fcaldera commented 5 years ago

If you made the unfortunate decision of naming your project public, the plugin won't work. It will skip all your files due the default exclude regular expression:

const exclude = pluginOptions.exclude || /(node_modules|.cache|public)/;

It can be fixed by overriding the defaults in your project to something like this:

// gatsby-config.js
{
  resolve: 'gatsby-plugin-eslint',
  options: {
    exclude: [
      path.resolve(__dirname, 'node_modules'),
      path.resolve(__dirname, '.cache'),
      path.resolve(__dirname, 'public')
    ]
  }
}

A corner case that may be worth documenting.

mongkuen commented 4 years ago

Sure