Yōga Sūtras
Yōga Sūtra 3.14
śāntōditāvyapadēśyadharmānupātī dharmī।
When thoughts during peaceful state, aroused state, as well as those about to come in the future are all in tune with dharma, the person is said to be dharmi, one who follows dharma.