Add ESLint rule to prevent v-html usage
This MR implements #232488 (closed) -
- Enables a rule to report usage of
v-html - Add disable comment for existing
v-htmlusages (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
-
Wrote an ESLint Auto-fixer to do the job - Checkout the snippet
-
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