diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 555654b9690922..70fbf8dfca8bf7 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -150,6 +150,13 @@ module.exports = defineConfig({ 'no-console': ['error'], }, }, + { + files: ['packages/vite/src/client/**'], + excludedFiles: '**/__tests__/**', + rules: { + 'n/no-unsupported-features/node-builtins': 'off', + }, + }, { files: [ 'packages/vite/src/types/**', @@ -219,6 +226,9 @@ module.exports = defineConfig({ 'error', { version: pkg.engines.node, + // ideally we would like to allow all experimental features + // https://github.com/eslint-community/eslint-plugin-n/issues/199 + ignores: ['fetch'], }, ], }, diff --git a/packages/vite/src/node/plugins/wasm.ts b/packages/vite/src/node/plugins/wasm.ts index f5adab8e1b43d5..407ea5f0009a9e 100644 --- a/packages/vite/src/node/plugins/wasm.ts +++ b/packages/vite/src/node/plugins/wasm.ts @@ -29,6 +29,7 @@ const wasmHelper = async (opts = {}, url: string) => { // correct MIME type for .wasm files, which unfortunately doesn't work for // a lot of static file servers, so we just work around it by getting the // raw buffer. + // eslint-disable-next-line n/no-unsupported-features/node-builtins -- this function runs in browsers const response = await fetch(url) const contentType = response.headers.get('Content-Type') || '' if (