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

feat: ESLint compat utilities post #564

Merged
merged 3 commits into from May 9, 2024
Merged

feat: ESLint compat utilities post #564

merged 3 commits into from May 9, 2024

Conversation

nzakas
Copy link
Member

@nzakas nzakas commented May 8, 2024

Prerequisites checklist

What is the purpose of this pull request?

What changes did you make? (Give an overview)

Added a blog post introducing the compatibility utilities.

Related Issues

eslint/rewrite#4

Is there anything you'd like reviewers to focus on?

@eslint-github-bot
Copy link

Hi @nzakas!, thanks for the Pull Request

The pull request title isn't properly formatted. We ask that you update the pull request title to match this format, as we use it to generate changelogs and automate releases.

  • The commit message tag wasn't recognized. Did you mean "docs", "fix", or "feat"?

To Fix: You can fix this problem by clicking 'Edit' next to the pull request title at the top of this page.

Read more about contributing to ESLint here

Copy link

netlify bot commented May 8, 2024

Deploy Preview for ja-eslint ready!

Name Link
🔨 Latest commit 199053e
🔍 Latest deploy log https://app.netlify.com/sites/ja-eslint/deploys/663ce1e93d1a3f00086dc45b
😎 Deploy Preview https://deploy-preview-564--ja-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented May 8, 2024

Deploy Preview for new-eslint ready!

Name Link
🔨 Latest commit 199053e
🔍 Latest deploy log https://app.netlify.com/sites/new-eslint/deploys/663ce1e997d964000863f43e
😎 Deploy Preview https://deploy-preview-564--new-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented May 8, 2024

Deploy Preview for zh-hans-eslint ready!

Name Link
🔨 Latest commit 199053e
🔍 Latest deploy log https://app.netlify.com/sites/zh-hans-eslint/deploys/663ce1e920a20a0008d8f58e
😎 Deploy Preview https://deploy-preview-564--zh-hans-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@nzakas nzakas changed the title post: ESLint compat utilities feat: ESLint compat utilities post May 8, 2024
Copy link

netlify bot commented May 8, 2024

Deploy Preview for es-eslint ready!

Name Link
🔨 Latest commit 199053e
🔍 Latest deploy log https://app.netlify.com/sites/es-eslint/deploys/663ce1e918a9d200083ebcc1
😎 Deploy Preview https://deploy-preview-564--es-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented May 8, 2024

Deploy Preview for pt-br-eslint ready!

Name Link
🔨 Latest commit 199053e
🔍 Latest deploy log https://app.netlify.com/sites/pt-br-eslint/deploys/663ce1e9c8df4b00079260b3
😎 Deploy Preview https://deploy-preview-564--pt-br-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented May 8, 2024

Deploy Preview for hi-eslint ready!

Name Link
🔨 Latest commit 199053e
🔍 Latest deploy log https://app.netlify.com/sites/hi-eslint/deploys/663ce1e94a2a8700080147b5
😎 Deploy Preview https://deploy-preview-564--hi-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented May 8, 2024

Deploy Preview for fr-eslint ready!

Name Link
🔨 Latest commit 199053e
🔍 Latest deploy log https://app.netlify.com/sites/fr-eslint/deploys/663ce1e9cfe4de0008fec0d5
😎 Deploy Preview https://deploy-preview-564--fr-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented May 8, 2024

Deploy Preview for de-eslint ready!

Name Link
🔨 Latest commit 199053e
🔍 Latest deploy log https://app.netlify.com/sites/de-eslint/deploys/663ce1e910fdfa0009c97b23
😎 Deploy Preview https://deploy-preview-564--de-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

mdjermanovic
mdjermanovic previously approved these changes May 8, 2024
Copy link
Member

@mdjermanovic mdjermanovic left a comment

Choose a reason for hiding this comment

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

LGTM, I only left two suggestions/questions.

```

After that, the plugin should work as expected.

Copy link
Member

Choose a reason for hiding this comment

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

Would it make sense to also provide an example with a plugin that exports a flat config?

For example, eslint-plugin-react exports flat configs:

https://github.com/jsx-eslint/eslint-plugin-react?tab=readme-ov-file#configuration-new-eslintconfigjs

Rules aren't compatible with the new API yet, but the config can be used like this:

// eslint.config.js
import { fixupConfigRules } from "@eslint/compat";
import reactRecommended  from "eslint-plugin-react/configs/recommended.js";

export default [
    ...fixupConfigRules(reactRecommended)
];

Copy link
Member Author

Choose a reason for hiding this comment

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

Good idea.

export default [
{
plugins: {
oldPlugin: fixupPluginRules(oldPlugin)
Copy link
Member

@fasttime fasttime May 9, 2024

Choose a reason for hiding this comment

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

Suggested change
oldPlugin: fixupPluginRules(oldPlugin)
"old-plugin": fixupPluginRules(oldPlugin)

Maybe like this to match the plugin name in eslintrc?

Copy link
Member Author

Choose a reason for hiding this comment

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

This isn't an eslintrc example, so I think it's okay as-is.

Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
@nzakas nzakas merged commit 87501da into main May 9, 2024
37 checks passed
@nzakas nzakas deleted the compat-post branch May 9, 2024 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Complete
Development

Successfully merging this pull request may close these issues.

None yet

3 participants