eslint-plugin-riot
raw JSON → 0.1.8 verified Fri May 01 auth: no javascript deprecated
ESLint plugin that extracts and lints JavaScript from Riot.js tag files (.html and .tag). Version 0.1.8, last released in 2015, with no updates since. It supports ES6, Babel, or JavaScript script blocks within Riot tags but does not handle Riot mini ES6 syntax. The plugin is deprecated in favor of modern alternatives like eslint-plugin-html or directly linting compiled JS.
Common errors
error Error: Failed to load plugin 'riot' ↓
cause Plugin not installed or ESLint version incompatible.
fix
Run npm install --save-dev eslint-plugin-riot and ensure ESLint 1.x is used.
error No files matching the pattern were found ↓
cause ESLint not configured to process .html or .tag files.
fix
Add '--ext .html,.tag' to ESLint CLI or configure glob patterns in .eslintrc.
error Parsing error: Unexpected token < ↓
cause ESLint is trying to parse the HTML/tag file directly without the processor.
fix
Ensure 'riot' is listed in plugins array and the file extension is supported.
Warnings
deprecated eslint-plugin-riot is unmaintained since 2015. Use eslint-plugin-html or modern alternatives. ↓
fix Switch to eslint-plugin-html or directly lint compiled JavaScript files.
gotcha Only processes <script type="es6"> or <script type="babel"> — does not support default <script> or <script type="text/javascript">. ↓
fix Use explicit type attribute: <script type="es6"> ... </script>.
gotcha Plugin does not handle Riot mini ES6 syntax (e.g., inline expressions like {opts.title}), only full script blocks. ↓
fix Lint only the script blocks; inline expressions remain unchecked.
breaking ESLint 2.x+ no longer supports processors in the same way; this plugin may not work with ESLint 3+. ↓
fix Use ESLint 1.x or consider alternative linting approach.
Install
npm install eslint-plugin-riot yarn add eslint-plugin-riot pnpm add eslint-plugin-riot Imports
- riot wrong
require('eslint-plugin-riot') in configcorrectplugins: ['riot'] - rules wrong
{"rules": {"riot/no-console": "error"}}correct{"plugins": ["riot"], "rules": {"no-console": "error"}} - processor wrong
no processor configurationcorrect{"plugins": ["riot"], "settings": {"riot": {"extensions": [".html", ".tag"]}}}
Quickstart
// Install
npm install --save-dev eslint-plugin-riot
// .eslintrc.json
{
"plugins": ["riot"],
"settings": {
"riot": {
"extensions": [".html", ".tag"]
}
}
}
// Run ESLint on a .tag file
// my-component.tag
<my-component>
<p>{message}</p>
<script type="es6">
this.message = 'Hello, Riot!'
</script>
</my-component>