Skip to content

False positive Magento2.Legacy.PhtmlTemplate #351

Closed
@DmitryFurs

Description

@DmitryFurs

Preconditions

  1. .phtml file with <script type="text/x-magento-init">
  2. magento-coding-standard v16

Steps to reproduce

  1. Create .phtml file with <script type="text/x-magento-init">
  2. run phpcs

Expected result

  1. No Magento2.Legacy.PhtmlTemplate triggered

Actual result

-------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------------
 49 | WARNING | Please do not initialize JS component in php. Do it in template
-------------------------------------------------------------------------------------------------------------------------------

Additional Notes

It's probably false positive triggering, or I'm missing something and now it's forbidden to use the <script type="text/x-magento-init"></script> script and data-mage-init="{}"attribute in phtml files.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions