chore: disallow node builtins in runtime (#8523)
This commit is contained in:
parent
a02707a8b2
commit
aac51bd00b
1 changed files with 12 additions and 0 deletions
|
@ -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: {
|
||||
|
|
Loading…
Reference in a new issue