Skip to content

Commit

Permalink
[v3] [Proposal] Bring prettier to the v3
Browse files Browse the repository at this point in the history
One of the bigger pain points of backporting fixes and improvements to
the v3 is due to the fact that we rely on prettier for the v4 but not on
the v3, leading to huge conflicts in the end mostly related to different
formatting.

This PR proposes that we bring prettier and a similar eslint config to
the v3 just to ease comparisons between both major versions.

Note that some eslint rules enabled on the v4 are here not enabled,
mostly `eqeqeq` and `no-nested-ternaries`(both because that's a lot of
work).

For that second rule, the fact that we also run prettier may lead to code
harder to read than before.
  • Loading branch information
peaBerberian committed Sep 13, 2024
1 parent 9be06de commit 605dc27
Show file tree
Hide file tree
Showing 396 changed files with 1,686 additions and 2,077 deletions.
377 changes: 132 additions & 245 deletions .eslintrc.js

Large diffs are not rendered by default.

44 changes: 42 additions & 2 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,31 @@ on:
types: [opened, synchronize, reopened]

jobs:
check:
format_check:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- uses: actions-rs/toolchain@v1
with:
toolchain: stable

- run: npm install
- run: rustup target add wasm32-unknown-unknown
- run: npm run fmt:prettier:check
- run: npm run fmt:rust:check

typechecking_and_linting:
runs-on: ubuntu-latest

strategy:
Expand All @@ -28,7 +51,24 @@ jobs:
cache: 'npm'
- run: npm install
- run: npm run check
- run: npm run test:unit

unit_tests:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- run: npm install
- run: npm run test:unit

integration_linux:

Expand Down
4 changes: 4 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"printWidth": 90,
"proseWrap": "always"
}
Loading

0 comments on commit 605dc27

Please sign in to comment.