angular-eslint-zoneless 1.1.0 → 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;
@@ -27,6 +28,7 @@ declare const plugin: {
27
28
  "no-ngzone-testing": import("@eslint/core").RuleDefinition<import("@eslint/core").RuleDefinitionTypeOptions>;
28
29
  "no-detectchanges-testing": import("@eslint/core").RuleDefinition<import("@eslint/core").RuleDefinitionTypeOptions>;
29
30
  "no-zonejs-testing-functions": import("@eslint/core").RuleDefinition<import("@eslint/core").RuleDefinitionTypeOptions>;
31
+ "no-changedetectorref": import("@eslint/core").RuleDefinition<import("@eslint/core").RuleDefinitionTypeOptions>;
30
32
  "no-subscribe-in-component-constructor": import("@eslint/core").RuleDefinition<import("@eslint/core").RuleDefinitionTypeOptions>;
31
33
  };
32
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"));
@@ -59,6 +60,9 @@ const plugin = {
59
60
  configs: {
60
61
  get recommended() {
61
62
  return recommended;
63
+ },
64
+ get all() {
65
+ return all;
62
66
  }
63
67
  },
64
68
  meta: { name, version },
@@ -82,6 +86,7 @@ const plugin = {
82
86
  [noNgzoneTesting.ruleName]: noNgzoneTesting.ruleDefinition,
83
87
  [noDetectchangesTesting.ruleName]: noDetectchangesTesting.ruleDefinition,
84
88
  [noZonejsTestingFunctions.ruleName]: noZonejsTestingFunctions.ruleDefinition,
89
+ [noChangedetectorref.ruleName]: noChangedetectorref.ruleDefinition,
85
90
  [noSubscribeInComponentConstructor.ruleName]: noSubscribeInComponentConstructor.ruleDefinition,
86
91
  },
87
92
  };
@@ -111,4 +116,14 @@ const recommended = {
111
116
  [`${name}/${noZonejsTestingFunctions.ruleName}`]: "error",
112
117
  },
113
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
+ };
114
129
  module.exports = plugin;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "angular-eslint-zoneless",
3
- "version": "1.1.0",
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
+ };