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

Linting plugin stopped working in 2.0.0-canary.0 #8252

Closed
1 task done
weyert opened this issue May 30, 2024 · 5 comments
Closed
1 task done

Linting plugin stopped working in 2.0.0-canary.0 #8252

weyert opened this issue May 30, 2024 · 5 comments
Labels
kind: bug Something isn't working needs: triage New issues get this label. Remove it after triage owned-by: turborepo

Comments

@weyert
Copy link
Contributor

weyert commented May 30, 2024

Verify canary release

  • I verified that the issue exists in the latest Turborepo canary release.

Link to code that reproduces this issue

n/a

What package manager are you using / does the bug impact?

pnpm

What operating system are you using?

Mac

Which canary version will you have in your reproduction?

2.0.0-canary.0

Describe the Bug

Upgrading eslint-plugin-turbo breaks/ stops the turbo lifting for functioning:

TypeError: Failed to load plugin 'turbo' declared in '--config » /Users/weyert/Development/Projects/company/company-monorepo/configs/eslint-config/turbo.js': Cannot convert undefined or null to object
    at Function.entries (<anonymous>)
    at Ii.generateKey (/Users/weyert/Development/Projects/company/company-monorepo/node_modules/.pnpm/[email protected][email protected]/node_modules/eslint-plugin-turbo/dist/index.js:74:6559)
    at new Ii (/Users/weyert/Development/Projects/company/company-monorepo/node_modules/.pnpm/[email protected][email protected]/node_modules/eslint-plugin-turbo/dist/index.js:74:6200)
    at Object.<anonymous> (/Users/weyert/Development/Projects/company/company-monorepo/node_modules/.pnpm/[email protected][email protected]/node_modules/eslint-plugin-turbo/dist/index.js:74:10209)
    at Module._compile (node:internal/modules/cjs/loader:1369:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1427:10)
    at Module.load (node:internal/modules/cjs/loader:1206:32)
    at Module._load (node:internal/modules/cjs/loader:1022:12)
    at Module.require (node:internal/modules/cjs/loader:1231:19)
    at require (node:internal/modules/helpers:179:18)

Expected Behavior

Able to use the turbo listing rules

To Reproduce

Upgrade to Turbo v2 canary build and try to run the linting rules

Additional context

Appears that code is still referring to pipeline instead of tasks when reading the turbo config file

@weyert weyert added kind: bug Something isn't working needs: triage New issues get this label. Remove it after triage owned-by: turborepo labels May 30, 2024
@anthonyshew
Copy link
Contributor

Looks like @chris-olszewski is ahead of it in #8253

@weyert
Copy link
Contributor Author

weyert commented Jun 1, 2024

Appears to fixed in the latest canary build

@weyert weyert closed this as completed Jun 1, 2024
@andrevenancio
Copy link

I'm not sure what's happening with eslint-config-turbo yesterday I reported an issue, yet today I also have an issue.

I have a monorepo with [email protected]. I have my root package with this npm script "lint": "eslint --fix packages apps".
Nothing else on my app has a lint script (no apps and no packages) so running npm run lint on the root just runs this.

I have this .eslintrc.js on the root and I've copied the packages/eslint-config from the latest turbo starter project npx create-turbo@latest.

Running this exact script I've described on a new repo works fine and I get the ✔ No ESLint warnings or errors

Running it on my monorepo, returns this

TypeError: Failed to load plugin 'turbo' declared in '.eslintrc.js » @intangible/eslint-config/library.js » eslint-config-turbo': Cannot convert undefined or null to object

Same exact code on packages/eslint-config, package.json and .eslintrc.js on both packages. Is this related to turbo cache? I reinstalled my monorepo, and for the life of me I can't get it to work. I just realised that this issue seems to indicate I'm not the only one, but installing the canary version does nothing for me.

@anthonyshew
Copy link
Contributor

That sounds similar to the error message I fixed in this PR: #8405

To be specific, renaming eslint-config-turbo to turbo in the ESLint configuration resolves that error.

@Grsz
Copy link

Grsz commented Aug 14, 2024

Still present, same error message

EDIT:

May help someone in the future, but it was related to a turbo.json file with missing tasks. The cannot convert undefined or null to object was referring to:

function Au(e,t){"pipeline"in e?Object.entries(e.pipeline).forEach(t):Object.entries(e.tasks).forEach(t)}

Where if e.tasks is not defined in the turbo.json file, it crashes ESLint.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug Something isn't working needs: triage New issues get this label. Remove it after triage owned-by: turborepo
Projects
None yet
Development

No branches or pull requests

4 participants