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

run eslint (with react config) on workers-playground/wrangler #6080

Merged
merged 1 commit into from
Jun 18, 2024

Conversation

threepointone
Copy link
Contributor

@threepointone threepointone commented Jun 18, 2024

This enables eslint (with our react config) for the workers-playground project. Additionally, this enables the react-jsx condition in relevant tsconfig/eslint configs, letting us write jsx without having React in scope.

What this PR solves / how to test

Fixes #6074

Author has addressed the following

  • Tests
    • TODO (before merge)
    • Included
    • Not necessary because: No functional changes
  • E2E Tests CI Job required? (Use "e2e" label or ask maintainer to run separately)
    • I don't know
    • Required / Maybe required
    • Not required because: already covered
  • Changeset (Changeset guidelines)
    • TODO (before merge)
    • Included
    • Not necessary because:
  • Public documentation
    • TODO (before merge)
    • Cloudflare docs PR(s):
    • Not necessary because: No public changes
@threepointone threepointone requested review from a team as code owners June 18, 2024 17:40
Copy link

changeset-bot bot commented Jun 18, 2024

🦋 Changeset detected

Latest commit: 92869d9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
wrangler Patch
@cloudflare/vitest-pool-workers Patch

Not sure what this means? Click here to learn what changesets are.

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

Copy link
Contributor

github-actions bot commented Jun 18, 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/9571182258/npm-package-wrangler-6080

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

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

Or you can use npx with this latest build directly:

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

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


wrangler@3.61.0 includes the following runtime dependencies:

Package Constraint Resolved
miniflare workspace:* 3.20240610.1
workerd 1.20240610.1 1.20240610.1
workerd --version 1.20240610.1 2024-06-10

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

@threepointone threepointone marked this pull request as draft June 18, 2024 17:50
This enables eslint (with our react config) for the workers-playground project. Additionally, this enables the react-jsx condition in relevant tsconfig/eslint config, letting us write jsx without having React in scope.
@threepointone threepointone marked this pull request as ready for review June 18, 2024 19:58
@threepointone threepointone requested a review from a team as a code owner June 18, 2024 19:58
@@ -13237,7 +13237,7 @@ snapshots:
eslint: 8.57.0
eslint-import-resolver-node: 0.3.7
eslint-import-resolver-typescript: 3.5.5(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.7)(eslint-plugin-import@2.27.5(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0))(eslint@8.57.0)
eslint-plugin-import: 2.27.5(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-typescript@3.5.5)(eslint@8.57.0)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these changes happen when running pnpm i on main right now

@@ -4,8 +4,12 @@ module.exports = {
plugins: ["eslint-plugin-react", "eslint-plugin-react-hooks"],
overrides: [
{
files: ["*.ts", "*.tsx"],
extends: ["plugin:react/recommended", "plugin:react-hooks/recommended"],
files: ["**/*.ts", "**/*.tsx"],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to check *.ts for JSX?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there might be hooks implemented in ts files, that can still be linted

@@ -90,7 +90,7 @@ export function VSCodeEditor({ content, onChange }: Props) {
}, []);

useEffect(() => {
if (quickEdit !== null)
if (quickEdit !== null) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

@threepointone threepointone merged commit e2972cf into main Jun 18, 2024
24 checks passed
@threepointone threepointone deleted the lint-workers-playground branch June 18, 2024 20:34
@workers-devprod workers-devprod added the contribution [Holopin] Recognizes an open-source contribution, big or small label Jun 18, 2024
Copy link

holopin-bot bot commented Jun 18, 2024

Congratulations @threepointone, the maintainer of this repository has issued you a holobyte! Here it is: https://holopin.io/holobyte/clxkv5cqg01990cl9i5ww4ngv

This badge can only be claimed by you, so make sure that your GitHub account is linked to your Holopin account. You can manage those preferences here: https://holopin.io/account.
Or if you're new to Holopin, you can simply sign up with GitHub, which will do the trick!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution [Holopin] Recognizes an open-source contribution, big or small
3 participants