npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@bhsd/eslint-browserify

v9.39.3

Published

ESLint in browser

Readme

ESLint-browserify

npm version License Codacy Badge

API

The eslint global variable has a Linter constructor.

const linter = new eslint.Linter();

Linter

The Linter instance does the actual evaluation of the JavaScript code. It parses and reports on the code.

Linter#verify

The most important method on Linter is verify(), which initiates linting of the given text. This method accepts three arguments:

  • code - the source code to lint (a string).
  • config - a configuration object or an array of configuration objects.

You can call verify() like this:

const linter = new eslint.Linter();

const messages = linter.verify(
	"var foo",
	{
		rules: {
			semi: 2,
		},
	},
);

The verify() method returns an array of objects containing information about the linting warnings and errors. Here's an example:

[
	{
		fatal: false,
		ruleId: "semi",
		severity: 2,
		line: 1,
		column: 8,
		message: "Missing semicolon.",
		fix: {
			range: [7, 7],
			text: ";",
		},
	},
];

The information available for each linting message is:

  • column - the column on which the error occurred.
  • fatal - usually omitted, but will be set to true if there's a parsing error (not related to a rule).
  • line - the line on which the error occurred.
  • message - the message that should be output.
  • messageId - the ID of the message used to generate the message (this property is omitted if the rule does not use message IDs).
  • ruleId - the ID of the rule that triggered the messages (or null if fatal is true).
  • severity - either 1 or 2, depending on your configuration.
  • endColumn - the end column of the range on which the error occurred (this property is omitted if it's not range).
  • endLine - the end line of the range on which the error occurred (this property is omitted if it's not range).
  • fix - an object describing the fix for the problem (this property is omitted if no fix is available).
  • suggestions - an array of objects describing possible lint fixes for editors to programmatically enable.

Linter#verifyAndFix

This method is similar to verify except that it also runs autofixing logic, similar to the --fix flag on the command line. The result object will contain the autofixed code, along with any remaining linting messages for the code that were not autofixed.

const linter = new eslint.Linter();

const messages = linter.verifyAndFix("var foo", {
	rules: {
		semi: 2,
	},
});

Output object from this method:

{
    fixed: true,
    output: "var foo;",
    messages: []
}

The information available is:

  • fixed - true, if the code was fixed.
  • output - fixed code text (might be the same as input if no fixes were applied).
  • messages - collection of all messages for the given code (It has the same information as explained above under verify block).