Registry / testing / eslint-linter-browserify

eslint-linter-browserify

JSON →
library10.2.1jsnpmunverified

A browser-compatible build of ESLint that runs the Linter API client-side without Node.js. Version 10.2.1 mirrors ESLint's core linting engine, made available for browser environments via bundlers like webpack or direct script tags. It ships TypeScript definitions and supports ESM, CJS, and UMD. Unlike server-side ESLint, only the Linter class is available (no CLI, no built-in formatters). Key differentiator: enables real-time linting in browser-based code editors such as CodeMirror or Monaco.

npm install eslint-linter-browserify
INSTALL
IMPORT
SIG · ESLINT-LINTER-BROW
E
eslint-linter-browserify
testingjavascriptv10.2.1
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
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 18–226 runs
build_error
glibc
node 18–226 runs
build_error
Code
Verified usage

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

Linter
✓ import { Linter } from 'eslint-linter-browserify'
✗ import Linter from 'eslint-linter-browserify'
Use named import, not default. The package exports an object with Linter property.
eslint (namespace)
✓ import * as eslint from 'eslint-linter-browserify'
✗ const eslint = require('eslint-linter-browserify')
Both ESM and CJS work. For browser scripts, use UMD: <script src='...linter.js'> and access window.eslint.
type Linter
✓ import type { Linter } from 'eslint-linter-browserify'
✗ import { Linter } from 'eslint-linter-browserify' // no runtime import needed
Only use type import when you only need the type, e.g. for TypeScript declarations.

Shows how to create a Linter instance, define rules, and verify code. Output is an array of lint messages.

import { Linter } from 'eslint-linter-browserify'; const linter = new Linter(); const code = "var foo = 1;"; const config = { rules: { semi: ["error", "always"], "no-var": ["error"] } }; const messages = linter.verify(code, config, { filename: "test.js" }); console.log(messages); // Example output: [{ line: 1, column: 1, message: "Unexpected var, use let or const instead.", ruleId: "no-var", severity: 2 }]
Debug
Known issues
bindingOnly the Linter class is available; other ESLint APIs (CLIEngine, RuleTester, etc.) are not bundled.
fix
Use only Linter. For other APIs, consider server-side ESLint.
affects: *
gotchaRules that require file system access (e.g., 'import', 'node') may not work or behave differently in the browser.
fix
Only use syntax and built-in rules that don't rely on Node.js APIs. Test thoroughly.
affects: *
deprecatedThe namespace import via <script> tag returns the linter object as window.eslint. Ensure script order if using multiple bundles.
fix
Use <script src='linter.js'> before any code that depends on window.eslint.
affects: *
Errors
Common errors & fixes
Cannot find module 'eslint-linter-browserify'
Package not installed or not in node_modules.
fix
Run 'npm install eslint-linter-browserify' and ensure import path is correct.
linter.verify is not a function
Using default import instead of named import: 'import Linter from ...' returns the module object, not the Linter class.
fix
Use 'import { Linter } from 'eslint-linter-browserify''.
ReferenceError: require is not defined
Using CJS require in an ESM context (e.g., modern browser or Node with 'type':'module').
fix
Use import instead, or switch to a bundler that supports require.
Failed to load rule 'no-undef': Cannot find module 'eslint/lib/rules/no-undef'
Trying to load a rule that expects Node.js module resolution; browser build may not include all rules.
fix
Only use rules that are bundled with the linter. Check the package's bundled rules list.
Upgrade
Version history
10.2.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
eslint-linter-browserify — npm install eslint-linter-browserify · libregistry