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

chore: switch to using config file to configure eslint-doc-generator #1291

Merged
merged 1 commit into from
Nov 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .eslint-doc-generatorrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/** @type {import('eslint-doc-generator/dist/lib/options').GenerateOptions} */
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice! I'll export this type in the future: bmish/eslint-doc-generator#261

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

sweet - I'm going to leave it as-is for now but will address when bmish/eslint-doc-generator#260 is done

Copy link
Contributor

Choose a reason for hiding this comment

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

Okay well you might want to switch to the public type sooner since:

  • The type no longer exists at the location you're using it--would cause an issue with any upgrade
  • I don't think I'll be able to work on the TypeScript config support any time soon

Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like this is now broken for you after the update.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Nope nothing to do with this because

Currently we don't actually check JS files with TS

🙂

Copy link
Contributor

Choose a reason for hiding this comment

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

Regardless of that, I find it valuable for the hover-over documentation / auto-complete too.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

As do I, but that's primarily useful when you edit the config file so I'll either update the type then or when I setup type checking for JS files.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good!

const config = {
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`,
};

module.exports = config;
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"prettier:write": "prettier --write 'docs/**/*.md' README.md '.github/**' package.json tsconfig.json src/globals.json .yarnrc.yml",
"postpublish": "pinst --enable",
"test": "jest",
"tools:regenerate-docs": "yarn prepack && eslint-doc-generator --ignore-config all --rule-doc-title-format desc-parens-name --rule-doc-section-include \"Rule details\" --rule-list-columns name,description,configsError,configsWarn,configsOff,fixable,hasSuggestions,deprecated --split-by meta.docs.requiresTypeChecking --url-configs \"https://github.com/jest-community/eslint-plugin-jest/blob/main/README.md#shareable-configurations\" && yarn prettier:write",
"tools:regenerate-docs": "yarn prepack && eslint-doc-generator && yarn prettier:write",
"typecheck": "tsc -p ."
},
"commitlint": {
Expand Down