You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To upvote this issue, give it a thumbs up. See this list for the most upvoted issues.
Is your feature request related to a problem? Please describe.
The Clojure Style Guide has a Use Idiomatic Namespace Aliases section which lists a set of namespace aliases. Adding a linter to clj-kondo to nudge developers towards adapting these community aliases in their own code would help increase the consistency of Clojure code bases.
Describe the solution you'd like
Add a linter that warns when using an unidiomatic namespace alias, where the idioms are defined in the Clojure Style Guide.
This can be implemented by adding a :community-guide flag to the :consistent-alias linter. Namespaces which have explicit configuration in the :consistent-alias linter should overwrite the :community-guide configuration, in case users prefer some aliases of their own, but generally want to adopt the community standards.
Describe alternatives you've considered @borkdude suggested that alternatively there can be a new clj-kondo library created which would contain the community guide aliases so they could get merged to a project's clj-kondo config when imported. This option would require the minimal change to clj-kondo itself -- probably just documentation. On the down side, this approach may be difficult when installing clj-kondo as a binary instead of a project dependency.
Additional context
Currently, the Style Guide recommends clojure.spec.alpha -> spec which is likely a bug. There is an open PR which changes this item and some others. There should be some expectation of the alias list evolving over time.
The text was updated successfully, but these errors were encountered:
To upvote this issue, give it a thumbs up. See this list for the most upvoted issues.
Is your feature request related to a problem? Please describe.
The Clojure Style Guide has a Use Idiomatic Namespace Aliases section which lists a set of namespace aliases. Adding a linter to clj-kondo to nudge developers towards adapting these community aliases in their own code would help increase the consistency of Clojure code bases.
Describe the solution you'd like
Add a linter that warns when using an unidiomatic namespace alias, where the idioms are defined in the Clojure Style Guide.
This can be implemented by adding a
:community-guide
flag to the:consistent-alias
linter. Namespaces which have explicit configuration in the:consistent-alias
linter should overwrite the:community-guide
configuration, in case users prefer some aliases of their own, but generally want to adopt the community standards.Describe alternatives you've considered
@borkdude suggested that alternatively there can be a new clj-kondo library created which would contain the community guide aliases so they could get merged to a project's clj-kondo config when imported. This option would require the minimal change to clj-kondo itself -- probably just documentation. On the down side, this approach may be difficult when installing clj-kondo as a binary instead of a project dependency.
Additional context
Currently, the Style Guide recommends
clojure.spec.alpha
->spec
which is likely a bug. There is an open PR which changes this item and some others. There should be some expectation of the alias list evolving over time.The text was updated successfully, but these errors were encountered: