Skip to content

react/no-this-in-sfc: eslint-plugin-react 7.25.0 interprets an old legacy jQuery plugin as a sfc #3054

@doberkofler

Description

@doberkofler

I get lot's of false positive react/no-this-in-sfc warnings in Typescript (*.ts) Files.
It seems as if TypeScript files with ts (not just tsx) extension would be regarded as react files and of type $.fn.<lowercase>... = function (): <type> | null would be interpreted as an sfc:

$.fn.getValueAsStringWeak = function (): string | null {
	const val = this.length === 1 ? this.val() : null;

	return typeof val === 'string' ? val : null;
};

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions