jsx-eslint/eslint-plugin-react

Add `reactLibrary` setting

開放

#2,904 建立於 2021年1月17日

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

倉庫指標

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

描述

Add a reactLibrary setting for the name of the React library (defaults to 'react'). This would be helpful for Preact users.

Currently, the jsx-fragments rule (set to syntax) doesn't warn about this:

import {Fragment} from 'preact'

const foo = <Fragment>foo</Fragment>

Checking for the configured reactLibrary setting instead of the hard-coded 'react' would make this rule (and possibly others, I haven't really looked into this plugin that much) more flexible.

貢獻者指南