New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: use pure ES modules at the monorepo top level #3970
Conversation
const { overrides } = require('@netlify/eslint-config-node') | ||
|
||
module.exports = { | ||
extends: ['plugin:fp/recommended', '@netlify/eslint-config-node'], | ||
parserOptions: { | ||
sourceType: 'module', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ESLint configuration can be simplified in several ways, now that every package is using pure ES modules.
d654f03
to
728a18e
Compare
{ | ||
files: ['packages/*/tests/**/*.{cjs,mjs,js}'], | ||
rules: { | ||
'no-magic-numbers': 'off', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Re-enable this rule since only a few statements were offending.
@@ -1,2 +1,2 @@ | |||
[[plugins]] | |||
package = "./plugin" | |||
package = "./plugin.cjs" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some test files must be renamed to .cjs
to get the right linting.
@@ -3,7 +3,7 @@ | |||
"private": true, | |||
"version": "0.0.0", | |||
"description": "Netlify build module", | |||
"main": "index.js", | |||
"type": "module", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's the main change.
@@ -3,7 +3,7 @@ | |||
"private": true, | |||
"version": "0.0.0", | |||
"description": "Netlify build module", | |||
"main": "index.js", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The top-level package.json
is not published to npm
and does not have any main
/exports
file.
Fixes #3742
Every package of this monorepo is now using pure ES modules, including
@netlify/build
and@netlify/config
.There is a top-level package which is not published and is not needed in development as part of the monorepo structure. This PR makes that top-level and related top-level files use pure ES modules as well.
This has no impact on published code, only on development code.
For us to review and ship your PR efficiently, please perform the following steps:
passes our tests.