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 19, 2024
1 parent 2ee686d commit 8ab56ab
Show file tree
Hide file tree
Showing 397 changed files with 1,917 additions and 2,286 deletions.
377 changes: 132 additions & 245 deletions .eslintrc.js

Large diffs are not rendered by default.

52 changes: 46 additions & 6 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,36 @@ 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:
matrix:
node-version: [16.x]
node-version: [20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
Expand All @@ -28,15 +51,32 @@ 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:

runs-on: ubuntu-latest

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

steps:
Expand All @@ -62,7 +102,7 @@ jobs:

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

# steps:
Expand All @@ -86,7 +126,7 @@ jobs:

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

# steps:
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 8ab56ab

Please sign in to comment.