2

I am trying to learn Gatsby and I included prettier-eslint plugin with a common configuration. You can see my configuration, the files, etc

When I try to add a css file I get this error:

Error

AndresSp
  • 176
  • 3
  • 16

2 Answers2

1

Have you tried using the following?

eslint: {
  patterns: "**/*.{js,jsx,ts,tsx}",
  customOptions: {
    fix: true,
    cache: true,
  },
},

The eslint pattern seems to be a string, not an array according to the plugin's example.


This seems to be an unresolved issue of the plugin, according to this opened issue (from a week ago), so keep an eye on that stack trace to see how it evolves. If the dependency has a bug when using the defaults (and suggested) configuration, there's nothing you can do except making a PR if you are able to spot the bug in the source code or wait for the resolution.

Ferran Buireu
  • 28,630
  • 6
  • 39
  • 67
  • 1
    Yes, that was my first configuration, and thanks for sharing the issue I will follow it. I'm currently trying to use Vscode extension – AndresSp Oct 03 '21 at 07:48
  • 1
    I'm also using prettier and ESLint in all my projects and I don't use any Gatsby's plugin. You can use the default's configuration for prettier (the `.prettierrc` file) and the `eslintrc.js` placed at the root of the project. Give it a try, you may not need to use the plugin – Ferran Buireu Oct 03 '21 at 07:57
0

I had the same issue. Turns out you must have a prettier config (.prettierrc or similar) set up. Check to make sure you have a config as mentioned in the Prettier docs.