corepack icon indicating copy to clipboard operation
corepack copied to clipboard

Changing linter rules

Open anonrig opened this issue 1 year ago • 6 comments

The overall linting and formatting rules in Corepack is extremely different than other repositories in Node.js. I'm planning on replacing it with Biome (which comes with linter and formatter) and have more nodejs/node similar code styles.

Any objections, ideas?

anonrig avatar Feb 27 '24 17:02 anonrig

It should use the same linter and lint rules as the Node core repo. Then if we ever move Corepack into the core repo, the code would already pass the lint check.

GeoffreyBooth avatar Feb 27 '24 17:02 GeoffreyBooth

It should use the same linter and lint rules as the Node core repo

See https://github.com/nodejs/node-core-test/issues/22 for what would need to happen for this to be possible. The effort was started in https://github.com/nodejs/eslint-plugin-nodejs-internal/issues/1

aduh95 avatar Feb 27 '24 17:02 aduh95

@GeoffreyBooth I recommended Biome because of several reasons:

  1. It has extremely unopinionated defaults.
  2. It doesn't involve installing X amount of dependencies, and discussions around what to use etc.
  3. I think this repository can be a test bed for https://github.com/nodejs/node/pull/50672.

anonrig avatar Feb 27 '24 17:02 anonrig

See https://github.com/nodejs/node-core-test/issues/22 for what would need to happen for this to be possible. The effort was started in https://github.com/nodejs/eslint-plugin-nodejs-internal/issues/1

I personally prefer to not invest more time on the current solution and Eslint, in favor of https://github.com/nodejs/node/pull/50672

anonrig avatar Feb 27 '24 17:02 anonrig

Then get Biome used on the main repo first, then update this one. If the main repo never migrates to Biome then we’re not any better off after migrating this repo to Biome than we are today.

We’re not any worse, either, I suppose. So either way. But it would be wasted effort if we migrate this to Biome and then the main repo migrates to something else, and then this repo needs to migrate again to that something else.

GeoffreyBooth avatar Feb 27 '24 17:02 GeoffreyBooth

It has extremely unopinionated defaults.

That seems like a negative and prone to bikeshedding.

merceyz avatar Feb 27 '24 17:02 merceyz