eslint-plugin-harlanzw
raw JSON → 0.12.1 verified Sat Apr 25 auth: no javascript
An experimental ESLint plugin v0.12.1 by Harlan Wilton for Vue/Nuxt projects, shipping 26+ rules across four categories: link hygiene (ASCII-only, lowercase, trailing slashes), Nuxt best practices (await navigateTo, prefer NuxtLink), Vue reactivity patterns (avoid nested reactivity, ref unwrapping), and AI deslop tools (clean AI-generated markdown slop). Requires eslint >=9.0.0 (flat config only), ships with TypeScript types, and is released irregularly with breaking changes (e.g., v0.12.0 dropped `mixed-conventions`). Differentiates from eslint-plugin-vue by targeting Nuxt-specific patterns and opinionated link rules not found elsewhere.
Common errors
error Error: Cannot find module 'eslint-plugin-harlanzw' ↓
cause Plugin not installed or missing from package.json dependencies.
fix
Run 'npm install eslint-plugin-harlanzw --save-dev' or 'yarn add -D eslint-plugin-harlanzw'.
error TypeError: eslint.Plugin is not a constructor ↓
cause Using legacy require() in CommonJS with ESLint flat config.
fix
Use ESM import syntax: 'import pluginHarlanzw from 'eslint-plugin-harlanzw';'.
error Error: Failed to load plugin 'harlanzw': Rule 'harlanzw/mixed-conventions' is not found ↓
cause Mixed-conventions rule was removed in v0.12.0 but still referenced in config.
fix
Remove 'harlanzw/mixed-conventions' from your rules object.
error Error: ESLint configuration in eslint.config.mjs is invalid: Unexpected top-level property 'rules'. ↓
cause Attempting to use flat config without the proper plugins object structure.
fix
Wrap rules inside a config object with 'plugins' property as shown in the quickstart.
Warnings
breaking Mixed-conventions rule has been removed in v0.12.0. ↓
fix Remove any references to 'harlanzw/mixed-conventions' from your ESLint configuration; the rule no longer exists.
gotcha The plugin requires ESLint flat config (>=9.0.0). Using .eslintrc or eslintrc configs will fail. ↓
fix Switch to flat config format (eslint.config.js or eslint.config.mjs) with ESLint >=9.0.0.
gotcha Rules are experimental and may change without major version bump. Some rules may have false positives in edge cases. ↓
fix Pin the plugin version and test rules thoroughly. Monitor release notes for rule changes.
deprecated The 'deslop' rules are highly experimental and may be removed or renamed in future versions. ↓
fix Use with caution; consider if these rules are necessary before adopting.
Install
npm install eslint-plugin-harlanzw yarn add eslint-plugin-harlanzw pnpm add eslint-plugin-harlanzw Imports
- pluginHarlanzw wrong
const pluginHarlanzw = require('eslint-plugin-harlanzw')correctimport pluginHarlanzw from 'eslint-plugin-harlanzw' - rules wrong
import { rules } from 'eslint-plugin-harlanzw/rules'correctimport { rules } from 'eslint-plugin-harlanzw' - configs
import { configs } from 'eslint-plugin-harlanzw'
Quickstart
import pluginHarlanzw from 'eslint-plugin-harlanzw';
export default [
{
plugins: {
harlanzw: pluginHarlanzw
},
rules: {
'harlanzw/link-ascii-only': 'error',
'harlanzw/link-lowercase': 'warn',
'harlanzw/link-trailing-slash': ['error', { trailing: 'never' }],
'harlanzw/nuxt-await-navigate-to': 'error',
'harlanzw/vue-no-nested-reactivity': 'error'
}
}
];