eslint-plugin-mavenlint
raw JSON → 0.4.1 verified Fri May 01 auth: no javascript
Custom ESLint rules for the Mavenlink codebase. This ESLint plugin provides a set of custom lint rules tailored for Mavenlink's specific coding conventions and best practices. Version 0.4.1 is the latest stable release. The plugin is maintained as part of the Mavenlink organization on GitHub. Unlike generic ESLint plugins, these rules enforce Mavenlink-specific patterns and avoid common pitfalls in their projects. The package requires eslint >=4.14.0 as a peer dependency.
Common errors
error Error: Failed to load plugin 'mavenlint' declared in '.eslintrc.js': Cannot find module 'eslint-plugin-mavenlint' ↓
cause Plugin not installed or not in node_modules.
fix
Run 'npm install eslint-plugin-mavenlint --save-dev'
error ESLint configuration error: The rules configuration 'mavenlint/rule-name' has a severity of 'warn' which is not allowed. Allowed values: 0, 1, 2, 'off', 'warn', 'error'. ↓
cause Invalid severity level.
fix
Use 'error', 'warn', or 'off' (or 2, 1, 0).
error Definition for rule 'rule-name' was not found. ↓
cause Rule name spelled incorrectly or missing prefix.
fix
Use 'mavenlint/rule-name' instead of 'rule-name'.
Warnings
gotcha Plugin must be listed in plugins array, not just rules. ↓
fix Add 'plugins: ["mavenlint"]' to your ESLint config.
gotcha Rules are prefixed with 'mavenlint/'. ↓
fix Use rule names like 'mavenlint/rule-name'.
deprecated Deprecated: using 'mavenlint' without prefix may be removed. ↓
fix Use full rule name with 'mavenlint/' prefix.
Install
npm install eslint-plugin-mavenlint yarn add eslint-plugin-mavenlint pnpm add eslint-plugin-mavenlint Imports
- default (plugin object) wrong
require('eslint-plugin-mavenlint')correctmodule.exports = { plugins: ['mavenlint'], rules: { 'mavenlint/rule-name': 'error' } }; - configs wrong
const configs = require('eslint-plugin-mavenlint/configs');correctimport { configs } from 'eslint-plugin-mavenlint'; - rules wrong
const rules = require('eslint-plugin-mavenlint').rules;correctimport { rules } from 'eslint-plugin-mavenlint';
Quickstart
// .eslintrc.js
module.exports = {
plugins: ['mavenlint'],
rules: {
'mavenlint/rule-name': 'error'
}
};