From f4c12cc07074e3131a8aededa242454c866187a4 Mon Sep 17 00:00:00 2001 From: Flo Edelmann Date: Wed, 17 Nov 2021 09:01:12 +0100 Subject: [PATCH] Add `vue/no-child-content` rule (#1707) * Add `vue/no-child-content` rule * Fix rule category * Add hints about available suggestions * Don't report whitespace-only child content * Report comments in `vue/no-child-content` * Simplify comment parsing with `tokenStore.getTokensBetween` --- docs/rules/README.md | 1 + docs/rules/no-child-content.md | 53 +++++++ lib/index.js | 1 + lib/rules/no-child-content.js | 164 ++++++++++++++++++++ lib/utils/index.js | 2 +- tests/lib/rules/no-child-content.js | 224 ++++++++++++++++++++++++++++ 6 files changed, 444 insertions(+), 1 deletion(-) create mode 100644 docs/rules/no-child-content.md create mode 100644 lib/rules/no-child-content.js create mode 100644 tests/lib/rules/no-child-content.js diff --git a/docs/rules/README.md b/docs/rules/README.md index 03ce9d584..684731a95 100644 --- a/docs/rules/README.md +++ b/docs/rules/README.md @@ -321,6 +321,7 @@ For example: | [vue/next-tick-style](./next-tick-style.md) | enforce Promise or callback style in `nextTick` | :wrench: | | [vue/no-bare-strings-in-template](./no-bare-strings-in-template.md) | disallow the use of bare strings in `