eslint-plugin-sonarjs 4.0.1 → 4.0.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.
- package/README.md +1 -1
- package/cjs/S100/rule.js +7 -5
- package/cjs/S101/rule.js +2 -2
- package/cjs/S104/rule.js +2 -2
- package/cjs/S105/rule.js +2 -2
- package/cjs/S1066/rule.js +5 -4
- package/cjs/S1067/rule.js +8 -6
- package/cjs/S1110/rule.js +7 -5
- package/cjs/S1119/rule.js +2 -2
- package/cjs/S1121/rule.js +4 -3
- package/cjs/S1125/rule.js +9 -8
- package/cjs/S1126/rule.js +2 -2
- package/cjs/S1128/rule.js +8 -5
- package/cjs/S1134/rule.js +2 -2
- package/cjs/S1135/rule.js +2 -2
- package/cjs/S1154/rule.js +6 -4
- package/cjs/S117/rule.js +6 -5
- package/cjs/S1172/rule.js +2 -2
- package/cjs/S1192/rule.js +5 -4
- package/cjs/S1219/rule.js +4 -3
- package/cjs/S1226/rule.js +6 -4
- package/cjs/S124/rule.js +2 -2
- package/cjs/S125/rule.js +9 -7
- package/cjs/S126/rule.js +2 -2
- package/cjs/S1264/rule.js +2 -2
- package/cjs/S128/rule.js +4 -3
- package/cjs/S1291/rule.js +2 -2
- package/cjs/S1301/rule.js +2 -2
- package/cjs/S1313/rule.js +2 -2
- package/cjs/S134/rule.js +7 -5
- package/cjs/S135/rule.js +5 -4
- package/cjs/S138/rule.js +9 -6
- package/cjs/S1439/rule.js +2 -2
- package/cjs/S1444/rule.js +2 -2
- package/cjs/S1451/rule.js +2 -2
- package/cjs/S1472/rule.js +2 -2
- package/cjs/S1479/rule.js +2 -2
- package/cjs/S1481/rule.js +2 -2
- package/cjs/S1488/rule.js +11 -7
- package/cjs/S1515/rule.js +10 -8
- package/cjs/S1523/rule.js +5 -5
- package/cjs/S1526/rule.js +5 -4
- package/cjs/S1527/rule.js +2 -2
- package/cjs/S1528/rule.js +2 -2
- package/cjs/S1529/rule.js +4 -3
- package/cjs/S1530/rule.js +5 -3
- package/cjs/S1533/rule.js +2 -2
- package/cjs/S1535/rule.js +2 -2
- package/cjs/S1541/rule.js +10 -7
- package/cjs/S1607/rule.js +22 -20
- package/cjs/S1764/rule.js +10 -7
- package/cjs/S1821/rule.js +2 -2
- package/cjs/S1848/rule.js +10 -7
- package/cjs/S1854/rule.js +18 -14
- package/cjs/S1862/rule.js +10 -8
- package/cjs/S1871/rule.js +21 -16
- package/cjs/S1874/rule.js +4 -3
- package/cjs/S1940/rule.js +2 -2
- package/cjs/S1994/rule.js +10 -7
- package/cjs/S2004/rule.js +9 -7
- package/cjs/S2068/rule.js +75 -12
- package/cjs/S2077/rule.js +10 -6
- package/cjs/S2092/rule.js +2 -2
- package/cjs/S2123/rule.js +2 -2
- package/cjs/S2137/rule.js +2 -2
- package/cjs/S2138/rule.js +4 -3
- package/cjs/S2187/rule.js +2 -2
- package/cjs/S2201/rule.js +8 -5
- package/cjs/S2208/rule.js +2 -2
- package/cjs/S2234/rule.js +15 -11
- package/cjs/S2245/rule.js +4 -3
- package/cjs/S2251/rule.js +5 -4
- package/cjs/S2255/rule.js +6 -5
- package/cjs/S2259/rule.js +14 -9
- package/cjs/S2301/rule.js +14 -9
- package/cjs/S2310/rule.js +14 -11
- package/cjs/S2392/rule.js +7 -5
- package/cjs/S2424/rule.js +2 -2
- package/cjs/S2428/rule.js +8 -6
- package/cjs/S2486/rule.js +4 -3
- package/cjs/S2589/rule.js +12 -10
- package/cjs/S2598/rule.js +17 -14
- package/cjs/S2612/generated-meta.js +1 -1
- package/cjs/S2612/rule.js +8 -6
- package/cjs/S2639/rule.js +2 -2
- package/cjs/S2681/rule.js +2 -2
- package/cjs/S2692/rule.js +6 -4
- package/cjs/S2699/rule.js +40 -31
- package/cjs/S2703/rule.js +2 -2
- package/cjs/S2737/rule.js +6 -4
- package/cjs/S2755/rule.js +9 -6
- package/cjs/S2757/rule.js +2 -2
- package/cjs/S2817/rule.js +10 -7
- package/cjs/S2819/rule.js +16 -12
- package/cjs/S2870/rule.js +8 -5
- package/cjs/S2871/rule.js +12 -9
- package/cjs/S2970/rule.js +9 -8
- package/cjs/S2990/rule.js +2 -2
- package/cjs/S2999/rule.js +10 -7
- package/cjs/S3001/rule.js +2 -2
- package/cjs/S3003/rule.js +10 -7
- package/cjs/S3317/rule.js +4 -3
- package/cjs/S3330/rule.js +2 -2
- package/cjs/S3358/rule.js +2 -2
- package/cjs/S3402/rule.js +14 -10
- package/cjs/S3403/rule.js +10 -7
- package/cjs/S3415/rule.js +16 -13
- package/cjs/S3499/rule.js +5 -4
- package/cjs/S3500/rule.js +5 -4
- package/cjs/S3513/rule.js +5 -4
- package/cjs/S3514/rule.js +10 -7
- package/cjs/S3516/rule.js +10 -7
- package/cjs/S3524/rule.js +2 -2
- package/cjs/S3525/rule.js +6 -4
- package/cjs/S3531/rule.js +5 -3
- package/cjs/S3533/rule.js +8 -7
- package/cjs/S3579/rule.js +6 -4
- package/cjs/S3616/rule.js +6 -4
- package/cjs/S3626/rule.js +4 -3
- package/cjs/S3686/rule.js +7 -5
- package/cjs/S3699/rule.js +4 -3
- package/cjs/S3735/rule.js +8 -5
- package/cjs/S3757/rule.js +8 -6
- package/cjs/S3758/rule.js +9 -7
- package/cjs/S3760/rule.js +24 -21
- package/cjs/S3776/rule.js +26 -22
- package/cjs/S3782/rule.js +6 -4
- package/cjs/S3785/rule.js +9 -6
- package/cjs/S3796/rule.js +12 -8
- package/cjs/S3798/rule.js +4 -3
- package/cjs/S3800/rule.js +16 -11
- package/cjs/S3801/rule.js +15 -11
- package/cjs/S3827/rule.js +9 -6
- package/cjs/S3923/rule.js +9 -6
- package/cjs/S3972/rule.js +5 -4
- package/cjs/S3973/rule.js +7 -5
- package/cjs/S3981/rule.js +4 -3
- package/cjs/S3984/rule.js +4 -3
- package/cjs/S4030/rule.js +10 -7
- package/cjs/S4036/rule.js +7 -5
- package/cjs/S4043/rule.js +12 -8
- package/cjs/S4139/rule.js +7 -5
- package/cjs/S4143/rule.js +12 -9
- package/cjs/S4144/rule.js +12 -9
- package/cjs/S4158/rule.js +11 -8
- package/cjs/S4165/rule.js +14 -12
- package/cjs/S4322/rule.js +8 -5
- package/cjs/S4323/rule.js +4 -3
- package/cjs/S4324/rule.js +7 -5
- package/cjs/S4328/rule.js +2 -2
- package/cjs/S4335/rule.js +6 -4
- package/cjs/S4423/rule.js +4 -3
- package/cjs/S4423/rule.lib.js +8 -7
- package/cjs/S4426/rule.js +11 -10
- package/cjs/S4502/rule.js +16 -13
- package/cjs/S4507/rule.js +8 -6
- package/cjs/S4524/rule.js +2 -2
- package/cjs/S4619/rule.js +6 -4
- package/cjs/S4621/rule.js +5 -4
- package/cjs/S4622/rule.js +5 -3
- package/cjs/S4623/rule.js +8 -5
- package/cjs/S4624/rule.js +6 -4
- package/cjs/S4634/rule.js +4 -3
- package/cjs/S4721/rule.js +7 -5
- package/cjs/S4782/rule.js +7 -5
- package/cjs/S4784/rule.js +5 -4
- package/cjs/S4787/rule.js +9 -7
- package/cjs/S4790/rule.js +7 -5
- package/cjs/S4798/rule.js +2 -2
- package/cjs/S4817/rule.js +10 -8
- package/cjs/S4818/rule.js +4 -3
- package/cjs/S4822/rule.js +13 -9
- package/cjs/S4823/rule.js +4 -3
- package/cjs/S4829/rule.js +4 -3
- package/cjs/S4830/rule.js +11 -8
- package/cjs/S5042/rule.js +9 -7
- package/cjs/S5122/rule.js +40 -36
- package/cjs/S5148/rule.js +9 -8
- package/cjs/S5247/rule.js +22 -18
- package/cjs/S5256/rule.js +5 -4
- package/cjs/S5257/rule.js +4 -3
- package/cjs/S5260/rule.js +4 -3
- package/cjs/S5264/rule.js +4 -3
- package/cjs/S5332/rule.js +4 -3
- package/cjs/S5332/rule.lib.js +19 -17
- package/cjs/S5443/rule.js +2 -2
- package/cjs/S5527/rule.js +18 -14
- package/cjs/S5542/rule.js +6 -4
- package/cjs/S5547/rule.js +6 -4
- package/cjs/S5604/rule.js +15 -14
- package/cjs/S5659/rule.js +15 -12
- package/cjs/S5689/rule.js +11 -8
- package/cjs/S5691/rule.js +7 -5
- package/cjs/S5693/rule.js +14 -12
- package/cjs/S5725/rule.js +9 -6
- package/cjs/S5728/rule.js +7 -4
- package/cjs/S5730/rule.js +9 -6
- package/cjs/S5732/rule.js +8 -5
- package/cjs/S5734/rule.js +7 -4
- package/cjs/S5736/rule.js +8 -5
- package/cjs/S5739/rule.js +11 -8
- package/cjs/S5742/rule.js +7 -4
- package/cjs/S5743/rule.js +8 -6
- package/cjs/S5757/rule.js +13 -10
- package/cjs/S5759/rule.js +10 -7
- package/cjs/S5842/rule.js +2 -2
- package/cjs/S5843/rule.js +22 -19
- package/cjs/S5850/rule.js +4 -3
- package/cjs/S5852/rule.js +2 -2
- package/cjs/S5856/rule.js +10 -7
- package/cjs/S5860/rule.js +30 -26
- package/cjs/S5863/rule.js +15 -11
- package/cjs/S5867/rule.js +8 -7
- package/cjs/S5868/rule.js +7 -5
- package/cjs/S5869/rule.js +6 -5
- package/cjs/S5876/rule.js +12 -8
- package/cjs/S5958/rule.js +12 -9
- package/cjs/S5973/rule.js +10 -7
- package/cjs/S6019/rule.js +4 -3
- package/cjs/S6035/rule.js +2 -2
- package/cjs/S6079/rule.js +9 -6
- package/cjs/S6080/rule.js +13 -10
- package/cjs/S6092/rule.js +9 -7
- package/cjs/S6245/rule.js +14 -9
- package/cjs/S6249/rule.js +7 -5
- package/cjs/S6252/rule.js +12 -8
- package/cjs/S6265/rule.js +27 -20
- package/cjs/S6268/rule.js +5 -4
- package/cjs/S6270/rule.js +12 -9
- package/cjs/S6275/rule.js +2 -2
- package/cjs/S6281/rule.js +22 -17
- package/cjs/S6299/rule.js +2 -2
- package/cjs/S6302/rule.js +6 -5
- package/cjs/S6303/rule.js +12 -10
- package/cjs/S6304/rule.js +6 -5
- package/cjs/S6308/rule.js +7 -5
- package/cjs/S6317/rule.js +5 -4
- package/cjs/S6319/rule.js +2 -2
- package/cjs/S6321/rule.js +25 -23
- package/cjs/S6323/rule.js +4 -3
- package/cjs/S6324/rule.js +2 -2
- package/cjs/S6326/rule.js +2 -2
- package/cjs/S6327/rule.js +2 -2
- package/cjs/S6328/rule.js +4 -3
- package/cjs/S6329/rule.js +7 -5
- package/cjs/S6330/rule.js +2 -2
- package/cjs/S6332/rule.js +2 -2
- package/cjs/S6333/rule.js +8 -6
- package/cjs/S6351/rule.js +22 -19
- package/cjs/S6353/rule.js +2 -2
- package/cjs/S6397/rule.js +2 -2
- package/cjs/S6418/rule.js +9 -24
- package/cjs/S6426/rule.js +5 -4
- package/cjs/S6437/rule.js +10 -7
- package/cjs/S6439/rule.js +9 -7
- package/cjs/S6442/rule.js +11 -8
- package/cjs/S6443/rule.js +9 -7
- package/cjs/S6486/rule.js +5 -4
- package/cjs/S6564/rule.js +4 -3
- package/cjs/S6594/rule.js +12 -8
- package/cjs/S6627/rule.js +6 -4
- package/cjs/S6759/rule.js +10 -6
- package/cjs/S6958/rule.js +2 -2
- package/cjs/S6959/rule.js +9 -6
- package/cjs/S7059/rule.js +8 -5
- package/cjs/S7639/rule.js +5 -4
- package/cjs/S7790/rule.js +7 -5
- package/cjs/S8441/rule.js +13 -9
- package/cjs/S881/rule.js +2 -2
- package/cjs/S888/rule.js +4 -3
- package/cjs/S930/rule.js +14 -12
- package/cjs/helpers/ast.js +11 -8
- package/cjs/helpers/aws/s3.js +9 -6
- package/cjs/helpers/chai.js +41 -43
- package/cjs/helpers/cookie-flag-check.js +19 -17
- package/cjs/helpers/{decorators/index.js → entropy.js} +16 -17
- package/cjs/helpers/express.js +127 -128
- package/cjs/helpers/mocha.js +50 -54
- package/cjs/helpers/regex/ast.js +7 -6
- package/cjs/helpers/regex/extract.js +11 -11
- package/cjs/helpers/regex/group.js +2 -2
- package/cjs/helpers/regex/location.js +2 -2
- package/cjs/helpers/regex/range.js +5 -4
- package/cjs/helpers/regex/rule-template.js +4 -3
- package/cjs/helpers/sinon.js +33 -36
- package/cjs/helpers/supertest.js +34 -37
- package/cjs/helpers/vitest.js +29 -32
- package/docs/file-permissions.md +1 -1
- package/package.json +39 -1
- package/types/helpers/ancestor.d.ts +1 -1
- package/types/helpers/aws/s3.d.ts +1 -1
- package/types/helpers/chai.d.ts +3 -5
- package/types/helpers/entropy.d.ts +1 -0
- package/types/helpers/express.d.ts +38 -43
- package/types/helpers/mocha.d.ts +19 -21
- package/types/helpers/regex/ast.d.ts +1 -1
- package/types/helpers/regex/rule-template.d.ts +1 -1
- package/types/helpers/sinon.d.ts +3 -5
- package/types/helpers/supertest.d.ts +3 -5
- package/types/helpers/type.d.ts +1 -1
- package/types/helpers/vitest.d.ts +3 -5
- package/cjs/helpers/aws/index.js +0 -35
- package/cjs/helpers/decorators/interceptor.js +0 -88
- package/cjs/helpers/index.js +0 -60
- package/cjs/helpers/recognizers/index.js +0 -37
- package/cjs/helpers/rule-detect-react.js +0 -29
- package/cjs/helpers/validate-version.js +0 -94
- package/types/helpers/aws/index.d.ts +0 -3
- package/types/helpers/decorators/index.d.ts +0 -2
- package/types/helpers/decorators/interceptor.d.ts +0 -16
- package/types/helpers/index.d.ts +0 -28
- package/types/helpers/recognizers/index.d.ts +0 -2
- package/types/helpers/rule-detect-react.d.ts +0 -2
- package/types/helpers/validate-version.d.ts +0 -13
|
@@ -2,47 +2,42 @@ import type { Rule } from 'eslint';
|
|
|
2
2
|
import type estree from 'estree';
|
|
3
3
|
import type { RulesMeta } from '@eslint/core';
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Checks whether the declaration looks somewhat like `<id> = express()`
|
|
6
|
+
* and returns `<id>` if it matches.
|
|
6
7
|
*/
|
|
7
|
-
export declare
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
* @param message - the reported message when an issue is raised
|
|
44
|
-
* @param meta - the rule metadata
|
|
45
|
-
* @returns a rule module that raises issues when a sensitive property is found
|
|
46
|
-
*/
|
|
47
|
-
function SensitiveMiddlewarePropertyRule(sensitivePropertyFinder: (context: Rule.RuleContext, middlewareCall: estree.CallExpression) => estree.Property[], message: string, meta?: RulesMeta): Rule.RuleModule;
|
|
48
|
-
}
|
|
8
|
+
export declare function attemptFindAppInstantiation(varDecl: estree.VariableDeclarator, context: Rule.RuleContext): estree.Identifier | undefined;
|
|
9
|
+
/**
|
|
10
|
+
* Checks whether the function injects an instantiated app and is exported like `module.exports = function(app) {}`
|
|
11
|
+
* or `module.exports.property = function(app) {}`, and returns app if it matches.
|
|
12
|
+
*/
|
|
13
|
+
export declare function attemptFindAppInjection(functionDef: estree.Function, context: Rule.RuleContext, node: estree.Node): estree.Identifier | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* Checks whether the expression looks somewhat like `app.use(m1, [m2, m3], ..., mN)`,
|
|
16
|
+
* where one of `mK`-nodes satisfies the given predicate.
|
|
17
|
+
*/
|
|
18
|
+
export declare function isUsingMiddleware(context: Rule.RuleContext, callExpression: estree.CallExpression, app: estree.Identifier, middlewareNodePredicate: (n: estree.Node) => boolean): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Checks whether a node looks somewhat like `require('m')()` for
|
|
21
|
+
* some middleware `m` from the list of middlewares.
|
|
22
|
+
*/
|
|
23
|
+
export declare function isMiddlewareInstance(context: Rule.RuleContext, middlewares: string[], n: estree.Node): boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Rule factory for detecting sensitive settings that are passed to
|
|
26
|
+
* middlewares eventually used by Express.js applications:
|
|
27
|
+
*
|
|
28
|
+
* app.use(
|
|
29
|
+
* middleware(settings)
|
|
30
|
+
* )
|
|
31
|
+
*
|
|
32
|
+
* or
|
|
33
|
+
*
|
|
34
|
+
* app.use(
|
|
35
|
+
* middleware.method(settings)
|
|
36
|
+
* )
|
|
37
|
+
*
|
|
38
|
+
* @param sensitivePropertyFinder - a function looking for a sensitive setting on a middleware call
|
|
39
|
+
* @param message - the reported message when an issue is raised
|
|
40
|
+
* @param meta - the rule metadata
|
|
41
|
+
* @returns a rule module that raises issues when a sensitive property is found
|
|
42
|
+
*/
|
|
43
|
+
export declare function SensitiveMiddlewarePropertyRule(sensitivePropertyFinder: (context: Rule.RuleContext, middlewareCall: estree.CallExpression) => estree.Property[], message: string, meta?: RulesMeta): Rule.RuleModule;
|
package/types/helpers/mocha.d.ts
CHANGED
|
@@ -1,23 +1,21 @@
|
|
|
1
1
|
import type estree from 'estree';
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
callback: estree.Function;
|
|
6
|
-
}
|
|
7
|
-
function isTestConstruct(node: estree.Node, constructs?: string[]): boolean;
|
|
8
|
-
function extractTestCase(node: estree.Node): TestCase | null;
|
|
9
|
-
/**
|
|
10
|
-
* returns true if the node is a test case
|
|
11
|
-
*
|
|
12
|
-
* @param node
|
|
13
|
-
* @returns
|
|
14
|
-
*/
|
|
15
|
-
function isTestCase(node: estree.Node): boolean;
|
|
16
|
-
/**
|
|
17
|
-
* returns true if the node is a describe block
|
|
18
|
-
*
|
|
19
|
-
* @param node
|
|
20
|
-
* @returns
|
|
21
|
-
*/
|
|
22
|
-
function isDescribeCase(node: estree.Node): boolean;
|
|
2
|
+
export interface TestCase {
|
|
3
|
+
node: estree.Node;
|
|
4
|
+
callback: estree.Function;
|
|
23
5
|
}
|
|
6
|
+
export declare function isTestConstruct(node: estree.Node, constructs?: string[]): boolean;
|
|
7
|
+
export declare function extractTestCase(node: estree.Node): TestCase | null;
|
|
8
|
+
/**
|
|
9
|
+
* returns true if the node is a test case
|
|
10
|
+
*
|
|
11
|
+
* @param node
|
|
12
|
+
* @returns
|
|
13
|
+
*/
|
|
14
|
+
export declare function isTestCase(node: estree.Node): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* returns true if the node is a describe block
|
|
17
|
+
*
|
|
18
|
+
* @param node
|
|
19
|
+
* @returns
|
|
20
|
+
*/
|
|
21
|
+
export declare function isDescribeCase(node: estree.Node): boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type estree from 'estree';
|
|
2
|
-
import {
|
|
2
|
+
import type { RequiredParserServices } from '../parser-services.js';
|
|
3
3
|
export declare function isRegExpConstructor(node: estree.Node): node is estree.CallExpression;
|
|
4
4
|
export declare function isStringReplaceCall(call: estree.CallExpression, services: RequiredParserServices): boolean;
|
|
5
5
|
export declare function isStringRegexMethodCall(call: estree.CallExpression, services: RequiredParserServices): boolean;
|
|
@@ -3,7 +3,7 @@ import type { RulesMeta } from '@eslint/core';
|
|
|
3
3
|
import type estree from 'estree';
|
|
4
4
|
import * as regexpp from '@eslint-community/regexpp';
|
|
5
5
|
import type { RegExpVisitor } from '@eslint-community/regexpp/visitor';
|
|
6
|
-
import { type IssueLocation } from '../
|
|
6
|
+
import { type IssueLocation } from '../location.js';
|
|
7
7
|
/**
|
|
8
8
|
* Rule context for regex rules that also includes the original ESLint node
|
|
9
9
|
* denoting the regular expression (string) literal.
|
package/types/helpers/sinon.d.ts
CHANGED
|
@@ -2,8 +2,6 @@ import type { Rule } from 'eslint';
|
|
|
2
2
|
import type estree from 'estree';
|
|
3
3
|
import type { ParserServicesWithTypeInformation } from '@typescript-eslint/utils';
|
|
4
4
|
import ts from 'typescript';
|
|
5
|
-
export declare
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
function isTSAssertion(services: ParserServicesWithTypeInformation, node: ts.Node): boolean;
|
|
9
|
-
}
|
|
5
|
+
export declare function isImported(context: Rule.RuleContext): boolean;
|
|
6
|
+
export declare function isAssertion(context: Rule.RuleContext, node: estree.Node): boolean;
|
|
7
|
+
export declare function isTSAssertion(services: ParserServicesWithTypeInformation, node: ts.Node): boolean;
|
|
@@ -2,8 +2,6 @@ import type { Rule } from 'eslint';
|
|
|
2
2
|
import type estree from 'estree';
|
|
3
3
|
import type { ParserServicesWithTypeInformation } from '@typescript-eslint/utils';
|
|
4
4
|
import ts from 'typescript';
|
|
5
|
-
export declare
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
function isTSAssertion(services: ParserServicesWithTypeInformation, node: ts.Node): boolean;
|
|
9
|
-
}
|
|
5
|
+
export declare function isImported(context: Rule.RuleContext): boolean;
|
|
6
|
+
export declare function isAssertion(context: Rule.RuleContext, node: estree.Node): boolean;
|
|
7
|
+
export declare function isTSAssertion(services: ParserServicesWithTypeInformation, node: ts.Node): boolean;
|
package/types/helpers/type.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type estree from 'estree';
|
|
2
2
|
import ts from 'typescript';
|
|
3
3
|
import type { TSESLint, TSESTree } from '@typescript-eslint/utils';
|
|
4
|
-
import type { RequiredParserServices } from '
|
|
4
|
+
import type { RequiredParserServices } from './parser-services.js';
|
|
5
5
|
import type { Rule } from 'eslint';
|
|
6
6
|
export type RuleContext = TSESLint.RuleContext<string, string[]>;
|
|
7
7
|
export declare function isArray(node: estree.Node, services: RequiredParserServices): boolean;
|
|
@@ -2,8 +2,6 @@ import type { Rule } from 'eslint';
|
|
|
2
2
|
import type estree from 'estree';
|
|
3
3
|
import type { ParserServicesWithTypeInformation } from '@typescript-eslint/utils';
|
|
4
4
|
import ts from 'typescript';
|
|
5
|
-
export declare
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
function isTSAssertion(services: ParserServicesWithTypeInformation, node: ts.Node): boolean;
|
|
9
|
-
}
|
|
5
|
+
export declare function isImported(context: Rule.RuleContext): boolean;
|
|
6
|
+
export declare function isAssertion(context: Rule.RuleContext, node: estree.Node): boolean;
|
|
7
|
+
export declare function isTSAssertion(services: ParserServicesWithTypeInformation, node: ts.Node): boolean;
|
package/cjs/helpers/aws/index.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
/*
|
|
18
|
-
* SonarQube JavaScript Plugin
|
|
19
|
-
* Copyright (C) 2011-2025 SonarSource Sàrl
|
|
20
|
-
* mailto:info AT sonarsource DOT com
|
|
21
|
-
*
|
|
22
|
-
* This program is free software; you can redistribute it and/or
|
|
23
|
-
* modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA.
|
|
24
|
-
*
|
|
25
|
-
* This program is distributed in the hope that it will be useful,
|
|
26
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
27
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
28
|
-
* See the Sonar Source-Available License for more details.
|
|
29
|
-
*
|
|
30
|
-
* You should have received a copy of the Sonar Source-Available License
|
|
31
|
-
* along with this program; if not, see https://sonarsource.com/license/ssal/
|
|
32
|
-
*/
|
|
33
|
-
__exportStar(require("./cdk.js"), exports);
|
|
34
|
-
__exportStar(require("./iam.js"), exports);
|
|
35
|
-
__exportStar(require("./s3.js"), exports);
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.interceptReport = interceptReport;
|
|
4
|
-
exports.interceptReportForReact = interceptReportForReact;
|
|
5
|
-
const NUM_ARGS_NODE_MESSAGE = 2;
|
|
6
|
-
/**
|
|
7
|
-
* Modifies the behavior of `context.report(descriptor)` for a given rule.
|
|
8
|
-
*
|
|
9
|
-
* Useful for performing additional checks before reporting an issue.
|
|
10
|
-
*
|
|
11
|
-
* @param rule the original rule
|
|
12
|
-
* @param onReport replacement for `context.report(descr)`
|
|
13
|
-
* invocations used inside of the rule
|
|
14
|
-
* @param contextOverrider optional function to change the default context overriding mechanism
|
|
15
|
-
*/
|
|
16
|
-
function interceptReport(rule, onReport, contextOverrider) {
|
|
17
|
-
return {
|
|
18
|
-
// meta should be defined only when it's defined on original rule, otherwise NodeRuleTester will fail
|
|
19
|
-
...(!!rule.meta && { meta: rule.meta }),
|
|
20
|
-
create(originalContext) {
|
|
21
|
-
let interceptingContext;
|
|
22
|
-
if (contextOverrider == null) {
|
|
23
|
-
interceptingContext = {
|
|
24
|
-
id: originalContext.id,
|
|
25
|
-
options: originalContext.options,
|
|
26
|
-
settings: originalContext.settings,
|
|
27
|
-
parserPath: originalContext.parserPath,
|
|
28
|
-
parserOptions: originalContext.parserOptions,
|
|
29
|
-
sourceCode: originalContext.sourceCode,
|
|
30
|
-
cwd: originalContext.cwd,
|
|
31
|
-
filename: originalContext.filename,
|
|
32
|
-
physicalFilename: originalContext.physicalFilename,
|
|
33
|
-
languageOptions: originalContext.languageOptions,
|
|
34
|
-
getCwd() {
|
|
35
|
-
return originalContext.cwd;
|
|
36
|
-
},
|
|
37
|
-
getPhysicalFilename() {
|
|
38
|
-
return originalContext.physicalFilename;
|
|
39
|
-
},
|
|
40
|
-
getFilename() {
|
|
41
|
-
return originalContext.filename;
|
|
42
|
-
},
|
|
43
|
-
getSourceCode() {
|
|
44
|
-
return originalContext.sourceCode;
|
|
45
|
-
},
|
|
46
|
-
// @ts-ignore
|
|
47
|
-
getSource(...args) {
|
|
48
|
-
return originalContext.sourceCode.getText(...args);
|
|
49
|
-
},
|
|
50
|
-
report(...args) {
|
|
51
|
-
let descr = undefined;
|
|
52
|
-
if (args.length === 1) {
|
|
53
|
-
descr = args[0];
|
|
54
|
-
}
|
|
55
|
-
else if (args.length === NUM_ARGS_NODE_MESSAGE && typeof args[1] === 'string') {
|
|
56
|
-
// not declared in the `.d.ts`, but used in practice by rules written in JS
|
|
57
|
-
descr = {
|
|
58
|
-
node: args[0],
|
|
59
|
-
message: args[1],
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
if (descr) {
|
|
63
|
-
onReport(originalContext, descr);
|
|
64
|
-
}
|
|
65
|
-
},
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
else {
|
|
69
|
-
interceptingContext = contextOverrider(originalContext, onReport);
|
|
70
|
-
}
|
|
71
|
-
return rule.create(interceptingContext);
|
|
72
|
-
},
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
// interceptReport() by default doesn't work with the React plugin
|
|
76
|
-
// as the rules fail to find the context getFirstTokens() function.
|
|
77
|
-
function interceptReportForReact(rule, onReport) {
|
|
78
|
-
return interceptReport(rule, onReport, contextOverriderForReact);
|
|
79
|
-
}
|
|
80
|
-
function contextOverriderForReact(context, onReport) {
|
|
81
|
-
const overriddenReportContext = {
|
|
82
|
-
report(reportDescriptor) {
|
|
83
|
-
onReport(context, reportDescriptor);
|
|
84
|
-
},
|
|
85
|
-
};
|
|
86
|
-
Object.setPrototypeOf(overriddenReportContext, context);
|
|
87
|
-
return overriddenReportContext;
|
|
88
|
-
}
|
package/cjs/helpers/index.js
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
/*
|
|
18
|
-
* SonarQube JavaScript Plugin
|
|
19
|
-
* Copyright (C) 2011-2025 SonarSource Sàrl
|
|
20
|
-
* mailto:info AT sonarsource DOT com
|
|
21
|
-
*
|
|
22
|
-
* This program is free software; you can redistribute it and/or
|
|
23
|
-
* modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA.
|
|
24
|
-
*
|
|
25
|
-
* This program is distributed in the hope that it will be useful,
|
|
26
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
27
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
28
|
-
* See the Sonar Source-Available License for more details.
|
|
29
|
-
*
|
|
30
|
-
* You should have received a copy of the Sonar Source-Available License
|
|
31
|
-
* along with this program; if not, see https://sonarsource.com/license/ssal/
|
|
32
|
-
*/
|
|
33
|
-
__exportStar(require("./accessibility.js"), exports);
|
|
34
|
-
__exportStar(require("./ancestor.js"), exports);
|
|
35
|
-
__exportStar(require("./ast.js"), exports);
|
|
36
|
-
__exportStar(require("./aws/index.js"), exports);
|
|
37
|
-
__exportStar(require("./chai.js"), exports);
|
|
38
|
-
__exportStar(require("./collection.js"), exports);
|
|
39
|
-
__exportStar(require("./conditions.js"), exports);
|
|
40
|
-
__exportStar(require("./decorators/index.js"), exports);
|
|
41
|
-
__exportStar(require("./equivalence.js"), exports);
|
|
42
|
-
__exportStar(require("./express.js"), exports);
|
|
43
|
-
__exportStar(require("./files.js"), exports);
|
|
44
|
-
__exportStar(require("./generate-meta.js"), exports);
|
|
45
|
-
__exportStar(require("./jsx.js"), exports);
|
|
46
|
-
__exportStar(require("./location.js"), exports);
|
|
47
|
-
__exportStar(require("./lva.js"), exports);
|
|
48
|
-
__exportStar(require("./mocha.js"), exports);
|
|
49
|
-
__exportStar(require("./module.js"), exports);
|
|
50
|
-
__exportStar(require("./module-ts.js"), exports);
|
|
51
|
-
__exportStar(require("./quickfix.js"), exports);
|
|
52
|
-
__exportStar(require("./reaching-definitions.js"), exports);
|
|
53
|
-
__exportStar(require("./rule-detect-react.js"), exports);
|
|
54
|
-
__exportStar(require("./sinon.js"), exports);
|
|
55
|
-
__exportStar(require("./test-frameworks.js"), exports);
|
|
56
|
-
__exportStar(require("./type.js"), exports);
|
|
57
|
-
__exportStar(require("./validate-version.js"), exports);
|
|
58
|
-
__exportStar(require("./vitest.js"), exports);
|
|
59
|
-
__exportStar(require("./vue.js"), exports);
|
|
60
|
-
__exportStar(require("./parser-services.js"), exports);
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* SonarQube JavaScript Plugin
|
|
4
|
-
* Copyright (C) 2011-2025 SonarSource Sàrl
|
|
5
|
-
* mailto:info AT sonarsource DOT com
|
|
6
|
-
*
|
|
7
|
-
* This program is free software; you can redistribute it and/or
|
|
8
|
-
* modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA.
|
|
9
|
-
*
|
|
10
|
-
* This program is distributed in the hope that it will be useful,
|
|
11
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
13
|
-
* See the Sonar Source-Available License for more details.
|
|
14
|
-
*
|
|
15
|
-
* You should have received a copy of the Sonar Source-Available License
|
|
16
|
-
* along with this program; if not, see https://sonarsource.com/license/ssal/
|
|
17
|
-
*/
|
|
18
|
-
// Inspired from sonar-java and sonar-analyzer-commons
|
|
19
|
-
// - https://github.com/SonarSource/sonar-java/blob/e3b4ce381eb994235ab811d253953e400d12aab2/java-checks/src/main/java/org/sonar/java/checks/JavaFootprint.java#L31
|
|
20
|
-
// - https://github.com/SonarSource/sonar-analyzer-commons/blob/e2881512ce632259981c65b587652151e876d736/recognizers/src/main/java/org/sonarsource/analyzer/commons/recognizers/CodeRecognizer.java#L25
|
|
21
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
22
|
-
if (k2 === undefined) k2 = k;
|
|
23
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
24
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
25
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
26
|
-
}
|
|
27
|
-
Object.defineProperty(o, k2, desc);
|
|
28
|
-
}) : (function(o, m, k, k2) {
|
|
29
|
-
if (k2 === undefined) k2 = k;
|
|
30
|
-
o[k2] = m[k];
|
|
31
|
-
}));
|
|
32
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
33
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
34
|
-
};
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
__exportStar(require("./JavaScriptFootPrint.js"), exports);
|
|
37
|
-
__exportStar(require("./CodeRecognizer.js"), exports);
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.detectReactRule = void 0;
|
|
4
|
-
const detectReactSelector = [
|
|
5
|
-
':matches(',
|
|
6
|
-
[
|
|
7
|
-
'CallExpression[callee.name="require"][arguments.0.value="react"]',
|
|
8
|
-
'CallExpression[callee.name="require"][arguments.0.value="create-react-class"]',
|
|
9
|
-
'ImportDeclaration[source.value="react"]',
|
|
10
|
-
].join(','),
|
|
11
|
-
')',
|
|
12
|
-
].join('');
|
|
13
|
-
exports.detectReactRule = {
|
|
14
|
-
meta: {
|
|
15
|
-
messages: {
|
|
16
|
-
reactDetected: 'React detected',
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
create(context) {
|
|
20
|
-
return {
|
|
21
|
-
[detectReactSelector](node) {
|
|
22
|
-
context.report({
|
|
23
|
-
messageId: 'reactDetected',
|
|
24
|
-
node,
|
|
25
|
-
});
|
|
26
|
-
},
|
|
27
|
-
};
|
|
28
|
-
},
|
|
29
|
-
};
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.isSupported = isSupported;
|
|
37
|
-
/*
|
|
38
|
-
* SonarQube JavaScript Plugin
|
|
39
|
-
* Copyright (C) 2011-2025 SonarSource Sàrl
|
|
40
|
-
* mailto:info AT sonarsource DOT com
|
|
41
|
-
*
|
|
42
|
-
* This program is free software; you can redistribute it and/or
|
|
43
|
-
* modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA.
|
|
44
|
-
*
|
|
45
|
-
* This program is distributed in the hope that it will be useful,
|
|
46
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
47
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
48
|
-
* See the Sonar Source-Available License for more details.
|
|
49
|
-
*
|
|
50
|
-
* You should have received a copy of the Sonar Source-Available License
|
|
51
|
-
* along with this program; if not, see https://sonarsource.com/license/ssal/
|
|
52
|
-
*/
|
|
53
|
-
const semver = __importStar(require("semver"));
|
|
54
|
-
const all_in_parent_dirs_js_1 = require("./package-jsons/all-in-parent-dirs.js");
|
|
55
|
-
/**
|
|
56
|
-
* Checks if context where the filename is located supports the provided
|
|
57
|
-
* minimum versions.
|
|
58
|
-
*/
|
|
59
|
-
function isSupported(dirname, minVersions) {
|
|
60
|
-
validateVersions(minVersions);
|
|
61
|
-
return isSupportedNodeVersion(dirname, minVersions.node);
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Check if the versions are valid semver
|
|
65
|
-
*/
|
|
66
|
-
function validateVersions(versions) {
|
|
67
|
-
for (const [ref, version] of Object.entries(versions)) {
|
|
68
|
-
if (semver.valid(version) === null) {
|
|
69
|
-
throw new Error(`Invalid semver version: "${version}" for "${ref}"`);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Check if the feature is supported by the minimum Node.js version of the project.
|
|
75
|
-
*
|
|
76
|
-
* @param dirname
|
|
77
|
-
* @param requiredVersion
|
|
78
|
-
* @returns
|
|
79
|
-
*/
|
|
80
|
-
function isSupportedNodeVersion(dirname, requiredVersion) {
|
|
81
|
-
if (!requiredVersion) {
|
|
82
|
-
return true;
|
|
83
|
-
}
|
|
84
|
-
const packageJsons = (0, all_in_parent_dirs_js_1.getManifests)(dirname);
|
|
85
|
-
const versionRange = packageJsons.find(pj => pj.engines?.node)?.engines?.node;
|
|
86
|
-
if (!versionRange) {
|
|
87
|
-
return true;
|
|
88
|
-
}
|
|
89
|
-
const projectMinVersion = semver.minVersion(versionRange);
|
|
90
|
-
if (!projectMinVersion) {
|
|
91
|
-
return true;
|
|
92
|
-
}
|
|
93
|
-
return semver.gte(projectMinVersion, requiredVersion);
|
|
94
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { Rule } from 'eslint';
|
|
2
|
-
type ReportOverrider = (context: Rule.RuleContext, reportDescriptor: Rule.ReportDescriptor) => void;
|
|
3
|
-
type ContextOverrider = (context: Rule.RuleContext, onReport: ReportOverrider) => Rule.RuleContext;
|
|
4
|
-
/**
|
|
5
|
-
* Modifies the behavior of `context.report(descriptor)` for a given rule.
|
|
6
|
-
*
|
|
7
|
-
* Useful for performing additional checks before reporting an issue.
|
|
8
|
-
*
|
|
9
|
-
* @param rule the original rule
|
|
10
|
-
* @param onReport replacement for `context.report(descr)`
|
|
11
|
-
* invocations used inside of the rule
|
|
12
|
-
* @param contextOverrider optional function to change the default context overriding mechanism
|
|
13
|
-
*/
|
|
14
|
-
export declare function interceptReport(rule: Rule.RuleModule, onReport: ReportOverrider, contextOverrider?: ContextOverrider): Rule.RuleModule;
|
|
15
|
-
export declare function interceptReportForReact(rule: Rule.RuleModule, onReport: ReportOverrider): Rule.RuleModule;
|
|
16
|
-
export {};
|
package/types/helpers/index.d.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
export * from './accessibility.js';
|
|
2
|
-
export * from './ancestor.js';
|
|
3
|
-
export * from './ast.js';
|
|
4
|
-
export * from './aws/index.js';
|
|
5
|
-
export * from './chai.js';
|
|
6
|
-
export * from './collection.js';
|
|
7
|
-
export * from './conditions.js';
|
|
8
|
-
export * from './decorators/index.js';
|
|
9
|
-
export * from './equivalence.js';
|
|
10
|
-
export * from './express.js';
|
|
11
|
-
export * from './files.js';
|
|
12
|
-
export * from './generate-meta.js';
|
|
13
|
-
export * from './jsx.js';
|
|
14
|
-
export * from './location.js';
|
|
15
|
-
export * from './lva.js';
|
|
16
|
-
export * from './mocha.js';
|
|
17
|
-
export * from './module.js';
|
|
18
|
-
export * from './module-ts.js';
|
|
19
|
-
export * from './quickfix.js';
|
|
20
|
-
export * from './reaching-definitions.js';
|
|
21
|
-
export * from './rule-detect-react.js';
|
|
22
|
-
export * from './sinon.js';
|
|
23
|
-
export * from './test-frameworks.js';
|
|
24
|
-
export * from './type.js';
|
|
25
|
-
export * from './validate-version.js';
|
|
26
|
-
export * from './vitest.js';
|
|
27
|
-
export * from './vue.js';
|
|
28
|
-
export * from './parser-services.js';
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { NormalizedAbsolutePath } from './files.js';
|
|
2
|
-
/**
|
|
3
|
-
* Minimum version per reference
|
|
4
|
-
*/
|
|
5
|
-
type MinimumVersions = {
|
|
6
|
-
node?: string;
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* Checks if context where the filename is located supports the provided
|
|
10
|
-
* minimum versions.
|
|
11
|
-
*/
|
|
12
|
-
export declare function isSupported(dirname: NormalizedAbsolutePath, minVersions: MinimumVersions): boolean;
|
|
13
|
-
export {};
|