@prowise/eslint-config-linting-rules 2.4.7 → 3.0.0

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.
@@ -21,18 +21,6 @@ export default {
21
21
  },
22
22
 
23
23
  rules: {
24
- /**
25
- * Enforce return after a callback.
26
- * https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/callback-return.md.
27
- */
28
- // "node/callback-return": "off",
29
-
30
- /**
31
- * Enforce either module.exports or exports.
32
- * https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/exports-style.md.
33
- */
34
- // "node/exports-style": "off",
35
-
36
24
  /**
37
25
  * Enforce file extensions in import declarations (ignores packages by default).
38
26
  * https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/file-extension-in-import.md.
@@ -40,34 +28,34 @@ export default {
40
28
  "node/file-extension-in-import": ["error", "always"],
41
29
 
42
30
  /**
43
- * Require all requires be top-level.
44
- * https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/global-require.md.
31
+ * Require correct usage of hashbang. ✅
32
+ * https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/hashbang.md.
45
33
  */
46
- "node/global-require": "error",
34
+ "node/hashbang": "error",
47
35
 
48
36
  /**
49
- * Enforces error handling in callbacks (node environment)
50
- * https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/handle-callback-err.md.
37
+ * Disallow deprecated APIs. ✅
38
+ * https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-deprecated-api.md.
51
39
  */
52
- // "node/handle-callback-err": "off",
40
+ "node/no-deprecated-api": "error",
53
41
 
54
42
  /**
55
- * Require correct usage of hashbang.
56
- * https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/hashbang.md.
43
+ * Disallow the assignment to exports. ✅
44
+ * https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-exports-assign.md.
57
45
  */
58
- "node/hashbang": "error",
46
+ "node/no-exports-assign": "error",
59
47
 
60
48
  /**
61
- * Disallow mixing regular variable and require declarations
62
- * https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-mixed-requires.md.
49
+ * Disallow require declarations which import extraneous modules. ✅
50
+ * https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-extraneous-require.md.
63
51
  */
64
- // "node/no-mixed-requires": ["off", false],
52
+ "node/no-extraneous-require": "error",
65
53
 
66
54
  /**
67
- * Disallow use of new operator with the require function
68
- * https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-new-require.md.
55
+ * Disallow require declarations which import missing modules. ✅
56
+ * https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-missing-require.md.
69
57
  */
70
- "node/no-new-require": "error",
58
+ "node/no-missing-require": "error",
71
59
 
72
60
  /**
73
61
  * Disallow string concatenation with __dirname and __filename
@@ -76,21 +64,69 @@ export default {
76
64
  "node/no-path-concat": "error",
77
65
 
78
66
  /**
79
- * Disallow use of process.env
80
- * https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-process-env.md.
81
- */
82
- // "/node/no-process-env": "off",
83
-
84
- /**
85
- * Disallow process.exit()
67
+ * Disallow process.exit(). ✅
86
68
  * https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-process-exit.md.
87
69
  */
88
- // "node/no-process-exit": "off",
70
+ "node/no-process-exit": "off",
89
71
 
90
72
  /**
91
- * Disallow use of the Buffer() constructor
73
+ * Enforce either `Buffer` or `require("buffer").Buffer`
92
74
  * https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/prefer-global/buffer.md.
93
75
  */
94
76
  "node/prefer-global/buffer": "error",
77
+
78
+ /**
79
+ * Enforce either `console` or `require("console")`
80
+ * https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/prefer-global/console.md.
81
+ */
82
+ "node/prefer-global/console": "error",
83
+
84
+ /**
85
+ * Enforce either `crypto` or `require("crypto").webcrypto`
86
+ * https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/prefer-global/crypto.md.
87
+ */
88
+ "node/prefer-global/crypto": "error",
89
+
90
+ /**
91
+ * Enforce either `process` or `require("process")`
92
+ * https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/prefer-global/process.md.
93
+ */
94
+ "node/prefer-global/process": "error",
95
+
96
+ /**
97
+ * Enforce either `TextDecoder` or `require("util").TextDecoder`
98
+ * https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/prefer-global/text-decoder.md.
99
+ */
100
+ "node/prefer-global/text-decoder": "error",
101
+
102
+ /**
103
+ * Enforce either `TextEncoder` or `require("util").TextEncoder`
104
+ * https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/prefer-global/text-encoder.md.
105
+ */
106
+ "node/prefer-global/text-encoder": "error",
107
+
108
+ /**
109
+ * Enforce either `UrlSearchParams` or `require("url").UrlSearchParams`
110
+ * https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/prefer-global/url-search-params.md.
111
+ */
112
+ "node/prefer-global/url-search-params": "error",
113
+
114
+ /**
115
+ * Enforce either `Url` or `require("url")`
116
+ * https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/prefer-global/url.md.
117
+ */
118
+ "node/prefer-global/url": "error",
119
+
120
+ /**
121
+ * Enforce either global timer functions or `require("timers")`
122
+ * https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/prefer-global/timers.md.
123
+ */
124
+ "node/prefer-global/timers": "error",
125
+
126
+ /**
127
+ * Enforce using the `node:` protocol when importing Node.js builtin modules.
128
+ * https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/prefer-node-protocol.md.
129
+ */
130
+ "node/prefer-node-protocol": "error",
95
131
  },
96
132
  };