Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Add eslint-plugin-eslint-comments to prevent accidentally leaving disabled rules for entire files #901

Closed
1 task
krysal opened this issue Feb 17, 2022 · 0 comments · Fixed by #999
Closed
1 task
Assignees
Labels
💻 aspect: code Concerns the software code in the repository ✨ goal: improvement Improvement to an existing user-facing feature 🟩 priority: low Low priority and doesn't need to be rushed

Comments

@krysal
Copy link
Member

krysal commented Feb 17, 2022

Problem

Some ESlint rules can be disabled in block comments for specific parts of a file, we use this for disabled some texts that should not be translated for example. The problem is that this approach is prone to forgetting to close the exception as happened in the VImageDetails component.

<!-- eslint-disable @intlify/vue-i18n/no-raw-text -->
{{ imageWidth }} &times; {{ imageHeight }}
{{ $t('image-details.information.pixels') }}
</dd>
</div>
</dl>
</section>
</template>
<script>

Description

Adding eslint-plugin-eslint-comments can help offload this burden from the developer who writes the exception comment as well as those who review the changes.

Alternatives

Be aware in code reviews that ESlint comments are not applied without their corresponding closure.

Additional context

Recommended in #898 by @sarayourfriend.

Implementation

  • 🙋 I would be interested in implementing this feature.
@krysal krysal added 🟩 priority: low Low priority and doesn't need to be rushed ✨ goal: improvement Improvement to an existing user-facing feature 💻 aspect: code Concerns the software code in the repository labels Feb 17, 2022
@sarayourfriend sarayourfriend self-assigned this Feb 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
💻 aspect: code Concerns the software code in the repository ✨ goal: improvement Improvement to an existing user-facing feature 🟩 priority: low Low priority and doesn't need to be rushed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants