WebStorm doesn’t support Nunjucks by default, and we have to add the Twig plugin manually to integrate Numjucks with WebStorm.
Version
WebStorm 2021.3
Twig

Preferences -> Plugins
- Add
Twigplugin
Add njk Extension

Preferences -> Editor -> File Types -> Twig
- Add
*.njkfor Twig

Conclusion
- The syntax of Nunjucks is similar to Twig, so that we can use Twig plugin for Nunjucks