Skip to content

Commit

Permalink
refactor(useFilenamingConvention): accept filename in unicase (#3356)
Browse files Browse the repository at this point in the history
  • Loading branch information
Conaclos authored Jul 5, 2024
1 parent 7e485c2 commit 1218c3a
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 2 deletions.
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
Empty file.
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

```
Empty file.
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

```

0 comments on commit 1218c3a

Please sign in to comment.