github biomejs/biome cli/v1.6.4-nightly.abab451
CLI v1.6.4-nightly.abab451

Analyzer

Bug fixes

  • Now Biome can detect the script language in Svelte and Vue script blocks more reliably (#2245). Contributed by @Sec-ant
  • useExhaustiveDependencies no longer reports recursive calls as missing
    dependencies (#2361).
    Contributed by @arendjr
  • useExhaustiveDependencies correctly reports missing dependencies declared
    using function declarations (#2362).
    Contributed by @arendjr
  • Biome now can handle .svelte and .vue files with CRLF as the end-of-line sequence. Contributed by @Sec-ant

Enhancements

  • Complete the well-known file lists for JSON-like files. Trailing commas are allowed in .jsonc files by default. Some well-known files like tsconfig.json and .babelrc don't use the .jsonc extension but still allow comments and trailing commas. While others, such as .eslintrc.json, only allow comments. Biome is able to identify these files and adjusts the json.parser.allowTrailingCommas option accordingly to ensure they are correctly parsed. Contributed by @Sec-ant

CLI

New features

  • Add a command to migrate from ESLint

    biome migrate eslint allows you to migrate an ESLint configuration to Biome.
    The command supports legacy ESLint configurations and new flat ESLint configurations.
    Legacy ESLint configurations using the YAML format are not supported.

    When loading a legacy ESLint configuration, Biome resolves the extends field.
    It resolves both shared configurations and plugin presets!
    To do this, it invokes Node.js.

    Biome relies on the metadata of its rules to determine the equivalent rule of an ESLint rule.
    A Biome rule is either inspired or roughly identical to an ESLint rules.
    By default, inspired and nursery rules are excluded from the migration.
    You can use the CLI flags --include-inspired and --include-nursery to migrate them as well.

    Note that this is a best-effort approach.
    You are not guaranteed to get the same behavior as ESLint.

    Given the following ESLint configuration:

    {
          "ignore_patterns": ["**/*.test.js"],
          "globals": { "var2": "readonly" },
          "rules": {
              "eqeqeq": "error"
          },
          "overrides": [{
              "files": ["lib/*.js"],
              "rules": {
                "default-param-last": "off"
              }
          }]
    }

    biome migrate eslint --write changes the Biome configuration as follows:

    {
      "linter": {
        "rules": {
          "recommended": false,
          "suspicious": {
            "noDoubleEquals": "error"
          }
        }
      },
      "javascript": { "globals": ["var2"] },
      "overrides": [{
        "include": ["lib/*.js"],
        "linter": {
          "rules": {
            "style": {
              "useDefaultParameterLast": "off"
            }
          }
        }
      }]
    }

    Also, if the working directory contains .eslintignore, then Biome migrates the glob patterns.
    Nested .eslintignore in subdirectories and negated glob patterns are not supported.

    If you find any issue, please don't hesitate to report them.

    Contributed by @Conaclos

Enhancements

  • Improve support of .prettierignore when migrating from Prettier

    Now, Biome translates most of the glob patterns in .prettierignore to the equivalent Biome ignore pattern.
    Only negated glob patterns are not supported.

    Contributed by @Conaclos

  • Support JavaScript configuration files when migrating from Prettier

    biome migrate prettier is now able to migrate Prettier configuration files
    ending with js, mjs, or cjs extensions.
    To do this, Biome invokes Node.js.

    Also, embedded Prettier configurations in package.json are now supported.

    Contributed by @Conaclos

  • Support overrides field in Prettier configuration files when migrating from Prettier.
    Contributed by @Conaclos

Bug fixes

  • Biome now tags the diagnostics emitted by organizeImports and formatter with correct severity levels, so they will be properly filtered by the flag --diagnositic-level (#2288). Contributed by @Sec-ant

  • Biome now correctly filters out files that are not present in the current directory when using the --changed flag #1996. Contributed by @castarco

Configuration

Bug fixes

  • Now setting group level all to false can disable recommended rules from that group when top level recommended is true or unset. Contributed by @Sec-ant

Enhancements

  • Biome now displays the location of a parsing error for its configuration file (#1627).

    Previously, when Biome encountered a parsing error in its configuration file,
    it didn't indicate the location of the error.
    It now displays the name of the configuration file and the range where the error occurred.

    Contributed by @Conaclos

  • options is no longer required for rules without any options (#2313).

    Previously, the JSON schema required to set options to null when an object is used to set the diagnostic level of a rule without any option.
    However, if options is set to null, Biome emits an error.

    The schema is now fixed and it no longer requires specifying options.
    This makes the following configuration valid:

    {
      "linter": {
        "rules": {
          "style": {
            "noDefaultExport": {
              "level": "off"
            }
          }
        }
      }
    }

    Contributed by @Conaclos

Editors

Bug fixes

Formatter

JavaScript APIs

Linter

New features

  • Add a new option ignoreReact to noUnusedImports.

    When ignoreReact is enabled, Biome ignores imports of React from the react package.
    The option is disabled by default.

    Contributed by @Conaclos

  • Implement #2043: The React rule useExhaustiveDependencies is now also compatible with Preact hooks imported from preact/hooks or preact/compat. Contributed by @arendjr

Enhancements

  • style/useFilenamingConvention now allows prefixing a filename with + (#2341).

    This is a convention used by Sveltekit and Vike.

    Contributed by @Conaclos

  • style/useNamingConvention now accepts PascalCase for local and top-level variables.

    This allows supporting local variables that hold a component or a regular class.
    The following code is now accepted:

    function loadComponent() {
      const Component = getComponent();
      return <Component />;
    }

    Contributed by @Conaclos

Bug fixes

  • Lint rules useNodejsImportProtocol, useNodeAssertStrict, noRestrictedImports, noNodejsModules will no longer check declare module statements anymore. Contributed by @Sec-ant

  • style/useNamingConvention now accepts any case for variables from object destructuring (#2332).

    The following name is now ignored:

    const { Strange_Style } = obj;

    Previously, the rule renamed this variable. This led to a runtime error.

    Contributed by @Conaclos

Parser

What's Changed

Other changes

  • chore: derive Diagnostic on enum by @arendjr in #2282
  • chore(deps): update dependency vite to v5.1.7 [security] by @renovate in #2290
  • feat(css_formatter): ValueListLayout::SingleLine by @denbezrukov in #2226
  • Describe multi-root workspace limitation in docs by @smikitky in #2297
  • refactor(project): new crate biome_configuration by @unvalley in #2269
  • refactor(biome_deserialize): replace is_type() with visitable_type() by @Conaclos in #2310
  • feat: graphql lexer by @vohoanglong0107 in #2271
  • docs: add warning around nested config by @ematipico in #2318
  • feat(cli): generic reporter APIs by @ematipico in #853
  • fix(js_analyzer): add graphics-symbol role by @drwpow in #2294
  • chore(ci): add update contributors workflow by @Sec-ant in #2333
  • chore(website): update contributors by @github-actions in #2334
  • fix(lint): noSvgWithoutTitle valid case to use aria-hidden correctly by @unvalley in #2340
  • fix(lint/useExhaustiveDependencies): unintended application of stable custom hook rules by @fluffy-takagi in #2328
  • chore(website): update contributors by @github-actions in #2344
  • chore(deps): pin dependencies by @renovate in #2345
  • chore(deps): update @biomejs packages by @renovate in #2346
  • chore(deps): update pnpm to v8.15.6 by @renovate in #2347
  • chore(ci): remove bots from contributors by @Sec-ant in #2349
  • chore(website): update contributors by @github-actions in #2352
  • chore(deps): update dependency dprint to v0.45.1 by @renovate in #2354
  • chore(deps): update rust crate serde_json to 1.0.115 by @renovate in #2351
  • chore(deps): update rust crate quote to 1.0.35 by @renovate in #2348
  • chore(deps): update rust crate regex to 1.10.4 by @renovate in #2350
  • chore(deps): update dependency eslint to v8.57.0 by @renovate in #2355
  • chore(deps): update rust crate bitflags to 2.5.0 by @renovate in #2356
  • refactor(linter): allow multiple rule sources by @Conaclos in #2336
  • chore(use-number-namespace.md): fix typo by @arienshibani in #2155
  • chore(website): update contributors by @github-actions in #2373
  • Add operation parsing rule for GraphQL parser by @vohoanglong0107 in #2327
  • docs(website): Getting Started and Formatter improvements by @Conaclos in #2379
  • chore(website): add yaml & graphql to language support & sync table rows by @afonsojramos in #2363
  • chore(website): update contributors by @github-actions in #2391

New Contributors

Full Changelog: cli/v1.6.4...cli/v1.6.4-nightly.abab451

Don't miss a new biome release

NewReleases is sending notifications on new releases.