As you haven’t provided a reference to the textbook,and this isn’t my field of expertise, I cannot say much about the correctness of the expression above, but it seems to match: 2.3.1 The deformation gradient tensor | FEBio Documentation (where this link uses 3D, not 2D).
I’ve read Nonlinear Continuum Mechanics for Finite Element Analysis. I also find a lecture note from Auckland University. Two deviatoric operator expressions don’t match up. This confused me.
I believe it is necessary to distinguish the deviatoric definition by @Dokken, which is synonymous with a trace-less tensor. The deviator of a second-order tensor dev A = A - \frac{1}{n} \text{tr}(A)I_{n}, where n denotes the dimension of the space; this definition is correct. This definition of deviatoric tensors is frequently used for stress tensors (for example, in plasticity criterion calculations).
The term ‘deviatoric’ used for a transformation gradient or strain measure is incorrect and should rather be replaced with ‘isochoric’ because a unitary determinant implies deformation without volume change. The confusion or misuse of language arises from the fact that when the system’s energy depends on the invariants of an isochoric strain tensor, the resulting stress is deviatoric.