-
Notifications
You must be signed in to change notification settings - Fork 8
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
New Lint rule to restrict process env usage #3220
base: main
Are you sure you want to change the base?
Conversation
Quality Gate passedIssues Measures |
}, | ||
}, | ||
{ | ||
files: ["*.loader.ts"], |
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.
@fraxachun loader.ts is just a convention: the file can have any name or the loader function can be defined in the component file
do you think this catches a common error, although not 100%?
demo/site-pages/src/config.ts
Outdated
@@ -1,4 +1,5 @@ | |||
/* eslint-disable no-console */ | |||
/* eslint-disable no-restricted-syntax */ |
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.
for site-pages this rule should be disabled for the whole site. And you should mention in the changeset (or even migration guide) that for projects using the old build that this rule should also be disabled there.
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.
IMO we shouldn't add this to the package at all, but make it a Demo/Starter-only change
Reasons:
- It's highly specific for our deployment setup
- The file name patterns will change often (e.g., it's next.config.mjs in the Starter, and will be next.config.ts starting with Next 15)
- There's no simple way to disable just this rule, devs would have to disable "no-restricted-syntax" altogether. This is okay for now, but once we add another rule, it will be disabled as a side effect.
Description
Added new eslint rules to restrict usage of process.env
Acceptance criteria
Further information