cli/v1.8.4-nightly.bd1d0c6
版本发布时间: 2024-08-04 18:20:26
biomejs/biome最新发布版本:js-api/v0.7.1(2024-10-02 00:17:16)
Analyzer
Enhancements
- Implement css suppression action. Contributed by @togami2864
- Add support of comments in
turbo.json
. Contributed by @Netail
CLI
New features
- Add
--graphql-linter-enabled
option, to control whether the linter should be enabled or not for GraphQL files. Contributed by @ematipico - The option
--max-diagnostics
now accept anone
value, which lifts the limit of diagnostics shown. Contributed by @ematipico
Enhancements
-
When a
--reporter
is provided, and it's different from the default one, the value provided by via--max-diagnostics
is ignored and the limit is lifted. Contributed by @ematipico -
biome init
now generates a new config file with more options set. This change intends to improve discoverability of the options and to set the more commonly used options to their default values. Contributed by Conaclos
Bug fixes
-
biome lint --write
now takes--only
and--skip
into account (#3470). Contributed by Conaclos
Configuration
- Add support for loading configuration from
.editorconfig
files (#1724). Contributed by @dyc3 Configuration supplied in.editorconfig
will be overridden by the configuration inbiome.json
. Support is disabled by default and can be enabled by adding the following to your formatter configuration inbiome.json
:{ "formatter": { "useEditorconfig": true } }
Formatter
Enhancements
-
Add parentheses for nullcoalescing in ternaries.
This change aligns on Prettier 3.3.3. This adds clarity to operator precedence.
- foo ? bar ?? foo : baz; + foo ? (bar ?? foo) : baz;
Contributed by @Conaclos
Bug fixes
-
Keep the parentheses around
infer
declarations in type unions and type intersections (#3419). Contributed by @Conaclos -
Keep parentheses around a
yield
expression inside a type assertion.Previously, Biome removed parentheses around some expressions that require them inside a type assertion. For example, in the following code, Biome now preserves the parentheses.
function* f() { return <T>(yield 0); }
Contributed by @Conaclos
-
Remove parentheses around expressions that don't need them inside a decorator.
Biome now matches Prettier in the following cases:
class { - @(decorator) + @decorator method() {} }, class { - @(decorator()) + @decorator() method() {} }, class { @(decorator?.()) method() {} },
Contributed by @Conaclos
-
Keep parentheses around objects preceded with a
@satisfies
comment.In the following example, parentheses are no longer removed.
export const PROPS = /** @satisfies {Record<string, string>} */ ({ prop: 0, });
Contributed by @Conaclos
Linter
New features
-
Add support for GraphQL linting. Contributed by @ematipico
-
Add nursery/noDynamicNamespaceImportAccess. Contributed by @minht11
-
noUndeclaredVariables no longer reports a direct reference to an enum member (#2974).
In the following code, the
A
reference is no longer reported as an undeclared variable.enum E { A = 1, B = A << 1, }
Contributed by @Conaclos
-
Add nursery/noIrregularWhitespace. Contributed by @michellocana
-
Implement
noIrreguluarWhitespace
for CSS. Contributed by @DerTimonius -
Add nursery/useTrimStartEnd. Contributed by @chansuke
Enhancements
-
noInvalidUseBeforeDeclaration now reports direct use of an enum member before its declaration.
In the following code,
A
is reported as use before its declaration.enum E { B = A << 1, A = 1, }
Contributed by @Conaclos
-
useFilenamingConvention now supports unicase letters.
unicase letters have a single case: they are neither uppercase nor lowercase. Biome now accepts filenames in unicase. For example, the filename
안녕하세요
is now accepted.We still reject a name that mixes unicase characters with lowercase or uppercase characters. For example, the filename
A안녕하세요
is rejected.This change also fixes #3353. Filenames consisting only of numbers are now accepted.
Contributed by @Conaclos
-
useFilenamingConvention now supports Next.js/Nuxt/Astro dynamic routes (#3465).
Next.js, SolidStart, Nuxt, and Astro support dynamic routes such as
[...slug].js
and[[...slug]].js
.Biome now recognizes this syntax.
slug
must contain only alphanumeric characters.Contributed by @Conaclos
-
useExportType no longer report empty
export
(#3535).An empty
export {}
allows you to force TypeScript to consider a file with no imports and exports as an EcmaScript module. Whileexport type {}
is valid, it is more common to useexport {}
. Users may find it confusing that the linter asks them to convert it toexport type {}
. Also, a bundler should be able to removeexport {}
as well asexport type {}
. So it is not so useful to reportexport {}
.Contributed by @Conaclos
-
noUnusedVariables now checks TypeScript declaration files.
This allows to report a type that is unused because it isn't exported. Global declarations files (declarations files without exports and imports) are still ignored.
Contributed by @Conaclos
Bug fixes
-
Don't request alt text for elements hidden from assistive technologies (#3316). Contributed by @robintown
-
Fix [#3149] crashes that occurred when applying the
noUselessFragments
unsafe fixes in certain scenarios. Contributed by @unvalley -
noExcessiveNestedTestSuites
: Fix another edge case where the rule would alert on heavily nested zod schemas. Contributed by @dyc3 -
noExtraNonNullAssertion
no longer reports a single non-null assertion enclosed in parentheses (#3352). Contributed by @Conaclos -
useAdjacentOverloadSignatures
no longer reports a#private
class member and a public class member that share the same name (#3309).The following code is no longer reported:
class C { #f() {} g() {} f() {} }
Contributed by @Conaclos
-
useNamingConvention now accepts applying custom convention on abstract classes. Contributed by @Conaclos
-
useNamingConvention no longer suggests an empty fix when a name doesn't match strict Pascal case (#3561).
Previously the following code led
useNamingConvention
to suggest an empty fix. The rule no longer provides a fix for this case.type AAb = any
Contributed by @Conaclos
-
useNamingConvention no longer provides fixes for global TypeScript declaration files.
Global TypeScript declaration files have no epxorts and no imports. All the declared types are available in all files of the project. Thus, it is not safe to propose renaming only in the declaration file.
Contributed by @Conaclos
Parser
Bug fixes
- Fix #3287 nested selectors with pseudo-classes. Contributed by @denbezrukov
- Fix #3349 allow CSS multiple ampersand support. Contributed by @denbezrukov
.class {
&& {
color: red;
}
}
- Fix #3410 by correctly parsing break statements containing keywords.
Contributed by @ah-yuout: while (true) { break out; }
What's Changed
Other changes
- fix(codegen): create output directory if it doesn't exist by @dyc3 in https://github.com/biomejs/biome/pull/3389
- refactor(codegen): generate most functions on
LanguageKind
with a macro by @dyc3 in https://github.com/biomejs/biome/pull/3380 - chore(grit): add auto-wrap + integrate with
search
command by @arendjr in https://github.com/biomejs/biome/pull/3288 - refactor(formatter_test): refactor
TestFormatLanguage
trait by @ah-yu in https://github.com/biomejs/biome/pull/3395 - feat(css_parser): introduce grit metavariable by @ah-yu in https://github.com/biomejs/biome/pull/3340
- feat(lint): add rule
useStrictMode
by @ematipico in https://github.com/biomejs/biome/pull/3370 - refactor(js_semantic): use range start to identify the declaration in read/write by @Conaclos in https://github.com/biomejs/biome/pull/3404
- chore(grit): add Grit testing infrastructure by @arendjr in https://github.com/biomejs/biome/pull/3406
- refactor(js_semantic): wrap scope id for niche optimization and clarity by @Conaclos in https://github.com/biomejs/biome/pull/3408
- refactor(js_analyze): improve restricted regex error meesages by @Conaclos in https://github.com/biomejs/biome/pull/3412
- refactor(js_semantic): minor changes by @Conaclos in https://github.com/biomejs/biome/pull/3416
- fix: fix typo in URL for noEvolvingTypes rule in diagnostics categories by @ynishimura in https://github.com/biomejs/biome/pull/3413
- fix(grit): correct calculation of line and column numbers by @arendjr in https://github.com/biomejs/biome/pull/3409
- fix(deserialize): unescape JSON strings by @Conaclos in https://github.com/biomejs/biome/pull/3414
- refactor(js_semantic): reduce semantic data size and make some cleanup by @Conaclos in https://github.com/biomejs/biome/pull/3417
- fix(biome-css-parser): incorrect option name in hint when using
:global
in CSS module by @shulaoda in https://github.com/biomejs/biome/pull/3420 - docs(js_semantic): update docs and comments by @Conaclos in https://github.com/biomejs/biome/pull/3421
- feat(yaml): more comprehensive grammar by @dyc3 in https://github.com/biomejs/biome/pull/3400
- fix(css_parser): fix Parser is no longer progressing #3284 by @denbezrukov in https://github.com/biomejs/biome/pull/3433
- fix(deps): update dependency prettier to v3.3.3 by @renovate in https://github.com/biomejs/biome/pull/3436
- chore(deps): update github-actions by @renovate in https://github.com/biomejs/biome/pull/3435
- chore(deps): update dependency dprint to v0.47.2 by @renovate in https://github.com/biomejs/biome/pull/3434
- chore(deps): update dependency eslint to v9.7.0 by @renovate in https://github.com/biomejs/biome/pull/3437
- ci: add script to correctly update packages during the release by @ematipico in https://github.com/biomejs/biome/pull/3423
- feat(lint): add
useConsistentCurlyBraces
by @dyc3 in https://github.com/biomejs/biome/pull/3182 - feat(lint/noStaticElementInteractions): add rule by @ryo-ebata in https://github.com/biomejs/biome/pull/2981
- chore: tidy-up licenses by @ematipico in https://github.com/biomejs/biome/pull/3438
- feat(graphql_parser): separate binding and reference nodes by @vohoanglong0107 in https://github.com/biomejs/biome/pull/3427
- fix(grit): fix matching array types by @arendjr in https://github.com/biomejs/biome/pull/3445
- fix(grit): match object literal by @arendjr in https://github.com/biomejs/biome/pull/3447
- fix(grit): leaf node normalization by @arendjr in https://github.com/biomejs/biome/pull/3448
- refactor: replace
biome_rowan::*
type into biome type by @chansuke in https://github.com/biomejs/biome/pull/3431 - chore: add new bronze sponsor by @ematipico in https://github.com/biomejs/biome/pull/3449
- chore(grit): compact snapshot range by @arendjr in https://github.com/biomejs/biome/pull/3455
- fix(lint/useConsistentCurlyBraces): specify correct language type by @chansuke in https://github.com/biomejs/biome/pull/3452
- chore: fix rules check snippet to emit an error code by @ematipico in https://github.com/biomejs/biome/pull/3458
- fix(js_analyze): handle shorthand property renaming by @Conaclos in https://github.com/biomejs/biome/pull/3454
- fix(lint/useHookAtTopLevel): don't flag jest function calls that look like hooks by @dyc3 in https://github.com/biomejs/biome/pull/3415
- fix(grit): improved diagnostics by @arendjr in https://github.com/biomejs/biome/pull/3456
- chore: update pnpm and remove workaround by @SuperchupuDev in https://github.com/biomejs/biome/pull/3467
- feat: noValueAtRule css lint rule by @rishabh3112 in https://github.com/biomejs/biome/pull/3293
- refactor(core): register syntax rules via visitor by @ematipico in https://github.com/biomejs/biome/pull/3471
- feat(graphql_semantic): build semantic model from AST by @vohoanglong0107 in https://github.com/biomejs/biome/pull/3378
- chore: add myself as maintainer by @dyc3 in https://github.com/biomejs/biome/pull/3480
- chore(deps): update rust crate lazy_static to 1.5.0 by @renovate in https://github.com/biomejs/biome/pull/3490
- chore(deps): update rust crate bitflags to 2.6.0 by @renovate in https://github.com/biomejs/biome/pull/3489
- chore(deps): update pnpm to v9.6.0 by @renovate in https://github.com/biomejs/biome/pull/3488
- chore(deps): update softprops/action-gh-release action to v2.0.8 by @renovate in https://github.com/biomejs/biome/pull/3487
- chore(deps): update rust crate tokio to 1.38.1 by @renovate in https://github.com/biomejs/biome/pull/3486
- chore(deps): update @biomejs packages by @renovate in https://github.com/biomejs/biome/pull/3485
- fix: noCommentText does not work when any other text is a child(#3298) by @ryo-ebata in https://github.com/biomejs/biome/pull/3446
- refactor(core): register rules using visitor pattern by @ematipico in https://github.com/biomejs/biome/pull/3483
- chore(deps): update dependency typescript to v5.5.4 by @renovate in https://github.com/biomejs/biome/pull/3502
- chore(deps): update docker/login-action action to v3.3.0 by @renovate in https://github.com/biomejs/biome/pull/3503
- chore(deps): update pnpm/action-setup action to v4 by @renovate in https://github.com/biomejs/biome/pull/3505
- fix(js_formater): strip useless quotes by @suxin2017 in https://github.com/biomejs/biome/pull/3492
- chore(deps): update rust crate similar to 2.6.0 by @renovate in https://github.com/biomejs/biome/pull/3504
- chore(deps): update rust crate dashmap to 5.5.3 by @renovate in https://github.com/biomejs/biome/pull/3507
- chore(deps): update rust crate ignore to 0.4.22 by @renovate in https://github.com/biomejs/biome/pull/3508
- chore(deps): update rust crate bpaf to 0.9.12 by @renovate in https://github.com/biomejs/biome/pull/3506
- chore(js_formatter): update prettier compat reports by @Conaclos in https://github.com/biomejs/biome/pull/3514
- chore: add silver sponsor by @ematipico in https://github.com/biomejs/biome/pull/3517
- chore: new bronze sponsor by @ematipico in https://github.com/biomejs/biome/pull/3519
- refactor: consistently use
cast
,cast_ref
andtry_cast
by @Conaclos in https://github.com/biomejs/biome/pull/3520 - refactor: remove try_cast_node by @Conaclos in https://github.com/biomejs/biome/pull/3521
- refactor(js_formatter): reduce copy by taking ownership in
needs_parentheses_with_parent
by @Conaclos in https://github.com/biomejs/biome/pull/3526 - docs: update contributing guidelines according to previous changes by @YuriyBl in https://github.com/biomejs/biome/pull/3527
- refactor(js_formatter): remove
NeedsParentheses::needs_parentheses_aith_parent
by @Conaclos in https://github.com/biomejs/biome/pull/3528 - refactor(biome_deserialize): use
enumflags2
by @RiESAEX in https://github.com/biomejs/biome/pull/3529 - chore(deps): update rust crate serde_json to 1.0.121 by @renovate in https://github.com/biomejs/biome/pull/3539
- chore(deps): update dependency eslint to v9.8.0 by @renovate in https://github.com/biomejs/biome/pull/3540
- chore(deps): update codspeedhq/action action to v2.4.4 by @renovate in https://github.com/biomejs/biome/pull/3538
- chore(deps): update @biomejs packages by @renovate in https://github.com/biomejs/biome/pull/3537
- fix(formatter): prevent line break when comment follows end of attributes, irrespective of bracketSameLine value by @satojin219 in https://github.com/biomejs/biome/pull/3534
- refactor(js_formatter): move
NeedsParentheses
trait tobiome_js_syntax
by @Conaclos in https://github.com/biomejs/biome/pull/3541 - fix(js_formatter): add parens to match Prettier by @Conaclos in https://github.com/biomejs/biome/pull/3552
- chore(js_formatter): ignore files with only bogus nodes for generating prettier compat reports by @Conaclos in https://github.com/biomejs/biome/pull/3553
- feat(js_parser): support metavariables by @arendjr in https://github.com/biomejs/biome/pull/3548
- fix(js_formatter): normalize keys then check if quotes are needed by @Conaclos in https://github.com/biomejs/biome/pull/3558
- chore: config Dockerfile.benchmark in gitattributes by @o-az in https://github.com/biomejs/biome/pull/3516
- refactor(formatter): improve string normalization by @Conaclos in https://github.com/biomejs/biome/pull/3564
- fix(cli): apply offsets for htmlish js file sources by @dyc3 in https://github.com/biomejs/biome/pull/3494
- feat(grit): implement variable matching by @arendjr in https://github.com/biomejs/biome/pull/3575
New Contributors
- @ynishimura made their first contribution in https://github.com/biomejs/biome/pull/3413
- @shulaoda made their first contribution in https://github.com/biomejs/biome/pull/3420
- @ryo-ebata made their first contribution in https://github.com/biomejs/biome/pull/2981
- @rishabh3112 made their first contribution in https://github.com/biomejs/biome/pull/3293
- @YuriyBl made their first contribution in https://github.com/biomejs/biome/pull/3527
- @RiESAEX made their first contribution in https://github.com/biomejs/biome/pull/3529
- @satojin219 made their first contribution in https://github.com/biomejs/biome/pull/3534
- @o-az made their first contribution in https://github.com/biomejs/biome/pull/3516
Full Changelog: https://github.com/biomejs/biome/compare/cli/v1.8.4-nightly.a579bf7...cli/v1.8.4-nightly.bd1d0c6
1、 biome-darwin-arm64 21.57MB
2、 biome-darwin-x64 23.19MB
3、 biome-linux-arm64 23.25MB
4、 biome-linux-arm64-musl 20.63MB
5、 biome-linux-x64 26.36MB
6、 biome-linux-x64-musl 25.53MB
7、 biome-win32-arm64.exe 24.97MB
8、 biome-win32-x64.exe 29.63MB