Skip to content

phpcs: Expected at least 1 space after "<"; 0 found in PhpStorm #3959

@badtiger

Description

@badtiger

Image

Good afternoon. I am encountering an incorrect error in PhpStorm. When using HTML inside JS files, I get the following PHPCS error:


![Image](https://github.com/user-attachments/assets/2efa4609-509b-4d33-85ba-1ab18ca09c38)

"Expected at least 1 space after '<'; 0 found."

When I try to fix it, I get the following result:

return (
    < div >
        < h1 > Data Table < / h1 >
        < table border = "1" >
            < thead >
            < tr >
                < th > < / th >
                < th > < / th >
                < th > Planned Shipment Date < / th >
            < / tr >
            < / thead >
            < tbody >
            {data.map((item) => (
                < tr key = {item.id} >
                    < td > {item.serial_number} < / td >
                    < td > {new Date(item.deadline).toLocaleString()} < / td >
                    < td > {item.productionItemPartStages ? .length || 0} < / td >
                < / tr >
            ))}
            < / tbody >
        < / table >
    < / div >
);

Could you please help me resolve this issue?

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