Let S = K[x 1 , . . . , x n ] be a polynomial ring over a field K, and E = y 1 , . . . , y n an exterior algebra. The linearity defect ld E (N ) of a finitely generated graded E-module N measures how far N departs from "componentwise linear". It is known that ld E (N ) < ∞ for all N . But the value can be arbitrary large, while the similar invariant ld S (M) for an S-module M is always at most n. We will show that if I Δ (resp. J Δ ) is the squarefree monomial ideal of S (resp. E) corresponding to a simplicial complex Δ ⊂ 2 {1,...,n} , then ld E (E/J Δ ) = ld S (S/I Δ ). Moreover, except some extremal cases, ld E (E/J Δ ) is a topological invariant of the geometric realization |Δ ∨ | of the Alexander dual Δ ∨ of Δ. We also show that, when n 4, ld E (E/J Δ ) = n − 2 (this is the largest possible value) if and only if Δ is an n-gon.