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

'PascalCase' and 'snake_case' never get migrated in variable-name rule #1442

Closed
sophia-belous opened this issue Apr 6, 2022 · 2 comments
Closed
Labels
area: incorrect converter Rule converter with incomplete, incorrect, or invalid rule names and/or arguments good first issue Good for newcomers; welcome aboard! status: accepting prs Please, send in a PR to resolve this! ✨ type: bug Something isn't working

Comments

@sophia-belous
Copy link

PascalCase and snake_case configuration options never get migrated to eslint because formats variable is not used anywhere.
See:

const formats = ["camelCase", "UPPER_CASE"];
if (hasCheckFormat && allowPascalCase) {
formats.push("PascalCase");
}
if (hasCheckFormat && allowSnakeCase) {
formats.push("snake_case");
}
if (!hasCheckFormat) {
camelCaseRules.push({
selector: "variable",
format: ["camelCase", "UPPER_CASE"],
leadingUnderscore: "forbid",
trailingUnderscore: "forbid",
});
} else {
camelCaseRules.push({
selector: "variable",
format: ["camelCase", "UPPER_CASE"],
leadingUnderscore: allowedLeadingUnderscore ? "allow" : "forbid",
trailingUnderscore: allowedTrailingUnderscore ? "allow" : "forbid",
});
}

@JoshuaKGoldberg JoshuaKGoldberg added type: bug Something isn't working status: accepting prs Please, send in a PR to resolve this! ✨ good first issue Good for newcomers; welcome aboard! area: incorrect converter Rule converter with incomplete, incorrect, or invalid rule names and/or arguments labels Apr 6, 2022
@hyperupcall
Copy link
Contributor

It looks like this fix got merged and released, but the issue wasn't automatically closed? Just trying to make sure no potential future contributors are confused :)

@JoshuaKGoldberg
Copy link
Member

...huh, you're right! Thanks @hyperupcall 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: incorrect converter Rule converter with incomplete, incorrect, or invalid rule names and/or arguments good first issue Good for newcomers; welcome aboard! status: accepting prs Please, send in a PR to resolve this! ✨ type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants