diff --git a/schemas/rules.v1.json b/schemas/rules.v1.json index 32ea51622..71d178495 100644 --- a/schemas/rules.v1.json +++ b/schemas/rules.v1.json @@ -70,7 +70,7 @@ "no-non-null-assertion", "no-obj-calls", "no-octal", - "no-process-global", + "no-process-globals", "no-prototype-builtins", "no-redeclare", "no-regex-spaces", diff --git a/src/rules/no_process_global.rs b/src/rules/no_process_global.rs index 2ded9763b..718571eed 100644 --- a/src/rules/no_process_global.rs +++ b/src/rules/no_process_global.rs @@ -17,7 +17,7 @@ use deno_ast::SourceRangedForSpanned; #[derive(Debug)] pub struct NoProcessGlobal; -const CODE: &str = "no-process-global"; +const CODE: &str = "no-process-globals"; const MESSAGE: &str = "NodeJS process global is discouraged in Deno"; impl LintRule for NoProcessGlobal { diff --git a/www/static/docs.json b/www/static/docs.json index 3361afd61..014621dcb 100644 --- a/www/static/docs.json +++ b/www/static/docs.json @@ -449,7 +449,7 @@ ] }, { - "code": "no-process-global", + "code": "no-process-globals", "docs": "Disallows the use of NodeJS `process` global.\n\nNodeJS and Deno expose `process` global but they are hard to statically analyze\nby tools, so code should not assume they are available. Instead,\n`import process from \"node:process\"`.\n\n### Invalid:\n\n```typescript\n// foo.ts\nconst foo = process.env.FOO;\n```\n\n### Valid:\n\n```typescript\n// foo.ts\nimport process from \"node:process\";\n\nconst foo = process.env.FOO;\n```\n", "tags": [ "recommended"