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

Converted prefer-declare-function from TSLint to ESLint #538

Merged

Conversation

JoshuaKGoldberg
Copy link
Contributor

Continues the work from #489.

@JoshuaKGoldberg JoshuaKGoldberg marked this pull request as ready for review September 26, 2022 16:51
@JoshuaKGoldberg
Copy link
Contributor Author

Bump @andrewbranch - is there any chance this & the other open TSLint->ESLint PRs be looked at soon, please?

@sandersn
Copy link
Member

@JoshuaKGoldberg I work on these during my DT week but I don't think anybody else is. When everybody gets back I'll ask others to take time as well.

Copy link
Member

@sandersn sandersn left a comment

Choose a reason for hiding this comment

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

The rule should apply to all variable declarations, not just exported ones.
I'll make the change since it's a simple one and this PR has been unreviewed for a long time.

{
code: `
namespace N {
export const example: () => void;
Copy link
Member

Choose a reason for hiding this comment

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

also needs to forbid const example: () => void, without the export

create(context) {
return {
// eslint-disable-next-line @typescript-eslint/naming-convention
"ExportNamedDeclaration > VariableDeclaration > VariableDeclarator"(node: TSESTree.VariableDeclarator) {
Copy link
Member

Choose a reason for hiding this comment

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

the type doesn't need to be exported to be an error.

@sandersn sandersn merged commit b3b8393 into microsoft:master Dec 30, 2022
@sandersn
Copy link
Member

I'll ship this tomorrow so I can create my fixup PR on DT right after.

@JoshuaKGoldberg JoshuaKGoldberg deleted the tseslint-prefer-declare-function branch December 30, 2022 15:12
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.

None yet

2 participants