Skip to content

noNodejsModules (since v1.5.0)

Diagnostic Category: lint/nursery/noNodejsModules

Sources:

Forbid the use of Node.js builtin modules.

This can be useful for client-side web projects that don’t have access to those modules.

import fs from "fs";
nursery/noNodejsModules.js:1:16 lint/nursery/noNodejsModules ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

   Using Node.js modules is forbidden.
  
  > 1 │ import fs from "fs";
                  ^^^^
    2 │ 
  
   Can be useful for client-side web projects that do not have access to those modules.
  
   Remove the import module.
  
import path from "node:path";
nursery/noNodejsModules.js:1:18 lint/nursery/noNodejsModules ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

   Using Node.js modules is forbidden.
  
  > 1 │ import path from "node:path";
                    ^^^^^^^^^^^
    2 │ 
  
   Can be useful for client-side web projects that do not have access to those modules.
  
   Remove the import module.
  
import fs from "fs-custom";