Registry / testing / eslint-plugin-light

eslint-plugin-light

JSON →
library1.0.16jsnpmunverified

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.

npm install eslint-plugin-light
INSTALL
IMPORT
SIG · ESLINT-PLUGIN-LIGH
E
eslint-plugin-light
testingjavascriptv1.0.16
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

plugin
module.exports = { plugins: ['light'] }
require('eslint-plugin-light') in .eslintrc
ESLint plugin prefix 'eslint-plugin-' can be omitted. Use string in .eslintrc plugins array.
recommended config
extends: ['plugin:light/recommended']
Use the 'plugin:light/recommended' config to enable all recommended rules.
rule specific
rules: { 'light/valid-vue-comp-import': 'error' }
rules: { 'valid-vue-comp-import': 2 }
Rules must be prefixed with 'light/' to indicate this plugin.

Install and configure eslint-plugin-light with all rules and recommended parser.

// Install ESLint and plugin // npm i eslint @babel/eslint-parser eslint-plugin-light -D // .eslintrc.js module.exports = { parser: '@babel/eslint-parser', plugins: ['light'], rules: { 'light/valid-vue-comp-import': 'error', 'light/no-plus-turn-number': 'warn', 'light/no-complex-key': 'error', 'light/json-parse-try-catch': 'error', 'light/no-import-all-in-one-api': ['error', { excludes: [] }], }, };
Debug
Known issues
gotchaPlugin requires @babel/eslint-parser as parser to work with Vue files.
fix
Set 'parser: @babel/eslint-parser' in ESLint config.
affects: all
gotchaRules are only applicable to .vue files; ESLint config must include .vue in lint target.
fix
Use --ext .vue or specify in config.
affects: all
gotchaNo TypeScript definitions provided; plugin is JavaScript only.
fix
No way to add types; use @types/eslint for type hints.
affects: all
Errors
Common errors & fixes
Error: Failed to load parser '@babel/eslint-parser'
@babel/eslint-parser is not installed or not in node_modules.
fix
Run 'npm install @babel/eslint-parser --save-dev'.
Definition for rule 'light/valid-vue-comp-import' was not found
Plugin 'eslint-plugin-light' not loaded in plugins config.
fix
Add 'plugins: ["light"]' to .eslintrc.
Upgrade
Version history
1.0.16latest on npm
Audit
Dependencies
@babel/eslint-parserrequiredRequired as peer dependency for parsing Vue code with Babel
eslintrequiredCore dependency; plugin extends ESLint rule system
Agent activity
2 hits · last 30 days
node
2
Resources
eslint-plugin-light — npm install eslint-plugin-light · libregistry