Skip to content

Rename useDeclarationOrder to cover declarations and exports #73

Description

@felixarntz

useDeclarationOrder checks both local declarations and named export occurrences, so its current name describes only part of the behavior. The replacement name should continue to cover exported and unexported top-level symbols without implying that every occurrence is a declaration.

Relevant files:

  • packages/konsistent/src/typescript/predicates/use-declaration-order.ts
  • packages/konsistent/src/typescript/parser.ts
  • packages/konsistent/src/typescript/types.ts
  • packages/konsistent/src/core/convention-name.ts
  • docs/reference/predicates.md

Possible names:

  • useSymbolOrder — preferred concise umbrella for declarations and exports.
  • useTopLevelSymbolOrder — more explicit about scope.
  • orderSymbols — shorter, but less consistent with the existing predicate naming style.

Backward compatibility: internal names and documentation can be renamed or removed without compatibility shims. In konsistent.json, keep useDeclarationOrder and its existing behavior as deprecated, add the replacement predicate, and emit a non-failing CLI warning whenever the old predicate is used.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions