Skip to content

Commit

Permalink
[js] change default formatter for JavaScript/TypeScript from clang-fo…
Browse files Browse the repository at this point in the history
…rmat to Prettier (#21728)

### Description

See
454996d
for manual changes (excluded auto-generated formatting changes)

### Why

Because the toolsets for old clang-format is out-of-date. This reduces
the development efficiency.

- The NPM package `clang-format` is already in maintenance mode. not
updated since 2 years ago.
- The VSCode extension for clang-format is not maintained for a while,
and a recent Node.js security update made it not working at all in
Windows.

No one in community seems interested in fixing those.

Choose Prettier as it is the most popular TS/JS formatter.

### How to merge

It's easy to break the build:
- Be careful of any new commits on main not included in this PR.
- Be careful that after this PR is merged, other PRs that already passed
CI can merge.

So, make sure there is no new commits before merging this one, and
invalidate js PRs that already passed CI, force them to merge to latest.
  • Loading branch information
fs-eire authored Aug 14, 2024
1 parent 6d8de1f commit abdc31d
Show file tree
Hide file tree
Showing 304 changed files with 31,055 additions and 27,231 deletions.
1 change: 0 additions & 1 deletion .lintrunner.toml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ include_patterns = [
]
exclude_patterns = [
'java/**', # FIXME: Enable clang-format for java
'js/**',
'onnxruntime/contrib_ops/cuda/bert/tensorrt_fused_multihead_attention/**', # Contains data chunks
'onnxruntime/core/flatbuffers/schema/*.fbs.h', # Generated code
'onnxruntime/test/flatbuffers/*.fbs.h', # Generated code
Expand Down
16 changes: 0 additions & 16 deletions js/.clang-format

This file was deleted.

Loading

0 comments on commit abdc31d

Please sign in to comment.