vercel / turborepo

Build system optimized for JavaScript and TypeScript, written in Rust
https://turbo.build/repo/docs
MIT License
26.31k stars 1.82k forks source link

Docs: no-unused-vars occurs on function type argument, in basic example #8045

Open moeyashi opened 6 months ago

moeyashi commented 6 months ago

What is the improvement or update you wish to see?

I want to avoid errors with the following definition

export type Add = (x: number, y: number) => number;

Is there any context that might help us understand?

I started with the basic example (https://github.com/vercel/turbo/tree/main/examples/basic).

Defining a function type like the one above will result in an error eslint(no-unused-vars).

I believe this behavior is inappropriate and needs to be fixed.

I know that this can be solved by changing the file at https://github.com/vercel/turbo/blob/main/examples/basic/apps/web/.eslintrc.js as follows

/** @type {import("eslint").Linter.Config} */
module.exports = {
  root: true,
  extends: [
    "@repo/eslint-config/next.js",
    "plugin:@typescript-eslint/recommended",
  ],
  parser: "@typescript-eslint/parser",
  parserOptions: {
    project: true,
  },
  plugins: ["@typescript-eslint"],
};

I'm new to monorepo development, so I'd like to ask here what's the appropriate file to change and how.

I'll also leave a capture of the error here.

スクリーンショット 2024-04-26 161417

Does the docs page already exist? Please link to it.

https://turbo.build/repo/docs/getting-started/from-example

burakozdemir32 commented 2 months ago

Same issue, there is something wrong in the base configurations causing this.