Skip to content

Commit

Permalink
Add n/prefer-global/process rule (#233)
Browse files Browse the repository at this point in the history
Global variables are often harmful. Unlike global variables defined in standard specs (ECMAScript or WHATWG etc.),
`process` is unique to Node.js. This may be a problem when running Stylelint on other platforms.

See https://github.com/eslint-community/eslint-plugin-n/blob/v11.1.0/docs/rules/prefer-global/process.md
  • Loading branch information
ybiquitous committed Aug 17, 2023
1 parent 03ab938 commit 30117e6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## Head

- Added: `n/prefer-global/process` rule.

## 19.1.0

- Added: rules for ESM files.
Expand Down
3 changes: 3 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ module.exports = {
'prefer-template': 'error',
'sort-imports': ['error', { allowSeparatedGroups: true }],

// Avoid a global variable unique to Node.js.
'n/prefer-global/process': ['error', 'never'],

// Prefer code readability, e.g. `[0-9A-Za-z]`.
'regexp/prefer-d': 'off',
},
Expand Down

0 comments on commit 30117e6

Please sign in to comment.