Skip to content

feat: create recommended eslint configuration#468

Closed
zendy199x wants to merge 2 commits intomicrosoft:mainfrom
zendy199x:feat/create-recommended-eslint-configuration
Closed

feat: create recommended eslint configuration#468
zendy199x wants to merge 2 commits intomicrosoft:mainfrom
zendy199x:feat/create-recommended-eslint-configuration

Conversation

@zendy199x
Copy link
Copy Markdown

Summary

Create a new configuration file that defines the recommended settings for eslint-plugin-tsdoc. This configuration will enable the tsdoc/syntax rule with a warn severity, allowing users to easily adopt TSDoc validation by extending plugin:tsdoc/recommended in their ESLint setup.

Changes

  • eslint-plugin/src/configs/recommended.ts
  • eslint-plugin/src/index.ts

Create a new configuration file that defines the recommended settings for eslint-plugin-tsdoc. This configuration will enable the tsdoc/syntax rule with a warn severity, allowing users to easily adopt TSDoc validation by extending plugin:tsdoc/recommended in their ESLint setup.

Testing

  • Verified changes follow existing project conventions
  • Confirmed no regressions in affected code paths

Closes #321

Create a new configuration file that defines the `recommended` settings for `eslint-plugin-tsdoc`. This configuration will enable the `tsdoc/syntax` rule with a `warn` severity, allowing users to easily adopt TSDoc validation by extending `plugin:tsdoc/recommended` in their ESLint setup.

Signed-off-by: Zendy <50132805+zendy199x@users.noreply.github.com>
Create a new configuration file that defines the `recommended` settings for `eslint-plugin-tsdoc`. This configuration will enable the `tsdoc/syntax` rule with a `warn` severity, allowing users to easily adopt TSDoc validation by extending `plugin:tsdoc/recommended` in their ESLint setup.

Signed-off-by: Zendy <50132805+zendy199x@users.noreply.github.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a recommended shareable config for eslint-plugin-tsdoc so users can enable TSDoc syntax validation via extends: ['plugin:tsdoc/recommended'].

Changes:

  • Added eslint-plugin/src/configs/recommended.ts defining tsdoc/syntax as warn
  • Updated eslint-plugin/src/index.ts to wire the new recommended config into the plugin export surface

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
eslint-plugin/src/index.ts Adds a recommended config import / plugin configs typing to expose plugin:tsdoc/recommended
eslint-plugin/src/configs/recommended.ts New recommended config enabling tsdoc/syntax with warn severity
Comments suppressed due to low confidence (1)

eslint-plugin/src/index.ts:73

  • eslint-plugin/src/index.ts is truncated: the plugin object and syntax.create function are not closed, and there is no export. This will fail TypeScript compilation and prevents the plugin from being consumable. Restore the removed implementation and ensure the module exports the plugin object (and closes all braces).
      create: (context: eslint.Rule.RuleContext) => {
        const sourceFilePath: string = context.filename;
        // If eslint is configured with @typescript-eslint/parser, there is a parser option
        // to explicitly specify where the tsconfig file is. Use that if available.
        const tsConfigDir: string | undefined = getRootDirectoryFromContext(
          context as unknown as TSESLint.RuleContext<string, unknown[]>
        );


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 21 to 24
interface IPlugin {
rules: { [x: string]: eslint.Rule.RuleModule };
configs: { [x: string]: eslint.Linter.Config };
}
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

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

configs was added to IPlugin and recommended is imported, but this file currently doesn't define/export plugin.configs anywhere. To actually expose plugin:tsdoc/recommended, ensure the exported plugin object includes configs: { recommended } (and that the module exports plugin).

Copilot uses AI. Check for mistakes.
Comment on lines +6 to +12
const config: Linter.Config = {
rules: {
'tsdoc/syntax': 'warn'
}
};

export default config;
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

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

This repo appears to consistently use named exports (no other export default usages were found). Consider exporting this as a named export (e.g., export const recommended = ...) to match existing module patterns and avoid any TS interop edge cases with default imports.

Suggested change
const config: Linter.Config = {
rules: {
'tsdoc/syntax': 'warn'
}
};
export default config;
export const recommended: Linter.Config = {
rules: {
'tsdoc/syntax': 'warn'
}
};

Copilot uses AI. Check for mistakes.
Comment on lines +6 to +9
const config: Linter.Config = {
rules: {
'tsdoc/syntax': 'warn'
}
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

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

The new recommended config is a public entrypoint (plugin:tsdoc/recommended) but there’s no test covering that it is exported and contains the expected rule settings. Consider adding a small unit test asserting plugin.configs.recommended.rules['tsdoc/syntax'] === 'warn' so this contract doesn’t regress.

Copilot uses AI. Check for mistakes.
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.

Could you provide eslint-plugin-tsdoc/recommended?

2 participants