Skip to content

Commit

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

Signed-off-by: Emmanuel Ferdman <[email protected]>
  • Loading branch information
emmanuel-ferdman authored Nov 4, 2024
1 parent 899ea1f commit 5a7ce21
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-globals",
"no-process-global",
"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-globals";
const CODE: &str = "no-process-global";
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-globals",
"code": "no-process-global",
"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 5a7ce21

Please sign in to comment.