eslint-plugin-eslint-plugin icon indicating copy to clipboard operation
eslint-plugin-eslint-plugin copied to clipboard

Detect suggestions reported with spread and ternary used in `require-meta-has-suggestions` and other rules

Open bmish opened this issue 2 years ago • 0 comments

Some of our rules need to be able to detect when suggestions are reported.

I found a situation where we fail to unwrap the suggestions: https://github.com/typescript-eslint/typescript-eslint/blob/ad412cdd74dc5619fbe4bf27c0a5eb5c5a4b65ca/packages/eslint-plugin/src/rules/no-empty-interface.ts#L86

context.report({
  node: node.id,
  messageId: 'noEmptyWithSuper',
  ...(useAutoFix
    ? { fix }
    : {
        suggest: [
          {
            messageId: 'noEmptyWithSuper',
            fix,
          },
        ],
      }),
});

This issue is not specific to TypeScript.

bmish avatar Aug 01 '22 03:08 bmish