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

Import config from extension; group by plugin #255

Merged
merged 14 commits into from
Apr 8, 2024
Merged

Import config from extension; group by plugin #255

merged 14 commits into from
Apr 8, 2024

Conversation

fregante
Copy link
Contributor

@fregante fregante commented Apr 7, 2024

  • Add Shopify and JSDoc plugins from extension
  • Import config from extension
  • group by plugin
  • Make typescript rules apply only to typescript files

@@ -25,6 +28,7 @@ module.exports = {
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-return": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"react/jsx-key": "off",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also: disable this in tests

@@ -41,6 +41,12 @@ module.exports = [
selector:
"ImportDeclaration[source.value=classnames] ImportDefaultSpecifier[local.name!=/cx/]",
},
{
message:
"Instead of `<div onClick/>`, use <UnstyledButton/> (`button` element) or <ClickableElement/> (accessible `div` element)",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also: updated description to suggest UnstyledButton as well (which is always preferred)

Copy link
Collaborator

Choose a reason for hiding this comment

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

This is also very Extension-specific.

Copy link
Contributor Author

@fregante fregante Apr 8, 2024

Choose a reason for hiding this comment

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

The a11y plugin rules also apply on the app, so these 2 components help fix them correctly:

https://github.com/pixiebrix/pixiebrix-app/pull/5067/files#diff-a215210d34dc5b245c69ef42b4f3831552c05b2f10e1f80d110688a1df8e6ee0

The only relation to the extension is that it lives in the @/components/* folder. The app can use them freely, the other repos can copy-pasted them I suppose.

@fregante fregante changed the title Import rules from extension; group rules by plugin Import config from extension; group by plugin Apr 7, 2024
Comment on lines 46 to 50
{
group: ["react-shadow/emotion"],
message:
'Use this instead: import EmotionShadowRoot from "@/components/EmotionShadowRoot"',
},
Copy link
Collaborator

Choose a reason for hiding this comment

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

This rule is pretty Extension specific. I'm not sure if it makes sense to include in the shared config.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right, the app doesn't have any Shadow DOM. I'll move it back

fregante added a commit to pixiebrix/pixiebrix-extension that referenced this pull request Apr 8, 2024
@fregante fregante merged commit 4d7cbab into main Apr 8, 2024
2 checks passed
@fregante fregante deleted the extraction branch April 8, 2024 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants