@angular-eslint/utils 15.1.1-alpha.26 → 15.1.1-alpha.30

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.
@@ -18,10 +18,11 @@ export declare const SelectorValidator: {
18
18
  camelCase(selector: string): boolean;
19
19
  element(selector: string): boolean;
20
20
  kebabCase(selector: string): boolean;
21
- prefix(prefix: string, selectorStyle: SelectorStyle): (selector: string) => boolean;
21
+ prefix(prefix: string, selectorStyle: string): (selector: string) => boolean;
22
22
  };
23
23
  export declare const reportPrefixError: (node: TSESTree.Node, prefix: string | readonly string[], context: Readonly<TSESLint.RuleContext<string, readonly unknown[]>>) => void;
24
24
  export declare const reportStyleError: (node: TSESTree.Node, style: SelectorStyleOption, context: Readonly<TSESLint.RuleContext<string, readonly unknown[]>>) => void;
25
+ export declare const reportStyleAndPrefixError: (node: TSESTree.Node, style: SelectorStyleOption, prefix: string | readonly string[], context: Readonly<TSESLint.RuleContext<string, readonly unknown[]>>) => void;
25
26
  export declare const reportTypeError: (node: TSESTree.Node, type: SelectorTypeOption | readonly SelectorTypeOption[], context: Readonly<TSESLint.RuleContext<string, readonly unknown[]>>) => void;
26
27
  export declare const checkValidOptions: (type: SelectorTypeOption | readonly SelectorTypeOption[], prefix: string | readonly string[], style: SelectorStyleOption) => boolean;
27
28
  export declare const checkSelector: (node: TSESTree.Node, typeOption: SelectorTypeOption | readonly SelectorTypeOption[], prefixOption: readonly string[], styleOption: SelectorStyle) => {
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.checkSelector = exports.checkValidOptions = exports.reportTypeError = exports.reportStyleError = exports.reportPrefixError = exports.SelectorValidator = exports.OPTION_TYPE_ELEMENT = exports.OPTION_TYPE_ATTRS = exports.OPTION_TYPE_ATTRIBUTE = void 0;
3
+ exports.checkSelector = exports.checkValidOptions = exports.reportTypeError = exports.reportStyleAndPrefixError = exports.reportStyleError = exports.reportPrefixError = exports.SelectorValidator = exports.OPTION_TYPE_ELEMENT = exports.OPTION_TYPE_ATTRS = exports.OPTION_TYPE_ATTRIBUTE = void 0;
4
4
  const bundled_angular_compiler_1 = require("@angular-eslint/bundled-angular-compiler");
5
5
  const ast_utils_1 = require("./ast-utils");
6
6
  const utils_1 = require("../utils");
@@ -71,6 +71,17 @@ const reportStyleError = (node, style, context) => {
71
71
  });
72
72
  };
73
73
  exports.reportStyleError = reportStyleError;
74
+ const reportStyleAndPrefixError = (node, style, prefix, context) => {
75
+ context.report({
76
+ node,
77
+ messageId: 'styleAndPrefixFailure',
78
+ data: {
79
+ style,
80
+ prefix: (0, utils_1.toHumanReadableText)((0, utils_1.arrayify)(prefix)),
81
+ },
82
+ });
83
+ };
84
+ exports.reportStyleAndPrefixError = reportStyleAndPrefixError;
74
85
  const reportTypeError = (node, type, context) => {
75
86
  context.report({
76
87
  node,
@@ -41,10 +41,10 @@ class RuleTester extends utils_1.TSESLint.RuleTester {
41
41
  // but that's not as clean to type, this saves us trying to manually enforce
42
42
  // that contributors require.resolve everything
43
43
  constructor(options) {
44
- var _a;
44
+ var _a, _b, _c;
45
45
  super(Object.assign(Object.assign({}, options), { parser: require.resolve(options.parser) }));
46
46
  if ((_a = options.parserOptions) === null || _a === void 0 ? void 0 : _a.project) {
47
- this.filename = path.join(getFixturesRootDir(), 'file.ts');
47
+ this.filename = path.join((_c = (_b = options.parserOptions) === null || _b === void 0 ? void 0 : _b.tsconfigRootDir) !== null && _c !== void 0 ? _c : getFixturesRootDir(), 'file.ts');
48
48
  }
49
49
  // make sure that the parser doesn't hold onto file handles between tests
50
50
  // on linux (i.e. our CI env), there can be very a limited number of watch handles available
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular-eslint/utils",
3
- "version": "15.1.1-alpha.26+40ac90d",
3
+ "version": "15.1.1-alpha.30+539cf9f",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -15,8 +15,8 @@
15
15
  "typescript": "*"
16
16
  },
17
17
  "dependencies": {
18
- "@angular-eslint/bundled-angular-compiler": "15.1.1-alpha.26+40ac90d",
18
+ "@angular-eslint/bundled-angular-compiler": "15.1.1-alpha.30+539cf9f",
19
19
  "@typescript-eslint/utils": "5.45.1"
20
20
  },
21
- "gitHead": "40ac90d1a1fbe45d21efe544c919440b19dfde66"
21
+ "gitHead": "539cf9f0cd33eae888cd27087ec9c22379161c93"
22
22
  }