Skip to content

Commit eadb04f

Browse files
feat(rules): add new TypeScript ESLint rules implementation
feat(utils): add JSX attribute contextual type handling fix(rules): improve null assertion check logic in no_unnecessary_type_assertion feat: implement dot-notation rule with property access validation feat: add explicit-member-accessibility rule for access modifiers feat: create max-params rule for parameter count validation feat: implement member-ordering rule for class member organization test: add comprehensive test cases for all new rules
1 parent 2310ebd commit eadb04f

File tree

12 files changed

+3397
-0
lines changed

12 files changed

+3397
-0
lines changed

cmd/rslint/api.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ import (
2020
"github.com/web-infra-dev/rslint/internal/rules/array_type"
2121
"github.com/web-infra-dev/rslint/internal/rules/await_thenable"
2222
"github.com/web-infra-dev/rslint/internal/rules/class_literal_property_style"
23+
"github.com/web-infra-dev/rslint/internal/rules/dot_notation"
24+
"github.com/web-infra-dev/rslint/internal/rules/explicit_member_accessibility"
25+
"github.com/web-infra-dev/rslint/internal/rules/max_params"
26+
"github.com/web-infra-dev/rslint/internal/rules/member_ordering"
2327
"github.com/web-infra-dev/rslint/internal/rules/no_array_delete"
2428
"github.com/web-infra-dev/rslint/internal/rules/no_base_to_string"
2529
"github.com/web-infra-dev/rslint/internal/rules/no_confusing_void_expression"
@@ -111,6 +115,10 @@ func (h *IPCHandler) HandleLint(req api.LintRequest) (*api.LintResponse, error)
111115
array_type.ArrayTypeRule,
112116
await_thenable.AwaitThenableRule,
113117
class_literal_property_style.ClassLiteralPropertyStyleRule,
118+
dot_notation.DotNotationRule,
119+
explicit_member_accessibility.ExplicitMemberAccessibilityRule,
120+
max_params.MaxParamsRule,
121+
member_ordering.MemberOrderingRule,
114122
no_array_delete.NoArrayDeleteRule,
115123
no_base_to_string.NoBaseToStringRule,
116124
no_confusing_void_expression.NoConfusingVoidExpressionRule,

internal/config/config.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ import (
1111
"github.com/web-infra-dev/rslint/internal/rules/array_type"
1212
"github.com/web-infra-dev/rslint/internal/rules/await_thenable"
1313
"github.com/web-infra-dev/rslint/internal/rules/class_literal_property_style"
14+
"github.com/web-infra-dev/rslint/internal/rules/dot_notation"
15+
"github.com/web-infra-dev/rslint/internal/rules/explicit_member_accessibility"
16+
"github.com/web-infra-dev/rslint/internal/rules/max_params"
17+
"github.com/web-infra-dev/rslint/internal/rules/member_ordering"
1418
"github.com/web-infra-dev/rslint/internal/rules/no_array_delete"
1519
"github.com/web-infra-dev/rslint/internal/rules/no_base_to_string"
1620
"github.com/web-infra-dev/rslint/internal/rules/no_confusing_void_expression"
@@ -271,6 +275,10 @@ func RegisterAllTypeScriptEslintPluginRules() {
271275
GlobalRuleRegistry.Register("@typescript-eslint/array-type", array_type.ArrayTypeRule)
272276
GlobalRuleRegistry.Register("@typescript-eslint/await-thenable", await_thenable.AwaitThenableRule)
273277
GlobalRuleRegistry.Register("@typescript-eslint/class-literal-property-style", class_literal_property_style.ClassLiteralPropertyStyleRule)
278+
GlobalRuleRegistry.Register("@typescript-eslint/dot-notation", dot_notation.DotNotationRule)
279+
GlobalRuleRegistry.Register("@typescript-eslint/explicit-member-accessibility", explicit_member_accessibility.ExplicitMemberAccessibilityRule)
280+
GlobalRuleRegistry.Register("@typescript-eslint/max-params", max_params.MaxParamsRule)
281+
GlobalRuleRegistry.Register("@typescript-eslint/member-ordering", member_ordering.MemberOrderingRule)
274282
GlobalRuleRegistry.Register("@typescript-eslint/no-array-delete", no_array_delete.NoArrayDeleteRule)
275283
GlobalRuleRegistry.Register("@typescript-eslint/no-base-to-string", no_base_to_string.NoBaseToStringRule)
276284
GlobalRuleRegistry.Register("@typescript-eslint/no-confusing-void-expression", no_confusing_void_expression.NoConfusingVoidExpressionRule)

0 commit comments

Comments
 (0)