Skip to content

Commit

Permalink
feat(basic): prefer non global object of node
Browse files Browse the repository at this point in the history
  • Loading branch information
zanminkian committed Mar 23, 2023
1 parent ab850b0 commit 12f6f5a
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -61,6 +61,7 @@ Type aware rules are enabled when a `tsconfig.eslint.json` is found in the proje

```js
// .eslintrc.js
const process = require('node:process')
process.env.ESLINT_TSCONFIG = 'tsconfig.json'

module.exports = {
Expand Down
5 changes: 5 additions & 0 deletions packages/basic/index.js
Expand Up @@ -49,6 +49,7 @@ module.exports = {
'antfu',
'no-only-tests',
'unused-imports',
'node',
],
settings: {
'import/resolver': {
Expand Down Expand Up @@ -314,6 +315,10 @@ module.exports = {
'operator-linebreak': ['error', 'before'],
'max-statements-per-line': ['error', { max: 1 }],

// node
'node/prefer-global/process': ['error', 'never'],
'node/prefer-global/buffer': ['error', 'never'],

// unicorns
// Pass error message when throwing errors
'unicorn/error-message': 'error',
Expand Down
1 change: 1 addition & 0 deletions packages/basic/package.json
Expand Up @@ -27,6 +27,7 @@
"eslint-plugin-markdown": "^3.0.0",
"eslint-plugin-n": "^15.6.1",
"eslint-plugin-no-only-tests": "^3.1.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-unicorn": "^46.0.0",
"eslint-plugin-unused-imports": "^2.0.0",
Expand Down
1 change: 1 addition & 0 deletions packages/typescript/index.js
@@ -1,4 +1,5 @@
const fs = require('node:fs')
const process = require('node:process')
const { join } = require('node:path')
const basic = require('@antfu/eslint-config-basic')

Expand Down
28 changes: 28 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 12f6f5a

Please sign in to comment.