@lipemat/eslint-config 4.0.4 → 5.0.0-beta.2

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.
@@ -0,0 +1,6 @@
1
+ import { type TSESLint } from '@typescript-eslint/utils';
2
+ type HtmlExecutingFunctions = 'document.write' | 'document.writeln';
3
+ type UnsafeCalls = 'after' | 'append' | 'before' | 'insertAdjacentHTML' | 'prepend' | 'replaceWith' | 'setAttribute';
4
+ type Messages = HtmlExecutingFunctions | UnsafeCalls | 'sanitize' | 'domPurify';
5
+ declare const plugin: TSESLint.RuleModule<Messages>;
6
+ export default plugin;
@@ -0,0 +1,4 @@
1
+ import { type TSESLint } from '@typescript-eslint/utils';
2
+ type Messages = 'setTimeoutString' | 'setIntervalString' | 'windowOpenUnsanitized' | 'cssTextUnsanitized' | 'sanitize' | 'domPurify';
3
+ declare const plugin: TSESLint.RuleModule<Messages>;
4
+ export default plugin;
@@ -0,0 +1,3 @@
1
+ import { type TSESLint } from '@typescript-eslint/utils';
2
+ declare const plugin: TSESLint.RuleModule<'htmlStringConcat'>;
3
+ export default plugin;
@@ -0,0 +1,17 @@
1
+ import { type TSESLint, type TSESTree } from '@typescript-eslint/utils';
2
+ type UnsafeCalls = 'after' | 'append' | 'appendTo' | 'before' | 'html' | 'insertAfter' | 'insertBefore' | 'prepend' | 'prependTo' | 'replaceAll' | 'replaceWith';
3
+ type Messages = 'needsEscaping' | 'sanitize' | 'domPurify';
4
+ type Context = TSESLint.RuleContext<Messages, []>;
5
+ /**
6
+ * Is the type of variable being passed a jQuery element?
7
+ *
8
+ * - jQuery elements are of type `JQuery`.
9
+ * - jQuery elements do not require sanitization.
10
+ *
11
+ * @link https://typescript-eslint.io/developers/custom-rules/#typed-rules
12
+ */
13
+ export declare function isJQueryElementType(arg: TSESTree.CallExpressionArgument, context: Context): boolean;
14
+ export declare function isJQueryCall(node: TSESTree.CallExpression): boolean;
15
+ export declare function getJQueryCall(node: TSESTree.CallExpression): UnsafeCalls | null;
16
+ declare const plugin: TSESLint.RuleModule<Messages>;
17
+ export default plugin;
@@ -0,0 +1,4 @@
1
+ import { type TSESLint } from '@typescript-eslint/utils';
2
+ type Messages = 'vulnerableTagStripping' | 'useTextOnly';
3
+ declare const plugin: TSESLint.RuleModule<Messages>;
4
+ export default plugin;
@@ -0,0 +1,5 @@
1
+ import { type TSESLint } from '@typescript-eslint/utils';
2
+ type Messages = 'unsafeWindow' | 'unsafeRead' | 'unsafeWindowLocation' | 'domPurify' | 'sanitize';
3
+ export declare function isSafeUrlString(value: string): boolean;
4
+ declare const plugin: TSESLint.RuleModule<Messages>;
5
+ export default plugin;
@@ -0,0 +1,21 @@
1
+ import { type TSESLint, type TSESTree } from '@typescript-eslint/utils';
2
+ import { type Type } from 'typescript';
3
+ export declare function isStringLike(node: TSESTree.CallExpressionArgument, context: Readonly<TSESLint.RuleContext<string, readonly []>>): boolean;
4
+ /**
5
+ * Get the TypeScript type of node.
6
+ */
7
+ export declare function getType<Context extends Readonly<TSESLint.RuleContext<string, readonly []>>>(arg: TSESTree.CallExpressionArgument, context: Context): Type;
8
+ /**
9
+ * Is the type of variable being passed a DOM element?
10
+ *
11
+ * - DOM elements are of the type `HTML{*}Element`.
12
+ * - DOM elements do not require sanitization.
13
+ *
14
+ * @link https://typescript-eslint.io/developers/custom-rules/#typed-rules
15
+ */
16
+ export declare function isDomElementType<Context extends Readonly<TSESLint.RuleContext<string, readonly []>>>(arg: TSESTree.CallExpressionArgument, context: Context): boolean;
17
+ /**
18
+ * Check if a node is a call to a known sanitization function.
19
+ * - Currently recognizes `sanitize(...)` and `DOMPurify.sanitize(...)`.
20
+ */
21
+ export declare function isSanitized(node: TSESTree.Property['value'] | TSESTree.CallExpressionArgument): boolean;