@depup/angular-eslint__utils 21.3.1-depup.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.
Files changed (34) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +25 -0
  3. package/changes.json +5 -0
  4. package/dist/eslint-plugin/ast-utils.d.ts +161 -0
  5. package/dist/eslint-plugin/ast-utils.d.ts.map +1 -0
  6. package/dist/eslint-plugin/ast-utils.js +465 -0
  7. package/dist/eslint-plugin/comment-utils.d.ts +11 -0
  8. package/dist/eslint-plugin/comment-utils.d.ts.map +1 -0
  9. package/dist/eslint-plugin/comment-utils.js +89 -0
  10. package/dist/eslint-plugin/get-aria-attribute-keys.d.ts +2 -0
  11. package/dist/eslint-plugin/get-aria-attribute-keys.d.ts.map +1 -0
  12. package/dist/eslint-plugin/get-aria-attribute-keys.js +56 -0
  13. package/dist/eslint-plugin/get-native-event-names.d.ts +12 -0
  14. package/dist/eslint-plugin/get-native-event-names.d.ts.map +1 -0
  15. package/dist/eslint-plugin/get-native-event-names.js +200 -0
  16. package/dist/eslint-plugin/rule-fixes.d.ts +17 -0
  17. package/dist/eslint-plugin/rule-fixes.d.ts.map +1 -0
  18. package/dist/eslint-plugin/rule-fixes.js +134 -0
  19. package/dist/eslint-plugin/selector-utils.d.ts +55 -0
  20. package/dist/eslint-plugin/selector-utils.d.ts.map +1 -0
  21. package/dist/eslint-plugin/selector-utils.js +269 -0
  22. package/dist/eslint-plugin/selectors.d.ts +28 -0
  23. package/dist/eslint-plugin/selectors.d.ts.map +1 -0
  24. package/dist/eslint-plugin/selectors.js +48 -0
  25. package/dist/eslint-plugin-template/parser-services.d.ts +13 -0
  26. package/dist/eslint-plugin-template/parser-services.d.ts.map +1 -0
  27. package/dist/eslint-plugin-template/parser-services.js +24 -0
  28. package/dist/index.d.ts +11 -0
  29. package/dist/index.d.ts.map +1 -0
  30. package/dist/index.js +56 -0
  31. package/dist/utils.d.ts +27 -0
  32. package/dist/utils.d.ts.map +1 -0
  33. package/dist/utils.js +59 -0
  34. package/package.json +61 -0
@@ -0,0 +1,200 @@
1
+ "use strict";
2
+ /**
3
+ * DO NOT EDIT THIS FILE
4
+ *
5
+ * In order to update this config, please run `pnpm update-native-event-names`.
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.getNativeEventNames = getNativeEventNames;
9
+ let nativeEventNames = null;
10
+ /**
11
+ * Check MDN events page for details https://developer.mozilla.org/en-US/docs/Web/Events
12
+ *
13
+ * Event names sourced from @mdn/browser-compat-data@7.3.6
14
+ */
15
+ function getNativeEventNames() {
16
+ return (nativeEventNames ??
17
+ (nativeEventNames = new Set([
18
+ 'abort',
19
+ 'afterprint',
20
+ 'afterscriptexecute',
21
+ 'animationcancel',
22
+ 'animationend',
23
+ 'animationiteration',
24
+ 'animationstart',
25
+ 'appinstalled',
26
+ 'auxclick',
27
+ 'beforeinput',
28
+ 'beforeinstallprompt',
29
+ 'beforematch',
30
+ 'beforeprint',
31
+ 'beforescriptexecute',
32
+ 'beforetoggle',
33
+ 'beforeunload',
34
+ 'beforexrselect',
35
+ 'beginEvent',
36
+ 'blur',
37
+ 'bounce',
38
+ 'cancel',
39
+ 'canplay',
40
+ 'canplaythrough',
41
+ 'change',
42
+ 'click',
43
+ 'close',
44
+ 'command',
45
+ 'compositionend',
46
+ 'compositionstart',
47
+ 'compositionupdate',
48
+ 'contentvisibilityautostatechange',
49
+ 'contextlost',
50
+ 'contextmenu',
51
+ 'contextrestored',
52
+ 'copy',
53
+ 'cuechange',
54
+ 'cut',
55
+ 'dblclick',
56
+ 'devicemotion',
57
+ 'deviceorientation',
58
+ 'deviceorientationabsolute',
59
+ 'DOMActivate',
60
+ 'DOMContentLoaded',
61
+ 'DOMMouseScroll',
62
+ 'drag',
63
+ 'dragend',
64
+ 'dragenter',
65
+ 'dragexit',
66
+ 'dragleave',
67
+ 'dragover',
68
+ 'dragstart',
69
+ 'drop',
70
+ 'durationchange',
71
+ 'emptied',
72
+ 'encrypted',
73
+ 'ended',
74
+ 'endEvent',
75
+ 'enterpictureinpicture',
76
+ 'error',
77
+ 'finish',
78
+ 'focus',
79
+ 'focusin',
80
+ 'focusout',
81
+ 'formdata',
82
+ 'freeze',
83
+ 'fullscreenchange',
84
+ 'fullscreenerror',
85
+ 'gamepadconnected',
86
+ 'gamepaddisconnected',
87
+ 'gesturechange',
88
+ 'gestureend',
89
+ 'gesturestart',
90
+ 'gotpointercapture',
91
+ 'hashchange',
92
+ 'input',
93
+ 'interest',
94
+ 'invalid',
95
+ 'keydown',
96
+ 'keypress',
97
+ 'keyup',
98
+ 'languagechange',
99
+ 'leavepictureinpicture',
100
+ 'load',
101
+ 'loadeddata',
102
+ 'loadedmetadata',
103
+ 'loadstart',
104
+ 'location',
105
+ 'loseinterest',
106
+ 'lostpointercapture',
107
+ 'message',
108
+ 'messageerror',
109
+ 'mousedown',
110
+ 'mouseenter',
111
+ 'mouseleave',
112
+ 'mousemove',
113
+ 'mouseout',
114
+ 'mouseover',
115
+ 'mouseup',
116
+ 'mousewheel',
117
+ 'MozMousePixelScroll',
118
+ 'offline',
119
+ 'online',
120
+ 'orientationchange',
121
+ 'pagehide',
122
+ 'pagereveal',
123
+ 'pageshow',
124
+ 'pageswap',
125
+ 'paste',
126
+ 'pause',
127
+ 'play',
128
+ 'playing',
129
+ 'pointercancel',
130
+ 'pointerdown',
131
+ 'pointerenter',
132
+ 'pointerleave',
133
+ 'pointerlockchange',
134
+ 'pointerlockerror',
135
+ 'pointermove',
136
+ 'pointerout',
137
+ 'pointerover',
138
+ 'pointerrawupdate',
139
+ 'pointerup',
140
+ 'popstate',
141
+ 'prerenderingchange',
142
+ 'progress',
143
+ 'promptaction',
144
+ 'promptdismiss',
145
+ 'ratechange',
146
+ 'readystatechange',
147
+ 'rejectionhandled',
148
+ 'repeatEvent',
149
+ 'reset',
150
+ 'resize',
151
+ 'resume',
152
+ 'scroll',
153
+ 'scrollend',
154
+ 'scrollsnapchange',
155
+ 'scrollsnapchanging',
156
+ 'search',
157
+ 'securitypolicyviolation',
158
+ 'seeked',
159
+ 'seeking',
160
+ 'select',
161
+ 'selectionchange',
162
+ 'selectstart',
163
+ 'slotchange',
164
+ 'stalled',
165
+ 'start',
166
+ 'storage',
167
+ 'submit',
168
+ 'suspend',
169
+ 'timeupdate',
170
+ 'toggle',
171
+ 'touchcancel',
172
+ 'touchend',
173
+ 'touchmove',
174
+ 'touchstart',
175
+ 'transitioncancel',
176
+ 'transitionend',
177
+ 'transitionrun',
178
+ 'transitionstart',
179
+ 'unhandledrejection',
180
+ 'unload',
181
+ 'validationstatuschange',
182
+ 'visibilitychange',
183
+ 'volumechange',
184
+ 'vrdisplayactivate',
185
+ 'vrdisplayconnect',
186
+ 'vrdisplaydeactivate',
187
+ 'vrdisplaydisconnect',
188
+ 'vrdisplaypresentchange',
189
+ 'waiting',
190
+ 'waitingforkey',
191
+ 'webglcontextcreationerror',
192
+ 'webglcontextlost',
193
+ 'webglcontextrestored',
194
+ 'webkitmouseforcechanged',
195
+ 'webkitmouseforcedown',
196
+ 'webkitmouseforceup',
197
+ 'webkitmouseforcewillbegin',
198
+ 'wheel',
199
+ ])));
200
+ }
@@ -0,0 +1,17 @@
1
+ import type { TSESLint, TSESTree } from '@typescript-eslint/utils';
2
+ export declare function getImportAddFix({ compatibleWithTypeOnlyImport, fixer, importName, moduleName, node, }: {
3
+ compatibleWithTypeOnlyImport?: boolean;
4
+ fixer: TSESLint.RuleFixer;
5
+ importName: string;
6
+ moduleName: string;
7
+ node: TSESTree.Node;
8
+ }): TSESLint.RuleFix | undefined;
9
+ export declare function getImportRemoveFix(sourceCode: Readonly<TSESLint.SourceCode>, importDeclarations: readonly TSESTree.ImportDeclaration[], importName: string, fixer: TSESLint.RuleFixer): TSESLint.RuleFix | undefined;
10
+ export declare function getImplementsSchemaFixer({ id, superClass, implements: classImplements, typeParameters, }: TSESTree.ClassDeclaration, interfaceName: string): {
11
+ readonly implementsNodeReplace: TSESTree.TSClassImplements | TSESTree.Identifier | TSESTree.TSTypeParameterDeclaration;
12
+ readonly implementsTextReplace: string;
13
+ };
14
+ export declare function getDecoratorPropertyAddFix({ expression }: TSESTree.Decorator, fixer: TSESLint.RuleFixer, text: string): TSESLint.RuleFix | undefined;
15
+ export declare function getImplementsRemoveFix(sourceCode: Readonly<TSESLint.SourceCode>, classDeclaration: TSESTree.ClassDeclaration, interfaceName: string, fixer: TSESLint.RuleFixer): TSESLint.RuleFix | undefined;
16
+ export declare function getNodeToCommaRemoveFix(sourceCode: Readonly<TSESLint.SourceCode>, node: TSESTree.Node, fixer: TSESLint.RuleFixer): TSESLint.RuleFix;
17
+ //# sourceMappingURL=rule-fixes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rule-fixes.d.ts","sourceRoot":"","sources":["../../src/eslint-plugin/rule-fixes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAcnE,wBAAgB,eAAe,CAAC,EAC9B,4BAAoC,EACpC,KAAK,EACL,UAAU,EACV,UAAU,EACV,IAAI,GACL,EAAE;IACD,4BAA4B,CAAC,EAAE,OAAO,CAAC;IACvC,KAAK,EAAE,QAAQ,CAAC,SAAS,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC;CACrB,GAAG,QAAQ,CAAC,OAAO,GAAG,SAAS,CA8B/B;AAED,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,QAAQ,CAAC,QAAQ,CAAC,UAAU,CAAC,EACzC,kBAAkB,EAAE,SAAS,QAAQ,CAAC,iBAAiB,EAAE,EACzD,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,QAAQ,CAAC,SAAS,GACxB,QAAQ,CAAC,OAAO,GAAG,SAAS,CAkC9B;AAED,wBAAgB,wBAAwB,CACtC,EACE,EAAE,EACF,UAAU,EACV,UAAU,EAAE,eAAe,EAC3B,cAAc,GACf,EAAE,QAAQ,CAAC,gBAAgB,EAC5B,aAAa,EAAE,MAAM,GACpB;IACD,QAAQ,CAAC,qBAAqB,EAC1B,QAAQ,CAAC,iBAAiB,GAC1B,QAAQ,CAAC,UAAU,GACnB,QAAQ,CAAC,0BAA0B,CAAC;IACxC,QAAQ,CAAC,qBAAqB,EAAE,MAAM,CAAC;CACxC,CA2BA;AAED,wBAAgB,0BAA0B,CACxC,EAAE,UAAU,EAAE,EAAE,QAAQ,CAAC,SAAS,EAClC,KAAK,EAAE,QAAQ,CAAC,SAAS,EACzB,IAAI,EAAE,MAAM,GACX,QAAQ,CAAC,OAAO,GAAG,SAAS,CA0B9B;AAED,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,QAAQ,CAAC,QAAQ,CAAC,UAAU,CAAC,EACzC,gBAAgB,EAAE,QAAQ,CAAC,gBAAgB,EAC3C,aAAa,EAAE,MAAM,EACrB,KAAK,EAAE,QAAQ,CAAC,SAAS,GACxB,QAAQ,CAAC,OAAO,GAAG,SAAS,CAkC9B;AAED,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,QAAQ,CAAC,QAAQ,CAAC,UAAU,CAAC,EACzC,IAAI,EAAE,QAAQ,CAAC,IAAI,EACnB,KAAK,EAAE,QAAQ,CAAC,SAAS,GACxB,QAAQ,CAAC,OAAO,CAMlB"}
@@ -0,0 +1,134 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getImportAddFix = getImportAddFix;
4
+ exports.getImportRemoveFix = getImportRemoveFix;
5
+ exports.getImplementsSchemaFixer = getImplementsSchemaFixer;
6
+ exports.getDecoratorPropertyAddFix = getDecoratorPropertyAddFix;
7
+ exports.getImplementsRemoveFix = getImplementsRemoveFix;
8
+ exports.getNodeToCommaRemoveFix = getNodeToCommaRemoveFix;
9
+ const utils_1 = require("@typescript-eslint/utils");
10
+ const ast_utils_1 = require("./ast-utils");
11
+ const utils_2 = require("../utils");
12
+ function getImportAddFix({ compatibleWithTypeOnlyImport = false, fixer, importName, moduleName, node, }) {
13
+ const fullImport = `import { ${importName} } from '${moduleName}';\n`;
14
+ const importDeclarations = (0, ast_utils_1.getImportDeclarations)(node, moduleName);
15
+ if (!importDeclarations?.length) {
16
+ return fixer.insertTextAfterRange([0, 0], fullImport);
17
+ }
18
+ const importDeclarationSpecifier = (0, ast_utils_1.getImportDeclarationSpecifier)(importDeclarations, importName);
19
+ if (importDeclarationSpecifier) {
20
+ return undefined;
21
+ }
22
+ const importClause = (0, ast_utils_1.getCorrespondentImportClause)(importDeclarations, compatibleWithTypeOnlyImport);
23
+ if (!importClause) {
24
+ return fixer.insertTextAfterRange([0, 0], fullImport);
25
+ }
26
+ const replacementText = (0, ast_utils_1.isImportDefaultSpecifier)(importClause)
27
+ ? `, { ${importName} }`
28
+ : `, ${importName}`;
29
+ return fixer.insertTextAfter(importClause, replacementText);
30
+ }
31
+ function getImportRemoveFix(sourceCode, importDeclarations, importName, fixer) {
32
+ const { importDeclaration, importSpecifier } = (0, ast_utils_1.getImportDeclarationSpecifier)(importDeclarations, importName) ?? {};
33
+ if (!importDeclaration || !importSpecifier)
34
+ return undefined;
35
+ const isFirstImportSpecifier = importDeclaration.specifiers[0] === importSpecifier;
36
+ const isLastImportSpecifier = (0, utils_2.getLast)(importDeclaration.specifiers) === importSpecifier;
37
+ const isSingleImportSpecifier = isFirstImportSpecifier && isLastImportSpecifier;
38
+ if (isSingleImportSpecifier) {
39
+ return fixer.remove(importDeclaration);
40
+ }
41
+ const tokenAfterImportSpecifier = sourceCode.getTokenAfter(importSpecifier);
42
+ if (isFirstImportSpecifier && tokenAfterImportSpecifier) {
43
+ return fixer.removeRange([
44
+ importSpecifier.range[0],
45
+ tokenAfterImportSpecifier.range[1],
46
+ ]);
47
+ }
48
+ const tokenBeforeImportSpecifier = sourceCode.getTokenBefore(importSpecifier);
49
+ if (!tokenBeforeImportSpecifier)
50
+ return undefined;
51
+ return fixer.removeRange([
52
+ tokenBeforeImportSpecifier.range[0],
53
+ importSpecifier.range[1],
54
+ ]);
55
+ }
56
+ function getImplementsSchemaFixer({ id, superClass, implements: classImplements, typeParameters, }, interfaceName) {
57
+ if (Array.isArray(classImplements) && classImplements.length > 0) {
58
+ return {
59
+ implementsNodeReplace: (0, utils_2.getLast)(classImplements),
60
+ implementsTextReplace: `, ${interfaceName}`,
61
+ };
62
+ }
63
+ const implementsTextReplace = ` implements ${interfaceName}`;
64
+ if ((0, utils_2.isNotNullOrUndefined)(superClass)) {
65
+ return {
66
+ implementsNodeReplace: superClass,
67
+ implementsTextReplace,
68
+ };
69
+ }
70
+ if ((0, utils_2.isNotNullOrUndefined)(typeParameters)) {
71
+ return {
72
+ implementsNodeReplace: typeParameters,
73
+ implementsTextReplace,
74
+ };
75
+ }
76
+ return {
77
+ implementsNodeReplace: id,
78
+ implementsTextReplace,
79
+ };
80
+ }
81
+ function getDecoratorPropertyAddFix({ expression }, fixer, text) {
82
+ if (!(0, ast_utils_1.isCallExpression)(expression)) {
83
+ return undefined;
84
+ }
85
+ const [firstArgument] = expression.arguments;
86
+ if (!firstArgument || !(0, ast_utils_1.isObjectExpression)(firstArgument)) {
87
+ // `@Component()` => `@Component({changeDetection: ChangeDetectionStrategy.OnPush})`
88
+ const [initialRange, endRange] = expression.range;
89
+ return fixer.insertTextAfterRange([initialRange + 1, endRange - 1], `{${text}}`);
90
+ }
91
+ const { properties } = firstArgument;
92
+ if (properties.length === 0) {
93
+ //` @Component({})` => `@Component({changeDetection: ChangeDetectionStrategy.OnPush})`
94
+ const [initialRange, endRange] = firstArgument.range;
95
+ return fixer.insertTextAfterRange([initialRange + 1, endRange - 1], text);
96
+ }
97
+ // `@Component({...})` => `@Component({changeDetection: ChangeDetectionStrategy.OnPush, ...})`
98
+ return fixer.insertTextBefore(properties[0], `${text},`);
99
+ }
100
+ function getImplementsRemoveFix(sourceCode, classDeclaration, interfaceName, fixer) {
101
+ const { implements: classImplements } = classDeclaration;
102
+ if (!classImplements)
103
+ return undefined;
104
+ const identifier = (0, ast_utils_1.getInterface)(classDeclaration, interfaceName);
105
+ if (!identifier)
106
+ return undefined;
107
+ const isFirstInterface = classImplements[0].expression === identifier;
108
+ const isLastInterface = (0, utils_2.getLast)(classImplements).expression === identifier;
109
+ const hasSingleInterfaceImplemented = isFirstInterface && isLastInterface;
110
+ const tokenBeforeInterface = sourceCode.getTokenBefore(identifier);
111
+ if (hasSingleInterfaceImplemented) {
112
+ return !tokenBeforeInterface || !(0, ast_utils_1.isImplementsToken)(tokenBeforeInterface)
113
+ ? undefined
114
+ : fixer.removeRange([
115
+ tokenBeforeInterface.range[0],
116
+ classImplements[0].range[1],
117
+ ]);
118
+ }
119
+ if (isFirstInterface) {
120
+ const tokenAfterInterface = sourceCode.getTokenAfter(identifier);
121
+ return !tokenAfterInterface
122
+ ? undefined
123
+ : fixer.removeRange([identifier.range[0], tokenAfterInterface.range[1]]);
124
+ }
125
+ return !tokenBeforeInterface
126
+ ? undefined
127
+ : fixer.removeRange([tokenBeforeInterface.range[0], identifier.range[1]]);
128
+ }
129
+ function getNodeToCommaRemoveFix(sourceCode, node, fixer) {
130
+ const tokenAfterNode = sourceCode.getTokenAfter(node);
131
+ return tokenAfterNode && utils_1.ASTUtils.isCommaToken(tokenAfterNode)
132
+ ? fixer.removeRange([node.range[0], tokenAfterNode.range[1]])
133
+ : fixer.remove(node);
134
+ }
@@ -0,0 +1,55 @@
1
+ import { CssSelector } from '@angular-eslint/bundled-angular-compiler';
2
+ import type { TSESLint, TSESTree } from '@typescript-eslint/utils';
3
+ import type { SelectorStyle } from './ast-utils';
4
+ export declare const OPTION_TYPE_ATTRIBUTE = "attribute";
5
+ export declare const OPTION_TYPE_ATTRS = "attrs";
6
+ export declare const OPTION_TYPE_ELEMENT = "element";
7
+ export type SelectorStyleOption = SelectorStyle | string;
8
+ export type SelectorTypeOption = typeof OPTION_TYPE_ATTRIBUTE | typeof OPTION_TYPE_ELEMENT | string;
9
+ export type SelectorTypeInternal = typeof OPTION_TYPE_ATTRS | typeof OPTION_TYPE_ELEMENT;
10
+ export type SelectorPrefixOption = undefined | string | readonly string[];
11
+ export type SelectorConfig = {
12
+ readonly type: SelectorTypeOption;
13
+ readonly prefix: SelectorPrefixOption;
14
+ readonly style: SelectorStyleOption;
15
+ };
16
+ export type SingleConfigOption = Options[number];
17
+ export type MultipleConfigOption = readonly SelectorConfig[];
18
+ export type RuleOptions = readonly [SingleConfigOption | MultipleConfigOption];
19
+ export type Options = [
20
+ {
21
+ readonly type: SelectorTypeOption | readonly SelectorTypeOption[];
22
+ readonly prefix: SelectorPrefixOption;
23
+ readonly style: SelectorTypeOption;
24
+ }
25
+ ];
26
+ export declare const SelectorValidator: {
27
+ attribute(selector: string): boolean;
28
+ camelCase(selector: string): boolean;
29
+ element(selector: string): boolean;
30
+ kebabCase(selector: string): boolean;
31
+ prefixRegex(prefix: string): RegExp;
32
+ prefix(prefix: string, selectorStyle: string): (selector: string) => boolean;
33
+ selectorAfterPrefix(prefix: string): (selector: string) => boolean;
34
+ };
35
+ export declare const reportPrefixError: (node: TSESTree.Node, prefix: SelectorPrefixOption, context: Readonly<TSESLint.RuleContext<string, readonly unknown[]>>) => void;
36
+ export declare const reportSelectorAfterPrefixError: (node: TSESTree.Node, prefix: SelectorPrefixOption, context: Readonly<TSESLint.RuleContext<string, readonly unknown[]>>) => void;
37
+ export declare const reportStyleError: (node: TSESTree.Node, style: SelectorStyleOption, context: Readonly<TSESLint.RuleContext<string, readonly unknown[]>>) => void;
38
+ export declare const reportStyleAndPrefixError: (node: TSESTree.Node, style: SelectorStyleOption, prefix: SelectorPrefixOption, context: Readonly<TSESLint.RuleContext<string, readonly unknown[]>>) => void;
39
+ export declare const reportTypeError: (node: TSESTree.Node, type: SelectorTypeOption | readonly SelectorTypeOption[], context: Readonly<TSESLint.RuleContext<string, readonly unknown[]>>) => void;
40
+ export declare const parseSelectorNode: (node: TSESTree.Node) => readonly CssSelector[] | null;
41
+ export declare const getActualSelectorType: (node: TSESTree.Node) => SelectorTypeOption | null;
42
+ export declare const checkValidOptions: (type: SelectorTypeOption | readonly SelectorTypeOption[], prefix: SelectorPrefixOption, style: SelectorStyleOption) => boolean;
43
+ export declare const checkSelector: (node: TSESTree.Node, typeOption: SelectorTypeOption | readonly SelectorTypeOption[], prefixOption: SelectorPrefixOption, styleOption: SelectorStyle, parsedSelectors?: readonly CssSelector[] | null) => {
44
+ readonly hasExpectedPrefix: boolean;
45
+ readonly hasExpectedType: boolean;
46
+ readonly hasExpectedStyle: boolean;
47
+ readonly hasSelectorAfterPrefix: boolean;
48
+ } | null;
49
+ export declare const isMultipleConfigOption: (option: SingleConfigOption | MultipleConfigOption) => option is MultipleConfigOption;
50
+ export declare const normalizeOptionsToConfigs: (option: SingleConfigOption | MultipleConfigOption) => Map<string, SelectorConfig>;
51
+ /**
52
+ * Get the applicable config for a given selector node
53
+ */
54
+ export declare const getApplicableConfig: (rawSelectors: TSESTree.Node, configByType: Map<string, SelectorConfig>) => SelectorConfig | null;
55
+ //# sourceMappingURL=selector-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"selector-utils.d.ts","sourceRoot":"","sources":["../../src/eslint-plugin/selector-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAC;AACvE,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AASjD,eAAO,MAAM,qBAAqB,cAAc,CAAC;AACjD,eAAO,MAAM,iBAAiB,UAAU,CAAC;AACzC,eAAO,MAAM,mBAAmB,YAAY,CAAC;AAE7C,MAAM,MAAM,mBAAmB,GAAG,aAAa,GAAG,MAAM,CAAC;AACzD,MAAM,MAAM,kBAAkB,GAC1B,OAAO,qBAAqB,GAC5B,OAAO,mBAAmB,GAC1B,MAAM,CAAC;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