Skip to content

Add ESLint rule to prevent v-html usage

Dheeraj Joshi requested to merge djadmin-eslint-vhtml into master

This MR implements #232488 (closed) -

  1. Enables a rule to report usage of v-html
  2. Add disable comment for existing v-html usages (across the file)

FAQs

Why add this rule

v-html is bad and can lead to XSS attacks https://vuejs.org/v2/api/#v-html

How did you disable existing usages

  1. Wrote an ESLint Auto-fixer to do the job - Checkout the snippet

  2. Scan and apply auto-fix

yarn eslint --fix && git add . && yarn prettier-staged-save && git add .

The auto-fixer adds an comment at the beginning of each file using v-html

Edited by Dheeraj Joshi

Merge request reports