Skip to content
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

refactor[scripts/prettier]: respect .prettierignore when resolving js files via glob #27627

Merged
merged 1 commit into from
Oct 30, 2023

Conversation

hoxyq
Copy link
Contributor

@hoxyq hoxyq commented Oct 30, 2023

This script is used on CI in yarn_lint job. With current glob call settings, it includes a bunch of build files, which are actually ignored by listing them in .prettierignore. This check is not failing only because there is no build step before it.

If you run node ./scripts/prettier/index with build files present, you will see a bunch of files listed as non-formatted. These changes add a simple logic to include all paths listed in .prettierignore to ignore list of glob call with transforming them from gitignore-style to glob-style.

This should unblock CI for #27612, where flow-typed directory will be added, turned out that including it in .prettierignore is not enough.

@facebook-github-bot facebook-github-bot added CLA Signed React Core Team Opened by a member of the React Core Team labels Oct 30, 2023
@hoxyq hoxyq force-pushed the consider-prettierignore-in-prettier-lint branch from 5f3b5b3 to 44b3db5 Compare October 30, 2023 14:03
@react-sizebot
Copy link

react-sizebot commented Oct 30, 2023

Comparing: 3e09c27...44b3db5

Critical size changes

Includes critical production bundles, as well as any change greater than 2%:

Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable/react-dom/cjs/react-dom.production.min.js = 175.09 kB 175.09 kB = 54.47 kB 54.47 kB
oss-experimental/react-dom/cjs/react-dom.production.min.js = 177.21 kB 177.21 kB = 55.16 kB 55.16 kB
facebook-www/ReactDOM-prod.classic.js = 567.70 kB 567.70 kB = 99.96 kB 99.96 kB
facebook-www/ReactDOM-prod.modern.js = 551.56 kB 551.56 kB = 97.06 kB 97.06 kB

Significant size changes

Includes any change greater than 0.2%:

(No significant changes)

Generated by 🚫 dangerJS against 44b3db5

@hoxyq hoxyq merged commit 0c63487 into facebook:main Oct 30, 2023
36 checks passed
@hoxyq hoxyq deleted the consider-prettierignore-in-prettier-lint branch October 30, 2023 15:32
gnoff added a commit to gnoff/next.js that referenced this pull request Oct 30, 2023
ijjk pushed a commit to vercel/next.js that referenced this pull request Oct 30, 2023
EdisonVan pushed a commit to EdisonVan/react that referenced this pull request Apr 15, 2024
… files via glob (facebook#27627)

This script is used on CI in `yarn_lint` job. With current `glob` call
settings, it includes a bunch of build files, which are actually ignored
by listing them in `.prettierignore`. This check is not failing only
because there is no build step before it.

If you run `node ./scripts/prettier/index` with build files present, you
will see a bunch of files listed as non-formatted. These changes add a
simple logic to include all paths listed in `.prettierignore` to ignore
list of `glob` call with transforming them from gitignore-style to
glob-style.

This should unblock CI for facebook#27612,
where `flow-typed` directory will be added, turned out that including it
in `.prettierignore` is not enough.
bigfootjon pushed a commit that referenced this pull request Apr 18, 2024
… files via glob (#27627)

This script is used on CI in `yarn_lint` job. With current `glob` call
settings, it includes a bunch of build files, which are actually ignored
by listing them in `.prettierignore`. This check is not failing only
because there is no build step before it.

If you run `node ./scripts/prettier/index` with build files present, you
will see a bunch of files listed as non-formatted. These changes add a
simple logic to include all paths listed in `.prettierignore` to ignore
list of `glob` call with transforming them from gitignore-style to
glob-style.

This should unblock CI for #27612,
where `flow-typed` directory will be added, turned out that including it
in `.prettierignore` is not enough.

DiffTrain build for commit 0c63487.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed React Core Team Opened by a member of the React Core Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants