eslint-plugin-cup
raw JSON → 2.0.4 verified Sat Apr 25 auth: no javascript maintenance
ESLint plugin for create-universal-package (cup), providing a custom no-undef rule that allows environment-specific globals (e.g., window, process) only when guarded by __BROWSER__ or __NODE__ checks. Current stable version 2.0.4, last release likely in 2019. Designed for universal code that runs in both browser and Node.js, enforcing that environment-sensitive globals are used only within appropriate conditional blocks. Requires ESLint 5.x or 6.x. Not actively maintained.
Common errors
error Error: Failed to load plugin 'cup': Cannot find module 'eslint-plugin-cup' ↓
cause Missing local installation.
fix
npm install eslint-plugin-cup --save-dev
error Definition for rule 'cup/no-undef' was not found. ↓
cause ESLint version incompatible (requires 5.x - 6.x).
fix
Use ESLint 5.x or 6.x, or check that the plugin is properly loaded.
Warnings
gotcha cup/no-undef replaces the standard no-undef; both should not be used together. ↓
fix Disable the default 'no-undef' rule when using 'cup/no-undef'.
deprecated Package is no longer actively maintained; may not work with ESLint 7+. ↓
fix Consider migrating to a custom rule or alternative solution.
Install
npm install eslint-plugin-cup yarn add eslint-plugin-cup pnpm add eslint-plugin-cup Imports
- rules wrong
const rules = require('eslint-plugin-cup').rulescorrectimport { rules } from 'eslint-plugin-cup' - configs wrong
const configs = require('eslint-plugin-cup').configscorrectimport { configs } from 'eslint-plugin-cup'
Quickstart
// .eslintrc.js
module.exports = {
plugins: ['cup'],
rules: {
'cup/no-undef': 'error'
}
};