Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(useFilenamingConvention): accept filename in unicase #3356

Merged
merged 1 commit into from
Jul 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,20 @@ our [guidelines for writing a good changelog entry](https://github.com/biomejs/b

Contributed by @Conaclos

- [useFilenamingConvention](https://biomejs.dev/linter/rules/use-filenaming-convention) now supports [unicase](https://en.wikipedia.org/wiki/Unicase) letters.

[unicase](https://en.wikipedia.org/wiki/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](https://github.com/biomejs/biome/issues/3353).
Filenames consisting only of numbers are now accepted.

Contributed by @Conaclos

#### Bug fixes

- Don't request alt text for elements hidden from assistive technologies ([#3316](https://github.com/biomejs/biome/issues/3316)). Contributed by @robintown
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ declare_lint_rule! {
///
/// ## Ignoring some files
///
/// Sometimes you want to completly ignore some files.
/// Sometimes you want to completely ignore some files.
/// Biome ignore comments cannot be used because the rule applies on filenames not file contents.
/// To ignore files, you can use [`overrides`](https://biomejs.dev/reference/configuration/#overrides).
/// If you want to ignore all files in the `test` directory, then you can disable the rule for those files only:
Expand Down Expand Up @@ -151,7 +151,7 @@ impl Rule for UseFilenamingConvention {
if !allowed_cases.is_empty() {
let trimmed_name = name.trim_matches('_');
let case = Case::identify(trimmed_name, options.strict_case);
if allowed_cases.contains(case) {
if (allowed_cases | Case::Uni).contains(case) {
return None;
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
source: crates/biome_js_analyze/tests/spec_tests.rs
expression: _404.tsx
---
# Input
```tsx

```
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
source: crates/biome_js_analyze/tests/spec_tests.rs
expression: 안녕하세요.js
---
# Input
```jsx

```