jsx-eslint/eslint-plugin-react

function-component-definition should ignore function with `this`

開放

#2,781 建立於 2020年9月1日

 (2 則留言) (0 個反應) (0 位負責人)JavaScript (2,732 個分叉)batch import
bughelp wanted

倉庫指標

星標
 (9,293 顆星)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

This is a polyfill for IE:

		Element.prototype.closest = function (s) {
			let el = this
			if (!document.documentElement.contains(el)) return null
			do {
				if (el.matches(s)) return el
				el = el.parentElement || el.parentNode
			} while (el !== null && el.nodeType === 1)
			return null
		}

it needs access to this and function-component-definition complains about it.

貢獻者指南