@flint.fyi/jsx 0.0.0 → 0.3.1

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 (96) hide show
  1. package/LICENSE.md +20 -0
  2. package/lib/index.js +1 -2
  3. package/lib/plugin.d.ts +309 -1
  4. package/lib/plugin.js +12 -6
  5. package/lib/rules/accessKeys.d.ts +8 -1
  6. package/lib/rules/accessKeys.js +2 -3
  7. package/lib/rules/altTexts.d.ts +8 -1
  8. package/lib/rules/altTexts.js +6 -16
  9. package/lib/rules/anchorAmbiguousText.d.ts +8 -1
  10. package/lib/rules/anchorAmbiguousText.js +2 -5
  11. package/lib/rules/anchorContent.d.ts +8 -1
  12. package/lib/rules/anchorContent.js +2 -3
  13. package/lib/rules/anchorValidity.d.ts +8 -1
  14. package/lib/rules/anchorValidity.js +4 -5
  15. package/lib/rules/ariaActiveDescendantTabIndex.d.ts +8 -1
  16. package/lib/rules/ariaActiveDescendantTabIndex.js +4 -7
  17. package/lib/rules/ariaHiddenFocusables.d.ts +8 -1
  18. package/lib/rules/ariaHiddenFocusables.js +7 -9
  19. package/lib/rules/ariaPropTypes.d.ts +8 -1
  20. package/lib/rules/ariaPropTypes.js +6 -9
  21. package/lib/rules/ariaProps.d.ts +8 -1
  22. package/lib/rules/ariaProps.js +2 -3
  23. package/lib/rules/ariaRoleValidity.d.ts +8 -1
  24. package/lib/rules/ariaRoleValidity.js +3 -4
  25. package/lib/rules/ariaUnsupportedElements.d.ts +8 -1
  26. package/lib/rules/ariaUnsupportedElements.js +2 -3
  27. package/lib/rules/autoFocusProps.d.ts +8 -1
  28. package/lib/rules/autoFocusProps.js +4 -6
  29. package/lib/rules/autocomplete.d.ts +8 -1
  30. package/lib/rules/autocomplete.js +3 -4
  31. package/lib/rules/booleanValues.d.ts +8 -1
  32. package/lib/rules/booleanValues.js +2 -3
  33. package/lib/rules/bracedStatements.d.ts +8 -1
  34. package/lib/rules/bracedStatements.js +1 -2
  35. package/lib/rules/buttonTypes.d.ts +8 -1
  36. package/lib/rules/buttonTypes.js +3 -4
  37. package/lib/rules/childrenProps.d.ts +8 -1
  38. package/lib/rules/childrenProps.js +1 -2
  39. package/lib/rules/clickEventKeyEvents.d.ts +8 -1
  40. package/lib/rules/clickEventKeyEvents.js +2 -3
  41. package/lib/rules/commentTextNodes.d.ts +8 -1
  42. package/lib/rules/commentTextNodes.js +2 -3
  43. package/lib/rules/distractingElements.d.ts +8 -1
  44. package/lib/rules/distractingElements.js +2 -3
  45. package/lib/rules/elementChildrenValidity.d.ts +8 -1
  46. package/lib/rules/elementChildrenValidity.js +1 -2
  47. package/lib/rules/headingContents.d.ts +8 -1
  48. package/lib/rules/headingContents.js +5 -6
  49. package/lib/rules/htmlLangs.d.ts +8 -1
  50. package/lib/rules/htmlLangs.js +2 -3
  51. package/lib/rules/iframeTitles.d.ts +8 -1
  52. package/lib/rules/iframeTitles.js +3 -4
  53. package/lib/rules/interactiveElementRoles.d.ts +8 -1
  54. package/lib/rules/interactiveElementRoles.js +3 -4
  55. package/lib/rules/interactiveElementsFocusable.d.ts +8 -1
  56. package/lib/rules/interactiveElementsFocusable.js +7 -8
  57. package/lib/rules/labelAssociatedControls.d.ts +8 -1
  58. package/lib/rules/labelAssociatedControls.js +6 -7
  59. package/lib/rules/langValidity.d.ts +8 -1
  60. package/lib/rules/langValidity.js +1 -2
  61. package/lib/rules/mediaCaptions.d.ts +8 -1
  62. package/lib/rules/mediaCaptions.js +12 -13
  63. package/lib/rules/mouseEventKeyEvents.d.ts +8 -1
  64. package/lib/rules/mouseEventKeyEvents.js +2 -3
  65. package/lib/rules/nonInteractiveElementInteractions.d.ts +8 -1
  66. package/lib/rules/nonInteractiveElementInteractions.js +3 -4
  67. package/lib/rules/nonInteractiveElementRoles.d.ts +8 -1
  68. package/lib/rules/nonInteractiveElementRoles.js +3 -4
  69. package/lib/rules/nonInteractiveElementTabIndexes.d.ts +8 -1
  70. package/lib/rules/nonInteractiveElementTabIndexes.js +7 -8
  71. package/lib/rules/propDuplicates.d.ts +8 -1
  72. package/lib/rules/propDuplicates.js +2 -3
  73. package/lib/rules/roleRedundancies.d.ts +8 -1
  74. package/lib/rules/roleRedundancies.js +3 -4
  75. package/lib/rules/roleRequiredAriaProps.d.ts +8 -1
  76. package/lib/rules/roleRequiredAriaProps.js +3 -4
  77. package/lib/rules/roleSupportedAriaProps.d.ts +8 -1
  78. package/lib/rules/roleSupportedAriaProps.js +3 -4
  79. package/lib/rules/roleTags.d.ts +8 -1
  80. package/lib/rules/roleTags.js +2 -3
  81. package/lib/rules/ruleCreator.js +1 -2
  82. package/lib/rules/scopeProps.d.ts +8 -1
  83. package/lib/rules/scopeProps.js +2 -3
  84. package/lib/rules/staticElementInteractions.d.ts +8 -1
  85. package/lib/rules/staticElementInteractions.js +2 -3
  86. package/lib/rules/svgTitles.d.ts +8 -1
  87. package/lib/rules/svgTitles.js +5 -6
  88. package/lib/rules/tabIndexPositiveValues.d.ts +8 -1
  89. package/lib/rules/tabIndexPositiveValues.js +4 -5
  90. package/lib/rules/unescapedEntities.d.ts +8 -1
  91. package/lib/rules/unescapedEntities.js +1 -2
  92. package/lib/rules/unnecessaryFragments.d.ts +8 -1
  93. package/lib/rules/unnecessaryFragments.js +3 -4
  94. package/package.json +46 -51
  95. package/lib/jsx.d.ts +0 -8
  96. package/lib/jsx.js +0 -100
package/LICENSE.md ADDED
@@ -0,0 +1,20 @@
1
+ # MIT License
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ 'Software'), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
18
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/lib/index.js CHANGED
@@ -1,3 +1,2 @@
1
1
  import { jsx } from "./plugin.js";
2
-
3
- export { jsx };
2
+ export { jsx };
package/lib/plugin.d.ts CHANGED
@@ -1,7 +1,315 @@
1
1
  import * as _flint_fyi_core0 from "@flint.fyi/core";
2
2
 
3
3
  //#region src/plugin.d.ts
4
- declare const jsx: _flint_fyi_core0.Plugin<_flint_fyi_core0.RuleAbout, string | undefined, [_flint_fyi_core0.Rule<_flint_fyi_core0.RuleAboutWithPresetsAndUrl<"logical" | "logicalStrict" | "stylistic">, object, object, "avoidAccessKey", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<_flint_fyi_core0.RuleAboutWithPresetsAndUrl<"logical" | "logicalStrict" | "stylistic">, object, object, "missingAlt", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<_flint_fyi_core0.RuleAboutWithPresetsAndUrl<"logical" | "logicalStrict" | "stylistic">, object, object, "ambiguousText", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<_flint_fyi_core0.RuleAboutWithPresetsAndUrl<"logical" | "logicalStrict" | "stylistic">, object, object, "missingContent", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<_flint_fyi_core0.RuleAboutWithPresetsAndUrl<"logical" | "logicalStrict" | "stylistic">, object, object, "invalidHref" | "missingHref" | "shouldBeButton", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<_flint_fyi_core0.RuleAboutWithPresetsAndUrl<"logical" | "logicalStrict" | "stylistic">, object, object, "missingTabIndex", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<_flint_fyi_core0.RuleAboutWithPresetsAndUrl<"logical" | "logicalStrict" | "stylistic">, object, object, "ariaHiddenFocusable", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<_flint_fyi_core0.RuleAboutWithPresetsAndUrl<"logical" | "logicalStrict" | "stylistic">, object, object, "invalidAriaProp", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<_flint_fyi_core0.RuleAboutWithPresetsAndUrl<"logical" | "logicalStrict" | "stylistic">, object, object, "invalidPropType", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<_flint_fyi_core0.RuleAboutWithPresetsAndUrl<"logical" | "logicalStrict" | "stylistic">, object, object, "invalidRole", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<_flint_fyi_core0.RuleAboutWithPresetsAndUrl<"logical" | "logicalStrict" | "stylistic">, object, object, "unsupportedElement", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<_flint_fyi_core0.RuleAboutWithPresetsAndUrl<"logical" | "logicalStrict" | "stylistic">, object, object, "invalid", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<_flint_fyi_core0.RuleAboutWithPresetsAndUrl<"logical" | "logicalStrict" | "stylistic">, object, object, "noAutoFocus", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<_flint_fyi_core0.RuleAboutWithPresetsAndUrl<"logical" | "logicalStrict" | "stylistic">, object, object, "preferShorthand", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<_flint_fyi_core0.RuleAboutWithPresetsAndUrl<"logical" | "logicalStrict" | "stylistic">, object, object, "unnecessaryBraces", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<_flint_fyi_core0.RuleAboutWithPresetsAndUrl<"logical" | "logicalStrict" | "stylistic">, object, object, "invalidType" | "missingType", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<_flint_fyi_core0.RuleAboutWithPresetsAndUrl<"logical" | "logicalStrict" | "stylistic">, object, object, "noChildrenProp", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<_flint_fyi_core0.RuleAboutWithPresetsAndUrl<"logical" | "logicalStrict" | "stylistic">, object, object, "missingKeyEvent", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<_flint_fyi_core0.RuleAboutWithPresetsAndUrl<"logical" | "logicalStrict" | "stylistic">, object, object, "commentAsText", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<_flint_fyi_core0.RuleAboutWithPresetsAndUrl<"logical" | "logicalStrict" | "stylistic">, object, object, "noDistractingElement", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<_flint_fyi_core0.RuleAboutWithPresetsAndUrl<"logical" | "logicalStrict" | "stylistic">, object, object, "duplicateProp", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<_flint_fyi_core0.RuleAboutWithPresetsAndUrl<"logical" | "logicalStrict" | "stylistic">, object, object, "emptyHeading", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<_flint_fyi_core0.RuleAboutWithPresetsAndUrl<"logical" | "logicalStrict" | "stylistic">, object, object, "missingLang", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<_flint_fyi_core0.RuleAboutWithPresetsAndUrl<"logical" | "logicalStrict" | "stylistic">, object, object, "missingTitle", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<_flint_fyi_core0.RuleAboutWithPresetsAndUrl<"logical" | "logicalStrict" | "stylistic">, object, object, "notFocusable", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<_flint_fyi_core0.RuleAboutWithPresetsAndUrl<"logical" | "logicalStrict" | "stylistic">, object, object, "invalidRole", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<_flint_fyi_core0.RuleAboutWithPresetsAndUrl<"logical" | "logicalStrict" | "stylistic">, object, object, "missingAssociatedControl", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<_flint_fyi_core0.RuleAboutWithPresetsAndUrl<"logical" | "logicalStrict" | "stylistic">, object, object, "invalidLang", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<_flint_fyi_core0.RuleAboutWithPresetsAndUrl<"logical" | "logicalStrict" | "stylistic">, object, object, "missingCaptions", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<_flint_fyi_core0.RuleAboutWithPresetsAndUrl<"logical" | "logicalStrict" | "stylistic">, object, object, "missingKeyEvent", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<_flint_fyi_core0.RuleAboutWithPresetsAndUrl<"logical" | "logicalStrict" | "stylistic">, object, object, "invalidHandler", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<_flint_fyi_core0.RuleAboutWithPresetsAndUrl<"logical" | "logicalStrict" | "stylistic">, object, object, "invalidRole", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<_flint_fyi_core0.RuleAboutWithPresetsAndUrl<"logical" | "logicalStrict" | "stylistic">, object, object, "nonInteractiveTabIndex", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<_flint_fyi_core0.RuleAboutWithPresetsAndUrl<"logical" | "logicalStrict" | "stylistic">, object, object, "redundantRole", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<_flint_fyi_core0.RuleAboutWithPresetsAndUrl<"logical" | "logicalStrict" | "stylistic">, object, object, "missingRequiredProps", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<_flint_fyi_core0.RuleAboutWithPresetsAndUrl<"logical" | "logicalStrict" | "stylistic">, object, object, "unsupportedProp", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<_flint_fyi_core0.RuleAboutWithPresetsAndUrl<"logical" | "logicalStrict" | "stylistic">, object, object, "preferSemanticElement", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<_flint_fyi_core0.RuleAboutWithPresetsAndUrl<"logical" | "logicalStrict" | "stylistic">, object, object, "invalidScope", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<_flint_fyi_core0.RuleAboutWithPresetsAndUrl<"logical" | "logicalStrict" | "stylistic">, object, object, "missingRole", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<_flint_fyi_core0.RuleAboutWithPresetsAndUrl<"logical" | "logicalStrict" | "stylistic">, object, object, "missingTitle", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<_flint_fyi_core0.RuleAboutWithPresetsAndUrl<"logical" | "logicalStrict" | "stylistic">, object, object, "noPositiveTabIndex", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<_flint_fyi_core0.RuleAboutWithPresetsAndUrl<"logical" | "logicalStrict" | "stylistic">, object, object, "unescapedEntity", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<_flint_fyi_core0.RuleAboutWithPresetsAndUrl<"logical" | "logicalStrict" | "stylistic">, object, object, "unnecessaryFragment", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<_flint_fyi_core0.RuleAboutWithPresetsAndUrl<"logical" | "logicalStrict" | "stylistic">, object, object, "voidElementWithChildren", _flint_fyi_core0.AnyOptionalSchema>]>;
4
+ declare const jsx: _flint_fyi_core0.Plugin<_flint_fyi_core0.RuleAbout, "all" | "javascript" | "typescript", [_flint_fyi_core0.Rule<{
5
+ readonly description: "Disallow the use of the `accessKey` / `accesskey` attribute on JSX elements.";
6
+ readonly id: "accessKeys";
7
+ readonly presets: ["logical", "logicalStrict"];
8
+ } & {
9
+ presets?: ("logical" | "logicalStrict" | "stylistic")[];
10
+ url: string;
11
+ }, object, object, "avoidAccessKey", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<{
12
+ readonly description: "Reports elements that require alt text but are missing it.";
13
+ readonly id: "altTexts";
14
+ readonly presets: ["logical", "logicalStrict"];
15
+ } & {
16
+ presets?: ("logical" | "logicalStrict" | "stylistic")[];
17
+ url: string;
18
+ }, object, object, "missingAlt", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<{
19
+ readonly description: "Reports anchor elements with ambiguous text that doesn't describe the link destination.";
20
+ readonly id: "anchorAmbiguousText";
21
+ readonly presets: ["logical", "logicalStrict"];
22
+ } & {
23
+ presets?: ("logical" | "logicalStrict" | "stylistic")[];
24
+ url: string;
25
+ }, object, object, "ambiguousText", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<{
26
+ readonly description: "Reports anchor elements without accessible content.";
27
+ readonly id: "anchorContent";
28
+ readonly presets: ["logical", "logicalStrict"];
29
+ } & {
30
+ presets?: ("logical" | "logicalStrict" | "stylistic")[];
31
+ url: string;
32
+ }, object, object, "missingContent", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<{
33
+ readonly description: "Reports invalid usage of anchor elements.";
34
+ readonly id: "anchorValidity";
35
+ readonly presets: ["logical", "logicalStrict"];
36
+ } & {
37
+ presets?: ("logical" | "logicalStrict" | "stylistic")[];
38
+ url: string;
39
+ }, object, object, "invalidHref" | "missingHref" | "shouldBeButton", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<{
40
+ readonly description: "Reports elements with aria-activedescendant without tabIndex.";
41
+ readonly id: "ariaActiveDescendantTabIndex";
42
+ readonly presets: ["logical", "logicalStrict"];
43
+ } & {
44
+ presets?: ("logical" | "logicalStrict" | "stylistic")[];
45
+ url: string;
46
+ }, object, object, "missingTabIndex", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<{
47
+ readonly description: "Reports elements with aria-hidden='true' that are focusable.";
48
+ readonly id: "ariaHiddenFocusables";
49
+ readonly presets: ["logical", "logicalStrict"];
50
+ } & {
51
+ presets?: ("logical" | "logicalStrict" | "stylistic")[];
52
+ url: string;
53
+ }, object, object, "ariaHiddenFocusable", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<{
54
+ readonly description: "Reports invalid ARIA properties.";
55
+ readonly id: "ariaProps";
56
+ readonly presets: ["logical", "logicalStrict"];
57
+ } & {
58
+ presets?: ("logical" | "logicalStrict" | "stylistic")[];
59
+ url: string;
60
+ }, object, object, "invalidAriaProp", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<{
61
+ readonly description: "Reports ARIA properties with invalid value types.";
62
+ readonly id: "ariaPropTypes";
63
+ readonly presets: ["logical", "logicalStrict"];
64
+ } & {
65
+ presets?: ("logical" | "logicalStrict" | "stylistic")[];
66
+ url: string;
67
+ }, object, object, "invalidPropType", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<{
68
+ readonly description: "Reports invalid or abstract ARIA roles.";
69
+ readonly id: "ariaRoleValidity";
70
+ readonly presets: ["logical", "logicalStrict"];
71
+ } & {
72
+ presets?: ("logical" | "logicalStrict" | "stylistic")[];
73
+ url: string;
74
+ }, object, object, "invalidRole", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<{
75
+ readonly description: "Reports ARIA attributes on elements that don't support them.";
76
+ readonly id: "ariaUnsupportedElements";
77
+ readonly presets: ["logical", "logicalStrict"];
78
+ } & {
79
+ presets?: ("logical" | "logicalStrict" | "stylistic")[];
80
+ url: string;
81
+ }, object, object, "unsupportedElement", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<{
82
+ readonly description: "Ensure the autocomplete attribute is correct and suitable for the form field.";
83
+ readonly id: "autocomplete";
84
+ readonly presets: ["logical", "logicalStrict"];
85
+ } & {
86
+ presets?: ("logical" | "logicalStrict" | "stylistic")[];
87
+ url: string;
88
+ }, object, object, "invalid", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<{
89
+ readonly description: "Reports autoFocus props that are not set to false.";
90
+ readonly id: "autoFocusProps";
91
+ readonly presets: ["logical", "logicalStrict"];
92
+ } & {
93
+ presets?: ("logical" | "logicalStrict" | "stylistic")[];
94
+ url: string;
95
+ }, object, object, "noAutoFocus", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<{
96
+ readonly description: "Prefer shorthand boolean attributes over explicit {true} values in JSX.";
97
+ readonly id: "booleanValues";
98
+ readonly presets: ["stylistic"];
99
+ } & {
100
+ presets?: ("logical" | "logicalStrict" | "stylistic")[];
101
+ url: string;
102
+ }, object, object, "preferShorthand", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<{
103
+ readonly description: "Disallow unnecessary JSX curly braces around literals and JSX elements.";
104
+ readonly id: "bracedStatements";
105
+ readonly presets: ["stylistic"];
106
+ } & {
107
+ presets?: ("logical" | "logicalStrict" | "stylistic")[];
108
+ url: string;
109
+ }, object, object, "unnecessaryBraces", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<{
110
+ readonly description: "Reports button elements without an explicit type attribute.";
111
+ readonly id: "buttonTypes";
112
+ readonly presets: ["logical", "logicalStrict"];
113
+ } & {
114
+ presets?: ("logical" | "logicalStrict" | "stylistic")[];
115
+ url: string;
116
+ }, object, object, "invalidType" | "missingType", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<{
117
+ readonly description: "Reports usage of the children prop.";
118
+ readonly id: "childrenProps";
119
+ readonly presets: ["stylistic"];
120
+ } & {
121
+ presets?: ("logical" | "logicalStrict" | "stylistic")[];
122
+ url: string;
123
+ }, object, object, "noChildrenProp", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<{
124
+ readonly description: "Reports onClick without keyboard event handlers.";
125
+ readonly id: "clickEventKeyEvents";
126
+ readonly presets: ["logical", "logicalStrict"];
127
+ } & {
128
+ presets?: ("logical" | "logicalStrict" | "stylistic")[];
129
+ url: string;
130
+ }, object, object, "missingKeyEvent", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<{
131
+ readonly description: "Reports JSX text nodes that contain comment syntax but are rendered as text.";
132
+ readonly id: "commentTextNodes";
133
+ readonly presets: ["logical", "logicalStrict"];
134
+ } & {
135
+ presets?: ("logical" | "logicalStrict" | "stylistic")[];
136
+ url: string;
137
+ }, object, object, "commentAsText", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<{
138
+ readonly description: "Reports distracting elements like <marquee> and <blink>.";
139
+ readonly id: "distractingElements";
140
+ readonly presets: ["logical", "logicalStrict"];
141
+ } & {
142
+ presets?: ("logical" | "logicalStrict" | "stylistic")[];
143
+ url: string;
144
+ }, object, object, "noDistractingElement", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<{
145
+ readonly description: "Reports void DOM elements that have children, which is invalid HTML.";
146
+ readonly id: "elementChildrenValidity";
147
+ readonly presets: ["logical", "logicalStrict"];
148
+ } & {
149
+ presets?: ("logical" | "logicalStrict" | "stylistic")[];
150
+ url: string;
151
+ }, object, object, "voidElementWithChildren", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<{
152
+ readonly description: "Reports heading elements without accessible content.";
153
+ readonly id: "headingContents";
154
+ readonly presets: ["logical", "logicalStrict"];
155
+ } & {
156
+ presets?: ("logical" | "logicalStrict" | "stylistic")[];
157
+ url: string;
158
+ }, object, object, "emptyHeading", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<{
159
+ readonly description: "Reports <html> elements without a lang prop.";
160
+ readonly id: "htmlLangs";
161
+ readonly presets: ["logical", "logicalStrict"];
162
+ } & {
163
+ presets?: ("logical" | "logicalStrict" | "stylistic")[];
164
+ url: string;
165
+ }, object, object, "missingLang", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<{
166
+ readonly description: "Reports <iframe> elements without a title prop.";
167
+ readonly id: "iframeTitles";
168
+ readonly presets: ["logical", "logicalStrict"];
169
+ } & {
170
+ presets?: ("logical" | "logicalStrict" | "stylistic")[];
171
+ url: string;
172
+ }, object, object, "missingTitle", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<{
173
+ readonly description: "Reports interactive elements with non-interactive ARIA roles.";
174
+ readonly id: "interactiveElementRoles";
175
+ readonly presets: ["logical", "logicalStrict"];
176
+ } & {
177
+ presets?: ("logical" | "logicalStrict" | "stylistic")[];
178
+ url: string;
179
+ }, object, object, "invalidRole", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<{
180
+ readonly description: "Reports interactive elements that are not focusable via keyboard.";
181
+ readonly id: "interactiveElementsFocusable";
182
+ readonly presets: ["logical", "logicalStrict"];
183
+ } & {
184
+ presets?: ("logical" | "logicalStrict" | "stylistic")[];
185
+ url: string;
186
+ }, object, object, "notFocusable", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<{
187
+ readonly description: "Reports <label> elements without an associated control element.";
188
+ readonly id: "labelAssociatedControls";
189
+ readonly presets: ["logical", "logicalStrict"];
190
+ } & {
191
+ presets?: ("logical" | "logicalStrict" | "stylistic")[];
192
+ url: string;
193
+ }, object, object, "missingAssociatedControl", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<{
194
+ readonly description: "Reports invalid lang attribute values.";
195
+ readonly id: "langValidity";
196
+ readonly presets: ["logical", "logicalStrict"];
197
+ } & {
198
+ presets?: ("logical" | "logicalStrict" | "stylistic")[];
199
+ url: string;
200
+ }, object, object, "invalidLang", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<{
201
+ readonly description: "Reports media elements without captions.";
202
+ readonly id: "mediaCaptions";
203
+ readonly presets: ["logical", "logicalStrict"];
204
+ } & {
205
+ presets?: ("logical" | "logicalStrict" | "stylistic")[];
206
+ url: string;
207
+ }, object, object, "missingCaptions", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<{
208
+ readonly description: "Reports mouse events without corresponding keyboard events.";
209
+ readonly id: "mouseEventKeyEvents";
210
+ readonly presets: ["logical", "logicalStrict"];
211
+ } & {
212
+ presets?: ("logical" | "logicalStrict" | "stylistic")[];
213
+ url: string;
214
+ }, object, object, "missingKeyEvent", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<{
215
+ readonly description: "Reports non-interactive elements with interactive event handlers.";
216
+ readonly id: "nonInteractiveElementInteractions";
217
+ readonly presets: ["logical", "logicalStrict"];
218
+ } & {
219
+ presets?: ("logical" | "logicalStrict" | "stylistic")[];
220
+ url: string;
221
+ }, object, object, "invalidHandler", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<{
222
+ readonly description: "Reports non-interactive elements with interactive ARIA roles.";
223
+ readonly id: "nonInteractiveElementRoles";
224
+ readonly presets: ["logical", "logicalStrict"];
225
+ } & {
226
+ presets?: ("logical" | "logicalStrict" | "stylistic")[];
227
+ url: string;
228
+ }, object, object, "invalidRole", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<{
229
+ readonly description: "Reports non-interactive elements with positive or zero tabIndex values.";
230
+ readonly id: "nonInteractiveElementTabIndexes";
231
+ readonly presets: ["logical", "logicalStrict"];
232
+ } & {
233
+ presets?: ("logical" | "logicalStrict" | "stylistic")[];
234
+ url: string;
235
+ }, object, object, "nonInteractiveTabIndex", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<{
236
+ readonly description: "Disallow duplicate props in JSX elements.";
237
+ readonly id: "propDuplicates";
238
+ readonly presets: ["logical", "logicalStrict"];
239
+ } & {
240
+ presets?: ("logical" | "logicalStrict" | "stylistic")[];
241
+ url: string;
242
+ }, object, object, "duplicateProp", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<{
243
+ readonly description: "Reports redundant ARIA roles on elements with implicit roles.";
244
+ readonly id: "roleRedundancies";
245
+ readonly presets: ["logical", "logicalStrict"];
246
+ } & {
247
+ presets?: ("logical" | "logicalStrict" | "stylistic")[];
248
+ url: string;
249
+ }, object, object, "redundantRole", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<{
250
+ readonly description: "Reports ARIA roles missing their required ARIA properties.";
251
+ readonly id: "roleRequiredAriaProps";
252
+ readonly presets: ["logical", "logicalStrict"];
253
+ } & {
254
+ presets?: ("logical" | "logicalStrict" | "stylistic")[];
255
+ url: string;
256
+ }, object, object, "missingRequiredProps", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<{
257
+ readonly description: "Reports ARIA properties that are not supported by an element's role.";
258
+ readonly id: "roleSupportedAriaProps";
259
+ readonly presets: ["logical", "logicalStrict"];
260
+ } & {
261
+ presets?: ("logical" | "logicalStrict" | "stylistic")[];
262
+ url: string;
263
+ }, object, object, "unsupportedProp", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<{
264
+ readonly description: "Reports ARIA roles that have semantic HTML element equivalents.";
265
+ readonly id: "roleTags";
266
+ readonly presets: ["logical", "logicalStrict"];
267
+ } & {
268
+ presets?: ("logical" | "logicalStrict" | "stylistic")[];
269
+ url: string;
270
+ }, object, object, "preferSemanticElement", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<{
271
+ readonly description: "Reports scope props on non-th elements.";
272
+ readonly id: "scopeProps";
273
+ readonly presets: ["logical", "logicalStrict"];
274
+ } & {
275
+ presets?: ("logical" | "logicalStrict" | "stylistic")[];
276
+ url: string;
277
+ }, object, object, "invalidScope", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<{
278
+ readonly description: "Reports static elements with event handlers that lack ARIA roles.";
279
+ readonly id: "staticElementInteractions";
280
+ readonly presets: ["logical", "logicalStrict"];
281
+ } & {
282
+ presets?: ("logical" | "logicalStrict" | "stylistic")[];
283
+ url: string;
284
+ }, object, object, "missingRole", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<{
285
+ readonly description: "Reports <svg> elements without a <title> child element.";
286
+ readonly id: "svgTitles";
287
+ readonly presets: ["logical", "logicalStrict"];
288
+ } & {
289
+ presets?: ("logical" | "logicalStrict" | "stylistic")[];
290
+ url: string;
291
+ }, object, object, "missingTitle", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<{
292
+ readonly description: "Reports positive tabIndex values.";
293
+ readonly id: "tabIndexPositiveValues";
294
+ readonly presets: ["logical", "logicalStrict"];
295
+ } & {
296
+ presets?: ("logical" | "logicalStrict" | "stylistic")[];
297
+ url: string;
298
+ }, object, object, "noPositiveTabIndex", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<{
299
+ readonly description: "Disallow unescaped HTML entities in JSX text that may cause rendering issues.";
300
+ readonly id: "unescapedEntities";
301
+ readonly presets: ["stylistic"];
302
+ } & {
303
+ presets?: ("logical" | "logicalStrict" | "stylistic")[];
304
+ url: string;
305
+ }, object, object, "unescapedEntity", _flint_fyi_core0.AnyOptionalSchema>, _flint_fyi_core0.Rule<{
306
+ readonly description: "Disallow unnecessary JSX fragments that wrap a single child or have no children.";
307
+ readonly id: "unnecessaryFragments";
308
+ readonly presets: ["stylistic"];
309
+ } & {
310
+ presets?: ("logical" | "logicalStrict" | "stylistic")[];
311
+ url: string;
312
+ }, object, object, "unnecessaryFragment", _flint_fyi_core0.AnyOptionalSchema>]>;
5
313
  //#endregion
6
314
  export { jsx };
7
315
  //# sourceMappingURL=plugin.d.ts.map
package/lib/plugin.js CHANGED
@@ -43,9 +43,15 @@ import tabIndexPositiveValues_default from "./rules/tabIndexPositiveValues.js";
43
43
  import unescapedEntities_default from "./rules/unescapedEntities.js";
44
44
  import unnecessaryFragments_default from "./rules/unnecessaryFragments.js";
45
45
  import { createPlugin } from "@flint.fyi/core";
46
-
47
46
  //#region src/plugin.ts
47
+ const jsFiles = ["**/*.jsx"];
48
+ const tsFiles = ["**/*.tsx"];
48
49
  const jsx = createPlugin({
50
+ files: {
51
+ all: [...jsFiles, ...tsFiles],
52
+ javascript: jsFiles,
53
+ typescript: tsFiles
54
+ },
49
55
  name: "JSX",
50
56
  rules: [
51
57
  accessKeys_default,
@@ -68,12 +74,12 @@ const jsx = createPlugin({
68
74
  clickEventKeyEvents_default,
69
75
  commentTextNodes_default,
70
76
  distractingElements_default,
71
- propDuplicates_default,
77
+ elementChildrenValidity_default,
72
78
  headingContents_default,
73
79
  htmlLangs_default,
74
80
  iframeTitles_default,
75
- interactiveElementsFocusable_default,
76
81
  interactiveElementRoles_default,
82
+ interactiveElementsFocusable_default,
77
83
  labelAssociatedControls_default,
78
84
  langValidity_default,
79
85
  mediaCaptions_default,
@@ -81,6 +87,7 @@ const jsx = createPlugin({
81
87
  nonInteractiveElementInteractions_default,
82
88
  nonInteractiveElementRoles_default,
83
89
  nonInteractiveElementTabIndexes_default,
90
+ propDuplicates_default,
84
91
  roleRedundancies_default,
85
92
  roleRequiredAriaProps_default,
86
93
  roleSupportedAriaProps_default,
@@ -90,11 +97,10 @@ const jsx = createPlugin({
90
97
  svgTitles_default,
91
98
  tabIndexPositiveValues_default,
92
99
  unescapedEntities_default,
93
- unnecessaryFragments_default,
94
- elementChildrenValidity_default
100
+ unnecessaryFragments_default
95
101
  ]
96
102
  });
97
-
98
103
  //#endregion
99
104
  export { jsx };
105
+
100
106
  //# sourceMappingURL=plugin.js.map
@@ -1,3 +1,10 @@
1
- declare const _default: import("@flint.fyi/core").Rule<import("@flint.fyi/core").RuleAboutWithPresetsAndUrl<"logical" | "logicalStrict" | "stylistic">, object, object, "avoidAccessKey", import("@flint.fyi/core").AnyOptionalSchema>;
1
+ declare const _default: import("@flint.fyi/core").Rule<{
2
+ readonly description: "Disallow the use of the `accessKey` / `accesskey` attribute on JSX elements.";
3
+ readonly id: "accessKeys";
4
+ readonly presets: ["logical", "logicalStrict"];
5
+ } & {
6
+ presets?: ("logical" | "logicalStrict" | "stylistic")[];
7
+ url: string;
8
+ }, object, object, "avoidAccessKey", import("@flint.fyi/core").AnyOptionalSchema>;
2
9
  export default _default;
3
10
  //# sourceMappingURL=accessKeys.d.ts.map
@@ -1,13 +1,12 @@
1
1
  import { ruleCreator } from "./ruleCreator.js";
2
2
  import { getTSNodeRange, typescriptLanguage } from "@flint.fyi/typescript-language";
3
3
  import { SyntaxKind } from "typescript";
4
-
5
4
  //#region src/rules/accessKeys.ts
6
5
  var accessKeys_default = ruleCreator.createRule(typescriptLanguage, {
7
6
  about: {
8
7
  description: "Disallow the use of the `accessKey` / `accesskey` attribute on JSX elements.",
9
8
  id: "accessKeys",
10
- presets: ["logical"]
9
+ presets: ["logical", "logicalStrict"]
11
10
  },
12
11
  messages: { avoidAccessKey: {
13
12
  primary: "The native DOM `{{ attribute }}` prop causes accessibility issues with keyboard-only users and screen readers.",
@@ -27,7 +26,7 @@ var accessKeys_default = ruleCreator.createRule(typescriptLanguage, {
27
26
  } } };
28
27
  }
29
28
  });
30
-
31
29
  //#endregion
32
30
  export { accessKeys_default as default };
31
+
33
32
  //# sourceMappingURL=accessKeys.js.map
@@ -1,3 +1,10 @@
1
- declare const _default: import("@flint.fyi/core").Rule<import("@flint.fyi/core").RuleAboutWithPresetsAndUrl<"logical" | "logicalStrict" | "stylistic">, object, object, "missingAlt", import("@flint.fyi/core").AnyOptionalSchema>;
1
+ declare const _default: import("@flint.fyi/core").Rule<{
2
+ readonly description: "Reports elements that require alt text but are missing it.";
3
+ readonly id: "altTexts";
4
+ readonly presets: ["logical", "logicalStrict"];
5
+ } & {
6
+ presets?: ("logical" | "logicalStrict" | "stylistic")[];
7
+ url: string;
8
+ }, object, object, "missingAlt", import("@flint.fyi/core").AnyOptionalSchema>;
2
9
  export default _default;
3
10
  //# sourceMappingURL=altTexts.d.ts.map
@@ -1,7 +1,6 @@
1
1
  import { ruleCreator } from "./ruleCreator.js";
2
2
  import { getTSNodeRange, typescriptLanguage } from "@flint.fyi/typescript-language";
3
3
  import { SyntaxKind } from "typescript";
4
-
5
4
  //#region src/rules/altTexts.ts
6
5
  const alternateProperties = new Set([
7
6
  "aria-label",
@@ -12,7 +11,7 @@ var altTexts_default = ruleCreator.createRule(typescriptLanguage, {
12
11
  about: {
13
12
  description: "Reports elements that require alt text but are missing it.",
14
13
  id: "altTexts",
15
- presets: ["logical"]
14
+ presets: ["logical", "logicalStrict"]
16
15
  },
17
16
  messages: { missingAlt: {
18
17
  primary: "{{ element }} element is missing alt text for non-visual users.",
@@ -47,27 +46,18 @@ var altTexts_default = ruleCreator.createRule(typescriptLanguage, {
47
46
  });
48
47
  return;
49
48
  }
50
- if (properties.kind === SyntaxKind.JsxAttribute) {
51
- if (!properties.initializer) context.report({
49
+ if (properties.kind === SyntaxKind.JsxAttribute && properties.initializer?.kind === SyntaxKind.JsxExpression) {
50
+ const { expression } = properties.initializer;
51
+ if (expression?.kind === SyntaxKind.Identifier && expression.text === "undefined") context.report({
52
52
  data: { element: elementName },
53
53
  message: "missingAlt",
54
54
  range: getTSNodeRange(tagName, sourceFile)
55
55
  });
56
- else if (properties.initializer.kind === SyntaxKind.JsxExpression) {
57
- const { expression } = properties.initializer;
58
- if (expression && expression.kind === SyntaxKind.Identifier && expression.text === "undefined") context.report({
59
- data: { element: elementName },
60
- message: "missingAlt",
61
- range: getTSNodeRange(tagName, sourceFile)
62
- });
63
- }
64
56
  }
65
57
  }
66
58
  function checkInputElement(attributes, tagName, sourceFile) {
67
59
  const typeAttribute = attributes.properties.find((properties) => properties.kind === SyntaxKind.JsxAttribute && properties.name.kind === SyntaxKind.Identifier && properties.name.text === "type");
68
- if (typeAttribute && typeAttribute.kind === SyntaxKind.JsxAttribute) {
69
- if (typeAttribute.initializer && typeAttribute.initializer.kind === SyntaxKind.StringLiteral && typeAttribute.initializer.text === "image") checkAltAttribute(attributes, tagName, "input[type='image']", sourceFile);
70
- }
60
+ if (typeAttribute?.kind === SyntaxKind.JsxAttribute && typeAttribute.initializer?.kind === SyntaxKind.StringLiteral && typeAttribute.initializer.text === "image") checkAltAttribute(attributes, tagName, "input[type='image']", sourceFile);
71
61
  }
72
62
  function checkObjectAccessibility(attributes, tagName, sourceFile) {
73
63
  if (!attributes.properties.some((property) => property.kind === SyntaxKind.JsxAttribute && property.name.kind === SyntaxKind.Identifier && alternateProperties.has(property.name.text) && property.initializer)) context.report({
@@ -82,7 +72,7 @@ var altTexts_default = ruleCreator.createRule(typescriptLanguage, {
82
72
  } };
83
73
  }
84
74
  });
85
-
86
75
  //#endregion
87
76
  export { altTexts_default as default };
77
+
88
78
  //# sourceMappingURL=altTexts.js.map
@@ -1,3 +1,10 @@
1
- declare const _default: import("@flint.fyi/core").Rule<import("@flint.fyi/core").RuleAboutWithPresetsAndUrl<"logical" | "logicalStrict" | "stylistic">, object, object, "ambiguousText", import("@flint.fyi/core").AnyOptionalSchema>;
1
+ declare const _default: import("@flint.fyi/core").Rule<{
2
+ readonly description: "Reports anchor elements with ambiguous text that doesn't describe the link destination.";
3
+ readonly id: "anchorAmbiguousText";
4
+ readonly presets: ["logical", "logicalStrict"];
5
+ } & {
6
+ presets?: ("logical" | "logicalStrict" | "stylistic")[];
7
+ url: string;
8
+ }, object, object, "ambiguousText", import("@flint.fyi/core").AnyOptionalSchema>;
2
9
  export default _default;
3
10
  //# sourceMappingURL=anchorAmbiguousText.d.ts.map
@@ -1,7 +1,6 @@
1
1
  import { ruleCreator } from "./ruleCreator.js";
2
2
  import { getTSNodeRange, typescriptLanguage } from "@flint.fyi/typescript-language";
3
3
  import { SyntaxKind } from "typescript";
4
-
5
4
  //#region src/rules/anchorAmbiguousText.ts
6
5
  const ambiguousWords = new Set([
7
6
  "a link",
@@ -36,9 +35,7 @@ var anchorAmbiguousText_default = ruleCreator.createRule(typescriptLanguage, {
36
35
  let text = "";
37
36
  for (const child of node.children) if (child.kind === SyntaxKind.JsxText) text += child.text;
38
37
  else if (child.kind === SyntaxKind.JsxElement) text += getTextContent(child);
39
- else if (child.kind === SyntaxKind.JsxExpression) {
40
- if (child.expression && child.expression.kind === SyntaxKind.StringLiteral) text += child.expression.text;
41
- }
38
+ else if (child.kind === SyntaxKind.JsxExpression && child.expression?.kind === SyntaxKind.StringLiteral) text += child.expression.text;
42
39
  return text;
43
40
  }
44
41
  return { visitors: { JsxElement(node, { sourceFile }) {
@@ -54,7 +51,7 @@ var anchorAmbiguousText_default = ruleCreator.createRule(typescriptLanguage, {
54
51
  } } };
55
52
  }
56
53
  });
57
-
58
54
  //#endregion
59
55
  export { anchorAmbiguousText_default as default };
56
+
60
57
  //# sourceMappingURL=anchorAmbiguousText.js.map
@@ -1,3 +1,10 @@
1
- declare const _default: import("@flint.fyi/core").Rule<import("@flint.fyi/core").RuleAboutWithPresetsAndUrl<"logical" | "logicalStrict" | "stylistic">, object, object, "missingContent", import("@flint.fyi/core").AnyOptionalSchema>;
1
+ declare const _default: import("@flint.fyi/core").Rule<{
2
+ readonly description: "Reports anchor elements without accessible content.";
3
+ readonly id: "anchorContent";
4
+ readonly presets: ["logical", "logicalStrict"];
5
+ } & {
6
+ presets?: ("logical" | "logicalStrict" | "stylistic")[];
7
+ url: string;
8
+ }, object, object, "missingContent", import("@flint.fyi/core").AnyOptionalSchema>;
2
9
  export default _default;
3
10
  //# sourceMappingURL=anchorContent.d.ts.map
@@ -1,13 +1,12 @@
1
1
  import { ruleCreator } from "./ruleCreator.js";
2
2
  import { getTSNodeRange, typescriptLanguage } from "@flint.fyi/typescript-language";
3
3
  import { SyntaxKind } from "typescript";
4
-
5
4
  //#region src/rules/anchorContent.ts
6
5
  var anchorContent_default = ruleCreator.createRule(typescriptLanguage, {
7
6
  about: {
8
7
  description: "Reports anchor elements without accessible content.",
9
8
  id: "anchorContent",
10
- presets: ["logical"]
9
+ presets: ["logical", "logicalStrict"]
11
10
  },
12
11
  messages: { missingContent: {
13
12
  primary: "This anchor element is missing accessible content.",
@@ -52,7 +51,7 @@ var anchorContent_default = ruleCreator.createRule(typescriptLanguage, {
52
51
  } };
53
52
  }
54
53
  });
55
-
56
54
  //#endregion
57
55
  export { anchorContent_default as default };
56
+
58
57
  //# sourceMappingURL=anchorContent.js.map
@@ -1,3 +1,10 @@
1
- declare const _default: import("@flint.fyi/core").Rule<import("@flint.fyi/core").RuleAboutWithPresetsAndUrl<"logical" | "logicalStrict" | "stylistic">, object, object, "invalidHref" | "missingHref" | "shouldBeButton", import("@flint.fyi/core").AnyOptionalSchema>;
1
+ declare const _default: import("@flint.fyi/core").Rule<{
2
+ readonly description: "Reports invalid usage of anchor elements.";
3
+ readonly id: "anchorValidity";
4
+ readonly presets: ["logical", "logicalStrict"];
5
+ } & {
6
+ presets?: ("logical" | "logicalStrict" | "stylistic")[];
7
+ url: string;
8
+ }, object, object, "invalidHref" | "missingHref" | "shouldBeButton", import("@flint.fyi/core").AnyOptionalSchema>;
2
9
  export default _default;
3
10
  //# sourceMappingURL=anchorValidity.d.ts.map