angular-eslint-zoneless 1.0.3 → 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/index.d.ts CHANGED
@@ -2,6 +2,7 @@ import type { ConfigObject } from "@eslint/core";
2
2
  declare const plugin: {
3
3
  configs: {
4
4
  readonly recommended: ConfigObject<import("@eslint/core").RulesConfig>;
5
+ readonly all: ConfigObject<import("@eslint/core").RulesConfig>;
5
6
  };
6
7
  meta: {
7
8
  name: string;
@@ -24,8 +25,10 @@ declare const plugin: {
24
25
  "no-content-decorator": import("@eslint/core").RuleDefinition<import("@eslint/core").RuleDefinitionTypeOptions>;
25
26
  "no-view-decorator": import("@eslint/core").RuleDefinition<import("@eslint/core").RuleDefinitionTypeOptions>;
26
27
  "no-ngzone": import("@eslint/core").RuleDefinition<import("@eslint/core").RuleDefinitionTypeOptions>;
28
+ "no-ngzone-testing": import("@eslint/core").RuleDefinition<import("@eslint/core").RuleDefinitionTypeOptions>;
27
29
  "no-detectchanges-testing": import("@eslint/core").RuleDefinition<import("@eslint/core").RuleDefinitionTypeOptions>;
28
30
  "no-zonejs-testing-functions": import("@eslint/core").RuleDefinition<import("@eslint/core").RuleDefinitionTypeOptions>;
31
+ "no-changedetectorref": import("@eslint/core").RuleDefinition<import("@eslint/core").RuleDefinitionTypeOptions>;
29
32
  "no-subscribe-in-component-constructor": import("@eslint/core").RuleDefinition<import("@eslint/core").RuleDefinitionTypeOptions>;
30
33
  };
31
34
  };
package/index.js CHANGED
@@ -32,6 +32,7 @@ var __importStar = (this && this.__importStar) || (function () {
32
32
  return result;
33
33
  };
34
34
  })();
35
+ const noChangedetectorref = __importStar(require("./rules/no-changedetectorref.js"));
35
36
  const noContentDecorator = __importStar(require("./rules/no-content-decorator.js"));
36
37
  const noDetectchangesTesting = __importStar(require("./rules/no-detectchanges-testing.js"));
37
38
  const noEagerChangeDetection = __importStar(require("./rules/no-eager-change-detection.js"));
@@ -44,6 +45,7 @@ const noNgdocheck = __importStar(require("./rules/no-ngdocheck.js"));
44
45
  const noNgonchanges = __importStar(require("./rules/no-ngonchanges.js"));
45
46
  const noNgondestroy = __importStar(require("./rules/no-ngondestroy.js"));
46
47
  const noNgoninit = __importStar(require("./rules/no-ngoninit.js"));
48
+ const noNgzoneTesting = __importStar(require("./rules/no-ngzone-testing.js"));
47
49
  const noNgzone = __importStar(require("./rules/no-ngzone.js"));
48
50
  const noOutputDecorator = __importStar(require("./rules/no-output-decorator.js"));
49
51
  const noProvidezonechangedetection = __importStar(require("./rules/no-providezonechangedetection.js"));
@@ -58,6 +60,9 @@ const plugin = {
58
60
  configs: {
59
61
  get recommended() {
60
62
  return recommended;
63
+ },
64
+ get all() {
65
+ return all;
61
66
  }
62
67
  },
63
68
  meta: { name, version },
@@ -78,8 +83,10 @@ const plugin = {
78
83
  [noContentDecorator.ruleName]: noContentDecorator.ruleDefinition,
79
84
  [noViewDecorator.ruleName]: noViewDecorator.ruleDefinition,
80
85
  [noNgzone.ruleName]: noNgzone.ruleDefinition,
86
+ [noNgzoneTesting.ruleName]: noNgzoneTesting.ruleDefinition,
81
87
  [noDetectchangesTesting.ruleName]: noDetectchangesTesting.ruleDefinition,
82
88
  [noZonejsTestingFunctions.ruleName]: noZonejsTestingFunctions.ruleDefinition,
89
+ [noChangedetectorref.ruleName]: noChangedetectorref.ruleDefinition,
83
90
  [noSubscribeInComponentConstructor.ruleName]: noSubscribeInComponentConstructor.ruleDefinition,
84
91
  },
85
92
  };
@@ -104,8 +111,19 @@ const recommended = {
104
111
  [`${name}/${noContentDecorator.ruleName}`]: "error",
105
112
  [`${name}/${noViewDecorator.ruleName}`]: "error",
106
113
  [`${name}/${noNgzone.ruleName}`]: "error",
114
+ [`${name}/${noNgzoneTesting.ruleName}`]: "error",
107
115
  [`${name}/${noDetectchangesTesting.ruleName}`]: "error",
108
116
  [`${name}/${noZonejsTestingFunctions.ruleName}`]: "error",
109
117
  },
110
118
  };
119
+ const all = {
120
+ plugins: {
121
+ [name]: plugin
122
+ },
123
+ rules: {
124
+ ...recommended.rules,
125
+ [`${name}/${noChangedetectorref.ruleName}`]: "error",
126
+ [`${name}/${noSubscribeInComponentConstructor.ruleName}`]: "error",
127
+ },
128
+ };
111
129
  module.exports = plugin;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "angular-eslint-zoneless",
3
- "version": "1.0.3",
3
+ "version": "1.2.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-changedetectorref";
3
+ export declare const ruleDefinition: RuleDefinition;
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ruleDefinition = exports.ruleName = void 0;
4
+ exports.ruleName = "no-changedetectorref";
5
+ const messageId = "noChangedetectorref";
6
+ exports.ruleDefinition = {
7
+ meta: {
8
+ type: "problem",
9
+ messages: {
10
+ [messageId]: `\`ChangeDetectorRef()\` should be avoided in a zoneless application, use signals and resources reactivity instead.`,
11
+ },
12
+ docs: {
13
+ description: `Checks that \`ChangeDetectorRef()\` is not used.`,
14
+ url: 'https://github.com/cyrilletuzi/angular-eslint-zoneless/blob/main/docs/rules/NO_CHANGEDETECTORREF.md',
15
+ },
16
+ schema: [],
17
+ },
18
+ create(context) {
19
+ return {
20
+ Identifier(node) {
21
+ if (node.name === 'ChangeDetectorRef') {
22
+ context.report({
23
+ node,
24
+ messageId,
25
+ });
26
+ }
27
+ },
28
+ };
29
+ },
30
+ };
@@ -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
+ };