Skip to content

style: align Prettier with rero-ils-ui and format codebase - #15

Merged
Garfield-fr merged 2 commits into
rero:mainfrom
Garfield-fr:chore/prettier-format
Nov 24, 2026
Merged

Garfield-fr merged 2 commits into
rero:mainfrom
Garfield-fr:chore/prettier-format

Conversation

@Garfield-fr

@Garfield-fr Garfield-fr commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Aligns the Prettier setup with rero-ils-ui, then formats the whole repository with it. prettier --check . reported 40 unformatted files before this PR. Apart from the two changes described under "Other changes", the code diff is formatting only (line wrapping, trailing commas, quotes, import order).

Configuration, copied from rero-ils-ui

  • .prettierrc: same file as rero-ils-ui. printWidth goes from 100 to 120, bracketSameLine is enabled, and imports are sorted by @ianvs/prettier-plugin-sort-imports.
  • eslint-plugin-simple-import-sort is removed. Prettier now sorts imports, as in rero-ils-ui, whose ESLint config does no import sorting. Keeping both sorters would make them fight over the import order.
  • .editorconfig: adds end_of_line = lf and max_line_length = 120, as in rero-ils-ui.
  • .prettierignore (new): skips pnpm-lock.yaml, .angular, dist and coverage. The entries specific to rero-ils-ui (translations, CHANGELOG, ng-core checkout) do not apply here.
  • format and format:check scripts, also as in rero-ils-ui. They are documented in .ai/dev-commands.md.

Import order note: the plugin treats the path aliases (@shared/..., @env/...) as third-party modules. Only relative imports (./...) form a separate group. rero-ils-ui behaves the same way.

Other changes

Books result count. In books.html, the result count label was 144 characters on one line, so Prettier had to split it before the closing >. The label is now a resultLabel computed signal in books.ts. It renders the same text, the template line fits within 120 characters, and the plural is computed once instead of twice.

Documentation. .ai/angular-patterns.md had code examples in plain text, so Prettier would have flattened their indentation. They are now in ```ts code blocks. The "Zoneless component pattern" heading was also changed from # to ## to match the other sections.

Checks

  • pnpm format:check: passes
  • pnpm lint: passes
  • pnpm test: 22/22 tests pass
  • pnpm build: passes

🤖 Generated with Claude Code

Run prettier --write on the whole repository so prettier --check passes.
No logic change.

- add .prettierignore to skip pnpm-lock.yaml, which pnpm generates
- wrap the examples of .ai/angular-patterns.md in ts code blocks so
  Prettier keeps their indentation, and fix a heading level

Co-Authored-by: Bertrand Zuchuat <bertrand.zuchuat@rero.ch>
@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 47 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: dfa852c5-de41-4ace-b9db-378f0f590665
Commits

Reviewing files that changed from the base of the PR and between 2ce1d4f and d4023e4.

Files ignored due to path filters: 1

  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
Files selected for processing: 50

  • .ai/angular-patterns.md
  • .ai/dev-commands.md
  • .editorconfig
  • .prettierignore
  • .prettierrc
  • README.md
  • angular.json
  • eslint.config.ts
  • package.json
  • src/app/app.config.mock.ts
  • src/app/app.config.ts
  • src/app/app.routes.ts
  • src/app/app.ts
  • src/app/features/books/book-detail.ts
  • src/app/features/books/book.ts
  • src/app/features/books/books.html
  • src/app/features/books/books.routes.ts
  • src/app/features/books/books.ts
  • src/app/features/books/search.ts
  • src/app/features/books/service/open-library-api.ts
  • src/app/features/books/service/open-library-base.ts
  • src/app/features/books/service/open-library-mock.ts
  • src/app/features/books/service/open-library-results.json
  • src/app/features/home/home.ts
  • src/app/features/login/login.html
  • src/app/features/not-found/not-found.ts
  • src/app/features/sidebar/sidebar.html
  • src/app/features/sidebar/sidebar.ts
  • src/app/features/todo/model/todo.mock.ts
  • src/app/features/todo/service/todo.service.ts
  • src/app/features/todo/store/todo.store.ts
  • src/app/features/todo/todo.html
  • src/app/features/todo/todo.ts
  • src/app/shared/appSate/app-state-store.ts
  • src/app/shared/appSate/model/user.data.ts
  • src/app/shared/component/paginator.ts
  • src/app/shared/interceptor/http-response-error-interceptor.ts
  • src/app/shared/layout/layout.service.ts
  • src/app/shared/model/es-result.ts
  • src/app/shared/page-title-strategy.spec.ts
  • src/app/shared/page-title-strategy.ts
  • src/app/shared/store/paginator-feature.spec.ts
  • src/app/shared/store/paginator-feature.ts
  • src/app/shared/store/request-status-feature.spec.ts
  • src/app/shared/store/request-status-feature.ts
  • src/index.html
  • src/main.ts
  • tsconfig.app.json
  • tsconfig.spec.json
  • vite.config.mts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@Garfield-fr Garfield-fr changed the title style: format codebase with Prettier style: align Prettier with rero-ils-ui and format codebase Nov 24, 2026
- .prettierrc: same settings as rero-ils-ui (printWidth 120,
  bracketSameLine, imports sorted by @ianvs/prettier-plugin-sort-imports)
- remove eslint-plugin-simple-import-sort: Prettier now sorts imports,
  and two sorters with different orders would conflict
- .prettierignore: also skip .angular, dist and coverage
- .editorconfig: end_of_line lf and max_line_length 120, as in rero-ils-ui
- add format and format:check scripts, documented in .ai/dev-commands.md
- reformat the codebase with the new settings
- books: move the result count label to a computed signal so the
  template line fits within printWidth

Co-Authored-by: Bertrand Zuchuat <bertrand.zuchuat@rero.ch>
@Garfield-fr
Garfield-fr force-pushed the chore/prettier-format branch from 859015b to d4023e4 Compare November 24, 2026 07:03
@Garfield-fr
Garfield-fr merged commit e1f7fbb into rero:main Nov 24, 2026
3 checks passed
@Garfield-fr
Garfield-fr deleted the chore/prettier-format branch November 24, 2026 07:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant