Skip to content

fix: npm run format script glob matches only directories #216

Description

@dobby-coder

Finding

The `format` script in `package.json` is:

```json
"format": "prettier --write src/**/"
```

The trailing slash on `src/**/` makes the glob expand to directories only, so prettier receives a list of directory paths and either no-ops or errors depending on shell expansion. The script does not actually format the source files as the name suggests.

Reproducer

```
$ npm run format

expands to: prettier --write src/lib/ src/routes/ src/lib/components/ ...

(directories, not files)

```

Suggested fix

```json
"format": "prettier --write ."
```

This matches the `lint` script's existing scope (`prettier --check .`) so `format` and `lint` stay symmetric. Repo's `.prettierignore` (if any) already governs exclusions.

File / line

  • `package.json:13`

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions