UNPKG

3.48 kBTypeScriptView Raw
1import { Linter } from "../index";
2
3export interface NodeJSAndCommonJS extends Linter.RulesRecord {
4 /**
5 * Rule to require `return` statements after callbacks.
6 *
7 * @since 1.0.0-rc-1
8 * @see https://eslint.org/docs/rules/callback-return
9 */
10 "callback-return": Linter.RuleEntry<[string[]]>;
11
12 /**
13 * Rule to require `require()` calls to be placed at top-level module scope.
14 *
15 * @since 1.4.0
16 * @see https://eslint.org/docs/rules/global-require
17 */
18 "global-require": Linter.RuleEntry<[]>;
19
20 /**
21 * Rule to require error handling in callbacks.
22 *
23 * @since 0.4.5
24 * @see https://eslint.org/docs/rules/handle-callback-err
25 */
26 "handle-callback-err": Linter.RuleEntry<[string]>;
27
28 /**
29 * Rule to disallow use of the `Buffer()` constructor.
30 *
31 * @since 4.0.0-alpha.0
32 * @see https://eslint.org/docs/rules/no-buffer-constructor
33 */
34 "no-buffer-constructor": Linter.RuleEntry<[]>;
35
36 /**
37 * Rule to disallow `require` calls to be mixed with regular variable declarations.
38 *
39 * @since 0.0.9
40 * @see https://eslint.org/docs/rules/no-mixed-requires
41 */
42 "no-mixed-requires": Linter.RuleEntry<
43 [
44 Partial<{
45 /**
46 * @default false
47 */
48 grouping: boolean;
49 /**
50 * @default false
51 */
52 allowCall: boolean;
53 }>,
54 ]
55 >;
56
57 /**
58 * Rule to disallow `new` operators with calls to `require`.
59 *
60 * @since 0.6.0
61 * @see https://eslint.org/docs/rules/no-new-require
62 */
63 "no-new-require": Linter.RuleEntry<[]>;
64
65 /**
66 * Rule to disallow string concatenation when using `__dirname` and `__filename`.
67 *
68 * @since 0.4.0
69 * @see https://eslint.org/docs/rules/no-path-concat
70 */
71 "no-path-concat": Linter.RuleEntry<[]>;
72
73 /**
74 * Rule to disallow the use of `process.env`.
75 *
76 * @since 0.9.0
77 * @see https://eslint.org/docs/rules/no-process-env
78 */
79 "no-process-env": Linter.RuleEntry<[]>;
80
81 /**
82 * Rule to disallow the use of `process.exit()`.
83 *
84 * @since 0.4.0
85 * @see https://eslint.org/docs/rules/no-process-exit
86 */
87 "no-process-exit": Linter.RuleEntry<[]>;
88
89 /**
90 * Rule to disallow specified modules when loaded by `require`.
91 *
92 * @since 0.6.0
93 * @see https://eslint.org/docs/rules/no-restricted-modules
94 */
95 "no-restricted-modules": Linter.RuleEntry<
96 [
97 ...Array<
98 | string
99 | {
100 name: string;
101 message?: string | undefined;
102 }
103 | Partial<{
104 paths: Array<
105 | string
106 | {
107 name: string;
108 message?: string | undefined;
109 }
110 >;
111 patterns: string[];
112 }>
113 >
114 ]
115 >;
116
117 /**
118 * Rule to disallow synchronous methods.
119 *
120 * @since 0.0.9
121 * @see https://eslint.org/docs/rules/no-sync
122 */
123 "no-sync": Linter.RuleEntry<
124 [
125 {
126 /**
127 * @default false
128 */
129 allowAtRootLevel: boolean;
130 },
131 ]
132 >;
133}