File tree 2 files changed +9
-35
lines changed
2 files changed +9
-35
lines changed Original file line number Diff line number Diff line change @@ -260,13 +260,11 @@ export function Markdown(options) {
260
260
}
261
261
262
262
if ( node . type === 'element' ) {
263
- let remove = false
264
-
265
- if ( allowedElements ) {
266
- remove = ! allowedElements . includes ( node . tagName )
267
- } else if ( disallowedElements ) {
268
- remove = disallowedElements . includes ( node . tagName )
269
- }
263
+ let remove = allowedElements
264
+ ? ! allowedElements . includes ( node . tagName )
265
+ : disallowedElements
266
+ ? disallowedElements . includes ( node . tagName )
267
+ : false
270
268
271
269
if ( ! remove && allowElement && typeof index === 'number' ) {
272
270
remove = ! allowElement ( node , index , parent )
@@ -307,11 +305,7 @@ export function defaultUrlTransform(value) {
307
305
return url
308
306
}
309
307
310
- let index = - 1
311
-
312
- while ( ++ index < safeProtocols . length ) {
313
- const protocol = safeProtocols [ index ]
314
-
308
+ for ( const protocol of safeProtocols ) {
315
309
if (
316
310
colon === protocol . length &&
317
311
url . slice ( 0 , protocol . length ) . toLowerCase ( ) === protocol
@@ -320,7 +314,7 @@ export function defaultUrlTransform(value) {
320
314
}
321
315
}
322
316
323
- index = url . indexOf ( '?' )
317
+ let index = url . indexOf ( '?' )
324
318
if ( index !== - 1 && colon > index ) {
325
319
return url
326
320
}
Original file line number Diff line number Diff line change 98
98
"@types/react-dom" : " ^18.0.0" ,
99
99
"c8" : " ^8.0.0" ,
100
100
"esbuild" : " ^0.19.0" ,
101
- "eslint-plugin-es" : " ^4.0.0" ,
102
101
"eslint-plugin-react" : " ^7.0.0" ,
103
- "eslint-plugin-react-hooks" : " ^4.0.0" ,
104
- "eslint-plugin-security" : " ^1.0.0" ,
105
102
"prettier" : " ^3.0.0" ,
106
103
"react" : " ^18.0.0" ,
107
104
"react-dom" : " ^18.0.0" ,
153
150
"atLeast" : 100 ,
154
151
"detail" : true ,
155
152
"ignoreCatch" : true ,
156
- "#" : " below is ignored because some proptypes will `any`; to do: remove prop-types?" ,
157
- "ignoreFiles" : [
158
- " lib/index.d.ts"
159
- ],
160
153
"strict" : true
161
154
},
162
155
"xo" : {
165
158
],
166
159
"extends" : " plugin:react/jsx-runtime" ,
167
160
"overrides" : [
168
- {
169
- "files" : [
170
- " lib/**/*.js"
171
- ],
172
- "extends" : [
173
- " plugin:es/restrict-to-es2019" ,
174
- " plugin:security/recommended"
175
- ],
176
- "rules" : {
177
- "complexity" : " off" ,
178
- "security/detect-object-injection" : " off"
179
- }
180
- },
181
161
{
182
162
"files" : [
183
163
" **/*.jsx"
189
169
],
190
170
"prettier" : true ,
191
171
"rules" : {
192
- "n/file-extension-in-import " : " off" ,
193
- "unicorn/prefer-string-replace-all " : " off"
172
+ "complexity " : " off" ,
173
+ "n/file-extension-in-import " : " off"
194
174
}
195
175
}
196
176
}
You can’t perform that action at this time.
0 commit comments