eslint-plugin-reliability 3.1.7 → 3.1.9

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.
@@ -1,26 +0,0 @@
1
- /**
2
- * Copyright (c) 2025 Ofri Peretz
3
- * Licensed under the MIT License. Use of this source code is governed by the
4
- * MIT license that can be found in the LICENSE file.
5
- */
6
- /**
7
- * ESLint Rule: no-missing-error-context
8
- * Detects thrown errors without context
9
- *
10
- * @see https://rules.sonarsource.com/javascript/RSPEC-1128/
11
- */
12
- import type { TSESLint } from '@interlace/eslint-devkit';
13
- type MessageIds = 'missingErrorContext' | 'addErrorMessage' | 'addErrorStack' | 'useErrorClass';
14
- export interface Options {
15
- /** Require error message. Default: true */
16
- requireMessage?: boolean;
17
- /** Require stack trace. Default: false */
18
- requireStackTrace?: boolean;
19
- /** Ignore in test files. Default: true */
20
- ignoreInTests?: boolean;
21
- }
22
- type RuleOptions = [Options?];
23
- export declare const noMissingErrorContext: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
24
- name: string;
25
- };
26
- export {};
@@ -1,24 +0,0 @@
1
- /**
2
- * Copyright (c) 2025 Ofri Peretz
3
- * Licensed under the MIT License. Use of this source code is governed by the
4
- * MIT license that can be found in the LICENSE file.
5
- */
6
- /**
7
- * ESLint Rule: no-silent-errors
8
- * Detects empty catch blocks
9
- *
10
- * @see https://rules.sonarsource.com/javascript/RSPEC-1186/
11
- */
12
- import type { TSESLint } from '@interlace/eslint-devkit';
13
- type MessageIds = 'silentError' | 'addErrorLogging' | 'addErrorHandling' | 'rethrowError';
14
- export interface Options {
15
- /** Allow empty catch if comment explains why. Default: false */
16
- allowWithComment?: boolean;
17
- /** Ignore in test files. Default: true */
18
- ignoreInTests?: boolean;
19
- }
20
- type RuleOptions = [Options?];
21
- export declare const noSilentErrors: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
22
- name: string;
23
- };
24
- export {};
@@ -1,49 +0,0 @@
1
- /**
2
- * Copyright (c) 2025 Ofri Peretz
3
- * Licensed under the MIT License. Use of this source code is governed by the
4
- * MIT license that can be found in the LICENSE file.
5
- */
6
- /**
7
- * ESLint Rule: no-unhandled-promise
8
- * Detects unhandled Promise rejections
9
- * CWE-1024: Comparison of Classes by Name
10
- *
11
- * @see https://cwe.mitre.org/data/definitions/1024.html
12
- * @see https://rules.sonarsource.com/javascript/RSPEC-4635/
13
- */
14
- import type { TSESLint, TSESTree } from '@interlace/eslint-devkit';
15
- type MessageIds = 'unhandledPromise' | 'addCatch' | 'useTryCatch' | 'useAwait';
16
- export interface Options {
17
- /** Ignore promises in test files. Default: true */
18
- ignoreInTests?: boolean;
19
- /** Ignore promises in void expressions. Default: false */
20
- ignoreVoidExpressions?: boolean;
21
- }
22
- type RuleOptions = [Options?];
23
- /**
24
- * Returns true if the call MIGHT return a Promise (default — we want to
25
- * preserve detection for unknown calls). Returns false only when the
26
- * callee is a known synchronous built-in (`setTimeout`, `console.log`,
27
- * `Math.floor`, etc.) — those structurally never return promises and
28
- * firing on them produces FPs. Keeping the default as "could be a
29
- * promise" preserves recall on user-defined async functions.
30
- *
31
- * Exported for direct Layer-2 unit testing: the non-CallExpression early
32
- * return is only reachable when called with a non-call node (kept for the
33
- * future `checkIdentifier` listener), which the current CallExpression-only
34
- * listener never produces.
35
- */
36
- export declare function isLikelyPromiseExpression(node: TSESTree.Node): boolean;
37
- /**
38
- * Check if promise is handled (has .catch, .then, or is in try/catch)
39
- *
40
- * Exported for direct Layer-2 unit testing: the Identifier branch is only
41
- * reachable when called with an Identifier node (kept for the future
42
- * `checkIdentifier` listener), which the current CallExpression-only
43
- * listener never produces.
44
- */
45
- export declare function isPromiseHandled(node: TSESTree.Node): boolean;
46
- export declare const noUnhandledPromise: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
47
- name: string;
48
- };
49
- export {};
@@ -1,24 +0,0 @@
1
- /**
2
- * Copyright (c) 2025 Ofri Peretz
3
- * Licensed under the MIT License. Use of this source code is governed by the
4
- * MIT license that can be found in the LICENSE file.
5
- */
6
- /**
7
- * ESLint Rule: no-await-in-loop
8
- * Disallow await inside loops without considering concurrency implications (unicorn-inspired)
9
- */
10
- import type { TSESLint } from '@interlace/eslint-devkit';
11
- type MessageIds = 'awaitInLoop' | 'suggestPromiseAll' | 'suggestConcurrent' | 'considerSequential' | 'asyncLoopPattern';
12
- export interface Options {
13
- /** Allow await in for-of loops */
14
- allowForOf?: boolean;
15
- /** Allow await in while loops */
16
- allowWhile?: boolean;
17
- /** Check for potential concurrent execution opportunities */
18
- checkConcurrency?: boolean;
19
- }
20
- type RuleOptions = [Options?];
21
- export declare const noAwaitInLoop: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
22
- name: string;
23
- };
24
- export {};
@@ -1,35 +0,0 @@
1
- /**
2
- * Copyright (c) 2025 Ofri Peretz
3
- * Licensed under the MIT License. Use of this source code is governed by the
4
- * MIT license that can be found in the LICENSE file.
5
- */
6
- /**
7
- * ESLint Rule: no-jsdoc-terminator-in-example
8
- * Detects `* /` sequences inside JSDoc @example blocks that can
9
- * prematurely close the comment and cause TypeScript compilation errors.
10
- *
11
- * Inspired by real DefinitelyTyped CI failures where patterns like
12
- * `*\/*` (MIME types, glob patterns) inside @example terminated the
13
- * JSDoc block early, producing broken type definitions.
14
- *
15
- * @see https://github.com/microsoft/dtslint
16
- */
17
- import type { TSESLint } from '@interlace/eslint-devkit';
18
- type MessageIds = 'jsdocTerminatorInExample' | 'wrapInQuotes';
19
- export interface Options {
20
- }
21
- type RuleOptions = [Options?];
22
- /**
23
- * Check whether a comment line is inside an @example block.
24
- * We track this by scanning line-by-line for @example / next-tag boundaries.
25
- *
26
- * Exported for direct Layer-2 unit testing: a real parser terminates the
27
- * enclosing block comment at the first star-slash sequence, so a comment
28
- * value containing one can never reach this function through a
29
- * normally-parsed file.
30
- */
31
- export declare function findTerminatorsInExamples(commentText: string): number[];
32
- export declare const noJsdocTerminatorInExample: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
33
- name: string;
34
- };
35
- export {};
@@ -1,35 +0,0 @@
1
- /**
2
- * Copyright (c) 2025 Ofri Peretz
3
- * Licensed under the MIT License. Use of this source code is governed by the
4
- * MIT license that can be found in the LICENSE file.
5
- */
6
- /**
7
- * ESLint Rule: no-missing-null-checks
8
- * Detects potential null pointer dereferences
9
- * CWE-476: NULL Pointer Dereference
10
- *
11
- * @see https://cwe.mitre.org/data/definitions/476.html
12
- * @see https://rules.sonarsource.com/javascript/RSPEC-2259/
13
- */
14
- import type { TSESLint, TSESTree } from '@interlace/eslint-devkit';
15
- type MessageIds = 'missingNullCheck' | 'useOptionalChaining' | 'useNullishCoalescing' | 'addExplicitCheck';
16
- export interface Options {
17
- /** Ignore in test files. Default: true */
18
- ignoreInTests?: boolean;
19
- /** Require explicit null checks. Default: false */
20
- requireExplicitChecks?: boolean;
21
- }
22
- type RuleOptions = [Options?];
23
- /**
24
- * Check if property access has null/undefined check
25
- *
26
- * Exported for direct Layer-2 unit testing: the `node.optional` and
27
- * ChainExpression early returns are defensive duplicates of checks both
28
- * callers perform before invoking this helper, so they are unreachable
29
- * through the rule's listeners.
30
- */
31
- export declare function hasNullCheck(node: TSESTree.MemberExpression, sourceCode: TSESLint.SourceCode): boolean;
32
- export declare const noMissingNullChecks: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
33
- name: string;
34
- };
35
- export {};
@@ -1,24 +0,0 @@
1
- /**
2
- * Copyright (c) 2025 Ofri Peretz
3
- * Licensed under the MIT License. Use of this source code is governed by the
4
- * MIT license that can be found in the LICENSE file.
5
- */
6
- /**
7
- * ESLint Rule: no-unsafe-type-narrowing
8
- * Detects unsafe type narrowing patterns
9
- *
10
- * @see https://rules.sonarsource.com/javascript/RSPEC-4326/
11
- */
12
- import type { TSESLint } from '@interlace/eslint-devkit';
13
- type MessageIds = 'unsafeTypeNarrowing' | 'useTypeGuard' | 'useProperNarrowing' | 'validateBeforeAssert';
14
- export interface Options {
15
- /** Ignore in test files. Default: true */
16
- ignoreInTests?: boolean;
17
- /** Allow type assertions with comments. Default: false */
18
- allowWithComment?: boolean;
19
- }
20
- type RuleOptions = [Options?];
21
- export declare const noUnsafeTypeNarrowing: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
22
- name: string;
23
- };
24
- export {};
@@ -1,12 +0,0 @@
1
- /**
2
- * Copyright (c) 2025 Ofri Peretz
3
- * Licensed under the MIT License. Use of this source code is governed by the
4
- * MIT license that can be found in the LICENSE file.
5
- */
6
- export interface Options {
7
- }
8
- type RuleOptions = [Options?];
9
- export declare const requireNetworkTimeout: import("@typescript-eslint/utils/ts-eslint").RuleModule<"violationDetected", RuleOptions, unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
10
- name: string;
11
- };
12
- export {};