-
-
Notifications
You must be signed in to change notification settings - Fork 872
Open
Description
Issue Summary
yarn run lint
fails for a brand new project created with gatsby-starter-ghost
➜ gatsby-starter-ghost git:(main) yarn run lint
yarn run v1.22.19
$ eslint . --ext .js --cache
/Users/mike/src/gatsby-starter-ghost/.eslintrc.js
0:0 error Parsing error: require() of ES Module /Users/mike/src/gatsby-starter-ghost/node_modules/eslint/node_modules/eslint-scope/lib/definition.js from /Users/mike/src/gatsby-starter-ghost/node_modules/babel-eslint/lib/require-from-eslint.js not supported.
Instead change the require of definition.js in /Users/mike/src/gatsby-starter-ghost/node_modules/babel-eslint/lib/require-from-eslint.js to a dynamic import() which is available in all CommonJS modules
...
To Reproduce
gatsby new example-project https://github.com/TryGhost/gatsby-starter-ghost.git
cd example-project
yarn install
yarn run lint
I think this is a bug because it adds work to getting basic CI/CD up-and-running for every new project created with this tool.
The impact may be minor if the user is capable of debugging and resolving the issues. Probably depends on the experience of the developer and how much they care about having these commands working.
Technical details:
- Ghost Version: N/A as far as I'm aware
- Gatsby CLI version: 4.20.0
- Gatsby version: 4.15.2
gatsby-starter-ghost
Version: 2.0.0- Node Version: 16.16.0
- OS: Mac
Resolution Notes
Others encountering this issue have resolved the problem by migrating from babel-eslint
(deprecated as of March 2020) to @babel/eslint-parser
.
I plan to put up a pull request that:
- does the migration from
babel-eslint
to@babel/eslint-parser
- adds a
lint-fix
script - applies automated fixes to any existing
eslint
issues - applies inline ignores to any remaining
eslint
issues (unless the fixes are obvious)
It'd be great to add a github action that ensures the linting is passing for any pull requests to the main
branch but that seems out of scope for the initial fix.
Metadata
Metadata
Assignees
Labels
No labels