@angular-eslint/eslint-plugin-template 18.0.2-alpha.8 → 18.1.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/dist/index.d.ts
CHANGED
|
@@ -125,6 +125,8 @@ declare const _default: {
|
|
|
125
125
|
"no-autofocus": import("@typescript-eslint/utils/ts-eslint").RuleModule<"noAutofocus", [], import("./utils/create-eslint-rule").RuleDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
126
126
|
"no-call-expression": import("@typescript-eslint/utils/ts-eslint").RuleModule<"noCallExpression", [{
|
|
127
127
|
readonly allowList?: readonly string[] | undefined;
|
|
128
|
+
readonly allowPrefix?: string | undefined;
|
|
129
|
+
readonly allowSuffix?: string | undefined;
|
|
128
130
|
}], import("./utils/create-eslint-rule").RuleDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
129
131
|
"no-distracting-elements": import("@typescript-eslint/utils/ts-eslint").RuleModule<"noDistractingElements", [], import("./utils/create-eslint-rule").RuleDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
130
132
|
"no-duplicate-attributes": import("@typescript-eslint/utils/ts-eslint").RuleModule<import("./rules/no-duplicate-attributes").MessageIds, [{
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmFA,kBAuCE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"no-call-expression.d.ts","sourceRoot":"","sources":["../../src/rules/no-call-expression.ts"],"names":[],"mappings":"AAMA,KAAK,OAAO,GAAG;IACb;QACE,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"no-call-expression.d.ts","sourceRoot":"","sources":["../../src/rules/no-call-expression.ts"],"names":[],"mappings":"AAMA,KAAK,OAAO,GAAG;IACb;QACE,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;QACvC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;QAC9B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;KAC/B;CACF,CAAC;AACF,MAAM,MAAM,UAAU,GAAG,kBAAkB,CAAC;AAC5C,eAAO,MAAM,SAAS,uBAAuB,CAAC;;AAE9C,wBA4EG"}
|
|
@@ -22,6 +22,8 @@ exports.default = (0, create_eslint_rule_1.createESLintRule)({
|
|
|
22
22
|
type: 'array',
|
|
23
23
|
uniqueItems: true,
|
|
24
24
|
},
|
|
25
|
+
allowPrefix: { type: 'string' },
|
|
26
|
+
allowSuffix: { type: 'string' },
|
|
25
27
|
},
|
|
26
28
|
type: 'object',
|
|
27
29
|
},
|
|
@@ -30,17 +32,29 @@ exports.default = (0, create_eslint_rule_1.createESLintRule)({
|
|
|
30
32
|
noCallExpression: 'Avoid calling expressions in templates',
|
|
31
33
|
},
|
|
32
34
|
},
|
|
33
|
-
defaultOptions: [
|
|
34
|
-
|
|
35
|
+
defaultOptions: [
|
|
36
|
+
{ allowList: [], allowPrefix: undefined, allowSuffix: undefined },
|
|
37
|
+
],
|
|
38
|
+
create(context, [{ allowList, allowPrefix, allowSuffix }]) {
|
|
35
39
|
(0, utils_1.ensureTemplateParser)(context);
|
|
36
40
|
const sourceCode = context.sourceCode;
|
|
37
41
|
return {
|
|
38
42
|
'Call[receiver.name!="$any"]'(node) {
|
|
39
43
|
const isChildOfBoundEvent = Boolean((0, get_nearest_node_from_1.getNearestNodeFrom)(node, isBoundEvent));
|
|
40
|
-
if (isChildOfBoundEvent
|
|
44
|
+
if (isChildOfBoundEvent ||
|
|
45
|
+
isCallNameInAllowList(node.receiver, allowList)) {
|
|
41
46
|
return;
|
|
42
|
-
|
|
47
|
+
}
|
|
48
|
+
if (allowPrefix &&
|
|
49
|
+
isASTWithName(node.receiver) &&
|
|
50
|
+
node.receiver.name.startsWith(allowPrefix)) {
|
|
43
51
|
return;
|
|
52
|
+
}
|
|
53
|
+
if (allowSuffix &&
|
|
54
|
+
isASTWithName(node.receiver) &&
|
|
55
|
+
node.receiver.name.endsWith(allowSuffix)) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
44
58
|
const { sourceSpan: { start, end }, } = node;
|
|
45
59
|
context.report({
|
|
46
60
|
loc: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-semantic-role-element.d.ts","sourceRoot":"","sources":["../../src/utils/is-semantic-role-element.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,0CAA0C,CAAC;AAalD,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,iBAAiB,EAAE,CAAC,oBAAoB,GAAG,qBAAqB,CAAC,EAAE,GAClE,OAAO,
|
|
1
|
+
{"version":3,"file":"is-semantic-role-element.d.ts","sourceRoot":"","sources":["../../src/utils/is-semantic-role-element.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,0CAA0C,CAAC;AAalD,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,iBAAiB,EAAE,CAAC,oBAAoB,GAAG,qBAAqB,CAAC,EAAE,GAClE,OAAO,CA8BT"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular-eslint/eslint-plugin-template",
|
|
3
|
-
"version": "18.0
|
|
3
|
+
"version": "18.1.0",
|
|
4
4
|
"description": "ESLint plugin for Angular Templates",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -18,17 +18,17 @@
|
|
|
18
18
|
"LICENSE"
|
|
19
19
|
],
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@angular-eslint/bundled-angular-compiler": "18.0
|
|
22
|
-
"@angular-eslint/utils": "18.0
|
|
21
|
+
"@angular-eslint/bundled-angular-compiler": "18.1.0",
|
|
22
|
+
"@angular-eslint/utils": "18.1.0",
|
|
23
23
|
"aria-query": "5.3.0",
|
|
24
24
|
"axobject-query": "4.0.0"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@angular-eslint/test-utils": "18.0
|
|
27
|
+
"@angular-eslint/test-utils": "18.1.0",
|
|
28
28
|
"@types/aria-query": "5.0.4"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
|
-
"@typescript-eslint/utils": "^7.11.0 || ^8.0.0-alpha.
|
|
31
|
+
"@typescript-eslint/utils": "^7.11.0 || ^8.0.0-alpha.37",
|
|
32
32
|
"eslint": "^8.57.0 || ^9.0.0",
|
|
33
33
|
"typescript": "*"
|
|
34
34
|
},
|