Skip to content

Commit 29c06d2

Browse files
authored
Core/NamingHelper: removed Anon-module TODO check (#772)
Removed Anon-module check TODO.
1 parent 194fd16 commit 29c06d2

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/FSharpLint.Core/Rules/Conventions/Naming/NamingHelper.fs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,8 +306,12 @@ let isImplicitModule (SynModuleOrNamespace.SynModuleOrNamespace(longIdent, _, mo
306306

307307
// Check the identifiers in the module name have no length.
308308
// Not ideal but there's no attribute in the AST indicating the module is implicit from the file name.
309-
// TODO: does SynModuleOrNamespaceKind.AnonModule replace this check?
310-
isModule moduleKind && longIdent |> List.forall (fun ident -> zeroLengthRange ident.idRange)
309+
match moduleKind with
310+
| SynModuleOrNamespaceKind.AnonModule -> true
311+
| _ when isModule moduleKind ->
312+
// Fallback check for older compiler versions
313+
longIdent |> List.forall (fun ident -> zeroLengthRange ident.idRange)
314+
| _ -> false
311315

312316
type GetIdents<'Item> = AccessControlLevel -> SynPat -> 'Item []
313317

0 commit comments

Comments
 (0)