Skip to content

Commit a1fc6d9

Browse files
committed
Refactor package.json some more
1 parent eca5e6b commit a1fc6d9

File tree

2 files changed

+9
-35
lines changed

2 files changed

+9
-35
lines changed

lib/index.js

+7-13
Original file line numberDiff line numberDiff line change
@@ -260,13 +260,11 @@ export function Markdown(options) {
260260
}
261261

262262
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
270268

271269
if (!remove && allowElement && typeof index === 'number') {
272270
remove = !allowElement(node, index, parent)
@@ -307,11 +305,7 @@ export function defaultUrlTransform(value) {
307305
return url
308306
}
309307

310-
let index = -1
311-
312-
while (++index < safeProtocols.length) {
313-
const protocol = safeProtocols[index]
314-
308+
for (const protocol of safeProtocols) {
315309
if (
316310
colon === protocol.length &&
317311
url.slice(0, protocol.length).toLowerCase() === protocol
@@ -320,7 +314,7 @@ export function defaultUrlTransform(value) {
320314
}
321315
}
322316

323-
index = url.indexOf('?')
317+
let index = url.indexOf('?')
324318
if (index !== -1 && colon > index) {
325319
return url
326320
}

package.json

+2-22
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,7 @@
9898
"@types/react-dom": "^18.0.0",
9999
"c8": "^8.0.0",
100100
"esbuild": "^0.19.0",
101-
"eslint-plugin-es": "^4.0.0",
102101
"eslint-plugin-react": "^7.0.0",
103-
"eslint-plugin-react-hooks": "^4.0.0",
104-
"eslint-plugin-security": "^1.0.0",
105102
"prettier": "^3.0.0",
106103
"react": "^18.0.0",
107104
"react-dom": "^18.0.0",
@@ -153,10 +150,6 @@
153150
"atLeast": 100,
154151
"detail": true,
155152
"ignoreCatch": true,
156-
"#": "below is ignored because some proptypes will `any`; to do: remove prop-types?",
157-
"ignoreFiles": [
158-
"lib/index.d.ts"
159-
],
160153
"strict": true
161154
},
162155
"xo": {
@@ -165,19 +158,6 @@
165158
],
166159
"extends": "plugin:react/jsx-runtime",
167160
"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-
},
181161
{
182162
"files": [
183163
"**/*.jsx"
@@ -189,8 +169,8 @@
189169
],
190170
"prettier": true,
191171
"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"
194174
}
195175
}
196176
}

0 commit comments

Comments
 (0)