Stylelint and PostCSS have postcss-bem-linter, but that just checks the name is in a BEM style rather than testing that the style is being applied to the right element. Linting style names is definitely better than nothing, but really I want some way to tie class names to elements that's both easy to use when I'm writing code, and straightforward to ensure my class names actually match what ends up in the browser.
The function can then pick the generated classes out of the CSS Module's JSON import. If the classname doesn't exist, it can warn to the console.
It's farely straight forward in React. You just need to make sure you always use the function to provide values to the className prop instead of manual strings.