Skip to content

Allow re-enabling via twig-cs-fixer-enable #436

@erengy

Description

@erengy

It's possible to disable every rule with twig-cs-fixer-disable since #162. Would be nice to have a matching twig-cs-fixer-enable directive to disable the fixer for a range of lines, rather than for the whole file.

Similar directives that I'm aware of: prettier-ignore-start/end clang-format off/on

My use case is to avoid getting errors for inline JS in templates:

{% block javascripts %}
    {# twig-cs-fixer-disable #}
    <script>
        // ...
        // ...
        // ...
    </script>
    {# twig-cs-fixer-enable #}
{% endblock javascripts %}

Current workarounds:

  • Extracting the script to a separate template and using twig-cs-fixer-disable there.
  • Using twig-cs-fixer-disable-next-line before each line with an error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions