@dineroregnskab/eslint-plugin-custom-rules 2.0.6 → 2.0.7

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 (174) hide show
  1. package/eslint-plugin-custom-rules.js +2 -0
  2. package/package.json +1 -1
  3. package/node_modules/@aashutoshrathi/word-wrap/LICENSE +0 -21
  4. package/node_modules/@aashutoshrathi/word-wrap/README.md +0 -182
  5. package/node_modules/@aashutoshrathi/word-wrap/index.d.ts +0 -50
  6. package/node_modules/@aashutoshrathi/word-wrap/index.js +0 -52
  7. package/node_modules/@aashutoshrathi/word-wrap/package.json +0 -81
  8. package/node_modules/@angular-eslint/bundled-angular-compiler/README.md +0 -1
  9. package/node_modules/@angular-eslint/bundled-angular-compiler/dist/index.d.ts +0 -5
  10. package/node_modules/@angular-eslint/bundled-angular-compiler/dist/index.js +0 -32004
  11. package/node_modules/@angular-eslint/bundled-angular-compiler/package.json +0 -19
  12. package/node_modules/@angular-eslint/template-parser/LICENSE +0 -21
  13. package/node_modules/@angular-eslint/template-parser/README.md +0 -1
  14. package/node_modules/@angular-eslint/template-parser/dist/convert-source-span-to-loc.d.ts +0 -6
  15. package/node_modules/@angular-eslint/template-parser/dist/convert-source-span-to-loc.js +0 -69
  16. package/node_modules/@angular-eslint/template-parser/dist/index.d.ts +0 -44
  17. package/node_modules/@angular-eslint/template-parser/dist/index.js +0 -219
  18. package/node_modules/@angular-eslint/template-parser/package.json +0 -28
  19. package/node_modules/@eslint/eslintrc/LICENSE +0 -19
  20. package/node_modules/@eslint/eslintrc/README.md +0 -115
  21. package/node_modules/@eslint/eslintrc/conf/config-schema.js +0 -79
  22. package/node_modules/@eslint/eslintrc/conf/environments.js +0 -215
  23. package/node_modules/@eslint/eslintrc/dist/eslintrc-universal.cjs +0 -1104
  24. package/node_modules/@eslint/eslintrc/dist/eslintrc-universal.cjs.map +0 -1
  25. package/node_modules/@eslint/eslintrc/dist/eslintrc.cjs +0 -4333
  26. package/node_modules/@eslint/eslintrc/dist/eslintrc.cjs.map +0 -1
  27. package/node_modules/@eslint/eslintrc/lib/cascading-config-array-factory.js +0 -532
  28. package/node_modules/@eslint/eslintrc/lib/config-array/config-array.js +0 -523
  29. package/node_modules/@eslint/eslintrc/lib/config-array/config-dependency.js +0 -115
  30. package/node_modules/@eslint/eslintrc/lib/config-array/extracted-config.js +0 -145
  31. package/node_modules/@eslint/eslintrc/lib/config-array/ignore-pattern.js +0 -238
  32. package/node_modules/@eslint/eslintrc/lib/config-array/index.js +0 -19
  33. package/node_modules/@eslint/eslintrc/lib/config-array/override-tester.js +0 -225
  34. package/node_modules/@eslint/eslintrc/lib/config-array-factory.js +0 -1149
  35. package/node_modules/@eslint/eslintrc/lib/flat-compat.js +0 -318
  36. package/node_modules/@eslint/eslintrc/lib/index-universal.js +0 -29
  37. package/node_modules/@eslint/eslintrc/lib/index.js +0 -56
  38. package/node_modules/@eslint/eslintrc/lib/shared/ajv.js +0 -191
  39. package/node_modules/@eslint/eslintrc/lib/shared/config-ops.js +0 -135
  40. package/node_modules/@eslint/eslintrc/lib/shared/config-validator.js +0 -325
  41. package/node_modules/@eslint/eslintrc/lib/shared/deprecation-warnings.js +0 -63
  42. package/node_modules/@eslint/eslintrc/lib/shared/naming.js +0 -96
  43. package/node_modules/@eslint/eslintrc/lib/shared/relative-module-resolver.js +0 -42
  44. package/node_modules/@eslint/eslintrc/lib/shared/types.js +0 -149
  45. package/node_modules/@eslint/eslintrc/package.json +0 -82
  46. package/node_modules/@eslint/eslintrc/universal.js +0 -9
  47. package/node_modules/@eslint/js/LICENSE +0 -19
  48. package/node_modules/@eslint/js/README.md +0 -57
  49. package/node_modules/@eslint/js/package.json +0 -31
  50. package/node_modules/@eslint/js/src/configs/eslint-all.js +0 -211
  51. package/node_modules/@eslint/js/src/configs/eslint-recommended.js +0 -76
  52. package/node_modules/@eslint/js/src/index.js +0 -17
  53. package/node_modules/@eslint-community/eslint-utils/LICENSE +0 -21
  54. package/node_modules/@eslint-community/eslint-utils/README.md +0 -37
  55. package/node_modules/@eslint-community/eslint-utils/index.js +0 -2068
  56. package/node_modules/@eslint-community/eslint-utils/index.js.map +0 -1
  57. package/node_modules/@eslint-community/eslint-utils/index.mjs +0 -2027
  58. package/node_modules/@eslint-community/eslint-utils/index.mjs.map +0 -1
  59. package/node_modules/@eslint-community/eslint-utils/package.json +0 -73
  60. package/node_modules/@eslint-community/regexpp/LICENSE +0 -21
  61. package/node_modules/@eslint-community/regexpp/README.md +0 -177
  62. package/node_modules/@eslint-community/regexpp/index.d.ts +0 -1065
  63. package/node_modules/@eslint-community/regexpp/index.js +0 -2747
  64. package/node_modules/@eslint-community/regexpp/index.js.map +0 -1
  65. package/node_modules/@eslint-community/regexpp/index.mjs +0 -2737
  66. package/node_modules/@eslint-community/regexpp/index.mjs.map +0 -1
  67. package/node_modules/@eslint-community/regexpp/package.json +0 -93
  68. package/node_modules/@humanwhocodes/config-array/LICENSE +0 -201
  69. package/node_modules/@humanwhocodes/config-array/README.md +0 -342
  70. package/node_modules/@humanwhocodes/config-array/api.js +0 -1061
  71. package/node_modules/@humanwhocodes/config-array/package.json +0 -61
  72. package/node_modules/@humanwhocodes/module-importer/CHANGELOG.md +0 -15
  73. package/node_modules/@humanwhocodes/module-importer/LICENSE +0 -201
  74. package/node_modules/@humanwhocodes/module-importer/README.md +0 -80
  75. package/node_modules/@humanwhocodes/module-importer/dist/module-importer.cjs +0 -22
  76. package/node_modules/@humanwhocodes/module-importer/dist/module-importer.d.cts +0 -27
  77. package/node_modules/@humanwhocodes/module-importer/dist/module-importer.d.ts +0 -2
  78. package/node_modules/@humanwhocodes/module-importer/dist/module-importer.js +0 -18
  79. package/node_modules/@humanwhocodes/module-importer/package.json +0 -65
  80. package/node_modules/@humanwhocodes/module-importer/src/module-importer.cjs +0 -81
  81. package/node_modules/@humanwhocodes/module-importer/src/module-importer.js +0 -22
  82. package/node_modules/@humanwhocodes/object-schema/.eslintrc.js +0 -29
  83. package/node_modules/@humanwhocodes/object-schema/.github/workflows/nodejs-test.yml +0 -27
  84. package/node_modules/@humanwhocodes/object-schema/.github/workflows/release-please.yml +0 -39
  85. package/node_modules/@humanwhocodes/object-schema/CHANGELOG.md +0 -26
  86. package/node_modules/@humanwhocodes/object-schema/LICENSE +0 -29
  87. package/node_modules/@humanwhocodes/object-schema/README.md +0 -234
  88. package/node_modules/@humanwhocodes/object-schema/package.json +0 -33
  89. package/node_modules/@humanwhocodes/object-schema/src/index.js +0 -7
  90. package/node_modules/@humanwhocodes/object-schema/src/merge-strategy.js +0 -53
  91. package/node_modules/@humanwhocodes/object-schema/src/object-schema.js +0 -301
  92. package/node_modules/@humanwhocodes/object-schema/src/validation-strategy.js +0 -102
  93. package/node_modules/@humanwhocodes/object-schema/tests/merge-strategy.js +0 -66
  94. package/node_modules/@humanwhocodes/object-schema/tests/object-schema.js +0 -659
  95. package/node_modules/@humanwhocodes/object-schema/tests/validation-strategy.js +0 -186
  96. package/node_modules/@nodelib/fs.scandir/LICENSE +0 -21
  97. package/node_modules/@nodelib/fs.scandir/README.md +0 -171
  98. package/node_modules/@nodelib/fs.scandir/out/adapters/fs.d.ts +0 -20
  99. package/node_modules/@nodelib/fs.scandir/out/adapters/fs.js +0 -19
  100. package/node_modules/@nodelib/fs.scandir/out/constants.d.ts +0 -4
  101. package/node_modules/@nodelib/fs.scandir/out/constants.js +0 -17
  102. package/node_modules/@nodelib/fs.scandir/out/index.d.ts +0 -12
  103. package/node_modules/@nodelib/fs.scandir/out/index.js +0 -26
  104. package/node_modules/@nodelib/fs.scandir/out/providers/async.d.ts +0 -7
  105. package/node_modules/@nodelib/fs.scandir/out/providers/async.js +0 -104
  106. package/node_modules/@nodelib/fs.scandir/out/providers/common.d.ts +0 -1
  107. package/node_modules/@nodelib/fs.scandir/out/providers/common.js +0 -13
  108. package/node_modules/@nodelib/fs.scandir/out/providers/sync.d.ts +0 -5
  109. package/node_modules/@nodelib/fs.scandir/out/providers/sync.js +0 -54
  110. package/node_modules/@nodelib/fs.scandir/out/settings.d.ts +0 -20
  111. package/node_modules/@nodelib/fs.scandir/out/settings.js +0 -24
  112. package/node_modules/@nodelib/fs.scandir/out/types/index.d.ts +0 -20
  113. package/node_modules/@nodelib/fs.scandir/out/types/index.js +0 -2
  114. package/node_modules/@nodelib/fs.scandir/out/utils/fs.d.ts +0 -2
  115. package/node_modules/@nodelib/fs.scandir/out/utils/fs.js +0 -19
  116. package/node_modules/@nodelib/fs.scandir/out/utils/index.d.ts +0 -2
  117. package/node_modules/@nodelib/fs.scandir/out/utils/index.js +0 -5
  118. package/node_modules/@nodelib/fs.scandir/package.json +0 -44
  119. package/node_modules/@nodelib/fs.stat/LICENSE +0 -21
  120. package/node_modules/@nodelib/fs.stat/README.md +0 -126
  121. package/node_modules/@nodelib/fs.stat/out/adapters/fs.d.ts +0 -13
  122. package/node_modules/@nodelib/fs.stat/out/adapters/fs.js +0 -17
  123. package/node_modules/@nodelib/fs.stat/out/index.d.ts +0 -12
  124. package/node_modules/@nodelib/fs.stat/out/index.js +0 -26
  125. package/node_modules/@nodelib/fs.stat/out/providers/async.d.ts +0 -4
  126. package/node_modules/@nodelib/fs.stat/out/providers/async.js +0 -36
  127. package/node_modules/@nodelib/fs.stat/out/providers/sync.d.ts +0 -3
  128. package/node_modules/@nodelib/fs.stat/out/providers/sync.js +0 -23
  129. package/node_modules/@nodelib/fs.stat/out/settings.d.ts +0 -16
  130. package/node_modules/@nodelib/fs.stat/out/settings.js +0 -16
  131. package/node_modules/@nodelib/fs.stat/out/types/index.d.ts +0 -4
  132. package/node_modules/@nodelib/fs.stat/out/types/index.js +0 -2
  133. package/node_modules/@nodelib/fs.stat/package.json +0 -37
  134. package/node_modules/@nodelib/fs.walk/LICENSE +0 -21
  135. package/node_modules/@nodelib/fs.walk/README.md +0 -215
  136. package/node_modules/@nodelib/fs.walk/out/index.d.ts +0 -14
  137. package/node_modules/@nodelib/fs.walk/out/index.js +0 -34
  138. package/node_modules/@nodelib/fs.walk/out/providers/async.d.ts +0 -12
  139. package/node_modules/@nodelib/fs.walk/out/providers/async.js +0 -30
  140. package/node_modules/@nodelib/fs.walk/out/providers/index.d.ts +0 -4
  141. package/node_modules/@nodelib/fs.walk/out/providers/index.js +0 -9
  142. package/node_modules/@nodelib/fs.walk/out/providers/stream.d.ts +0 -12
  143. package/node_modules/@nodelib/fs.walk/out/providers/stream.js +0 -34
  144. package/node_modules/@nodelib/fs.walk/out/providers/sync.d.ts +0 -10
  145. package/node_modules/@nodelib/fs.walk/out/providers/sync.js +0 -14
  146. package/node_modules/@nodelib/fs.walk/out/readers/async.d.ts +0 -30
  147. package/node_modules/@nodelib/fs.walk/out/readers/async.js +0 -97
  148. package/node_modules/@nodelib/fs.walk/out/readers/common.d.ts +0 -7
  149. package/node_modules/@nodelib/fs.walk/out/readers/common.js +0 -31
  150. package/node_modules/@nodelib/fs.walk/out/readers/reader.d.ts +0 -6
  151. package/node_modules/@nodelib/fs.walk/out/readers/reader.js +0 -11
  152. package/node_modules/@nodelib/fs.walk/out/readers/sync.d.ts +0 -15
  153. package/node_modules/@nodelib/fs.walk/out/readers/sync.js +0 -59
  154. package/node_modules/@nodelib/fs.walk/out/settings.d.ts +0 -30
  155. package/node_modules/@nodelib/fs.walk/out/settings.js +0 -26
  156. package/node_modules/@nodelib/fs.walk/out/types/index.d.ts +0 -8
  157. package/node_modules/@nodelib/fs.walk/out/types/index.js +0 -2
  158. package/node_modules/@nodelib/fs.walk/package.json +0 -44
  159. package/node_modules/@ungap/structured-clone/.github/workflows/node.js.yml +0 -31
  160. package/node_modules/@ungap/structured-clone/LICENSE +0 -15
  161. package/node_modules/@ungap/structured-clone/README.md +0 -95
  162. package/node_modules/@ungap/structured-clone/cjs/deserialize.js +0 -78
  163. package/node_modules/@ungap/structured-clone/cjs/index.js +0 -27
  164. package/node_modules/@ungap/structured-clone/cjs/json.js +0 -24
  165. package/node_modules/@ungap/structured-clone/cjs/package.json +0 -1
  166. package/node_modules/@ungap/structured-clone/cjs/serialize.js +0 -160
  167. package/node_modules/@ungap/structured-clone/cjs/types.js +0 -22
  168. package/node_modules/@ungap/structured-clone/esm/deserialize.js +0 -79
  169. package/node_modules/@ungap/structured-clone/esm/index.js +0 -25
  170. package/node_modules/@ungap/structured-clone/esm/json.js +0 -21
  171. package/node_modules/@ungap/structured-clone/esm/serialize.js +0 -161
  172. package/node_modules/@ungap/structured-clone/esm/types.js +0 -11
  173. package/node_modules/@ungap/structured-clone/package.json +0 -53
  174. package/node_modules/@ungap/structured-clone/structured-json.js +0 -1
@@ -1,19 +0,0 @@
1
- {
2
- "name": "@angular-eslint/bundled-angular-compiler",
3
- "version": "17.1.0",
4
- "description": "A CJS bundled version of @angular/compiler",
5
- "license": "MIT",
6
- "main": "dist/index.js",
7
- "types": "dist/index.d.ts",
8
- "repository": {
9
- "type": "git",
10
- "url": "https://github.com/angular-eslint/angular-eslint.git",
11
- "directory": "packages/bundled-angular-compiler"
12
- },
13
- "files": [
14
- "dist",
15
- "package.json",
16
- "README.md"
17
- ],
18
- "gitHead": "e2006e5e9c99e5a943d1a999e0efa5247d29ec24"
19
- }
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2020 James Henry
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
@@ -1 +0,0 @@
1
- # @angular-eslint/template-parser
@@ -1,6 +0,0 @@
1
- import type { ParseSourceSpan, TmplAstElement } from '@angular-eslint/bundled-angular-compiler';
2
- import type { TSESLint, TSESTree } from '@typescript-eslint/utils';
3
- export declare function convertNodeSourceSpanToLoc(sourceSpan: ParseSourceSpan): TSESTree.SourceLocation;
4
- export declare function convertElementSourceSpanToLoc(context: Readonly<TSESLint.RuleContext<string, readonly unknown[]>>, node: TmplAstElement & {
5
- type: string;
6
- }): TSESTree.SourceLocation;
@@ -1,69 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.convertElementSourceSpanToLoc = exports.convertNodeSourceSpanToLoc = void 0;
4
- const bundled_angular_compiler_1 = require("@angular-eslint/bundled-angular-compiler");
5
- function convertNodeSourceSpanToLoc(sourceSpan) {
6
- return {
7
- start: {
8
- line: sourceSpan.start.line + 1,
9
- column: sourceSpan.start.col,
10
- },
11
- end: {
12
- line: sourceSpan.end.line + 1,
13
- column: sourceSpan.end.col,
14
- },
15
- };
16
- }
17
- exports.convertNodeSourceSpanToLoc = convertNodeSourceSpanToLoc;
18
- function convertElementSourceSpanToLoc(context, node) {
19
- if (node.type !== 'Element$1') {
20
- // We explicitly throw an exception since this function should not be used
21
- // with non-element nodes, e.g. `TextAttribute` or `MethodDefinition`, etc.
22
- throw new Error('convertElementSourceSpanToLoc is intended to be used only with elements.');
23
- }
24
- // Void elements are "self-closed" elements, e.g. `<img />` or `<area />`.
25
- // The Angular compiler explicitly doesn't set the end source span for void
26
- // elements, but we still have to find its location to be able to report failures.
27
- if ((0, bundled_angular_compiler_1.getHtmlTagDefinition)(node.name).isVoid) {
28
- // Fallback to the original `node` if the
29
- // `tryToFindTheVoidNodeThatMatchesTheSourceSpan` returns nothing.
30
- node = (tryToFindTheVoidNodeThatMatchesTheSourceSpan(context, node) ||
31
- node);
32
- }
33
- return convertNodeSourceSpanToLoc(node.sourceSpan);
34
- }
35
- exports.convertElementSourceSpanToLoc = convertElementSourceSpanToLoc;
36
- function tryToFindTheVoidNodeThatMatchesTheSourceSpan(context, node) {
37
- // Previously, `codelyzer` used `TemplateParser` to parse a template into an AST tree.
38
- // The `TemplateParser` used `HtmlParser`, because `HtmlParser` still sets the end span
39
- // for void elements.
40
- const { rootNodes } = getHtmlParser().parse(context.getSourceCode().getText(), context.getFilename());
41
- return lookupTheVoidNode(rootNodes, node.sourceSpan);
42
- }
43
- function lookupTheVoidNode(rootNodes, sourceSpan) {
44
- for (const node of rootNodes) {
45
- if (
46
- // We can't compare by `node.sourceSpan == sourceSpan` since references
47
- // will differ. But comparing `line` and` offset` is the
48
- // correct way, because they will not differ.
49
- node.sourceSpan.start.line === sourceSpan.start.line &&
50
- node.sourceSpan.start.offset === sourceSpan.start.offset) {
51
- return node;
52
- }
53
- // `HtmlParser` will return a list of root nodes, these nodes
54
- // can be either text or elements. Elements might have child elements.
55
- if (node instanceof bundled_angular_compiler_1.Element) {
56
- const voidNodeBeingLookedUp = lookupTheVoidNode(node.children, sourceSpan);
57
- if (voidNodeBeingLookedUp !== null) {
58
- return voidNodeBeingLookedUp;
59
- }
60
- }
61
- }
62
- return null;
63
- }
64
- let htmlParser = null;
65
- // Initialize the `HtmlParser` class lazily only when the function is
66
- // invoked for the first time.
67
- function getHtmlParser() {
68
- return htmlParser || (htmlParser = new bundled_angular_compiler_1.HtmlParser());
69
- }
@@ -1,44 +0,0 @@
1
- import type { ParseError } from '@angular-eslint/bundled-angular-compiler';
2
- import type { TSESTree } from '@typescript-eslint/types';
3
- import { ScopeManager } from 'eslint-scope';
4
- import { convertElementSourceSpanToLoc, convertNodeSourceSpanToLoc } from './convert-source-span-to-loc';
5
- type NodeOrTokenType = any;
6
- interface Node {
7
- [key: string]: any;
8
- type: NodeOrTokenType;
9
- }
10
- interface VisitorKeys {
11
- [nodeName: string]: string[];
12
- }
13
- interface Token extends TSESTree.BaseNode {
14
- type: NodeOrTokenType;
15
- value: string;
16
- }
17
- interface AST extends Node, Omit<Token, 'parent'> {
18
- comments: Token[];
19
- tokens: Token[];
20
- templateNodes: any[];
21
- }
22
- export declare class TemplateParseError extends Error {
23
- readonly fileName: string;
24
- readonly index: number;
25
- readonly lineNumber: number;
26
- readonly column: number;
27
- constructor(message: string, fileName: string, index: number, lineNumber: number, column: number);
28
- }
29
- export declare function createTemplateParseError(parseError: ParseError): TemplateParseError;
30
- export interface ParserOptions {
31
- filePath: string;
32
- suppressParseErrors?: boolean;
33
- }
34
- declare function parseForESLint(code: string, options: ParserOptions): {
35
- ast: AST;
36
- scopeManager: ScopeManager;
37
- visitorKeys: VisitorKeys;
38
- services: {
39
- convertElementSourceSpanToLoc: typeof convertElementSourceSpanToLoc;
40
- convertNodeSourceSpanToLoc: typeof convertNodeSourceSpanToLoc;
41
- };
42
- };
43
- export { parseForESLint };
44
- export declare function parse(code: string, options: ParserOptions): AST;
@@ -1,219 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.parse = exports.parseForESLint = exports.createTemplateParseError = exports.TemplateParseError = void 0;
4
- const bundled_angular_compiler_1 = require("@angular-eslint/bundled-angular-compiler");
5
- const eslint_scope_1 = require("eslint-scope");
6
- const convert_source_span_to_loc_1 = require("./convert-source-span-to-loc");
7
- const KEYS = {
8
- ASTWithSource: ['ast'],
9
- Binary: ['left', 'right'],
10
- BoundAttribute: ['value'],
11
- BoundEvent: ['handler'],
12
- BoundText: ['value'],
13
- Conditional: ['condition', 'trueExp', 'falseExp'],
14
- Element$1: ['children', 'inputs', 'outputs', 'attributes'],
15
- Interpolation$1: ['expressions'],
16
- PrefixNot: ['expression'],
17
- Program: ['templateNodes'],
18
- PropertyRead: ['receiver'],
19
- Template: ['templateAttrs', 'children', 'inputs'],
20
- BindingPipe: ['exp'],
21
- DeferredBlock: ['children'],
22
- DeferredBlockLoading: ['children'],
23
- DeferredBlockError: ['children'],
24
- DeferredBlockPlaceholder: ['children'],
25
- };
26
- function fallbackKeysFilter(key) {
27
- let value = null;
28
- return (key !== 'comments' &&
29
- key !== 'leadingComments' &&
30
- key !== 'loc' &&
31
- key !== 'parent' &&
32
- key !== 'range' &&
33
- key !== 'tokens' &&
34
- key !== 'trailingComments' &&
35
- (value = this[key]) !== null &&
36
- typeof value === 'object' &&
37
- (typeof value.type === 'string' || Array.isArray(value)));
38
- }
39
- function getFallbackKeys(node) {
40
- return Object.keys(node).filter(fallbackKeysFilter, node);
41
- }
42
- function isNode(node) {
43
- return (node !== null &&
44
- typeof node === 'object' &&
45
- typeof node.type === 'string');
46
- }
47
- /**
48
- * ESLint requires all Nodes to have `type` and `loc` properties before it can
49
- * work with the custom AST.
50
- */
51
- function preprocessNode(node) {
52
- let i = 0;
53
- let j = 0;
54
- const keys = KEYS[node.type] || getFallbackKeys(node);
55
- if (!node.loc && node.sourceSpan) {
56
- node.loc = (0, convert_source_span_to_loc_1.convertNodeSourceSpanToLoc)(node.sourceSpan);
57
- }
58
- for (i = 0; i < keys.length; ++i) {
59
- const child = node[keys[i]];
60
- const isArr = Array.isArray(child);
61
- if (child.type !== undefined) {
62
- // Angular sometimes uses a prop called type already
63
- child.__originalType = child.type;
64
- }
65
- if (!isArr && !child.type) {
66
- child.type = child.constructor.name;
67
- }
68
- if (isArr) {
69
- for (j = 0; j < child.length; ++j) {
70
- const c = child[j];
71
- if (c.type !== undefined) {
72
- // Angular sometimes uses a prop called type already
73
- c.__originalType = c.type;
74
- }
75
- // Pay attention to the condition `typeof c.type === number`,
76
- // Angular compiler sets `type` property for some AST nodes,
77
- // e.g. for the `BoundAttribute`, which is a `BindingType`.
78
- if (!c.type || typeof c.type === 'number') {
79
- c.type = c.constructor.name;
80
- }
81
- if (isNode(c)) {
82
- preprocessNode(c);
83
- }
84
- }
85
- }
86
- else if (isNode(child)) {
87
- preprocessNode(child);
88
- }
89
- }
90
- }
91
- function getStartSourceSpanFromAST(ast) {
92
- let startSourceSpan = null;
93
- ast.templateNodes.forEach((node) => {
94
- const nodeSourceSpan = node.startSourceSpan || node.sourceSpan;
95
- if (!startSourceSpan) {
96
- startSourceSpan = nodeSourceSpan;
97
- return;
98
- }
99
- if (nodeSourceSpan &&
100
- nodeSourceSpan.start.offset < startSourceSpan.start.offset) {
101
- startSourceSpan = nodeSourceSpan;
102
- return;
103
- }
104
- });
105
- return startSourceSpan;
106
- }
107
- function getEndSourceSpanFromAST(ast) {
108
- let endSourceSpan = null;
109
- ast.templateNodes.forEach((node) => {
110
- const nodeSourceSpan = node.endSourceSpan || node.sourceSpan;
111
- if (!endSourceSpan) {
112
- endSourceSpan = nodeSourceSpan;
113
- return;
114
- }
115
- if (nodeSourceSpan &&
116
- nodeSourceSpan.end.offset > endSourceSpan.end.offset) {
117
- endSourceSpan = nodeSourceSpan;
118
- return;
119
- }
120
- });
121
- return endSourceSpan;
122
- }
123
- function convertNgAstCommentsToTokens(comments) {
124
- const commentTokens = comments.map((comment) => {
125
- return {
126
- // In an HTML context, effectively all our comments are Block comments
127
- type: 'Block',
128
- value: comment.value,
129
- loc: (0, convert_source_span_to_loc_1.convertNodeSourceSpanToLoc)(comment.sourceSpan),
130
- range: [comment.sourceSpan.start.offset, comment.sourceSpan.end.offset],
131
- };
132
- });
133
- /**
134
- * ESLint requires this to be sorted by Token#range[0]
135
- * https://eslint.org/docs/developer-guide/working-with-custom-parsers
136
- */
137
- return commentTokens.sort((a, b) => a.range[0] - b.range[0]);
138
- }
139
- class TemplateParseError extends Error {
140
- constructor(message, fileName, index, lineNumber, column) {
141
- super(message);
142
- this.fileName = fileName;
143
- this.index = index;
144
- this.lineNumber = lineNumber;
145
- this.column = column;
146
- Object.defineProperty(this, 'name', {
147
- value: new.target.name,
148
- enumerable: false,
149
- configurable: true,
150
- });
151
- }
152
- }
153
- exports.TemplateParseError = TemplateParseError;
154
- function createTemplateParseError(parseError) {
155
- const message = parseError.msg;
156
- const fileName = parseError.span.start.file.url;
157
- const index = parseError.span.start.offset;
158
- const lineNumber = parseError.span.start.line + 1;
159
- const column = parseError.span.start.col + 1;
160
- return new TemplateParseError(message, fileName, index, lineNumber, column);
161
- }
162
- exports.createTemplateParseError = createTemplateParseError;
163
- function parseForESLint(code, options) {
164
- var _a, _b;
165
- const angularCompilerResult = (0, bundled_angular_compiler_1.parseTemplate)(code, options.filePath, {
166
- preserveWhitespaces: true,
167
- preserveLineEndings: true,
168
- collectCommentNodes: true,
169
- });
170
- let ngAstCommentNodes = [];
171
- if (Array.isArray(angularCompilerResult.commentNodes)) {
172
- ngAstCommentNodes = angularCompilerResult.commentNodes;
173
- }
174
- const ast = {
175
- type: 'Program',
176
- comments: convertNgAstCommentsToTokens(ngAstCommentNodes),
177
- tokens: [],
178
- range: [0, 0],
179
- loc: {
180
- start: { line: 0, column: 0 },
181
- end: { line: 0, column: 0 },
182
- },
183
- templateNodes: angularCompilerResult.nodes,
184
- value: code,
185
- };
186
- // @ts-expect-error The types for ScopeManager seem to be wrong, it requires a configuration object or it will throw at runtime
187
- const scopeManager = new eslint_scope_1.ScopeManager({});
188
- // @ts-expect-error Create a global scope for the ScopeManager, the types for Scope also seem to be wrong
189
- new eslint_scope_1.Scope(scopeManager, 'module', null, ast, false);
190
- preprocessNode(ast);
191
- const startSourceSpan = getStartSourceSpanFromAST(ast);
192
- const endSourceSpan = getEndSourceSpanFromAST(ast);
193
- if (startSourceSpan && endSourceSpan) {
194
- ast.range = [startSourceSpan.start.offset, endSourceSpan.end.offset];
195
- ast.loc = {
196
- start: (0, convert_source_span_to_loc_1.convertNodeSourceSpanToLoc)(startSourceSpan).start,
197
- end: (0, convert_source_span_to_loc_1.convertNodeSourceSpanToLoc)(endSourceSpan).end,
198
- };
199
- }
200
- // TODO: Stop suppressing parse errors by default in v18
201
- const suppressParseErrors = (_a = options.suppressParseErrors) !== null && _a !== void 0 ? _a : true;
202
- if (!suppressParseErrors && ((_b = angularCompilerResult.errors) === null || _b === void 0 ? void 0 : _b.length)) {
203
- throw createTemplateParseError(angularCompilerResult.errors[0]);
204
- }
205
- return {
206
- ast,
207
- scopeManager,
208
- visitorKeys: KEYS,
209
- services: {
210
- convertNodeSourceSpanToLoc: convert_source_span_to_loc_1.convertNodeSourceSpanToLoc,
211
- convertElementSourceSpanToLoc: convert_source_span_to_loc_1.convertElementSourceSpanToLoc,
212
- },
213
- };
214
- }
215
- exports.parseForESLint = parseForESLint;
216
- function parse(code, options) {
217
- return parseForESLint(code, options).ast;
218
- }
219
- exports.parse = parse;
@@ -1,28 +0,0 @@
1
- {
2
- "name": "@angular-eslint/template-parser",
3
- "version": "17.1.0",
4
- "description": "Angular Template parser for ESLint",
5
- "license": "MIT",
6
- "main": "dist/index.js",
7
- "types": "dist/index.d.ts",
8
- "repository": {
9
- "type": "git",
10
- "url": "https://github.com/angular-eslint/angular-eslint.git",
11
- "directory": "packages/template-parser"
12
- },
13
- "files": [
14
- "dist",
15
- "package.json",
16
- "README.md",
17
- "LICENSE"
18
- ],
19
- "dependencies": {
20
- "@angular-eslint/bundled-angular-compiler": "17.1.0",
21
- "eslint-scope": "^7.0.0"
22
- },
23
- "peerDependencies": {
24
- "eslint": "^7.20.0 || ^8.0.0",
25
- "typescript": "*"
26
- },
27
- "gitHead": "e2006e5e9c99e5a943d1a999e0efa5247d29ec24"
28
- }
@@ -1,19 +0,0 @@
1
- Copyright OpenJS Foundation and other contributors, <www.openjsf.org>
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining a copy
4
- of this software and associated documentation files (the "Software"), to deal
5
- in the Software without restriction, including without limitation the rights
6
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- copies of the Software, and to permit persons to whom the Software is
8
- furnished to do so, subject to the following conditions:
9
-
10
- The above copyright notice and this permission notice shall be included in
11
- all copies or substantial portions of the Software.
12
-
13
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- THE SOFTWARE.
@@ -1,115 +0,0 @@
1
- # ESLintRC Library
2
-
3
- This repository contains the legacy ESLintRC configuration file format for ESLint. This package is not intended for use outside of the ESLint ecosystem. It is ESLint-specific and not intended for use in other programs.
4
-
5
- **Note:** This package is frozen except for critical bug fixes as ESLint moves to a new config system.
6
-
7
- ## Installation
8
-
9
- You can install the package as follows:
10
-
11
- ```
12
- npm install @eslint/eslintrc --save-dev
13
-
14
- # or
15
-
16
- yarn add @eslint/eslintrc -D
17
- ```
18
-
19
- ## Usage (ESM)
20
-
21
- The primary class in this package is `FlatCompat`, which is a utility to translate ESLintRC-style configs into flat configs. Here's how you use it inside of your `eslint.config.js` file:
22
-
23
- ```js
24
- import { FlatCompat } from "@eslint/eslintrc";
25
- import js from "@eslint/js";
26
- import path from "path";
27
- import { fileURLToPath } from "url";
28
-
29
- // mimic CommonJS variables -- not needed if using CommonJS
30
- const __filename = fileURLToPath(import.meta.url);
31
- const __dirname = path.dirname(__filename);
32
-
33
- const compat = new FlatCompat({
34
- baseDirectory: __dirname, // optional; default: process.cwd()
35
- resolvePluginsRelativeTo: __dirname, // optional
36
- recommendedConfig: js.configs.recommended, // optional
37
- allConfig: js.configs.all, // optional
38
- });
39
-
40
- export default [
41
-
42
- // mimic ESLintRC-style extends
43
- ...compat.extends("standard", "example"),
44
-
45
- // mimic environments
46
- ...compat.env({
47
- es2020: true,
48
- node: true
49
- }),
50
-
51
- // mimic plugins
52
- ...compat.plugins("airbnb", "react"),
53
-
54
- // translate an entire config
55
- ...compat.config({
56
- plugins: ["airbnb", "react"],
57
- extends: "standard",
58
- env: {
59
- es2020: true,
60
- node: true
61
- },
62
- rules: {
63
- semi: "error"
64
- }
65
- })
66
- ];
67
- ```
68
-
69
- ## Usage (CommonJS)
70
-
71
- Using `FlatCompat` in CommonJS files is similar to ESM, but you'll use `require()` and `module.exports` instead of `import` and `export`. Here's how you use it inside of your `eslint.config.js` CommonJS file:
72
-
73
- ```js
74
- const { FlatCompat } = require("@eslint/eslintrc");
75
- const js = require("@eslint/js");
76
-
77
- const compat = new FlatCompat({
78
- baseDirectory: __dirname, // optional; default: process.cwd()
79
- resolvePluginsRelativeTo: __dirname, // optional
80
- recommendedConfig: js.configs.recommended, // optional
81
- allConfig: js.configs.all, // optional
82
- });
83
-
84
- module.exports = [
85
-
86
- // mimic ESLintRC-style extends
87
- ...compat.extends("standard", "example"),
88
-
89
- // mimic environments
90
- ...compat.env({
91
- es2020: true,
92
- node: true
93
- }),
94
-
95
- // mimic plugins
96
- ...compat.plugins("airbnb", "react"),
97
-
98
- // translate an entire config
99
- ...compat.config({
100
- plugins: ["airbnb", "react"],
101
- extends: "standard",
102
- env: {
103
- es2020: true,
104
- node: true
105
- },
106
- rules: {
107
- semi: "error"
108
- }
109
- })
110
- ];
111
- ```
112
-
113
- ## License
114
-
115
- MIT License
@@ -1,79 +0,0 @@
1
- /**
2
- * @fileoverview Defines a schema for configs.
3
- * @author Sylvan Mably
4
- */
5
-
6
- const baseConfigProperties = {
7
- $schema: { type: "string" },
8
- env: { type: "object" },
9
- extends: { $ref: "#/definitions/stringOrStrings" },
10
- globals: { type: "object" },
11
- overrides: {
12
- type: "array",
13
- items: { $ref: "#/definitions/overrideConfig" },
14
- additionalItems: false
15
- },
16
- parser: { type: ["string", "null"] },
17
- parserOptions: { type: "object" },
18
- plugins: { type: "array" },
19
- processor: { type: "string" },
20
- rules: { type: "object" },
21
- settings: { type: "object" },
22
- noInlineConfig: { type: "boolean" },
23
- reportUnusedDisableDirectives: { type: "boolean" },
24
-
25
- ecmaFeatures: { type: "object" } // deprecated; logs a warning when used
26
- };
27
-
28
- const configSchema = {
29
- definitions: {
30
- stringOrStrings: {
31
- oneOf: [
32
- { type: "string" },
33
- {
34
- type: "array",
35
- items: { type: "string" },
36
- additionalItems: false
37
- }
38
- ]
39
- },
40
- stringOrStringsRequired: {
41
- oneOf: [
42
- { type: "string" },
43
- {
44
- type: "array",
45
- items: { type: "string" },
46
- additionalItems: false,
47
- minItems: 1
48
- }
49
- ]
50
- },
51
-
52
- // Config at top-level.
53
- objectConfig: {
54
- type: "object",
55
- properties: {
56
- root: { type: "boolean" },
57
- ignorePatterns: { $ref: "#/definitions/stringOrStrings" },
58
- ...baseConfigProperties
59
- },
60
- additionalProperties: false
61
- },
62
-
63
- // Config in `overrides`.
64
- overrideConfig: {
65
- type: "object",
66
- properties: {
67
- excludedFiles: { $ref: "#/definitions/stringOrStrings" },
68
- files: { $ref: "#/definitions/stringOrStringsRequired" },
69
- ...baseConfigProperties
70
- },
71
- required: ["files"],
72
- additionalProperties: false
73
- }
74
- },
75
-
76
- $ref: "#/definitions/objectConfig"
77
- };
78
-
79
- export default configSchema;