Skip to content

Commit

Permalink
chore: disallow node builtins in runtime (#8523)
Browse files Browse the repository at this point in the history
  • Loading branch information
natemoo-re committed Sep 12, 2023
1 parent a02707a commit aac51bd
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const { builtinModules } = require('module')

module.exports = {
extends: [
'plugin:@typescript-eslint/recommended-type-checked',
Expand Down Expand Up @@ -54,6 +56,16 @@ module.exports = {
'prefer-const': 'off',
},
overrides: [
{
// Ensure Node builtins aren't included in Astro's server runtime
files: ['packages/astro/src/runtime/**/*.ts'],
rules: {
"no-restricted-imports": ["error", {
"paths": [...builtinModules],
"patterns": ["node:*"]
}],
}
},
{
files: ['packages/**/test/*.js', 'packages/**/*.js'],
env: {
Expand Down

0 comments on commit aac51bd

Please sign in to comment.