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

Update local ESLint config to match shared config + apply new rules #7755

Merged
merged 7 commits into from
Feb 28, 2024

Conversation

fregante
Copy link
Collaborator

@fregante fregante commented Feb 28, 2024

{
group: ["react-shadow/emotion"],
message:
'Use this instead: import EmotionShadowRoot from "@/components/EmotionShadowRoot"',
Copy link
Collaborator Author

@fregante fregante Feb 28, 2024

Choose a reason for hiding this comment

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

// NOTE: If you add more rules, add the tests to eslint-local-rules/noRestrictedSyntax.ts
],

// We want to have a default case to check for `never`
"@typescript-eslint/switch-exhaustiveness-check": [
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

],

// Rules that depend on https://github.com/pixiebrix/pixiebrix-extension/issues/775
"@typescript-eslint/restrict-template-expressions": [
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

{
group: ["./*"],
message:
'Use root-based imports (`import "@/something"`) instead of relative imports.',
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Moved back here from the shared config. This is an extension-only rule.

# pre-commit autoupdate
#
# And then run updated hooks against all files with:
# pre-commit run --all-files
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Copied from Johnny's comment on the app repo

@@ -299,6 +299,9 @@
"yaml-jest-transform": "^2.0.2",
"yaml-loader": "^0.8.1"
},
"overrides": {
"@typescript-eslint/eslint-plugin": "7.0.2"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@@ -1,5 +1,3 @@
/* eslint-disable jsx-a11y/click-events-have-key-events */
/* eslint-disable jsx-a11y/no-static-element-interactions -- Test only */
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@@ -109,8 +109,6 @@ describe("SetupPage", () => {
expect(screen.queryByTestId("loader")).toBeNull();
});

screen.debug();
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

},
// If they're not specific to the extension, add them to the shared config instead:
// https://github.com/pixiebrix/eslint-config-pixiebrix/blob/main/no-restricted-syntax.js
...require("eslint-config-pixiebrix/no-restricted-syntax"),
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

"local-rules/preferNullish": "warn",
"local-rules/preferNullishable": "warn",
"local-rules/preferNullish": "error",
"local-rules/preferNullishable": "error",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

There were only a handful of errors. Fixed all

Copy link

codecov bot commented Feb 28, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 72.12%. Comparing base (d5ef4e8) to head (42f7eef).

Files Patch % Lines
src/utils/inference/selectorInference.ts 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7755      +/-   ##
==========================================
- Coverage   72.13%   72.12%   -0.02%     
==========================================
  Files        1270     1270              
  Lines       39760    39760              
  Branches     7375     7375              
==========================================
- Hits        28681    28675       -6     
- Misses      11079    11085       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

No loom links were found in the first post. Please add one there if you'd like to it to appear on Slack.

Do not edit this comment manually.

@fregante fregante merged commit cbd7760 into main Feb 28, 2024
20 checks passed
@fregante fregante deleted the F/lint/no-restricted-syntax branch February 28, 2024 16:52
@grahamlangford grahamlangford added this to the 1.8.10 milestone Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants