From 46da539a5cd00c959e0d6c22a70a6014eb819e71 Mon Sep 17 00:00:00 2001 From: Douglas Wade Date: Tue, 12 Apr 2022 16:17:27 -0700 Subject: [PATCH] Fix 1786 (#1831) * Fix #1786: Add rule match-component-import-name * Write the documentation for match-component-import-name * fix(1786): Respond to PR feedback * Update lib/rules/match-component-import-name.js Co-authored-by: Flo Edelmann * Don't change utils if you can avoid it * update docs * Update docs/rules/match-component-import-name.md Co-authored-by: Flo Edelmann * Update docs/rules/match-component-import-name.md Co-authored-by: Flo Edelmann * Update docs/rules/match-component-import-name.md Co-authored-by: Flo Edelmann * Update docs/rules/match-component-import-name.md Co-authored-by: Flo Edelmann * remove case option * remove stray newline * Remove prefix; handle computed properties * but who lints the linters Co-authored-by: Flo Edelmann --- docs/rules/README.md | 1 + docs/rules/match-component-import-name.md | 45 +++++++++++ lib/index.js | 1 + lib/rules/match-component-import-name.js | 79 +++++++++++++++++++ .../lib/rules/match-component-import-name.js | 73 +++++++++++++++++ 5 files changed, 199 insertions(+) create mode 100644 docs/rules/match-component-import-name.md create mode 100644 lib/rules/match-component-import-name.js create mode 100644 tests/lib/rules/match-component-import-name.js diff --git a/docs/rules/README.md b/docs/rules/README.md index b4ebfefd7..3d2d113d7 100644 --- a/docs/rules/README.md +++ b/docs/rules/README.md @@ -317,6 +317,7 @@ For example: | [vue/html-comment-content-spacing](./html-comment-content-spacing.md) | enforce unified spacing in HTML comments | :wrench: | | [vue/html-comment-indent](./html-comment-indent.md) | enforce consistent indentation in HTML comments | :wrench: | | [vue/match-component-file-name](./match-component-file-name.md) | require component name property to match its file name | | +| [vue/match-component-import-name](./match-component-import-name.md) | require the registered component name to match the imported component name | | | [vue/new-line-between-multi-line-property](./new-line-between-multi-line-property.md) | enforce new lines between multi-line properties in Vue components | :wrench: | | [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 `