angular-eslint-zoneless 1.2.2 → 1.3.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
@@ -1,6 +1,7 @@
1
1
  import type { ConfigObject } from "@eslint/core";
2
2
  declare const plugin: {
3
3
  configs: {
4
+ readonly minimal: ConfigObject<import("@eslint/core").RulesConfig>;
4
5
  readonly recommended: ConfigObject<import("@eslint/core").RulesConfig>;
5
6
  readonly strict: ConfigObject<import("@eslint/core").RulesConfig>;
6
7
  };
@@ -24,6 +25,7 @@ declare const plugin: {
24
25
  "no-output-decorator": import("@eslint/core").RuleDefinition<import("@eslint/core").RuleDefinitionTypeOptions>;
25
26
  "no-content-decorator": import("@eslint/core").RuleDefinition<import("@eslint/core").RuleDefinitionTypeOptions>;
26
27
  "no-view-decorator": import("@eslint/core").RuleDefinition<import("@eslint/core").RuleDefinitionTypeOptions>;
28
+ "no-asyncpipe": import("@eslint/core").RuleDefinition<import("@eslint/core").RuleDefinitionTypeOptions>;
27
29
  "no-ngzone": import("@eslint/core").RuleDefinition<import("@eslint/core").RuleDefinitionTypeOptions>;
28
30
  "no-ngzone-testing": import("@eslint/core").RuleDefinition<import("@eslint/core").RuleDefinitionTypeOptions>;
29
31
  "no-detectchanges-testing": import("@eslint/core").RuleDefinition<import("@eslint/core").RuleDefinitionTypeOptions>;
package/index.js CHANGED
@@ -32,6 +32,7 @@ var __importStar = (this && this.__importStar) || (function () {
32
32
  return result;
33
33
  };
34
34
  })();
35
+ const noAsyncpipe = __importStar(require("./rules/no-asyncpipe.js"));
35
36
  const noChangedetectorref = __importStar(require("./rules/no-changedetectorref.js"));
36
37
  const noContentDecorator = __importStar(require("./rules/no-content-decorator.js"));
37
38
  const noDetectchangesTesting = __importStar(require("./rules/no-detectchanges-testing.js"));
@@ -58,6 +59,9 @@ const { name, version } =
58
59
  require("./package.json");
59
60
  const plugin = {
60
61
  configs: {
62
+ get minimal() {
63
+ return minimal;
64
+ },
61
65
  get recommended() {
62
66
  return recommended;
63
67
  },
@@ -82,6 +86,7 @@ const plugin = {
82
86
  [noOutputDecorator.ruleName]: noOutputDecorator.ruleDefinition,
83
87
  [noContentDecorator.ruleName]: noContentDecorator.ruleDefinition,
84
88
  [noViewDecorator.ruleName]: noViewDecorator.ruleDefinition,
89
+ [noAsyncpipe.ruleName]: noAsyncpipe.ruleDefinition,
85
90
  [noNgzone.ruleName]: noNgzone.ruleDefinition,
86
91
  [noNgzoneTesting.ruleName]: noNgzoneTesting.ruleDefinition,
87
92
  [noDetectchangesTesting.ruleName]: noDetectchangesTesting.ruleDefinition,
@@ -90,13 +95,24 @@ const plugin = {
90
95
  [noSubscribeInComponentConstructor.ruleName]: noSubscribeInComponentConstructor.ruleDefinition,
91
96
  },
92
97
  };
93
- const recommended = {
98
+ const minimal = {
94
99
  plugins: {
95
100
  [name]: plugin
96
101
  },
97
102
  rules: {
98
103
  [`${name}/${noZonejsImport.ruleName}`]: "error",
99
104
  [`${name}/${noProvidezonechangedetection.ruleName}`]: "error",
105
+ [`${name}/${noNgzone.ruleName}`]: "error",
106
+ [`${name}/${noNgzoneTesting.ruleName}`]: "error",
107
+ [`${name}/${noZonejsTestingFunctions.ruleName}`]: "error",
108
+ },
109
+ };
110
+ const recommended = {
111
+ plugins: {
112
+ [name]: plugin
113
+ },
114
+ rules: {
115
+ ...minimal.rules,
100
116
  [`${name}/${noEagerChangeDetection.ruleName}`]: "error",
101
117
  [`${name}/${noNgoninit.ruleName}`]: "error",
102
118
  [`${name}/${noNgdocheck.ruleName}`]: "error",
@@ -110,10 +126,8 @@ const recommended = {
110
126
  [`${name}/${noOutputDecorator.ruleName}`]: "error",
111
127
  [`${name}/${noContentDecorator.ruleName}`]: "error",
112
128
  [`${name}/${noViewDecorator.ruleName}`]: "error",
113
- [`${name}/${noNgzone.ruleName}`]: "error",
114
- [`${name}/${noNgzoneTesting.ruleName}`]: "error",
129
+ [`${name}/${noAsyncpipe.ruleName}`]: "error",
115
130
  [`${name}/${noDetectchangesTesting.ruleName}`]: "error",
116
- [`${name}/${noZonejsTestingFunctions.ruleName}`]: "error",
117
131
  },
118
132
  };
119
133
  const strict = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "angular-eslint-zoneless",
3
- "version": "1.2.2",
3
+ "version": "1.3.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-asyncpipe";
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 is_import_identifier_1 = require("../utils/is-import-identifier");
5
+ exports.ruleName = "no-asyncpipe";
6
+ const messageId = "noAsyncpipe";
7
+ exports.ruleDefinition = {
8
+ meta: {
9
+ type: "problem",
10
+ messages: {
11
+ [messageId]: `\`AsyncPipe\` should be avoided in a zoneless application, use \`toSignal()\` or \`rxResource()\` instead.`,
12
+ },
13
+ docs: {
14
+ description: `Checks that \`AsyncPipe\` is not used.`,
15
+ url: 'https://github.com/cyrilletuzi/angular-eslint-zoneless/blob/main/docs/rules/NO_ASYNCPIPE.md',
16
+ recommended: true,
17
+ },
18
+ schema: [],
19
+ },
20
+ create(context) {
21
+ return {
22
+ "Identifier[name='AsyncPipe']"(node) {
23
+ if (!(0, is_import_identifier_1.isImportIdentifier)(node)) {
24
+ context.report({
25
+ node,
26
+ messageId,
27
+ });
28
+ }
29
+ },
30
+ };
31
+ },
32
+ };
@@ -11,7 +11,7 @@ exports.ruleDefinition = {
11
11
  [messageId]: `\`ChangeDetectorRef()\` should be avoided in a zoneless application, use signals and resources reactivity instead.`,
12
12
  },
13
13
  docs: {
14
- description: `Checks that \`ChangeDetectorRef()\` is not used.`,
14
+ description: `Checks that \`ChangeDetectorRef\` is not used.`,
15
15
  url: 'https://github.com/cyrilletuzi/angular-eslint-zoneless/blob/main/docs/rules/NO_CHANGEDETECTORREF.md',
16
16
  },
17
17
  schema: [],
@@ -11,7 +11,7 @@ exports.ruleDefinition = {
11
11
  [messageId]: `\`NgZone()\` is useless and does not work in a zoneless application.`,
12
12
  },
13
13
  docs: {
14
- description: `Checks that \`NgZone()\` is not used.`,
14
+ description: `Checks that \`NgZone\` is not used.`,
15
15
  url: 'https://github.com/cyrilletuzi/angular-eslint-zoneless/blob/main/docs/rules/NO_NGZONE.md',
16
16
  recommended: true,
17
17
  },