Skip to content
Open
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
2 changes: 2 additions & 0 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import (
"github.com/web-infra-dev/rslint/internal/plugins/typescript/rules/no_redundant_type_constituents"
"github.com/web-infra-dev/rslint/internal/plugins/typescript/rules/no_require_imports"
"github.com/web-infra-dev/rslint/internal/plugins/typescript/rules/no_unnecessary_boolean_literal_compare"
"github.com/web-infra-dev/rslint/internal/plugins/typescript/rules/no_unnecessary_condition"
"github.com/web-infra-dev/rslint/internal/plugins/typescript/rules/no_unnecessary_template_expression"
"github.com/web-infra-dev/rslint/internal/plugins/typescript/rules/no_unnecessary_type_arguments"
"github.com/web-infra-dev/rslint/internal/plugins/typescript/rules/no_unnecessary_type_assertion"
Expand Down Expand Up @@ -354,6 +355,7 @@ func registerAllTypeScriptEslintPluginRules() {
GlobalRuleRegistry.Register("@typescript-eslint/no-redundant-type-constituents", no_redundant_type_constituents.NoRedundantTypeConstituentsRule)
GlobalRuleRegistry.Register("@typescript-eslint/no-require-imports", no_require_imports.NoRequireImportsRule)
GlobalRuleRegistry.Register("@typescript-eslint/no-unnecessary-boolean-literal-compare", no_unnecessary_boolean_literal_compare.NoUnnecessaryBooleanLiteralCompareRule)
GlobalRuleRegistry.Register("@typescript-eslint/no-unnecessary-condition", no_unnecessary_condition.NoUnnecessaryConditionRule)
GlobalRuleRegistry.Register("@typescript-eslint/no-unnecessary-template-expression", no_unnecessary_template_expression.NoUnnecessaryTemplateExpressionRule)
GlobalRuleRegistry.Register("@typescript-eslint/no-unnecessary-type-arguments", no_unnecessary_type_arguments.NoUnnecessaryTypeArgumentsRule)
GlobalRuleRegistry.Register("@typescript-eslint/no-unnecessary-type-assertion", no_unnecessary_type_assertion.NoUnnecessaryTypeAssertionRule)
Expand Down
3 changes: 2 additions & 1 deletion internal/plugins/import/plugin.go
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
package import_plugin
const PLUGIN_NAME = "eslint-plugin-import"

const PLUGIN_NAME = "eslint-plugin-import"
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package no_self_import_test
import (
"testing"

"github.com/web-infra-dev/rslint/internal/plugins/import/fixtures"
"github.com/web-infra-dev/rslint/internal/plugins/import/rules/no_self_import"
"github.com/web-infra-dev/rslint/internal/rule_tester"
"github.com/web-infra-dev/rslint/internal/plugins/import/fixtures"
)

func TestNoSelfImportRule(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ type T = Record<string, A | B>;
},
}, []rule_tester.InvalidTestCase{
{
Only: true,
Only: true,
Code: "type T = 1 | 1;",
Output: []string{"type T = 1 ;"},
Errors: []rule_tester.InvalidTestCaseError{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func isAnyInRestParameter(node *ast.Node) bool {
// Check if the any keyword is inside a rest parameter with array type
// We need to check if the any is part of an array type in a rest parameter
// Valid patterns to ignore: ...args: any[], ...args: readonly any[], ...args: Array<any>, ...args: ReadonlyArray<any>

// First check if we're inside an ArrayType
inArrayType := false
for p := node.Parent; p != nil; p = p.Parent {
Expand All @@ -92,11 +92,11 @@ func isAnyInRestParameter(node *ast.Node) bool {
}
}
}

if !inArrayType {
return false
}

// Then check if we're in a rest parameter
for p := node.Parent; p != nil; p = p.Parent {
if p.Kind == ast.KindParameter {
Expand Down
Loading
Loading