Commit 593fe17
authored
fix: conditionally register ember and oxc parsers when dependencies available (#234)
Prevents errors when prettier-plugin-ember-template-tag or
@prettier/plugin-oxc are not installed. The previous getter-based lazy
loading caused errors during parser enumeration by other plugins (like
prettier-plugin-toml), breaking compatibility. Now parsers are only
registered when dependencies exist.
resolves #233
## Testing
I tested by removing the spread operators and confirmed relevant tests
fail.
I also tested with my
[repro](https://github.com/jahands/prettier-sort-imports-plugin-repro#)
posted in #233 and confirmed it no longer errors1 parent ec4ea16 commit 593fe17
1 file changed
+34
-26
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
70 | 79 | | |
71 | 80 | | |
72 | 81 | | |
| |||
79 | 88 | | |
80 | 89 | | |
81 | 90 | | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
82 | 100 | | |
83 | 101 | | |
84 | 102 | | |
| |||
88 | 106 | | |
89 | 107 | | |
90 | 108 | | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
96 | 112 | | |
97 | | - | |
98 | | - | |
| 113 | + | |
| 114 | + | |
99 | 115 | | |
100 | 116 | | |
101 | 117 | | |
102 | 118 | | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
108 | 122 | | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
116 | 126 | | |
117 | | - | |
118 | | - | |
| 127 | + | |
| 128 | + | |
119 | 129 | | |
120 | 130 | | |
121 | 131 | | |
| |||
127 | 137 | | |
128 | 138 | | |
129 | 139 | | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
135 | 143 | | |
0 commit comments