From df2921afa1a05fe7b9c9e2800dc235ef6d26c1a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Connor=20B=C3=A4r?= Date: Tue, 4 Jul 2023 22:54:44 +0200 Subject: [PATCH] Be more specific about the invalid code (#2173) --- .changeset/tough-clouds-listen.md | 5 +++++ .../no-deprecated-components/index.ts | 2 +- .../eslint-plugin-circuit-ui/no-deprecated-props/index.ts | 2 +- packages/eslint-plugin-circuit-ui/no-renamed-props/index.ts | 4 ++-- 4 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 .changeset/tough-clouds-listen.md diff --git a/.changeset/tough-clouds-listen.md b/.changeset/tough-clouds-listen.md new file mode 100644 index 0000000000..2bae8d5805 --- /dev/null +++ b/.changeset/tough-clouds-listen.md @@ -0,0 +1,5 @@ +--- +'@sumup/eslint-plugin-circuit-ui': patch +--- + +Made the reported node more specific. diff --git a/packages/eslint-plugin-circuit-ui/no-deprecated-components/index.ts b/packages/eslint-plugin-circuit-ui/no-deprecated-components/index.ts index 692b7674fc..103c68491a 100644 --- a/packages/eslint-plugin-circuit-ui/no-deprecated-components/index.ts +++ b/packages/eslint-plugin-circuit-ui/no-deprecated-components/index.ts @@ -64,7 +64,7 @@ export const noDeprecatedComponents = createRule({ } context.report({ - node, + node: specifier, messageId: 'deprecated', data: component, }); diff --git a/packages/eslint-plugin-circuit-ui/no-deprecated-props/index.ts b/packages/eslint-plugin-circuit-ui/no-deprecated-props/index.ts index aab27fad21..7391888165 100644 --- a/packages/eslint-plugin-circuit-ui/no-deprecated-props/index.ts +++ b/packages/eslint-plugin-circuit-ui/no-deprecated-props/index.ts @@ -95,7 +95,7 @@ export const noDeprecatedProps = createRule({ } context.report({ - node, + node: attribute, messageId: 'deprecated', data: { component, prop, alternative }, }); diff --git a/packages/eslint-plugin-circuit-ui/no-renamed-props/index.ts b/packages/eslint-plugin-circuit-ui/no-renamed-props/index.ts index 4d79794cc3..0d3a47aefd 100644 --- a/packages/eslint-plugin-circuit-ui/no-renamed-props/index.ts +++ b/packages/eslint-plugin-circuit-ui/no-renamed-props/index.ts @@ -114,7 +114,7 @@ export const noRenamedProps = createRule({ } context.report({ - node, + node: attribute, messageId: 'propName', data: { component, current, replacement }, fix(fixer) { @@ -151,7 +151,7 @@ export const noRenamedProps = createRule({ } context.report({ - node, + node: attribute, messageId: 'propValue', data: { component, prop, current, replacement }, fix(fixer) {