Suppressing ESLint errors

Hey everyone, first of all, great work on Frontity. I’ve avoided using WordPress for some years but a client I work with insists on it for their clients, so this project has been perfect to allow me to continue working with React and not have to dive back into PHP.

I always work with ESLint and tend to use this configuration from Wes Bos but with it installed I’m getting a few errors I have to resolve in weird ways.

Firstly, when I import React, I get a warning that React must be included in my project dependencies (package.json).

Similarly, I’m getting the same error when importing Link:
import Link from '@frontity/components/link';

Lastly, I also get errors if I add install any third party dependencies.

I guess it’s reading the package.json included with the theme package and not the one at the root of the project. So my question is; should I be installing packages at the root or at theme level? My workaround at the moment is to just include the package in both package.json files.

Anyone have any suggestions here?

Hi @modg

Can you please provide a repo or code-sandbox with your code? This is especially helpful to find solutions to technical issues with specific code

Detailing the info suggested here when having issues will help the community to provide the best possible help as quickly and as efficiently as possible.

Hey @juanma, try this:

Whilst not a fix per-se, I did manage to suppress all of these errors by updating my .eslintrc file:

{
  "extends": [
    "wesbos"
  ],
  "rules": {
    "import/no-extraneous-dependencies": 0,
    "import/no-unresolved": 0
  }
}