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

chore: fail build on eslint warnings #6111

Merged
merged 1 commit into from
Jun 25, 2024

Conversation

threepointone
Copy link
Contributor

@threepointone threepointone commented Jun 20, 2024

Modify all the eslint commands to fail if any warnings are present.


This should fail, and pass once https://github.com/cloudflare/workers-sdk/pull/6001/files#r1648173873 is resolved

Copy link

changeset-bot bot commented Jun 20, 2024

⚠️ No Changeset found

Latest commit: db58c8b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@threepointone threepointone marked this pull request as ready for review June 20, 2024 21:52
@threepointone threepointone requested review from a team as code owners June 20, 2024 21:52
Copy link
Contributor

github-actions bot commented Jun 20, 2024

A wrangler prerelease is available for testing. You can install this latest build in your project with:

npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/9664540137/npm-package-wrangler-6111

You can reference the automatically updated head of this PR with:

npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/6111/npm-package-wrangler-6111

Or you can use npx with this latest build directly:

npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/9664540137/npm-package-wrangler-6111 dev path/to/script.js
Additional artifacts:
npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/9664540137/npm-package-create-cloudflare-6111 --no-auto-update
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/9664540137/npm-package-cloudflare-kv-asset-handler-6111
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/9664540137/npm-package-miniflare-6111
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/9664540137/npm-package-cloudflare-pages-shared-6111
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/9664540137/npm-package-cloudflare-vitest-pool-workers-6111

Note that these links will no longer work once the GitHub Actions artifact expires.


[email protected] includes the following runtime dependencies:

Package Constraint Resolved
miniflare workspace:* 3.20240620.0
workerd 1.20240620.1 1.20240620.1
workerd --version 1.20240620.1 2024-06-20

Please ensure constraints are pinned, and miniflare/workerd minor versions match.

@DaniFoldi
Copy link
Contributor

Hey Sunil 👋,

I'm not sure if changing the scripts here is the best approach for contributors.

In IDEs warnings and errors have separate colours for highlighting, and most people are probably used to red being errors, and yellow being warnings. Obviously, I'd avoid introducing new warnings whenever possible, however if the goal is for a rule (or all rules) to prevent a change from being merged, wouldn't the best way to achieve that be setting the severity of that rule (or all rules) to error? That way local (IDE) and CI experience is consistent. Flat eslint configs (while a definite increase in complexity over the old system) are just js arrays/objects, so mapping warnings to errors should be relatively simple even with presets.

@threepointone
Copy link
Contributor Author

Warnings signal that, with good judgement, they can be disabled. While an error signals that it's usually a mistake and may cause problems down the line. This doesn't change anything about the dx, but we don't want to land code that hasn't had a call taken. For example the linked code shouldn't have landed and should have broken the build, even though it wasn't super serious. I wouldn't want that standing out as an error while developing, feels too aggressive.

@threepointone threepointone force-pushed the fail-build-on-lint-warning branch from 23b79d4 to 7226bba Compare June 24, 2024 09:57
@CarmenPopoviciu CarmenPopoviciu changed the title chore: fail build on eslint warnings [PLEASE MERGE FIRST THING AFTER RELEASE] chore: fail build on eslint warnings Jun 24, 2024
@threepointone threepointone force-pushed the fail-build-on-lint-warning branch 2 times, most recently from ed5ab8c to 480111e Compare June 25, 2024 14:30
@CarmenPopoviciu CarmenPopoviciu changed the title [PLEASE MERGE FIRST THING AFTER RELEASE] chore: fail build on eslint warnings chore: fail build on eslint warnings Jun 25, 2024
@threepointone threepointone force-pushed the fail-build-on-lint-warning branch from 480111e to d38e9ff Compare June 25, 2024 14:38
modify all the eslint commands to fail if any warnings are present
@threepointone threepointone force-pushed the fail-build-on-lint-warning branch from d38e9ff to db58c8b Compare June 25, 2024 14:38
@CarmenPopoviciu CarmenPopoviciu merged commit 6b09f65 into main Jun 25, 2024
24 checks passed
@CarmenPopoviciu CarmenPopoviciu deleted the fail-build-on-lint-warning branch June 25, 2024 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants