{"id":19816,"library":"eslint-plugin-light","title":"eslint-plugin-light","description":"ESLint plugin with Vue-specific rules for uni-app projects. Version 1.0.16, maintained by novlan1. Provides 5 rules focusing on Vue component imports, type coercion in templates, complex keys, JSON.parse error handling, and API import management. Designed for Node 12+ with peer dependencies on @babel/eslint-parser and ESLint 6+. Differentiates from general Vue ESLint plugins by targeting common uni-app pitfalls and offering auto-fix capabilities.","status":"active","version":"1.0.16","language":"javascript","source_language":"en","source_url":"https://github.com/novlan1/plugin-light","tags":["javascript","eslint","eslint plugin","eslint-plugin","eslint-plugin-light"],"install":[{"cmd":"npm install eslint-plugin-light","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-plugin-light","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-plugin-light","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required as peer dependency for parsing Vue code with Babel","package":"@babel/eslint-parser","optional":false},{"reason":"Core dependency; plugin extends ESLint rule system","package":"eslint","optional":false}],"imports":[{"note":"ESLint plugin prefix 'eslint-plugin-' can be omitted. Use string in .eslintrc plugins array.","wrong":"require('eslint-plugin-light') in .eslintrc","symbol":"plugin","correct":"module.exports = { plugins: ['light'] }"},{"note":"Use the 'plugin:light/recommended' config to enable all recommended rules.","symbol":"recommended config","correct":"extends: ['plugin:light/recommended']"},{"note":"Rules must be prefixed with 'light/' to indicate this plugin.","wrong":"rules: { 'valid-vue-comp-import': 2 }","symbol":"rule specific","correct":"rules: { 'light/valid-vue-comp-import': 'error' }"}],"quickstart":{"code":"// Install ESLint and plugin\n// npm i eslint @babel/eslint-parser eslint-plugin-light -D\n\n// .eslintrc.js\nmodule.exports = {\n  parser: '@babel/eslint-parser',\n  plugins: ['light'],\n  rules: {\n    'light/valid-vue-comp-import': 'error',\n    'light/no-plus-turn-number': 'warn',\n    'light/no-complex-key': 'error',\n    'light/json-parse-try-catch': 'error',\n    'light/no-import-all-in-one-api': ['error', { excludes: [] }],\n  },\n};","lang":"javascript","description":"Install and configure eslint-plugin-light with all rules and recommended parser."},"warnings":[{"fix":"Set 'parser: @babel/eslint-parser' in ESLint config.","message":"Plugin requires @babel/eslint-parser as parser to work with Vue files.","severity":"gotcha","affected_versions":"all"},{"fix":"Use --ext .vue or specify in config.","message":"Rules are only applicable to .vue files; ESLint config must include .vue in lint target.","severity":"gotcha","affected_versions":"all"},{"fix":"No way to add types; use @types/eslint for type hints.","message":"No TypeScript definitions provided; plugin is JavaScript only.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run 'npm install @babel/eslint-parser --save-dev'.","cause":"@babel/eslint-parser is not installed or not in node_modules.","error":"Error: Failed to load parser '@babel/eslint-parser'"},{"fix":"Add 'plugins: [\"light\"]' to .eslintrc.","cause":"Plugin 'eslint-plugin-light' not loaded in plugins config.","error":"Definition for rule 'light/valid-vue-comp-import' was not found"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}