eslint-plugin-ai-guard 1.1.13 → 1.2.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.
- package/README.md +337 -233
- package/dist/cli/index.js +1013 -104
- package/dist/cli/index.js.map +1 -1
- package/dist/index.d.mts +23 -4
- package/dist/index.d.ts +23 -4
- package/dist/index.js +385 -55
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +375 -55
- package/dist/index.mjs.map +1 -1
- package/package.json +10 -3
package/dist/index.d.mts
CHANGED
|
@@ -1,9 +1,22 @@
|
|
|
1
1
|
import * as _typescript_eslint_utils_ts_eslint from '@typescript-eslint/utils/ts-eslint';
|
|
2
2
|
import { TSESLint } from '@typescript-eslint/utils';
|
|
3
3
|
|
|
4
|
+
interface RuleOptions {
|
|
5
|
+
allowedFunctionNames?: string[];
|
|
6
|
+
frameworkFiles?: string[];
|
|
7
|
+
ignorePassThroughWrappers?: boolean;
|
|
8
|
+
ignoreHandlerFunctions?: boolean;
|
|
9
|
+
}
|
|
10
|
+
|
|
4
11
|
/**
|
|
5
12
|
* All rules exported by the plugin.
|
|
6
13
|
* Each key is the rule name (without the plugin prefix).
|
|
14
|
+
*
|
|
15
|
+
* Categories (internal source directories):
|
|
16
|
+
* reliability/ — error handling & exception patterns
|
|
17
|
+
* async/ — async/await & promise patterns
|
|
18
|
+
* security/ — secrets, injection, auth gaps
|
|
19
|
+
* ai-patterns/ — AI-specific code slop: dead code, quality issues
|
|
7
20
|
*/
|
|
8
21
|
declare const allRules: {
|
|
9
22
|
readonly 'no-empty-catch': _typescript_eslint_utils_ts_eslint.RuleModule<"emptyCatch" | "addTodoHandler", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
@@ -24,10 +37,10 @@ declare const allRules: {
|
|
|
24
37
|
readonly 'no-floating-promise': _typescript_eslint_utils_ts_eslint.RuleModule<"floatingPromise", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
25
38
|
name: string;
|
|
26
39
|
};
|
|
27
|
-
readonly 'no-await-in-loop': _typescript_eslint_utils_ts_eslint.RuleModule<"awaitInLoop", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
40
|
+
readonly 'no-await-in-loop': _typescript_eslint_utils_ts_eslint.RuleModule<"awaitInLoop", [{}], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
28
41
|
name: string;
|
|
29
42
|
};
|
|
30
|
-
readonly 'no-async-without-await': _typescript_eslint_utils_ts_eslint.RuleModule<"asyncWithoutAwait", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
43
|
+
readonly 'no-async-without-await': _typescript_eslint_utils_ts_eslint.RuleModule<"asyncWithoutAwait" | "asyncPassThrough", [RuleOptions], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
31
44
|
name: string;
|
|
32
45
|
};
|
|
33
46
|
readonly 'no-redundant-await': _typescript_eslint_utils_ts_eslint.RuleModule<"redundantAwait", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
@@ -59,6 +72,9 @@ declare const allRules: {
|
|
|
59
72
|
readonly 'no-duplicate-logic-block': _typescript_eslint_utils_ts_eslint.RuleModule<"duplicateLogic", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
60
73
|
name: string;
|
|
61
74
|
};
|
|
75
|
+
readonly 'no-dead-branch': _typescript_eslint_utils_ts_eslint.RuleModule<"alwaysTrue" | "alwaysFalse" | "whileFalse", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
76
|
+
name: string;
|
|
77
|
+
};
|
|
62
78
|
};
|
|
63
79
|
|
|
64
80
|
declare const recommended: TSESLint.ClassicConfig.Config;
|
|
@@ -91,10 +107,10 @@ declare const plugin: {
|
|
|
91
107
|
readonly 'no-floating-promise': _typescript_eslint_utils_ts_eslint.RuleModule<"floatingPromise", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
92
108
|
name: string;
|
|
93
109
|
};
|
|
94
|
-
readonly 'no-await-in-loop': _typescript_eslint_utils_ts_eslint.RuleModule<"awaitInLoop", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
110
|
+
readonly 'no-await-in-loop': _typescript_eslint_utils_ts_eslint.RuleModule<"awaitInLoop", [{}], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
95
111
|
name: string;
|
|
96
112
|
};
|
|
97
|
-
readonly 'no-async-without-await': _typescript_eslint_utils_ts_eslint.RuleModule<"asyncWithoutAwait", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
113
|
+
readonly 'no-async-without-await': _typescript_eslint_utils_ts_eslint.RuleModule<"asyncWithoutAwait" | "asyncPassThrough", [RuleOptions], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
98
114
|
name: string;
|
|
99
115
|
};
|
|
100
116
|
readonly 'no-redundant-await': _typescript_eslint_utils_ts_eslint.RuleModule<"redundantAwait", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
@@ -126,6 +142,9 @@ declare const plugin: {
|
|
|
126
142
|
readonly 'no-duplicate-logic-block': _typescript_eslint_utils_ts_eslint.RuleModule<"duplicateLogic", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
127
143
|
name: string;
|
|
128
144
|
};
|
|
145
|
+
readonly 'no-dead-branch': _typescript_eslint_utils_ts_eslint.RuleModule<"alwaysTrue" | "alwaysFalse" | "whileFalse", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
146
|
+
name: string;
|
|
147
|
+
};
|
|
129
148
|
};
|
|
130
149
|
configs: {
|
|
131
150
|
recommended: _typescript_eslint_utils_ts_eslint.ClassicConfig.Config;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,22 @@
|
|
|
1
1
|
import * as _typescript_eslint_utils_ts_eslint from '@typescript-eslint/utils/ts-eslint';
|
|
2
2
|
import { TSESLint } from '@typescript-eslint/utils';
|
|
3
3
|
|
|
4
|
+
interface RuleOptions {
|
|
5
|
+
allowedFunctionNames?: string[];
|
|
6
|
+
frameworkFiles?: string[];
|
|
7
|
+
ignorePassThroughWrappers?: boolean;
|
|
8
|
+
ignoreHandlerFunctions?: boolean;
|
|
9
|
+
}
|
|
10
|
+
|
|
4
11
|
/**
|
|
5
12
|
* All rules exported by the plugin.
|
|
6
13
|
* Each key is the rule name (without the plugin prefix).
|
|
14
|
+
*
|
|
15
|
+
* Categories (internal source directories):
|
|
16
|
+
* reliability/ — error handling & exception patterns
|
|
17
|
+
* async/ — async/await & promise patterns
|
|
18
|
+
* security/ — secrets, injection, auth gaps
|
|
19
|
+
* ai-patterns/ — AI-specific code slop: dead code, quality issues
|
|
7
20
|
*/
|
|
8
21
|
declare const allRules: {
|
|
9
22
|
readonly 'no-empty-catch': _typescript_eslint_utils_ts_eslint.RuleModule<"emptyCatch" | "addTodoHandler", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
@@ -24,10 +37,10 @@ declare const allRules: {
|
|
|
24
37
|
readonly 'no-floating-promise': _typescript_eslint_utils_ts_eslint.RuleModule<"floatingPromise", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
25
38
|
name: string;
|
|
26
39
|
};
|
|
27
|
-
readonly 'no-await-in-loop': _typescript_eslint_utils_ts_eslint.RuleModule<"awaitInLoop", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
40
|
+
readonly 'no-await-in-loop': _typescript_eslint_utils_ts_eslint.RuleModule<"awaitInLoop", [{}], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
28
41
|
name: string;
|
|
29
42
|
};
|
|
30
|
-
readonly 'no-async-without-await': _typescript_eslint_utils_ts_eslint.RuleModule<"asyncWithoutAwait", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
43
|
+
readonly 'no-async-without-await': _typescript_eslint_utils_ts_eslint.RuleModule<"asyncWithoutAwait" | "asyncPassThrough", [RuleOptions], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
31
44
|
name: string;
|
|
32
45
|
};
|
|
33
46
|
readonly 'no-redundant-await': _typescript_eslint_utils_ts_eslint.RuleModule<"redundantAwait", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
@@ -59,6 +72,9 @@ declare const allRules: {
|
|
|
59
72
|
readonly 'no-duplicate-logic-block': _typescript_eslint_utils_ts_eslint.RuleModule<"duplicateLogic", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
60
73
|
name: string;
|
|
61
74
|
};
|
|
75
|
+
readonly 'no-dead-branch': _typescript_eslint_utils_ts_eslint.RuleModule<"alwaysTrue" | "alwaysFalse" | "whileFalse", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
76
|
+
name: string;
|
|
77
|
+
};
|
|
62
78
|
};
|
|
63
79
|
|
|
64
80
|
declare const recommended: TSESLint.ClassicConfig.Config;
|
|
@@ -91,10 +107,10 @@ declare const plugin: {
|
|
|
91
107
|
readonly 'no-floating-promise': _typescript_eslint_utils_ts_eslint.RuleModule<"floatingPromise", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
92
108
|
name: string;
|
|
93
109
|
};
|
|
94
|
-
readonly 'no-await-in-loop': _typescript_eslint_utils_ts_eslint.RuleModule<"awaitInLoop", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
110
|
+
readonly 'no-await-in-loop': _typescript_eslint_utils_ts_eslint.RuleModule<"awaitInLoop", [{}], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
95
111
|
name: string;
|
|
96
112
|
};
|
|
97
|
-
readonly 'no-async-without-await': _typescript_eslint_utils_ts_eslint.RuleModule<"asyncWithoutAwait", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
113
|
+
readonly 'no-async-without-await': _typescript_eslint_utils_ts_eslint.RuleModule<"asyncWithoutAwait" | "asyncPassThrough", [RuleOptions], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
98
114
|
name: string;
|
|
99
115
|
};
|
|
100
116
|
readonly 'no-redundant-await': _typescript_eslint_utils_ts_eslint.RuleModule<"redundantAwait", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
@@ -126,6 +142,9 @@ declare const plugin: {
|
|
|
126
142
|
readonly 'no-duplicate-logic-block': _typescript_eslint_utils_ts_eslint.RuleModule<"duplicateLogic", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
127
143
|
name: string;
|
|
128
144
|
};
|
|
145
|
+
readonly 'no-dead-branch': _typescript_eslint_utils_ts_eslint.RuleModule<"alwaysTrue" | "alwaysFalse" | "whileFalse", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
146
|
+
name: string;
|
|
147
|
+
};
|
|
129
148
|
};
|
|
130
149
|
configs: {
|
|
131
150
|
recommended: _typescript_eslint_utils_ts_eslint.ClassicConfig.Config;
|