Closed
Description
Preconditions
.phtml
file with<script type="text/x-magento-init">
- magento-coding-standard v16
Steps to reproduce
- Create
.phtml
file with<script type="text/x-magento-init">
- run
phpcs
Expected result
- 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.