@metamask-previews/oxlint-config-nodejs 0.0.0-preview-41780a9 → 0.0.0-preview-ffe49c0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -1
- package/src/index.js +31 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@metamask-previews/oxlint-config-nodejs",
|
|
3
|
-
"version": "0.0.0-preview-
|
|
3
|
+
"version": "0.0.0-preview-ffe49c0",
|
|
4
4
|
"description": "Shareable MetaMask Oxlint config for Node.js",
|
|
5
5
|
"homepage": "https://github.com/MetaMask/oxlint-config#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -34,11 +34,13 @@
|
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@metamask/auto-changelog": "^3.4.4",
|
|
36
36
|
"@metamask/oxlint-config": "^0.0.0",
|
|
37
|
+
"eslint-plugin-n": "^18.3.0",
|
|
37
38
|
"oxlint": "^1.82.0",
|
|
38
39
|
"vitest": "^2.1.9"
|
|
39
40
|
},
|
|
40
41
|
"peerDependencies": {
|
|
41
42
|
"@metamask/oxlint-config": "^0.0.0",
|
|
43
|
+
"eslint-plugin-n": "^18.3.0",
|
|
42
44
|
"oxlint": "^1.82.0"
|
|
43
45
|
},
|
|
44
46
|
"engines": {
|
package/src/index.js
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import { createConfig } from '@metamask/oxlint-config';
|
|
2
2
|
|
|
3
3
|
const config = createConfig({
|
|
4
|
-
plugins: ['node'],
|
|
4
|
+
plugins: ['node', 'unicorn'],
|
|
5
|
+
|
|
6
|
+
// `eslint-plugin-n` is loaded as a JS plugin to enable rules not yet
|
|
7
|
+
// natively implemented in Oxlint.
|
|
8
|
+
jsPlugins: ['eslint-plugin-n'],
|
|
5
9
|
|
|
6
10
|
rules: {
|
|
7
11
|
// Possible Errors
|
|
8
12
|
'node/handle-callback-err': ['error', '^(err|error)$'],
|
|
13
|
+
'node/no-exports-assign': 'error',
|
|
9
14
|
'node/no-new-require': 'error',
|
|
10
15
|
'node/no-path-concat': 'error',
|
|
11
16
|
|
|
@@ -17,6 +22,31 @@ const config = createConfig({
|
|
|
17
22
|
'node/no-process-env': 'error',
|
|
18
23
|
'node/no-sync': 'error',
|
|
19
24
|
|
|
25
|
+
// Unicorn rules
|
|
26
|
+
'unicorn/no-process-exit': 'error',
|
|
27
|
+
|
|
28
|
+
// `eslint-plugin-n` rules
|
|
29
|
+
'n/hashbang': 'error',
|
|
30
|
+
'n/no-callback-literal': 'error',
|
|
31
|
+
'n/no-deprecated-api': 'error',
|
|
32
|
+
'n/no-extraneous-import': 'error',
|
|
33
|
+
'n/no-extraneous-require': 'error',
|
|
34
|
+
'n/no-unpublished-bin': 'error',
|
|
35
|
+
'n/no-unpublished-import': 'error',
|
|
36
|
+
'n/no-unpublished-require': 'error',
|
|
37
|
+
'n/no-unsupported-features/es-builtins': 'error',
|
|
38
|
+
'n/no-unsupported-features/node-builtins': 'error',
|
|
39
|
+
'n/prefer-global/buffer': 'error',
|
|
40
|
+
'n/prefer-global/console': 'error',
|
|
41
|
+
'n/prefer-global/process': 'error',
|
|
42
|
+
'n/prefer-global/text-decoder': 'error',
|
|
43
|
+
'n/prefer-global/text-encoder': 'error',
|
|
44
|
+
'n/prefer-global/url': 'error',
|
|
45
|
+
'n/prefer-global/url-search-params': 'error',
|
|
46
|
+
'n/prefer-promises/dns': 'error',
|
|
47
|
+
'n/prefer-promises/fs': 'error',
|
|
48
|
+
'n/process-exit-as-throw': 'error',
|
|
49
|
+
|
|
20
50
|
// Enabled in the base config, but this should be allowed in Node.js
|
|
21
51
|
// projects.
|
|
22
52
|
'import/no-nodejs-modules': 'off',
|