sanity-io / sanity-template-gatsby-blog

A Sanity powered Gatsby blog for https://www.sanity.io/create
https://www.sanity.io/create?template=sanity-io/sanity-template-gatsby-blog
98 stars 34 forks source link

Linter fails #167

Open rileyjshaw opened 2 years ago

rileyjshaw commented 2 years ago

On a fresh install of the project, I ran:

npm run lint

I’m seeing a bunch of errors like:

0:0  error  Parsing error: require() of ES Module /path/to/node_modules/eslint-scope/lib/definition.js from /path/to/node_modules/babel-eslint/lib/require-from-eslint.js not supported.
Instead change the require of definition.js in /path/to/node_modules/babel-eslint/lib/require-from-eslint.js to a dynamic import() which is available in all CommonJS modules

I believe this could be because the babel-eslint package is no-longer supported and has been replaced by @babel/eslint-parser.

rileyjshaw commented 2 years ago

I had some luck trying the following:

npm uninstall -D babel-eslint
npm install -D @babel/eslint-parser

…and then updating each .eslintrc.js file to include:

  parser: "@babel/eslint-parser",
  parserOptions: {
    requireConfigFile: false,

I’m not making a PR yet because the configuration still seems somewhat broken; it’s linting the cache, node_modules, etc. But no errors so far after the upgrade.