Could be done in the following ways as per the documentation
npm exec --workspace=a -- eslint ./*.js
or
npx --workspace=a -- eslint ./*.js