-
-
Notifications
You must be signed in to change notification settings - Fork 154
refactor(eslint): fix eslint warning #1618
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
Conversation
- Replace 'any' with 'unknown' for better type safety - Add proper type imports and interfaces where needed - Fix type assertions and property access patterns - Maintain existing behavior while improving type safety - Reduce ESLint @typescript-eslint/no-explicit-any warnings from 209 to 136 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Change DiffPart interface to type in diff.ts - Change Visitor interface to type in ast-traverse index.ts - Maintain consistency with project's preference for type over interface 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Add type guard functions to safely check object properties before access - Replace `as Record<string, unknown>` with proper type guards - Improve type safety while maintaining functionality - Reduce reliance on `as` type assertions for better runtime safety 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Fix AnyTxtNode to Record<string, unknown> casting in ast-traverse - Add null coalescing for plugin options in textlint-tester - Add helper function for creating test TextlintMessage objects - Remove unused @ts-expect-error directive - Improve type safety while maintaining functionality 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Add outDir and declarationDir to tsconfig.json for organized build output - Update .gitignore to exclude dist/ directory instead of individual files - Prevent future commits of generated TypeScript compilation artifacts 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Fix all TypeScript compilation errors from type-check - Add createTestMessage helper functions for test type safety - Replace unsafe type assertions with double assertions - Improve type guards in config-loader for unknown values - Fix import path for ES modules compatibility - Support both TextlintPluginOptions and boolean in TestPluginSet - Remove unused imports and add proper type annotations 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
|
…patibility Replace this.skip() with context.skip() according to Vitest API: https://vitest.dev/api/#test-skip 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
options?: any; | ||
options?: TextlintRuleOptions; | ||
description?: string; | ||
errors: TesterErrorDefinition[]; | ||
}; | ||
|
||
export type TestRuleSet = { | ||
rules: { [index: string]: TextlintRuleModule }; | ||
rulesOptions: any; | ||
rulesOptions: Record<string, TextlintRuleOptions>; | ||
}; | ||
|
||
export type TestPluginSet = { | ||
plugins: { [index: string]: TextlintPluginCreator }; | ||
pluginOptions: any; | ||
pluginOptions: Record<string, TextlintPluginOptions | boolean>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed pluginOptions type from any to Record<string, TextlintPluginOptions | boolean>
Reason: Plugin options can be either configuration objects or boolean values for enable/disable. The TestConfigPlugin type already supports options?: TextlintPluginOptions | boolean, but TestPluginSet was not aligned with this. This change ensures type consistency between the plugin configuration types and resolves TypeScript compilation errors when boolean values are passed as plugin options.
Impact: Enables proper type checking for both object and boolean plugin configurations without breaking existing functionality.
Set line and column to undefined for test cases that expect line 0, col 0 output. This matches the junit formatter behavior where missing line/column defaults to 0. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Uh oh!
There was an error while loading. Please reload this page.