title: How to resolve "Unresolved variable or type data" warnings when using EJS?
body: <p>I'm using <strong>EJS</strong> as Template engine. Everything looks like working fine, but I have these weak <strong>"Unresolved variable or type data"</strong> warnings in IntelliJ. How to get rid of these warnings? Is anything wrong with the code?</p>
  
  <p><strong>app.js</strong>:</p>
  
  <pre><code>var express = require('express');
  var app = express();
  
  var hostname = 'localhost';
  var port = 3000;
  
  app.set('view engine', 'ejs');
  app.use('/static', express.static('static'));
  
  app.get('/', (req, res) =&gt; {
    res.sendFile(`${__dirname}/index.html`);
  });
  
  app.get('/profile/:id', (req, res) =&gt; {
    var userData = {
      id: req.params.id,
      firstName: 'John',
      lastName: 'Peterson',
      age: 23,
      active: true,
      interests: ['Design', 'Web', 'Acting']
    };
    res.render('profile', { data: userData });
  });
  
  app.get('*', (req, res) =&gt; {
    res.sendFile(`${__dirname}/404.html`);
  });
  
  app.listen(port);
  console.log(`Server running at http://${hostname}:${port}`);
  </code></pre>
  
  <p><strong>views/profile.ejs</strong>:</p>
  
  <pre><code> &lt;!doctype html&gt;
      &lt;html lang="en"&gt;
      &lt;head&gt;
        &lt;meta charset="UTF-8"&gt;
        &lt;meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"&gt;
        &lt;meta http-equiv="X-UA-Compatible" content="ie=edge"&gt;
        &lt;title&gt;My Profile&lt;/title&gt;
        &lt;link rel="stylesheet" href="../static/style.css"&gt;
      &lt;/head&gt;
      &lt;body&gt;
        &lt;h2&gt;My Profile Template&lt;/h2&gt;
        &lt;p&gt;ID: &lt;%=data.id%&gt;&lt;/p&gt;
        &lt;p&gt;Name: &lt;%=data.firstName%&gt; &lt;%=data.lastName%&gt;&lt;/p&gt;
        &lt;p&gt;Age: &lt;%=data.age%&gt; years&lt;/p&gt;
        &lt;p&gt;Active: &lt;%=data.active%&gt;&lt;/p&gt;
      &lt;/body&gt;
      &lt;/html&gt;
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/OvXfv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/OvXfv.png" alt="enter image description here"></a></p>