@alfresco/eslint-plugin-eslint-angular 7.0.0-alpha.4-11142304607 → 7.0.0-alpha.4-11144818791

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.
Files changed (3) hide show
  1. package/main.js +95 -88
  2. package/main.js.map +1 -1
  3. package/package.json +3 -3
package/main.js CHANGED
@@ -1,7 +1,8 @@
1
1
  /******/ (() => { // webpackBootstrap
2
2
  /******/ "use strict";
3
- /******/ var __webpack_modules__ = ([
4
- /* 0 */
3
+ /******/ var __webpack_modules__ = ({
4
+
5
+ /***/ "./index.ts":
5
6
  /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
6
7
 
7
8
 
@@ -44,8 +45,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
44
45
  __setModuleDefault(result, mod);
45
46
  return result;
46
47
  };
47
- const use_none_component_view_encapsulation_1 = __importStar(__webpack_require__(1));
48
- const no_angular_material_selectors_1 = __importStar(__webpack_require__(5));
48
+ const use_none_component_view_encapsulation_1 = __importStar(__webpack_require__("./src/rules/use-none-component-view-encapsulation/use-none-component-view-encapsulation.ts"));
49
+ const no_angular_material_selectors_1 = __importStar(__webpack_require__("./src/rules/no-angular-material-selectors/no-angular-material-selectors.ts"));
49
50
  module.exports = {
50
51
  rules: {
51
52
  [use_none_component_view_encapsulation_1.RULE_NAME]: use_none_component_view_encapsulation_1.default,
@@ -55,7 +56,8 @@ module.exports = {
55
56
 
56
57
 
57
58
  /***/ }),
58
- /* 1 */
59
+
60
+ /***/ "./src/rules/no-angular-material-selectors/no-angular-material-selectors.ts":
59
61
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
60
62
 
61
63
 
@@ -77,8 +79,83 @@ module.exports = {
77
79
  */
78
80
  Object.defineProperty(exports, "__esModule", ({ value: true }));
79
81
  exports.RULE_NAME = void 0;
80
- const utils_1 = __webpack_require__(2);
81
- const create_eslint_rule_1 = __webpack_require__(3);
82
+ const create_eslint_rule_1 = __webpack_require__("./src/utils/create-eslint-rule/create-eslint-rule.ts");
83
+ exports.RULE_NAME = 'no-angular-material-selectors';
84
+ const ASTSelectors = [
85
+ ':not(Property[key.name="template"]) Literal[value=/(\\.|\\s|^)(mat-(?!datetimepicker)|mdc-)/i]',
86
+ ':not(Property[key.name="template"]) > TemplateLiteral > TemplateElement[value.raw=/(\\.|\\s|^)(mat-(?!datetimepicker)|mdc-)/i]'
87
+ ];
88
+ const messages = {
89
+ noAngularMaterialSelectors: 'Using Angular Material internal selectors is not allowed',
90
+ useAngularMaterialTestingHarness: 'Use testing harness instead of Angular Material internal selectors',
91
+ useE2ELocatorVariables: 'Use locator variables instead of Angular Material internal selectors'
92
+ };
93
+ const filetypeErrors = [
94
+ {
95
+ regexp: /.*\.spec\.ts/,
96
+ messageId: 'useAngularMaterialTestingHarness'
97
+ },
98
+ {
99
+ regexp: /.*\.e2e\.ts/,
100
+ messageId: 'useE2ELocatorVariables'
101
+ }
102
+ ];
103
+ /**
104
+ * Custom ESLint rule for detecting the usage of internal Angular Material selectors
105
+ */
106
+ exports["default"] = (0, create_eslint_rule_1.createESLintRule)({
107
+ name: exports.RULE_NAME,
108
+ meta: {
109
+ type: 'suggestion',
110
+ docs: {
111
+ description: 'Disallows using Angular Material internal selectors',
112
+ recommended: 'error'
113
+ },
114
+ hasSuggestions: true,
115
+ schema: [],
116
+ messages
117
+ },
118
+ defaultOptions: [],
119
+ create(context) {
120
+ return {
121
+ [ASTSelectors.join(',')](node) {
122
+ const message = filetypeErrors.find((fileTypeError) => context.getFilename().match(fileTypeError.regexp)) || { messageId: 'noAngularMaterialSelectors' };
123
+ context.report({
124
+ node,
125
+ messageId: message.messageId
126
+ });
127
+ }
128
+ };
129
+ }
130
+ });
131
+
132
+
133
+ /***/ }),
134
+
135
+ /***/ "./src/rules/use-none-component-view-encapsulation/use-none-component-view-encapsulation.ts":
136
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
137
+
138
+
139
+ /*!
140
+ * @license
141
+ * Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
142
+ *
143
+ * Licensed under the Apache License, Version 2.0 (the "License");
144
+ * you may not use this file except in compliance with the License.
145
+ * You may obtain a copy of the License at
146
+ *
147
+ * http://www.apache.org/licenses/LICENSE-2.0
148
+ *
149
+ * Unless required by applicable law or agreed to in writing, software
150
+ * distributed under the License is distributed on an "AS IS" BASIS,
151
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
152
+ * See the License for the specific language governing permissions and
153
+ * limitations under the License.
154
+ */
155
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
156
+ exports.RULE_NAME = void 0;
157
+ const utils_1 = __webpack_require__("@angular-eslint/utils");
158
+ const create_eslint_rule_1 = __webpack_require__("./src/utils/create-eslint-rule/create-eslint-rule.ts");
82
159
  exports.RULE_NAME = 'use-none-component-view-encapsulation';
83
160
  const metadataPropertyName = 'encapsulation';
84
161
  const viewEncapsulationNone = 'ViewEncapsulation.None';
@@ -159,13 +236,8 @@ exports["default"] = (0, create_eslint_rule_1.createESLintRule)({
159
236
 
160
237
 
161
238
  /***/ }),
162
- /* 2 */
163
- /***/ ((module) => {
164
239
 
165
- module.exports = require("@angular-eslint/utils");
166
-
167
- /***/ }),
168
- /* 3 */
240
+ /***/ "./src/utils/create-eslint-rule/create-eslint-rule.ts":
169
241
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
170
242
 
171
243
 
@@ -187,92 +259,27 @@ module.exports = require("@angular-eslint/utils");
187
259
  */
188
260
  Object.defineProperty(exports, "__esModule", ({ value: true }));
189
261
  exports.createESLintRule = void 0;
190
- const utils_1 = __webpack_require__(4);
262
+ const utils_1 = __webpack_require__("@typescript-eslint/utils");
191
263
  exports.createESLintRule = utils_1.ESLintUtils.RuleCreator((ruleName) => ruleName);
192
264
 
193
265
 
194
266
  /***/ }),
195
- /* 4 */
267
+
268
+ /***/ "@angular-eslint/utils":
196
269
  /***/ ((module) => {
197
270
 
198
- module.exports = require("@typescript-eslint/utils");
271
+ module.exports = require("@angular-eslint/utils");
199
272
 
200
273
  /***/ }),
201
- /* 5 */
202
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
203
-
204
274
 
205
- /*!
206
- * @license
207
- * Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
208
- *
209
- * Licensed under the Apache License, Version 2.0 (the "License");
210
- * you may not use this file except in compliance with the License.
211
- * You may obtain a copy of the License at
212
- *
213
- * http://www.apache.org/licenses/LICENSE-2.0
214
- *
215
- * Unless required by applicable law or agreed to in writing, software
216
- * distributed under the License is distributed on an "AS IS" BASIS,
217
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
218
- * See the License for the specific language governing permissions and
219
- * limitations under the License.
220
- */
221
- Object.defineProperty(exports, "__esModule", ({ value: true }));
222
- exports.RULE_NAME = void 0;
223
- const create_eslint_rule_1 = __webpack_require__(3);
224
- exports.RULE_NAME = 'no-angular-material-selectors';
225
- const ASTSelectors = [
226
- ':not(Property[key.name="template"]) Literal[value=/(\\.|\\s|^)(mat-(?!datetimepicker)|mdc-)/i]',
227
- ':not(Property[key.name="template"]) > TemplateLiteral > TemplateElement[value.raw=/(\\.|\\s|^)(mat-(?!datetimepicker)|mdc-)/i]'
228
- ];
229
- const messages = {
230
- noAngularMaterialSelectors: 'Using Angular Material internal selectors is not allowed',
231
- useAngularMaterialTestingHarness: 'Use testing harness instead of Angular Material internal selectors',
232
- useE2ELocatorVariables: 'Use locator variables instead of Angular Material internal selectors'
233
- };
234
- const filetypeErrors = [
235
- {
236
- regexp: /.*\.spec\.ts/,
237
- messageId: 'useAngularMaterialTestingHarness'
238
- },
239
- {
240
- regexp: /.*\.e2e\.ts/,
241
- messageId: 'useE2ELocatorVariables'
242
- }
243
- ];
244
- /**
245
- * Custom ESLint rule for detecting the usage of internal Angular Material selectors
246
- */
247
- exports["default"] = (0, create_eslint_rule_1.createESLintRule)({
248
- name: exports.RULE_NAME,
249
- meta: {
250
- type: 'suggestion',
251
- docs: {
252
- description: 'Disallows using Angular Material internal selectors',
253
- recommended: 'error'
254
- },
255
- hasSuggestions: true,
256
- schema: [],
257
- messages
258
- },
259
- defaultOptions: [],
260
- create(context) {
261
- return {
262
- [ASTSelectors.join(',')](node) {
263
- const message = filetypeErrors.find((fileTypeError) => context.getFilename().match(fileTypeError.regexp)) || { messageId: 'noAngularMaterialSelectors' };
264
- context.report({
265
- node,
266
- messageId: message.messageId
267
- });
268
- }
269
- };
270
- }
271
- });
275
+ /***/ "@typescript-eslint/utils":
276
+ /***/ ((module) => {
272
277
 
278
+ module.exports = require("@typescript-eslint/utils");
273
279
 
274
280
  /***/ })
275
- /******/ ]);
281
+
282
+ /******/ });
276
283
  /************************************************************************/
277
284
  /******/ // The module cache
278
285
  /******/ var __webpack_module_cache__ = {};
@@ -303,7 +310,7 @@ exports["default"] = (0, create_eslint_rule_1.createESLintRule)({
303
310
  /******/ // startup
304
311
  /******/ // Load entry module and return exports
305
312
  /******/ // This entry module is referenced by other modules so it can't be inlined
306
- /******/ var __webpack_exports__ = __webpack_require__(0);
313
+ /******/ var __webpack_exports__ = __webpack_require__("./index.ts");
307
314
  /******/ var __webpack_export_target__ = exports;
308
315
  /******/ for(var i in __webpack_exports__) __webpack_export_target__[i] = __webpack_exports__[i];
309
316
  /******/ if(__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, "__esModule", { value: true });
package/main.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"main.js","mappings":";;;;;;AAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oCAAoC;AACnD;AACA;AACA,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA,0CAA0C,4BAA4B;AACtE,CAAC;AACD;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6DAA6D,mBAAO,CAAC,CAAyF;AAC9J,qDAAqD,mBAAO,CAAC,CAAyE;AACtI;AACA;AACA;AACA;AACA;AACA;;;;;;;AC/Ca;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA6C,EAAE,aAAa,EAAC;AAC7D,iBAAiB;AACjB,gBAAgB,mBAAO,CAAC,CAAuB;AAC/C,6BAA6B,mBAAO,CAAC,CAAmD;AACxF,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAe;AACf;AACA;AACA;AACA;AACA,uEAAuE,sBAAsB;AAC7F;AACA,SAAS;AACT;AACA;AACA;AACA,kFAAkF,sBAAsB;AACxG,qDAAqD,sBAAsB;AAC3E;AACA,KAAK;AACL;AACA;AACA;AACA,gDAAgD,4CAA4C,sGAAsG,sBAAsB;AACxN,wDAAwD,6CAA6C;AACrG,eAAe,sBAAsB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC;AACrC,iGAAiG,qBAAqB,IAAI,sBAAsB;AAChJ;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,CAAC;;;;;;;ACjGD;;;;;;ACAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA6C,EAAE,aAAa,EAAC;AAC7D,wBAAwB;AACxB,gBAAgB,mBAAO,CAAC,CAA0B;AAClD,wBAAwB;;;;;;;ACpBxB;;;;;;ACAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA6C,EAAE,aAAa,EAAC;AAC7D,iBAAiB;AACjB,6BAA6B,mBAAO,CAAC,CAAmD;AACxF,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,+HAA+H;AAC/H;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,CAAC;;;;;;UCnED;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;UEtBA;UACA;UACA;UACA","sources":["webpack://@alfresco/eslint-plugin-eslint-angular/./index.ts","webpack://@alfresco/eslint-plugin-eslint-angular/./src/rules/use-none-component-view-encapsulation/use-none-component-view-encapsulation.ts","webpack://@alfresco/eslint-plugin-eslint-angular/external commonjs \"@angular-eslint/utils\"","webpack://@alfresco/eslint-plugin-eslint-angular/./src/utils/create-eslint-rule/create-eslint-rule.ts","webpack://@alfresco/eslint-plugin-eslint-angular/external commonjs \"@typescript-eslint/utils\"","webpack://@alfresco/eslint-plugin-eslint-angular/./src/rules/no-angular-material-selectors/no-angular-material-selectors.ts","webpack://@alfresco/eslint-plugin-eslint-angular/webpack/bootstrap","webpack://@alfresco/eslint-plugin-eslint-angular/webpack/before-startup","webpack://@alfresco/eslint-plugin-eslint-angular/webpack/startup","webpack://@alfresco/eslint-plugin-eslint-angular/webpack/after-startup"],"sourcesContent":["\"use strict\";\n/*!\n * @license\n * Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nconst use_none_component_view_encapsulation_1 = __importStar(require(\"./src/rules/use-none-component-view-encapsulation/use-none-component-view-encapsulation\"));\nconst no_angular_material_selectors_1 = __importStar(require(\"./src/rules/no-angular-material-selectors/no-angular-material-selectors\"));\nmodule.exports = {\n rules: {\n [use_none_component_view_encapsulation_1.RULE_NAME]: use_none_component_view_encapsulation_1.default,\n [no_angular_material_selectors_1.RULE_NAME]: no_angular_material_selectors_1.default\n }\n};\n","\"use strict\";\n/*!\n * @license\n * Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.RULE_NAME = void 0;\nconst utils_1 = require(\"@angular-eslint/utils\");\nconst create_eslint_rule_1 = require(\"../../utils/create-eslint-rule/create-eslint-rule\");\nexports.RULE_NAME = 'use-none-component-view-encapsulation';\nconst metadataPropertyName = 'encapsulation';\nconst viewEncapsulationNone = 'ViewEncapsulation.None';\nconst nodeToReport = (node) => {\n if (!utils_1.ASTUtils.isProperty(node)) {\n return node;\n }\n return utils_1.ASTUtils.isMemberExpression(node.value) ? node.value.property : node.value;\n};\n/**\n * Custom ESLint rule which check if component uses ViewEncapsulation.None. It has been implemented because None encapsulation makes themes styling easier.\n * It also allows to autofix.\n */\nexports.default = (0, create_eslint_rule_1.createESLintRule)({\n name: exports.RULE_NAME,\n meta: {\n type: 'suggestion',\n docs: {\n description: `Disallows using other encapsulation than \\`${viewEncapsulationNone}\\``,\n recommended: false\n },\n hasSuggestions: true,\n schema: [],\n messages: {\n useNoneComponentViewEncapsulation: `Using encapsulation other than '${viewEncapsulationNone}' makes themes styling harder.`,\n suggestAddViewEncapsulationNone: `Add '${viewEncapsulationNone}'`\n }\n },\n defaultOptions: [],\n create(context) {\n const encapsulationProperty = utils_1.Selectors.metadataProperty(metadataPropertyName);\n const withoutEncapsulationProperty = `${utils_1.Selectors.COMPONENT_CLASS_DECORATOR}:matches([expression.arguments.length=0], [expression.arguments.0.type='ObjectExpression']:not(:has(${encapsulationProperty})))`;\n const nonNoneViewEncapsulationNoneProperty = `${utils_1.Selectors.COMPONENT_CLASS_DECORATOR} > CallExpression > ObjectExpression > ` +\n `${encapsulationProperty}:matches([value.type='Identifier'][value.name='undefined'], [value.object.name='ViewEncapsulation'][value.property.name!='None'])`;\n const selectors = [\n withoutEncapsulationProperty,\n nonNoneViewEncapsulationNoneProperty\n ].join(',');\n return {\n [selectors](node) {\n context.report({\n node: nodeToReport(node),\n messageId: 'useNoneComponentViewEncapsulation',\n suggest: [\n {\n messageId: 'suggestAddViewEncapsulationNone',\n fix: (fixer) => {\n if (utils_1.ASTUtils.isProperty(node)) {\n return [\n utils_1.RuleFixes.getImportAddFix({\n fixer,\n importName: 'ViewEncapsulation',\n moduleName: '@angular/core',\n node: node.parent.parent.parent.parent\n }),\n utils_1.ASTUtils.isMemberExpression(node.value)\n ? fixer.replaceText(node.value.property, 'None')\n : fixer.replaceText(node.value, viewEncapsulationNone)\n ].filter(utils_1.isNotNullOrUndefined);\n }\n return [\n utils_1.RuleFixes.getImportAddFix({\n fixer,\n importName: 'ViewEncapsulation',\n moduleName: '@angular/core',\n node: node.parent\n }),\n utils_1.RuleFixes.getDecoratorPropertyAddFix(node, fixer, `${metadataPropertyName}: ${viewEncapsulationNone}`)\n ].filter(utils_1.isNotNullOrUndefined);\n }\n }\n ]\n });\n }\n };\n }\n});\n","module.exports = require(\"@angular-eslint/utils\");","\"use strict\";\n/*!\n * @license\n * Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createESLintRule = void 0;\nconst utils_1 = require(\"@typescript-eslint/utils\");\nexports.createESLintRule = utils_1.ESLintUtils.RuleCreator((ruleName) => ruleName);\n","module.exports = require(\"@typescript-eslint/utils\");","\"use strict\";\n/*!\n * @license\n * Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.RULE_NAME = void 0;\nconst create_eslint_rule_1 = require(\"../../utils/create-eslint-rule/create-eslint-rule\");\nexports.RULE_NAME = 'no-angular-material-selectors';\nconst ASTSelectors = [\n ':not(Property[key.name=\"template\"]) Literal[value=/(\\\\.|\\\\s|^)(mat-(?!datetimepicker)|mdc-)/i]',\n ':not(Property[key.name=\"template\"]) > TemplateLiteral > TemplateElement[value.raw=/(\\\\.|\\\\s|^)(mat-(?!datetimepicker)|mdc-)/i]'\n];\nconst messages = {\n noAngularMaterialSelectors: 'Using Angular Material internal selectors is not allowed',\n useAngularMaterialTestingHarness: 'Use testing harness instead of Angular Material internal selectors',\n useE2ELocatorVariables: 'Use locator variables instead of Angular Material internal selectors'\n};\nconst filetypeErrors = [\n {\n regexp: /.*\\.spec\\.ts/,\n messageId: 'useAngularMaterialTestingHarness'\n },\n {\n regexp: /.*\\.e2e\\.ts/,\n messageId: 'useE2ELocatorVariables'\n }\n];\n/**\n * Custom ESLint rule for detecting the usage of internal Angular Material selectors\n */\nexports.default = (0, create_eslint_rule_1.createESLintRule)({\n name: exports.RULE_NAME,\n meta: {\n type: 'suggestion',\n docs: {\n description: 'Disallows using Angular Material internal selectors',\n recommended: 'error'\n },\n hasSuggestions: true,\n schema: [],\n messages\n },\n defaultOptions: [],\n create(context) {\n return {\n [ASTSelectors.join(',')](node) {\n const message = filetypeErrors.find((fileTypeError) => context.getFilename().match(fileTypeError.regexp)) || { messageId: 'noAngularMaterialSelectors' };\n context.report({\n node,\n messageId: message.messageId\n });\n }\n };\n }\n});\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(0);\n",""],"names":[],"sourceRoot":""}
1
+ {"version":3,"file":"main.js","mappings":";;;;;;;AAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oCAAoC;AACnD;AACA;AACA,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA,0CAA0C,4BAA4B;AACtE,CAAC;AACD;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6DAA6D,mBAAO,CAAC,4FAAyF;AAC9J,qDAAqD,mBAAO,CAAC,4EAAyE;AACtI;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC/Ca;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA6C,EAAE,aAAa,EAAC;AAC7D,iBAAiB;AACjB,6BAA6B,mBAAO,CAAC,sDAAmD;AACxF,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,+HAA+H;AAC/H;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,CAAC;;;;;;;;ACnEY;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA6C,EAAE,aAAa,EAAC;AAC7D,iBAAiB;AACjB,gBAAgB,mBAAO,CAAC,uBAAuB;AAC/C,6BAA6B,mBAAO,CAAC,sDAAmD;AACxF,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAe;AACf;AACA;AACA;AACA;AACA,uEAAuE,sBAAsB;AAC7F;AACA,SAAS;AACT;AACA;AACA;AACA,kFAAkF,sBAAsB;AACxG,qDAAqD,sBAAsB;AAC3E;AACA,KAAK;AACL;AACA;AACA;AACA,gDAAgD,4CAA4C,sGAAsG,sBAAsB;AACxN,wDAAwD,6CAA6C;AACrG,eAAe,sBAAsB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC;AACrC,iGAAiG,qBAAqB,IAAI,sBAAsB;AAChJ;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,CAAC;;;;;;;;ACjGY;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA6C,EAAE,aAAa,EAAC;AAC7D,wBAAwB;AACxB,gBAAgB,mBAAO,CAAC,0BAA0B;AAClD,wBAAwB;;;;;;;;ACpBxB;;;;;;;ACAA;;;;;;UCAA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;UEtBA;UACA;UACA;UACA","sources":["webpack://@alfresco/eslint-plugin-eslint-angular/./index.ts","webpack://@alfresco/eslint-plugin-eslint-angular/./src/rules/no-angular-material-selectors/no-angular-material-selectors.ts","webpack://@alfresco/eslint-plugin-eslint-angular/./src/rules/use-none-component-view-encapsulation/use-none-component-view-encapsulation.ts","webpack://@alfresco/eslint-plugin-eslint-angular/./src/utils/create-eslint-rule/create-eslint-rule.ts","webpack://@alfresco/eslint-plugin-eslint-angular/external commonjs \"@angular-eslint/utils\"","webpack://@alfresco/eslint-plugin-eslint-angular/external commonjs \"@typescript-eslint/utils\"","webpack://@alfresco/eslint-plugin-eslint-angular/webpack/bootstrap","webpack://@alfresco/eslint-plugin-eslint-angular/webpack/before-startup","webpack://@alfresco/eslint-plugin-eslint-angular/webpack/startup","webpack://@alfresco/eslint-plugin-eslint-angular/webpack/after-startup"],"sourcesContent":["\"use strict\";\n/*!\n * @license\n * Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nconst use_none_component_view_encapsulation_1 = __importStar(require(\"./src/rules/use-none-component-view-encapsulation/use-none-component-view-encapsulation\"));\nconst no_angular_material_selectors_1 = __importStar(require(\"./src/rules/no-angular-material-selectors/no-angular-material-selectors\"));\nmodule.exports = {\n rules: {\n [use_none_component_view_encapsulation_1.RULE_NAME]: use_none_component_view_encapsulation_1.default,\n [no_angular_material_selectors_1.RULE_NAME]: no_angular_material_selectors_1.default\n }\n};\n","\"use strict\";\n/*!\n * @license\n * Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.RULE_NAME = void 0;\nconst create_eslint_rule_1 = require(\"../../utils/create-eslint-rule/create-eslint-rule\");\nexports.RULE_NAME = 'no-angular-material-selectors';\nconst ASTSelectors = [\n ':not(Property[key.name=\"template\"]) Literal[value=/(\\\\.|\\\\s|^)(mat-(?!datetimepicker)|mdc-)/i]',\n ':not(Property[key.name=\"template\"]) > TemplateLiteral > TemplateElement[value.raw=/(\\\\.|\\\\s|^)(mat-(?!datetimepicker)|mdc-)/i]'\n];\nconst messages = {\n noAngularMaterialSelectors: 'Using Angular Material internal selectors is not allowed',\n useAngularMaterialTestingHarness: 'Use testing harness instead of Angular Material internal selectors',\n useE2ELocatorVariables: 'Use locator variables instead of Angular Material internal selectors'\n};\nconst filetypeErrors = [\n {\n regexp: /.*\\.spec\\.ts/,\n messageId: 'useAngularMaterialTestingHarness'\n },\n {\n regexp: /.*\\.e2e\\.ts/,\n messageId: 'useE2ELocatorVariables'\n }\n];\n/**\n * Custom ESLint rule for detecting the usage of internal Angular Material selectors\n */\nexports.default = (0, create_eslint_rule_1.createESLintRule)({\n name: exports.RULE_NAME,\n meta: {\n type: 'suggestion',\n docs: {\n description: 'Disallows using Angular Material internal selectors',\n recommended: 'error'\n },\n hasSuggestions: true,\n schema: [],\n messages\n },\n defaultOptions: [],\n create(context) {\n return {\n [ASTSelectors.join(',')](node) {\n const message = filetypeErrors.find((fileTypeError) => context.getFilename().match(fileTypeError.regexp)) || { messageId: 'noAngularMaterialSelectors' };\n context.report({\n node,\n messageId: message.messageId\n });\n }\n };\n }\n});\n","\"use strict\";\n/*!\n * @license\n * Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.RULE_NAME = void 0;\nconst utils_1 = require(\"@angular-eslint/utils\");\nconst create_eslint_rule_1 = require(\"../../utils/create-eslint-rule/create-eslint-rule\");\nexports.RULE_NAME = 'use-none-component-view-encapsulation';\nconst metadataPropertyName = 'encapsulation';\nconst viewEncapsulationNone = 'ViewEncapsulation.None';\nconst nodeToReport = (node) => {\n if (!utils_1.ASTUtils.isProperty(node)) {\n return node;\n }\n return utils_1.ASTUtils.isMemberExpression(node.value) ? node.value.property : node.value;\n};\n/**\n * Custom ESLint rule which check if component uses ViewEncapsulation.None. It has been implemented because None encapsulation makes themes styling easier.\n * It also allows to autofix.\n */\nexports.default = (0, create_eslint_rule_1.createESLintRule)({\n name: exports.RULE_NAME,\n meta: {\n type: 'suggestion',\n docs: {\n description: `Disallows using other encapsulation than \\`${viewEncapsulationNone}\\``,\n recommended: false\n },\n hasSuggestions: true,\n schema: [],\n messages: {\n useNoneComponentViewEncapsulation: `Using encapsulation other than '${viewEncapsulationNone}' makes themes styling harder.`,\n suggestAddViewEncapsulationNone: `Add '${viewEncapsulationNone}'`\n }\n },\n defaultOptions: [],\n create(context) {\n const encapsulationProperty = utils_1.Selectors.metadataProperty(metadataPropertyName);\n const withoutEncapsulationProperty = `${utils_1.Selectors.COMPONENT_CLASS_DECORATOR}:matches([expression.arguments.length=0], [expression.arguments.0.type='ObjectExpression']:not(:has(${encapsulationProperty})))`;\n const nonNoneViewEncapsulationNoneProperty = `${utils_1.Selectors.COMPONENT_CLASS_DECORATOR} > CallExpression > ObjectExpression > ` +\n `${encapsulationProperty}:matches([value.type='Identifier'][value.name='undefined'], [value.object.name='ViewEncapsulation'][value.property.name!='None'])`;\n const selectors = [\n withoutEncapsulationProperty,\n nonNoneViewEncapsulationNoneProperty\n ].join(',');\n return {\n [selectors](node) {\n context.report({\n node: nodeToReport(node),\n messageId: 'useNoneComponentViewEncapsulation',\n suggest: [\n {\n messageId: 'suggestAddViewEncapsulationNone',\n fix: (fixer) => {\n if (utils_1.ASTUtils.isProperty(node)) {\n return [\n utils_1.RuleFixes.getImportAddFix({\n fixer,\n importName: 'ViewEncapsulation',\n moduleName: '@angular/core',\n node: node.parent.parent.parent.parent\n }),\n utils_1.ASTUtils.isMemberExpression(node.value)\n ? fixer.replaceText(node.value.property, 'None')\n : fixer.replaceText(node.value, viewEncapsulationNone)\n ].filter(utils_1.isNotNullOrUndefined);\n }\n return [\n utils_1.RuleFixes.getImportAddFix({\n fixer,\n importName: 'ViewEncapsulation',\n moduleName: '@angular/core',\n node: node.parent\n }),\n utils_1.RuleFixes.getDecoratorPropertyAddFix(node, fixer, `${metadataPropertyName}: ${viewEncapsulationNone}`)\n ].filter(utils_1.isNotNullOrUndefined);\n }\n }\n ]\n });\n }\n };\n }\n});\n","\"use strict\";\n/*!\n * @license\n * Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createESLintRule = void 0;\nconst utils_1 = require(\"@typescript-eslint/utils\");\nexports.createESLintRule = utils_1.ESLintUtils.RuleCreator((ruleName) => ruleName);\n","module.exports = require(\"@angular-eslint/utils\");","module.exports = require(\"@typescript-eslint/utils\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(\"./index.ts\");\n",""],"names":[],"sourceRoot":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alfresco/eslint-plugin-eslint-angular",
3
- "version": "7.0.0-alpha.4-11142304607",
3
+ "version": "7.0.0-alpha.4-11144818791",
4
4
  "description": "Alfresco ADF eslint angular custom rules",
5
5
  "main": "main.js",
6
6
  "author": "Hyland Software, Inc. and its affiliates",
@@ -20,7 +20,7 @@
20
20
  "access": "public"
21
21
  },
22
22
  "dependencies": {
23
- "@angular-eslint/utils": "16.0.3",
24
- "@typescript-eslint/utils": "5.59.7"
23
+ "@angular-eslint/utils": "15.2.1",
24
+ "@typescript-eslint/utils": "5.48.2"
25
25
  }
26
26
  }