biomejs / biome

A toolchain for web projects, aimed to provide functionalities to maintain them. Biome offers formatter and linter, usable via CLI and LSP.
https://biomejs.dev
Apache License 2.0
15.28k stars 475 forks source link

💅 Getting when I try to migrate eslint in react native typescript project #2818

Closed golu7679 closed 6 months ago

golu7679 commented 6 months ago

Environment information

CLI:
  Version:                      1.5.3
  Color support:                true

Platform:
  CPU Architecture:             x86_64
  OS:                           windows

Environment:
  BIOME_LOG_DIR:                unset
  NO_COLOR:                     unset
  TERM:                         "xterm-256color"
  JS_RUNTIME_VERSION:           "v20.11.1"
  JS_RUNTIME_NAME:              "node"
  NODE_PACKAGE_MANAGER:         unset

Biome Configuration:
  Status:                       unset

Workspace:
  Open Documents:               0

Rule name

Eslint

Playground link


Expected result

I am trying to migrate eslint config into biome but when I trigger this command npx @biomejs/biome migrate eslint --write

I always get an error Error: eslint is not expected in this context

This is my .eslintric.json config

{
    "parser": "@typescript-eslint/parser",
    "parserOptions": {
        "project": "tsconfig.json",
        "sourceType": "module"
    },
    "plugins": [
        "@typescript-eslint/eslint-plugin"
    ],
    "extends": [
        "plugin:@typescript-eslint/recommended",
        "prettier"
    ],
    "root": true,
    "env": {
        "node": true,
        "jest": true
    },
    "ignorePatterns": [
        ".eslintrc.json"
    ],
    "rules": {
        "@typescript-eslint/interface-name-prefix": "off",
        "@typescript-eslint/explicit-function-return-type": "off",
        "@typescript-eslint/explicit-module-boundary-types": "off",
        "@typescript-eslint/no-explicit-any": "off",
        "@typescript-eslint/no-inferrable-types": "off"
    }
}

Code of Conduct

Conaclos commented 6 months ago

I cannot reproduce your error. Here is my attempt:

❯ npm init --yes
❯ npm i -D eslint
❯ npm i -D @eslint/js typescript typescript-eslint
❯ npm i -D eslint-plugin-prettier eslint-config-prettier
❯ npm i -D @biomejs/biome
❯ npx biome init
❯ cat .eslintrc.json
{
    "parser": "@typescript-eslint/parser",
    "parserOptions": {
        "project": "tsconfig.json",
        "sourceType": "module"
    },
    "plugins": [
        "@typescript-eslint/eslint-plugin"
    ],
    "extends": [
        "plugin:@typescript-eslint/recommended",
        "prettier"
    ],
    "root": true,
    "env": {
        "node": true,
        "jest": true
    },
    "ignorePatterns": [
        ".eslintrc.json"
    ],
    "rules": {
        "@typescript-eslint/interface-name-prefix": "off",
        "@typescript-eslint/explicit-function-return-type": "off",
        "@typescript-eslint/explicit-module-boundary-types": "off",
        "@typescript-eslint/no-explicit-any": "off",
        "@typescript-eslint/no-inferrable-types": "off"
    }
}

❯ npx biome migrate eslint --write
.eslintrc.json has been successfully migrated.
Run the command with the option --include-inspired to also migrate inspired rules.
golu7679 commented 6 months ago

I don't know what is the exact issue after reinstalling dependencies it is working.