@eslint/config-helpers
Helper utilities for creating ESLint configuration
Last updated 7 days ago by GitHub Actions .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @eslint/config-helpers 
SYNC missed versions from official npm registry.

@eslint/config-helpers

Description

Helper utilities for creating ESLint configuration.

Installation

For Node.js and compatible runtimes:

npm install @eslint/config-helpers
# or
yarn add @eslint/config-helpers
# or
pnpm install @eslint/config-helpers
# or
bun add @eslint/config-helpers

For Deno:

deno add @eslint/config-helpers

Usage

defineConfig()

The defineConfig() function allows you to specify an ESLint configuration with full type checking and additional capabilities, such as extends. Here's an example:

// eslint.config.js
import { defineConfig } from "@eslint/config-helpers";
import js from "@eslint/js";

export default defineConfig([
	{
		files: ["src/**/*.js"],
		plugins: { js },
		extends: ["js/recommended"],
		rules: {
			"no-var": "error",
			"prefer-const": "error",
		},
	},
	{
		files: ["test/**/*.js"],
		rules: {
			"no-console": "off",
		},
	},
]);

globalIgnores()

The globalIgnores() function allows you to specify patterns for files and directories that should be globally ignored by ESLint. This is useful for excluding files that you don't want to lint, such as build directories or third-party libraries. Here's an example:

// eslint.config.js
import { defineConfig, globalIgnores } from "@eslint/config-helpers";

export default defineConfig([
	{
		files: ["src/**/*.js"],
		rules: {
			"no-var": "error",
			"prefer-const": "error",
		},
	},
	globalIgnores(["node_modules/", "dist/", "coverage/"]),
]);

License

Apache 2.0

Sponsors

The following companies, organizations, and individuals support ESLint's ongoing maintenance and development. Become a Sponsor to get your logo on our READMEs and website.

Platinum Sponsors

Automattic

Gold Sponsors

Qlty Software

Silver Sponsors

Vite Liftoff StackBlitz

Bronze Sponsors

Cybozu SAP CrawlJobs aeriusventilation's Org Depot Icons8 Discord GitBook HeroCoders TestMu AI Open Source Office (Formerly LambdaTest)

Technology Sponsors

Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.

Netlify Algolia 1Password

Current Tags

  • 0.5.4                                ...           latest (7 days ago)

15 Versions

  • 0.5.4                                ...           7 days ago
  • 0.5.3                                ...           a month ago
  • 0.5.2                                ...           2 months ago
  • 0.5.1                                ...           3 months ago
  • 0.5.0                                ...           5 months ago
  • 0.4.2                                ...           5 months ago
  • 0.4.1                                ...           6 months ago
  • 0.4.0                                ...           7 months ago
  • 0.3.1                                ...           8 months ago
  • 0.3.0                                ...           10 months ago
  • 0.2.3                                ...           10 months ago
  • 0.2.2                                ...           a year ago
  • 0.2.1                                ...           a year ago
  • 0.2.0                                ...           a year ago
  • 0.1.0                                ...           a year ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 2
Last Month 2
Dependencies (1)
Dev Dependencies (1)
Dependents (2)

Copyright 2013 - present © cnpmjs.org | Home |