Skip to content

[TRI-1149] bug: Cannot get eslint-plugin working on a fresh Next.js project #391

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

Closed
ericallam opened this issue Aug 24, 2023 · 2 comments · Fixed by #414
Closed

[TRI-1149] bug: Cannot get eslint-plugin working on a fresh Next.js project #391

ericallam opened this issue Aug 24, 2023 · 2 comments · Fixed by #414
Labels
area/integrations bug Something isn't working
Milestone

Comments

@ericallam
Copy link
Member

ericallam commented Aug 24, 2023

Here's the reproduction project:

https://github.com/ericallam/my-app

As you can see I've setup the eslint-plugin, but for some reason npm run lint isn't finding any errors in this code:

import { Job, eventTrigger } from "@trigger.dev/sdk";
import { client } from "@/trigger";

// your first job
new Job(client, {
  id: "example-job",
  name: "Example Job",
  version: "0.0.1",
  trigger: eventTrigger({
    name: "example.event",
  }),
  run: async (payload, io, ctx) => {
    await io.runTask("example.task", { name: "Task 1" }, async () => {});
    await io.runTask("example.task", { name: "Task 2" }, async () => {});
  },
});

cc: @ologbonowiwi

TRI-1149

@ericallam ericallam changed the title bug: Cannot get eslint-plugin working on a fresh Next.js project [TRI-1149] bug: Cannot get eslint-plugin working on a fresh Next.js project Aug 24, 2023
@maige-app maige-app bot added bug Something isn't working area/integrations labels Aug 24, 2023
@wesleymatosdev
Copy link
Contributor

Likely, the issue is on /packages/eslint-plugin/lib/rules/no-duplicated-task-keys.js:84.

     "CallExpression[callee.property.name='defineJob'] ObjectExpression BlockStatement": (node) => {

When implementing, I didn't know that we had another way than with defineJob to create a Job.

Do you have any other example that needs to be fixed with the current implementation?

We can add any other examples on /packages/eslint-plugin/tests/lib/rules/no-duplicated-task-keys.js:57, and run a pnpm test on /packages/eslint-plugin, this should show any invalid implementation (and it's easier than create a whole project to test this).

I already have some stuff on my queue, but you can assign this to me.

@wesleymatosdev
Copy link
Contributor

Fix on #398. Can you review it when available, @ericallam?

I tested your example and added some more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/integrations bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants