Open-Assistant icon indicating copy to clipboard operation
Open-Assistant copied to clipboard

New eslintrc.json

Open Jac-Zac opened this issue 2 years ago • 5 comments

Closes #121

New eslintrc.json which should include this and also those

Jac-Zac avatar Dec 28 '22 19:12 Jac-Zac

@Jac-Zac great!

So the problem is that there are missing dependencies which needs to be installed, but before we do that, we can simplify the config file:

{
  "root": true,
  "extends": [
    "eslint:recommended",
    "plugin:@typescript-eslint/recommended",
    "next/core-web-vitals"
  ],
  "rules": {
    "sort-imports": "error"
  }
}

we put next/core-web-vitals at the end so it overrides the previous ones.

We don't need parser and plugins since similar ones are already defined by next/core-web-vitals (you have to see the source code to know that, so don't worry).

And finally, since we are using the default config of sort-imports from eslint, we don't need to define it in details.

I hope that makes sense.

The only thing that is missing now is to install the missing dependencies, you can do that using npm i -D @typescript-eslint/eslint-plugin, you should see that your package.json and package-lock.json have changed, please commit and push both of them.

AbdBarho avatar Dec 28 '22 19:12 AbdBarho

@Jac-Zac Great!

You can see that it is working because the pipeline fails and eslint shows errors

https://github.com/LAION-AI/Open-Assistant/actions/runs/3796227051/jobs/6456127814#step:4:143

I will discuss with the team how to move forward with this and we will handle the rest, thanks again!

AbdBarho avatar Dec 28 '22 19:12 AbdBarho

@Jac-Zac Great!

You can see that it is working because the pipeline fails and eslint shows errors

https://github.com/LAION-AI/Open-Assistant/actions/runs/3796227051/jobs/6456127814#step:4:143

I will discuss with the team how to move forward with this and we will handle the rest, thanks again!

Yeah, I figured. Btw, you have been really kind and helpful in the process, thanks.

Jac-Zac avatar Dec 28 '22 19:12 Jac-Zac

Will review later my date and after pre-commits all work

fozziethebeat avatar Dec 28 '22 22:12 fozziethebeat

Can I request a change to a file that's similar to eslint and will help with cleaner more consistent code? Can you delete the paths configuration in website/tsconfig.json? that's causing a lot of visual studio code issues regarding imports.

fozziethebeat avatar Dec 29 '22 11:12 fozziethebeat

@Jac-Zac Thank you for the contribution! ❤

I did some small changes in #142, and also addressed what @fozziethebeat mentioned. Your work is preserved: https://github.com/LAION-AI/Open-Assistant/commit/71e260ec52478ea096f5b73bd8997670b1cb10ac

AbdBarho avatar Dec 29 '22 18:12 AbdBarho