-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
fix: add eslintrc files for check code convention #9104
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
Conversation
|
c55dafd
to
5701e8a
Compare
import path from 'path'; | ||
import glob from 'tiny-glob/sync.js'; | ||
import { | ||
mkdirSync as mkdir_sync, |
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.
we don't have a convention of aliasing external packages to snake_case
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.
Yes, I understand.
If svelte 5 accepts the eslint rule,
You can use the eslint-disable-next-line id-match
comment here.
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.
I appreciate that this rule found a lot of places that should be updated. However, I think it's just going to end up being too annoying to do eslint disable wherever we're calling an external package and think we probably can't accept this PR as a result. I really appreciate the effort you put into it. I think we could accept the fixes you identified if they were split out separately from the lint rule itself - though it might be better to wait until Svelte 5 for that as we're going to be throwing away all the existing compiler code
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.
Thank you for the thorough review.
The changes were intended for validating the effectiveness of the rule, and I believe applying them in the current version wouldn't bring significant benefits.
@@ -10,11 +10,11 @@ export { | |||
SvelteComponentTyped | |||
} from './index.js'; | |||
|
|||
/** @returns {void} */ |
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.
i'm not sure why these comments were removed
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.
The return void is deduced automatically,
and I removed it because other parts of the code didn't add these type comments, but if it was a change to specify that nothing should be returned,
this change is should be roll back.
thank you for this. it's a very interesting idea. unfortunately I don't think we can move forward for the reasons mentioned above: #9104 (comment) |
Before submitting the PR, please make sure you do the following
feat:
,fix:
,chore:
, ordocs:
.Tests and linting
pnpm test
and lint the project withpnpm lint
1. Added eslintrc file to check
snake_case
.ex) "$$" | "abc_abc", "__abc_abc", "$$abc_abc", "abc123", "abc_123" | "ABC_ABC", "ABC123", "ABC_123" | "AbcAbc", "Abc123", "Abc_123"but the test folder was excluded because there were too many errors.
2. I modified the code according to the added eslint rule.
for public variable names,
camelCase
was applied usingexport as
keyword oreslint-disable
comment.I'm not sure if this amounts to a large changes.
This PR has been force pushed,
including modifications to the regular expression in id-match and any additional changes that result from it.
check
snake_case
rule$$
lower_snake_case
that starts with a 0-2 letter_
or$
UPPER_SNAKE_CASE
PascalCase
a11y_required_attributes
snake_case_123
,PascalCase_123