{"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,"search_vec":"'1.0.16':18 '12':46 '5':23 '6':54 'api':40 'app':15,66 'auto':71 'auto-fix':70 'babel/eslint-parser':51 'capabl':73 'coercion':31 'common':63 'complex':34 'compon':28 'depend':49 'design':43 'differenti':55 'error':37 'eslint':2,5,53,59,75,76,79,82 'eslint-plugin':78 'eslint-plugin-light':1,81 'fix':72 'focus':25 'general':57 'handl':38 'import':29,41 'javascript':74 'json.parse':36 'key':35 'light':4,84 'maintain':19 'manag':42 'node':45 'novlan1':21 'offer':69 'peer':48 'pitfal':67 'plugin':3,6,60,77,80,83 'project':16 'provid':22 'rule':11,24 'specif':10 'target':62 'templat':33 'type':30 'uni':14,65 'uni-app':13,64 'version':17 'vue':9,27,58 'vue-specif':8","created_at":"2026-04-25T11:19:49.120576+00:00","updated_at":"2026-04-25T11:19:49.120576+00:00","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,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":"https://novlan1.github.io/docs/plugin-light/zh/eslint-plugin-light.html","github":"https://github.com/novlan1/plugin-light","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/eslint-plugin-light","openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-17","next_check":"2026-07-24","install_tag":null}}