eslint-plugin-sxzz
raw JSON → 0.4.4 verified Sat Apr 25 auth: no javascript
A collection of ESLint rules for personal and project use, maintained by Kevin Deng. Current stable version is 0.4.4, with frequent releases. The plugin is ESM-only since v0.2.0, requires ESLint ^9.15.0 or ^10.0.0, and Node.js >=20.19.0. It includes TypeScript type definitions. Differentiators: custom rules like `require-package-field`, and breaking changes between versions (dropped CJS, dropped Node 18). Notable forked from eslint-plugin-antfu.
Common errors
error Cannot find module 'eslint-plugin-sxzz' ↓
cause Package not installed or ESM import used in CJS project.
fix
Run 'npm install eslint-plugin-sxzz' and ensure package.json has 'type':'module' or use .mjs extension.
error Failed to load plugin 'sxzz': Plugin is not an object or function ↓
cause Plugin imported incorrectly (e.g., using require in CJS or missing default export).
fix
Use import plugin from 'eslint-plugin-sxzz' (ESM) and set it as { plugins: { sxzz: plugin } }.
error ESLint: Error while loading rule 'sxzz/require-package-field': Rule not found ↓
cause Rule name misspelled or not available in this version.
fix
Check available rules in documentation; use correct rule name like 'sxzz/require-package-field'.
Warnings
breaking Dropped CJS build in v0.2.0; ESM-only. ↓
fix Use ESM imports (import) instead of require().
breaking Node.js <20.19.0 is no longer supported since v0.3.0. ↓
fix Upgrade Node.js to >=20.19.0.
breaking ESLint typegen changes in v0.4.0 may break type definitions. ↓
fix Check TypeScript config; may need to update type imports.
gotcha Plugin does not export a recommended config; you must manually configure rules. ↓
fix Add plugin.sxzz to plugins and enable individual rules.
deprecated ESLint flat config is required; legacy .eslintrc format not supported. ↓
fix Use 'eslint.config.js' or 'eslint.config.mjs' with flat config.
Install
npm install eslint-plugin-sxzz yarn add eslint-plugin-sxzz pnpm add eslint-plugin-sxzz Imports
- default wrong
const plugin = require('eslint-plugin-sxzz')correctimport plugin from 'eslint-plugin-sxzz' - rules wrong
import { rules } from 'eslint-plugin-sxzz/rules'correctimport { rules } from 'eslint-plugin-sxzz' - configs wrong
import configs from 'eslint-plugin-sxzz/configs'correctimport { configs } from 'eslint-plugin-sxzz'
Quickstart
// eslint.config.js
import plugin from 'eslint-plugin-sxzz';
export default [
{
plugins: { sxzz: plugin },
rules: {
'sxzz/require-package-field': 'error',
},
},
];