Yarn gives a helpful warning message when a package-lock.json file is found:
yarn install v1.9.4
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
npm should provide the opposite warning when yarn.lock files are found, suggesting to delete yarn.lock and continue using npm.