diff --git a/.eslintrc.cjs b/.eslintrc.cjs index ad881979b..0e247943a 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -1,3 +1,5 @@ +const { builtinModules } = require('module') + module.exports = { extends: [ 'plugin:@typescript-eslint/recommended-type-checked', @@ -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: {