Registry / testing / eslint-plugin-eta-3

eslint-plugin-eta-3

JSON →
library3.0.1jsnpmunverified

An ESLint plugin that lints Eta v3 template files. Version 3.0.1 is current and stable, with a low release cadence. It processes .eta files through a custom processor, enabling ESLint rules on Eta templates. Key differentiators: built specifically for Eta v3, supports JavaScript-like syntax inside templates, and integrates seamlessly with standard ESLint workflows. Alternatives like eslint-plugin-eta target older Eta versions. Requires ESLint >=8 and eta >=3 as peer dependencies.

npm install eslint-plugin-eta-3
INSTALL
IMPORT
SIG · ESLINT-PLUGIN-ETA-
E
eslint-plugin-eta-3
testingjavascriptv3.0.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

plugin (as object)
const eta3Plugin = require('eslint-plugin-eta-3');
import { eta3Plugin } from 'eslint-plugin-eta-3';
CommonJS require is idiomatic; there is no named export for the plugin object.
Processor
// Not directly exported; use 'eta-3/eta' in ESLint config
import { EtaProcessor } from 'eslint-plugin-eta-3';
The processor is referenced as a string path in ESLint config, not imported.
Plugin name
plugins: ["eta-3"]
plugins: ["eslint-plugin-eta-3"]
ESLint expects the short name without the 'eslint-plugin-' prefix.

Shows installation, plugin and processor configuration for ESLint, and an example template to lint.

// Install npm install --save-dev eslint eslint-plugin-eta-3 eta@^3 // .eslintrc.js module.exports = { root: true, env: { browser: true, es2021: true }, plugins: ["eta-3"], overrides: [ { files: ["*.eta"], processor: "eta-3/eta", rules: { // Example rules "no-unused-vars": "error", "no-undef": "error" } } ] }; // Example Eta template: template.eta // <% let name = "World" %> // <h1>Hello <%= name %></h1> // Run linter npx eslint template.eta
Debug
Known issues
gotchaPlugin only works with Eta v3; using with other versions may break.
fix
Ensure eta package is version 3.x.
affects: >=3.0.0
deprecatedNamed export for processor is not available; must use string path.
fix
In ESLint config, use processor: 'eta-3/eta'.
affects: >=3.0.0
gotchaPlugin requires ESLint >=8; older versions are incompatible.
fix
Upgrade ESLint to version 8 or higher.
affects: >=3.0.0
gotchaOverrides with files pattern must match .eta extension exactly.
fix
Use files: ['*.eta'] (not '.eta' or '**/*.eta').
affects: >=3.0.0
Errors
Common errors & fixes
Error: Failed to load plugin 'eta-3' declared in '.eslintrc': Cannot find module 'eslint-plugin-eta-3'
Package not installed or missing from node_modules.
fix
Run npm install --save-dev eslint-plugin-eta-3
Error: Cannot find module 'eta'
Missing peer dependency eta.
fix
Run npm install eta@^3
TypeError: Cannot read properties of undefined (reading 'eta')
Processor reference 'eta-3/eta' is incorrect or missing.
fix
In ESLint config, use processor: 'eta-3/eta' under the override.
Warning: Rule 'no-unused-vars' severity 'error' has unknown options
ESLint version mismatch; rules may have changed in newer ESLint.
fix
Ensure ESLint version is 8.x; check rule documentation.
Upgrade
Version history
3.0.1latest on npm
Audit
Dependencies
eslintrequiredpeer dependency required for plugin functionality
etarequiredpeer dependency required for template processing
Agent activity
2 hits · last 30 days
node
2
Resources
eslint-plugin-eta-3 — npm install eslint-plugin-eta-3 · libregistry