Content-Length: 287483 | pFad | https://github.com/jsx-eslint/eslint-plugin-react/issues/1088

9A False positives on "Declare only one React component per file" (react/no-multi-comp) · Issue #1088 · jsx-eslint/eslint-plugin-react · GitHub
Skip to content

False positives on "Declare only one React component per file" (react/no-multi-comp) #1088

Closed
singapore/lint-condo
#262
@MoOx

Description

@MoOx
import test from "jest-ava-api"
import React, { createElement } from "react"
import { createRenderer } from "react-addons-test-utils"

const renderer = (...args) => { // I guess this is detected as a component
  const render = createRenderer()
  render.render(...args)
  return render.getRenderOutput()
}

test("what", () => {
  return {
    isActive: () => false, // what?
  }
})

react/no-multi-comp is detecting 2 components here since I get a warning on the last () => false.
Both are wrong.

Ps: the code does not make sense as it is as I removed some part to make the debugging more easy.

Not that if I does not import createElement, the error seems to disappear (but I need this...)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions









      ApplySandwichStrip

      pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


      --- a PPN by Garber Painting Akron. With Image Size Reduction included!

      Fetched URL: https://github.com/jsx-eslint/eslint-plugin-react/issues/1088

      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy