Skip to content

Commit

Permalink
Revert "refactor: adjust rule code for no-process-global to ensure …
Browse files Browse the repository at this point in the history
…consistency (#1338)"

This reverts commit 5a7ce21.
  • Loading branch information
bartlomieju committed Dec 2, 2024
1 parent 912434b commit 3301451
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion schemas/rules.v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/rules/no_process_global.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion www/static/docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 3301451

Please sign in to comment.