Git Product home page Git Product logo

Comments (12)

Jarred-Sumner avatar Jarred-Sumner commented on August 21, 2024 2

We will push Bun v1.0.34 to fix this tonight

from bun.

joglr avatar joglr commented on August 21, 2024

I think it would be helpful if you can provide the exact commands used for reproducing the repository that is broken.

from bun.

thecrabcode avatar thecrabcode commented on August 21, 2024

Unfortunately it's a bit complicated to replciate as we have a private monorepo built on turborepo. What we have is a base eslint-config package defined as such

{
  "env": {
    "es2021": true,
    "node": true
  },
  "extends": [
    "eslint:recommended",
    "plugin:@typescript-eslint/recommended",
    "prettier"
  ],
  "parser": "@typescript-eslint/parser",
  "parserOptions": {
    "ecmaVersion": "latest",
    "sourceType": "module"
  },
  "plugins": [
    "@typescript-eslint",
    "prettier"
  ],
  "rules": {
    "@typescript-eslint/ban-types": "off",
    "@typescript-eslint/no-explicit-any": "off",
    "no-mixed-spaces-and-tabs": "off",
    "@typescript-eslint/no-non-null-assertion": "off",
    "@typescript-eslint/no-extra-semi": "off",
    "@typescript-eslint/ban-ts-comment": "off",
    "@typescript-eslint/no-namespace": "off",
    "no-case-declarations": "off",
    "no-extra-semi": "off",
    "@typescript-eslint/no-unused-vars": [
      "error",
      {
        "argsIgnorePattern": "^_"
      }
    ],
    "prettier/prettier": "error"
  },
  "ignorePatterns": [
    "example /*",
    "tests/**/*"
  ]
}

and then for each app and package all we do is to extends such package as such

{
  "$schema": "https://json.schemastore.org/eslintrc",
  "extends": ["@my-app/eslint-config/base.json"]
}

Running the lint command works just fine on v1.0.30, but if I upgrade to v1.0.32, without changing anything else, it breaks immediately due to

@my-app/error-protocol:lint: There was a problem loading formatter: ~/repos/apps/my-app/node_modules/eslint/lib/cli-engine/formatters/stylish
@my-app/error-protocol:lint: Error: require() of ES Module ~/repos/apps/my-app/node_modules/chalk/source/index.js from ~/repos/apps/my-app/node_modules/eslint/lib/cli-engine/formatters/stylish.js not supported.
@my-app/error-protocol:lint: Instead change the require of index.js in ~/repos/apps/my-app/node_modules/eslint/lib/cli-engine/formatters/stylish.js to a dynamic import() which is available in all CommonJS modules.

It works ok on v1.0.31 on my local, but that also fails when running on Gitlab CI.

from bun.

Jarred-Sumner avatar Jarred-Sumner commented on August 21, 2024

@thecrabcode one subtle change we made in v1.0.32 was to hoist devDependencies above regular dependencies in more cases. I'm pretty sure it would only ever error with error.DependencyLoop in those cases though. This was to allow better support having both the same package in devDependencies and dependencies. I wonder if this is a workspace and there are multiple versions of these eslint related packages?

from bun.

thecrabcode avatar thecrabcode commented on August 21, 2024

hi @Jarred-Sumner, thanks for your answer!

We do indeed use workspaces, but we have a turbo package which install all the eslint dependencies, and it contains base eslint config files (we have different base configs for different kinds of apps, such as next config, base config etc...) that we extends from in each single app and package.

So in theory every app and package should use that one "central" dependency that is installed in the eslint config packge.

from bun.

cuquo avatar cuquo commented on August 21, 2024

the error with eslint seems to be related to ajv, Eslint uses an older version (v6) and with the new hoisting is trying to make eslint work with a newer version that throws a option missingRefs. I will confirm if the newest version fixes this

from bun.

cuquo avatar cuquo commented on August 21, 2024

I just installed the latest canary and it works correctly

from bun.

thecrabcode avatar thecrabcode commented on August 21, 2024

That's great to hear! Thanks for the quick fix. Do you guys know when 1.0.34 will be made official?

from bun.

cuquo avatar cuquo commented on August 21, 2024

@thecrabcode "when its done" I guess. I usually follow releases in @Jarred-Sumner Twitter account. The dates there are not accurate but gives us an idea of the ETA

from bun.

thecrabcode avatar thecrabcode commented on August 21, 2024

@cuquo sounds good, thanks!

from bun.

whjvenyl avatar whjvenyl commented on August 21, 2024

nice.. I'm in the same boat as @thecrabcode since 1.0.32 also broke browser-sync
eagerly awaiting the new release

from bun.

thecrabcode avatar thecrabcode commented on August 21, 2024

Just downloaded the 1.0.34 release and I can confirm this sorted the issue out. Thanks for the super quick turnaround guys!

from bun.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.