-
Notifications
You must be signed in to change notification settings - Fork 22
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
Conversation
{ | ||
group: ["react-shadow/emotion"], | ||
message: | ||
'Use this instead: import EmotionShadowRoot from "@/components/EmotionShadowRoot"', |
There was a problem hiding this comment.
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": [ |
There was a problem hiding this comment.
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": [ |
There was a problem hiding this comment.
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.', |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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 */ |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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"), |
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
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
Codecov ReportAttention: Patch coverage is
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. |
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. |
What does this PR do?
no-restricted-syntax
from extension eslint-config-pixiebrix#228Checklist