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

📚 Basic TypeScript types #142

Closed
scagood opened this issue Nov 22, 2023 · 4 comments · Fixed by #169
Closed

📚 Basic TypeScript types #142

scagood opened this issue Nov 22, 2023 · 4 comments · Fixed by #169
Assignees
Milestone

Comments

@scagood
Copy link

scagood commented Nov 22, 2023

We should probably look to add some super basic types I currently use:

declare module 'eslint-plugin-n' {
    import type { ESLint, Linter, Rule } from 'eslint';

    export default {} as {
        meta: {
            name: string;
            version: string;
        };
        rules: Record<string, Rule.RuleModule>;
        configs: {
            'recommended-module': ESLint.ConfigData
            'recommended-script': ESLint.ConfigData
            'recommended': ESLint.ConfigData
            'flat/recommended-module': Linter.FlatConfig
            'flat/recommended-script': Linter.FlatConfig
            'flat/recommended': Linter.FlatConfig
            'flat/mixed-esm-and-cjs': Linter.FlatConfig
        }
    };
}
@scagood scagood added this to the v17 milestone Nov 22, 2023
@scagood scagood self-assigned this Nov 22, 2023
@voxpelli
Copy link
Member

Maybe we can generate this from JSDoc comments? That way they would also be validated against the current code and be a bit more DRY :)

@scagood
Copy link
Author

scagood commented Nov 22, 2023

mmm, I do prefer that idea, but it will be a fair bit more work as most of the doc comments dont really work currently 😂

@voxpelli
Copy link
Member

Maybe we can make it in two steps?

@scagood

This comment was marked as off-topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants