ESLint plugin for Meteor
raw JSON → 7.3.0 verified Sat Apr 25 auth: no javascript
ESLint plugin providing Meteor-specific linting rules for best practices, security, and Blaze templates. Version 7.3.0 (February 2021) is the latest stable release. It enforces rules like audit-argument-checks, no-session, and template-names. Works with ESLint >=3.7.0 and Node >=10. Slower release cadence (last release 2021). Differentiator: the only dedicated Meteor ESLint plugin with a recommended configuration.
Common errors
error ESLint couldn't find the plugin "eslint-plugin-meteor". ↓
cause Plugin not installed or not in node_modules.
fix
Run 'npm install --save-dev eslint-plugin-meteor'
error Configuration for rule "meteor/audit-argument-checks" is invalid. ↓
cause Rule configuration options are incorrect.
fix
Check documentation for correct rule options. Use 'error' or 'warn' as severity.
error Cannot read property 'type' of undefined (audit-argument-checks rule). ↓
cause Bug in v7.2.0 with certain code patterns.
fix
Upgrade to v7.2.2 or later.
Warnings
breaking Dropped support for Node 8 in v7.0.0 ↓
fix Upgrade to Node >=10
breaking Dropped support for Node 6 in v6.0.0 ↓
fix Upgrade to Node >=8 (or >=10 for v7)
breaking Removed eslint peer dep upper bound in v7.2.1 ↓
fix No action needed; the upper bound was removed to allow newer ESLint versions
deprecated The rule 'no-template-lifecycle-assignments' was introduced to replace deprecated Meteor lifecycle callback assignments. ↓
fix Use modern Meteor lifecycle callbacks (onCreated, onRendered, onDestroyed) instead of Template.name.created etc.
gotcha The plugin does not warn about client-only features used on the server. ↓
fix Be aware that the linter does not analyze runtime environment; manually review cross-environment code.
Install
npm install eslint-plugin-meteor yarn add eslint-plugin-meteor pnpm add eslint-plugin-meteor Imports
- plugin wrong
// Wrong: requiring the plugin in code. Use ESLint config files instead.correct// In .eslintrc.js: plugins: ['meteor'] - recommended config wrong
extends: ['meteor']correctextends: ['plugin:meteor/recommended'] - rules wrong
rules: { 'audit-argument-checks': 'error' }correctrules: { 'meteor/audit-argument-checks': 'error' }
Quickstart
// Install: npm install --save-dev eslint eslint-plugin-meteor
// Create .eslintrc.json:
{
"plugins": ["meteor"],
"extends": ["plugin:meteor/recommended"],
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"ecmaFeatures": { "jsx": true }
}
}