Skip to content

🐛 overrides for specific include filenames, triggers checks with same filename (different case) in other paths #2421

@f15u

Description

@f15u

Environment information

CLI:
  Version:                      1.6.4
  Color support:                true

Platform:
  CPU Architecture:             x86_64
  OS:                           linux

Environment:
  BIOME_LOG_DIR:                unset
  NO_COLOR:                     unset
  TERM:                         "xterm"
  JS_RUNTIME_VERSION:           "v20.11.0"
  JS_RUNTIME_NAME:              "node"
  NODE_PACKAGE_MANAGER:         "pnpm/8.15.6"

Biome Configuration:
  Status:                       Loaded successfully
  Formatter disabled:           false
  Linter disabled:              false
  Organize imports disabled:    true
  VCS disabled:                 true

Workspace:
  Open Documents:               0

What happened?

Having this file structure:

.
├── biome.jsonc
├── ...
├── server.ts
├── source
│   ├── ...
│   └── Shared
│       └── Infrastructure
│           ├── ...
│           └── Server.ts
├── ...

and this configuration:

{
	"$schema": "https://biomejs.dev/schemas/1.6.4/schema.json",
	"files": {
		"ignoreUnknown": true,
		"include": ["config/**/*.ts", "source/**/*.ts", "server.ts"]
	},
	"linter": {
		"enabled": true,
		"rules": {
			"style": {
				"useFilenamingConvention": {
					"level": "error",
					"options": {
						"requireAscii": true,
						"filenameCases": ["PascalCase", "export"]
					}
				}
			},
		}
	},
	"overrides": [
		{
			"include": ["./server.ts"],
			"linter": {
				"rules": {
					"style": {
						"useFilenamingConvention": {
							"level": "error",
							"options": {
								"filenameCases": ["camelCase", "export"]
							}
						}
					}
				}
			}
		}
	]
}

Running biome check --config-path ./ --apply ./ results in an error:

./source/Shared/Infrastructure/Server.ts lint/style/useFilenamingConvention ━━━━━━━━━━━━━━━━━━━━━━━━

  ✖ The filename should be in camelCase or equal to the name of an export.
  
  ℹ The filename could be renamed to one of the following names:
    server.ts
  

Checked 18 files in 375ms. No fixes needed.
Found 1 error.

Expected result

I expect the override function to apply the configuration only in included files, server.ts in the root in this particular case and matching the case too.

I suppose there is a match with the filename so ./server.ts matches my ./Server.ts regardless how deep is in another folder and its case.

Code of Conduct

  • I agree to follow Biome's Code of Conduct

Metadata

Metadata

Assignees

Labels

A-ProjectArea: projectS-Bug-confirmedStatus: report has been confirmed as a valid bug

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions