angular-eslint-zoneless 1.0.2 → 1.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/index.d.ts CHANGED
@@ -24,6 +24,7 @@ declare const plugin: {
24
24
  "no-content-decorator": import("@eslint/core").RuleDefinition<import("@eslint/core").RuleDefinitionTypeOptions>;
25
25
  "no-view-decorator": import("@eslint/core").RuleDefinition<import("@eslint/core").RuleDefinitionTypeOptions>;
26
26
  "no-ngzone": import("@eslint/core").RuleDefinition<import("@eslint/core").RuleDefinitionTypeOptions>;
27
+ "no-ngzone-testing": import("@eslint/core").RuleDefinition<import("@eslint/core").RuleDefinitionTypeOptions>;
27
28
  "no-detectchanges-testing": import("@eslint/core").RuleDefinition<import("@eslint/core").RuleDefinitionTypeOptions>;
28
29
  "no-zonejs-testing-functions": import("@eslint/core").RuleDefinition<import("@eslint/core").RuleDefinitionTypeOptions>;
29
30
  "no-subscribe-in-component-constructor": import("@eslint/core").RuleDefinition<import("@eslint/core").RuleDefinitionTypeOptions>;
package/index.js CHANGED
@@ -44,6 +44,7 @@ const noNgdocheck = __importStar(require("./rules/no-ngdocheck.js"));
44
44
  const noNgonchanges = __importStar(require("./rules/no-ngonchanges.js"));
45
45
  const noNgondestroy = __importStar(require("./rules/no-ngondestroy.js"));
46
46
  const noNgoninit = __importStar(require("./rules/no-ngoninit.js"));
47
+ const noNgzoneTesting = __importStar(require("./rules/no-ngzone-testing.js"));
47
48
  const noNgzone = __importStar(require("./rules/no-ngzone.js"));
48
49
  const noOutputDecorator = __importStar(require("./rules/no-output-decorator.js"));
49
50
  const noProvidezonechangedetection = __importStar(require("./rules/no-providezonechangedetection.js"));
@@ -78,6 +79,7 @@ const plugin = {
78
79
  [noContentDecorator.ruleName]: noContentDecorator.ruleDefinition,
79
80
  [noViewDecorator.ruleName]: noViewDecorator.ruleDefinition,
80
81
  [noNgzone.ruleName]: noNgzone.ruleDefinition,
82
+ [noNgzoneTesting.ruleName]: noNgzoneTesting.ruleDefinition,
81
83
  [noDetectchangesTesting.ruleName]: noDetectchangesTesting.ruleDefinition,
82
84
  [noZonejsTestingFunctions.ruleName]: noZonejsTestingFunctions.ruleDefinition,
83
85
  [noSubscribeInComponentConstructor.ruleName]: noSubscribeInComponentConstructor.ruleDefinition,
@@ -104,6 +106,7 @@ const recommended = {
104
106
  [`${name}/${noContentDecorator.ruleName}`]: "error",
105
107
  [`${name}/${noViewDecorator.ruleName}`]: "error",
106
108
  [`${name}/${noNgzone.ruleName}`]: "error",
109
+ [`${name}/${noNgzoneTesting.ruleName}`]: "error",
107
110
  [`${name}/${noDetectchangesTesting.ruleName}`]: "error",
108
111
  [`${name}/${noZonejsTestingFunctions.ruleName}`]: "error",
109
112
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "angular-eslint-zoneless",
3
- "version": "1.0.2",
3
+ "version": "1.1.0",
4
4
  "description": "Angular zoneless lint rules for ESLint",
5
5
  "keywords": [
6
6
  "angular",
@@ -0,0 +1,3 @@
1
+ import type { RuleDefinition } from "@eslint/core";
2
+ export declare const ruleName = "no-ngzone-testing";
3
+ export declare const ruleDefinition: RuleDefinition;
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ruleDefinition = exports.ruleName = void 0;
4
+ const utils_1 = require("@typescript-eslint/utils");
5
+ exports.ruleName = "no-ngzone-testing";
6
+ const messageId = "noNgzoneTesting";
7
+ exports.ruleDefinition = {
8
+ meta: {
9
+ type: "problem",
10
+ messages: {
11
+ [messageId]: `\`fixture.ngZone\` is useless and null in a zoneless application.`,
12
+ },
13
+ docs: {
14
+ description: `Checks that \`fixture.ngZone\` is not used.`,
15
+ url: 'https://github.com/cyrilletuzi/angular-eslint-zoneless/blob/main/docs/rules/NO_NGZONE_TESTING.md',
16
+ },
17
+ schema: [],
18
+ },
19
+ create(context) {
20
+ return {
21
+ MemberExpression(node) {
22
+ if (node.property.type === utils_1.AST_NODE_TYPES.Identifier &&
23
+ node.property.name === "ngZone") {
24
+ context.report({
25
+ node,
26
+ messageId,
27
+ });
28
+ }
29
+ },
30
+ };
31
+ },
32
+ };