-
-
Notifications
You must be signed in to change notification settings - Fork 618
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert to ESLint 9 flat config and move to pnpm, use .mjs and new jest types #2548
Open
SleeplessByte
wants to merge
7
commits into
main
Choose a base branch
from
chore/pnpm
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
d4028e4
Initial work to mjs, ESLint 9, and newwer jest
SleeplessByte a11146d
Start switching workflows to pnpm
SleeplessByte 3690000
Update docs for corepack and pnpm
SleeplessByte c900eb4
Add missing step for changed files
SleeplessByte b07b336
Add jest imports
SleeplessByte 0bb2149
Fix test configuration
SleeplessByte ee621f8
Fix texts
SleeplessByte File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/node_modules | ||
/bin/configlet | ||
/bin/configlet.exe | ||
/pnpm-lock.yaml | ||
/package-lock.json | ||
/yarn.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,5 +7,6 @@ | |
// because of how whitespace is (not) rendered. | ||
65 | ||
] | ||
} | ||
}, | ||
"cSpell.words": ["xtest"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module.exports = { | ||
presets: ['@exercism/babel-preset-javascript'], | ||
presets: [['@exercism/babel-preset-javascript', { corejs: '3.38' }]], | ||
plugins: [], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,50 @@ | ||
#!/bin/bash | ||
#!/usr/bin/env bash | ||
|
||
if [ -z "$EXERCISM_PRETTIER_VERSION" ]; then | ||
echo "Pulling prettier version from package.json" | ||
EXERCISM_PRETTIER_VERSION=$(npm list prettier | grep -Po '.*\sprettier@\K.*') | ||
set -uo pipefail | ||
|
||
if [ -z "${EXERCISM_PRETTIER_VERSION:-}" ]; then | ||
echo "[format] pulling prettier version from pnpm list using sed" | ||
EXERCISM_PRETTIER_VERSION="$(corepack pnpm list prettier --parseable | sed -n -e '1,$s/^.*prettier@//' -e 's/\\node_modules\\prettier//p')" | ||
echo "[format] expected version is now ${EXERCISM_PRETTIER_VERSION:-}" | ||
fi | ||
|
||
if [ -z "${EXERCISM_PRETTIER_VERSION:-}" ]; then | ||
echo "[format] pulling prettier version via pnpm-lock.yaml using grep" | ||
EXERCISM_PRETTIER_VERSION="$(cat pnpm-lock.yaml | grep -Po ' prettier@\K[^:]+')" | ||
echo "[format] expected version is now ${EXERCISM_PRETTIER_VERSION:-}" | ||
fi | ||
|
||
if [ -z "$EXERCISM_PRETTIER_VERSION" ]; then | ||
if [ -z "${EXERCISM_PRETTIER_VERSION:-}" ]; then | ||
echo "Version could not be pulled using sed or grep" >&2 | ||
echo "" | ||
echo "---------------------------------------------------" | ||
echo "This script requires the EXERCISM_PRETTIER_VERSION variable to work." | ||
echo "Please see https://exercism.org/docs/building/markdown/style-guide for guidance." | ||
echo "---------------------------------------------------" | ||
echo "This is what npm list reports:" | ||
echo "$(npm list prettier)" | ||
echo "$(corepack pnpm -v)" | ||
echo "" | ||
echo "This is what corepack pnpm list reports:" | ||
echo "$ corepack pnpm list prettier --parseable" | ||
echo "$(corepack pnpm list prettier --parseable)" | ||
echo "" | ||
echo "And corepack pnpm info reports the following:" | ||
echo "$ corepack pnpm info prettier" | ||
echo "$(corepack pnpm info prettier)" | ||
echo "" | ||
echo "This is the version that can be extracted using sed:" | ||
echo "$ corepack pnpm list prettier --parseable | sed -n -e '1,\$s/^.*prettier@//' -e 's/\\node_modules\\prettier//p'" | ||
echo "└─ $(corepack pnpm list prettier --parseable | sed -n -e '1,$s/^.*prettier@//' -e 's/\\node_modules\\prettier//p')" | ||
echo "" | ||
echo "This is the version that can be extracted:" | ||
echo "$(npm list prettier | grep -Po '.*\sprettier@\K.*')" | ||
echo "This is the version that can be extracted using grep:" | ||
echo "$ cat pnpm-lock.yaml | grep -Po ' prettier@\K[^:]+'" | ||
echo "└─ $(cat pnpm-lock.yaml | grep -Po ' prettier@\K[^:]+')" | ||
echo "" | ||
echo "These files are found in the repo root:" | ||
echo "$(ls -p | grep -v /)" | ||
echo "---------------------------------------------------" | ||
exit 1 | ||
else | ||
echo "Running format with prettier@$EXERCISM_PRETTIER_VERSION" | ||
echo "[format] running with prettier@$EXERCISM_PRETTIER_VERSION" | ||
fi | ||
|
||
npx "prettier@$EXERCISM_PRETTIER_VERSION" --check "*/**/*.{js,jsx,ts,tsx,css,sass,scss,html,json,md,yml}" | ||
corepack pnpm dlx "prettier@$EXERCISM_PRETTIER_VERSION" --check "**/*.{js,jsx,cjs,mjs,ts,tsx,css,sass,scss,html,json,md,yml}" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this intended for here or was it an artifact?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eh. Yeah i run spellcheck locally but didn't mean to commit this I think.