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

Support TypeScript based config #260

Open
G-Rath opened this issue Nov 19, 2022 · 1 comment
Open

Support TypeScript based config #260

G-Rath opened this issue Nov 19, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@G-Rath
Copy link
Contributor

G-Rath commented Nov 19, 2022

I like authoring my config files with TypeScript where possible for consistency, continence, and validation, and it's usually pretty straightforward to support - I've implemented this for a few packages now, both with and without cosmiconfig - I think most of the code from this PR should be what's required.

The result would be this:

import { GenerateOptions } from 'eslint-doc-generator/dist/lib/options';

const config: GenerateOptions = {
  ignoreConfig: ['all'],
  ruleDocTitleFormat: 'desc-parens-name',
  ruleDocSectionInclude: ['Rule details'],
  ruleListColumns: [
    'name',
    'description',
    'configsError',
    'configsWarn',
    'configsOff',
    'fixable',
    'hasSuggestions',
    'deprecated',
  ].join(),
  splitBy: 'meta.docs.requiresTypeChecking',
  urlConfigs: `https://github.com/jest-community/eslint-plugin-jest/blob/main/README.md#shareable-configurations`,
};

export default config;

(I would do a PR myself but am a bit burnt out right now so are making an issue instead incase someone else has the bandwidth to pick this up 🙂)

@bmish
Copy link
Owner

bmish commented Nov 19, 2022

Cool, I would definitely like to support TypeScript configs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants