eslint-config-riot
raw JSON → 5.0.2 verified Sat Apr 25 auth: no javascript
Riot default ESLint configuration preset for version 5.0.2, updated to ESLint 9 flat config. Requires manual installation of peer dependencies: ESLint ^9.0.0, eslint-config-prettier ^10.0.0, eslint-plugin-jsdoc ^50.0.0, eslint-plugin-fp ^2.3.0, and Prettier ^3.0.0. Release cadence is stable, with breaking changes introduced in v5.0.0 when moving to flat config. Key differentiator: purpose-built for Riot.js ecosystem, enforces functional programming patterns via eslint-plugin-fp.
Common errors
error Cannot find module 'eslint-config-riot' ↓
cause Package not installed or missing from node_modules.
fix
Run
npm install --save-dev eslint-config-riot. error Error: Failed to load config 'eslint-config-riot' to extend from. ↓
cause Legacy .eslintrc using 'extends' string instead of flat array.
fix
Use eslint.config.js with
import riotConfig from 'eslint-config-riot'; export default [rioteConfig];. error Parsing error: The keyword 'using' is reserved ↓
cause ecmaVersion set to 2025 but code uses syntax not yet supported.
fix
Set
languageOptions: { ecmaVersion: 2024 } in your config or update code. Warnings
breaking v5.0.0 switched to ESLint 9 flat config; legacy .eslintrc files are not compatible. ↓
fix Migrate to eslint.config.js flat config format.
breaking v5.0.0 dropped support for ESLint 8 and earlier; must use ESLint ^9.0.0. ↓
fix Upgrade ESLint to 9.x.
deprecated The 'prettier' rule configuration may conflict with eslint-config-prettier; ensure prettier config is loaded last. ↓
fix Place eslint-config-prettier after riot config in extends array.
gotcha ecmaVersion was updated to 2025 in v5.0.2; code using older syntax may cause parser errors. ↓
fix Ensure your code targets ES2025 or override ecmaVersion in your config.
deprecated eslint-plugin-fp is no longer actively maintained; consider using eslint-plugin-functional or similar. ↓
fix Replace eslint-plugin-fp with a maintained alternative.
Install
npm install eslint-config-riot yarn add eslint-config-riot pnpm add eslint-config-riot Imports
- default wrong
const riotEslintConfig = require('eslint-config-riot')correctimport riotEslintConfig from 'eslint-config-riot' - defineConfig
import { defineConfig } from 'eslint/config' - flat config wrong
module.exports = { extends: 'eslint-config-riot' }correctimport riotEslintConfig from 'eslint-config-riot' export default defineConfig([{ extends: [riotEslintConfig] }])
Quickstart
// Install dependencies first:
// npm i -D eslint@9 eslint-config-riot eslint-plugin-fp@2 eslint-config-prettier@10 eslint-plugin-jsdoc@50 prettier@3
// eslint.config.js
import { defineConfig } from 'eslint/config';
import riotEslintConfig from 'eslint-config-riot';
export default defineConfig([
{ extends: [riotEslintConfig] },
// Add your overrides
{
rules: {
'no-console': 'warn'
}
}
]);