Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug(linter) false positive in no-unused-vars #5274

Closed
camc314 opened this issue Aug 27, 2024 · 2 comments · Fixed by #5306
Closed

bug(linter) false positive in no-unused-vars #5274

camc314 opened this issue Aug 27, 2024 · 2 comments · Fixed by #5306
Assignees
Labels
C-bug Category - Bug

Comments

@camc314
Copy link
Collaborator

camc314 commented Aug 27, 2024

export const render = markdown => {
  const rendered = marked(markdown, {
    renderer: new (class CustomRenderer extends Renderer {
      heading({ tokens }) {
        return `
          <Fragment>
            <Section><b>${tokens[0].text}</b></Section>
            <Divider />
          </Fragment>`;
      }

      list(token) {
        return `<Section>${super.list(token)}</Section>`;
      }

      hr() {
        return `<Divider />`;
      }
    })(),
  });
  return jsxslack([`<Blocks>${rendered}</Blocks>`]);
};
  × eslint(no-unused-vars): Class 'CustomRenderer' is declared but never used.
   ╭─[tools/changelog/markdown.js:6:26]
 5 │   const rendered = marked(markdown, {
 6 │     renderer: new (class CustomRenderer extends Renderer {
   ·                          ───────┬──────
   ·                                 ╰── 'CustomRenderer' is declared here
 7 │       heading({ tokens }) {
   ╰────
  help: Consider removing this declaration.

Finished in 113ms on 2036 files with 99 rules using 12 threads.
Found 0 warnings and 1 error.
@camc314 camc314 added the C-bug Category - Bug label Aug 27, 2024
@DonIsaac
Copy link
Collaborator

Man I just love JavaScript sometimes

@Boshen
Copy link
Member

Boshen commented Aug 28, 2024

I'll make a new oxlint release once this is fixed for Affine https://github.com/oxc-project/oxlint-ecosystem-ci/actions/runs/10591385888/job/29348827098

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category - Bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants