             enum Numbers: Decimal {
               case ↓one, ↓two
             }
+            """),
+            Example("""
+            enum Outer {
+                enum Numbers: Decimal {
+                  case ↓one, ↓two
+                }
+            }
             """)
         ]
     )
 
-    public func validate(file: SwiftLintFile, kind: SwiftDeclarationKind,
-                         dictionary: SourceKittenDictionary) -> [StyleViolation] {
-        guard kind == .enum else {
-            return []
+    public func makeVisitor(file: SwiftLintFile) -> ViolationsSyntaxVisitor? {
+        Visitor(viewMode: .sourceAccurate)
+    }
+}
+
+private extension ExplicitEnumRawValueRule {
+    final class Visitor: SyntaxVisitor, ViolationsSyntaxVisitor {
+        private(set) var violationPositions: [AbsolutePosition] = []
+
+        override func visitPost(_ node: EnumCaseElementSyntax) {
+            if node.rawValue == nil,
+               let enclosingEnum = Syntax(node).enclosingEnum(),
+               let inheritance = enclosingEnum.inheritanceClause,
+               inheritance.supportsRawValue {
+                violationPositions.append(node.identifier.positionAfterSkippingLeadingTrivia)
+            }
+        }
+    }
+}
+
+private extension Syntax {
+    func enclosingEnum() -> EnumDeclSyntax? {
+        if let node = self.as(EnumDeclSyntax.self) {
+            return node
         }
 
+        return parent?.enclosingEnum()
+    }
+}
+
+private extension TypeInheritanceClauseSyntax {
+    var supportsRawValue: Bool {
         // Check if it's an enum which supports raw values
         let implicitRawValueSet: Set<String> = [
             "Int", "Int8", "Int16", "Int32", "Int64",

import SourceKittenFramework

public struct ExplicitEnumRawValueRule: ASTRule, OptInRule, ConfigurationProviderRule {
    public var configuration = SeverityConfiguration(.warning)

    public init() {}

            "NSDecimalNumber", "NSInteger", "String"
        ]

        return inheritedTypeCollection.contains { element in
            guard let identifier = element.typeName.as(SimpleTypeIdentifierSyntax.self)?.name.text else {
                return false
            }

            return implicitRawValueSet.contains(identifier)
        }
    }
}
