realm / realm/SwiftLint

Support for typealiases in valid_ibinspectable

Open
#1,925 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Swift
Stars
19.7k
Forks
2.3k
Avg merge
1d 1h
Merged PRs (30d)
11

Description

New Issue Checklist
Rule Request

I have a case where I am creating an IBDesignable Map View, where the developer can input individual coordinates as IBInspectable properties. To keep consistent with the CoreLocation API, It would be ideal to have these IBInspectable properties be of type CLLocationDegrees instead of type Double (CLLocationDegrees is a typealias for Double). Because swiftlint doesn't recognize that CLLocationDegrees as a Double, it produces a warning saying it is a declaration violation. I am sure there are numerous other cases where this type of issue could come up.

I am proposing that any new whitelisted types for valid_ibinspectable be opt-in, and configurable in the yaml file as a new type to support for the rule. I think this would be easier to implement than having to have the linter manually cross-reference any types or do any extra work.

Thanks for your consideration.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the valid_ibinspectable rule and how SwiftLint reads YAML configuration. Clarify the opt-in typealias behavior and use the rule's existing test coverage, if available, to verify that configured aliases such as CLLocationDegrees are accepted while unconfigured types retain current behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.