
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
eslint-plugin-template
Advanced tools
Parses out template declarations found in js and html files.
For example if you have a file like below, eslint will not be able to parse it
normally due to the template markers. With this plugin, the linter is able to
work normally. Note that whatever is inside the markers is replaced with {}.
{# Set data in the JS variable data #} // ignored
{% import json %} // ignored
var x = {{ json.dumps(data) }} // becomes var x = {}
var y = {% raw json.dumps(data) %} // becomes var y = {}
It handles conditional templates within JavaScript similarly.
{% if true %}
var x = 1
{% else %}
var x = 2
{% endif %}
becomes:
var x = 1
var x = 2
If there are edge cases that still cannot be handled, wrap them inside /* eslint-disable */ and /* eslint-enable */:
foo({{x}})
/* eslint-disable */
var x = {% if x %}{{x}}{% else %}0{% endif %}
/* eslint-enable */
becomes:
foo({})
npm install --save-dev eslint eslint-plugin-template
Add template to the plugins section of your .eslintrc configuration file:
{
"plugins": [
"template"
]
}
npm test
package.jsonnpm publishFAQs
Parses out template declarations found in JS/HTML files
The npm package eslint-plugin-template receives a total of 4,762 weekly downloads. As such, eslint-plugin-template popularity was classified as popular.
We found that eslint-plugin-template demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.