eslint-config-brightspace

raw JSON →
2.12.1 verified Sat Apr 25 auth: no javascript

Shareable ESLint configuration for Brightspace projects. Version 2.12.1 is the latest stable release, updated as of February 2026, with a monthly release cadence driven by dependency bumps and fixes. It supports ESLint 7–9 and provides environment-specific configs (node, browser, Lit, React, testing). Unlike generic ESLint configs, it includes helper functions like `addExtensions` and `setDirectoryConfigs` for fine-grained control over file extensions and directory-level overrides. Notably, it migrated from deprecated `quotes` rule to `@stylistic/quotes` in v2.11.1, and adopted the flat config format (eslint.config.js) required by ESLint 9. This config is designed exclusively for D2L/Brightspace ecosystem but can serve as a reference for large-scale project configurations.

error Error [ERR_REQUIRE_ESM]: require() of ES Module /path/to/eslint-config-brightspace/index.js from /path/to/eslint.config.js not supported.
cause Trying to require an ESM-only package with CommonJS require() or using require() in eslint.config.js without ESM context.
fix
Change to import syntax and ensure eslint.config.js is treated as ESM (e.g., set type: 'module' in package.json).
error Configuration for rule "quotes" is invalid: "@stylistic/quotes" has not been loaded.
cause Using an older version (<2.11.1) that still uses the deprecated 'quotes' rule, or the plugin '@stylistic/eslint-plugin' is missing.
fix
Upgrade to v2.11.1+ and install '@stylistic/eslint-plugin' if it's not automatically installed.
error ESLint couldn't find the config "eslint-config-brightspace" to extend from. Please check that the name of the config is correct.
cause Using .eslintrc.* format instead of eslint.config.js flat config.
fix
Convert to eslint.config.js and use import syntax. Remove .eslintrc.* files.
error Cannot read properties of undefined (reading 'map')
cause Occurs when setDirectoryConfigs is called with incorrect arguments (e.g., missing config array).
fix
Ensure the first argument is a valid config array (e.g., nodeConfig) and the second argument is an object mapping directory names to config arrays.
gotcha ESM-only package: This package uses ES modules. It cannot be imported with CommonJS require().
fix Use import syntax in an ESM context (type: 'module' in package.json or .mjs extension).
deprecated Deprecated quotes rule: The 'quotes' rule has been replaced by '@stylistic/quotes' in v2.11.1.
fix Upgrade to v2.11.1 or later to use the stylistic version.
gotcha Flat config only: This package uses the new flat config format (eslint.config.js) and does not support .eslintrc.* formats.
fix Use eslint.config.js file; remove any .eslintrc.* files.
breaking ESLint compatibility limited to 7-9: v2.12.1 explicitly restricts peer dependency to ESLint 7, 8, and 9.
fix Ensure ESLint version is 7.x, 8.x, or 9.x. ESLint 10+ not supported without upgrade.
gotcha setDirectoryConfigs forces prior configs to ignore specified directories: Configs applied via setDirectoryConfigs will be ignored by any previously defined configs for paths matching the directory.
fix Order configurations correctly: define global config first, then directory-specific overrides.
gotcha No default export: The package does not export a default configuration; always use named exports.
fix Use named imports like `import { nodeConfig } from 'eslint-config-brightspace'`.
npm install eslint-config-brightspace
yarn add eslint-config-brightspace
pnpm add eslint-config-brightspace

Shows how to combine browser and node configs with custom file extensions and an extra rule override.

// eslint.config.js
import { nodeConfig, browserConfig, addExtensions } from 'eslint-config-brightspace';

export default [
  ...browserConfig,
  ...addExtensions(nodeConfig, ['.js', '.mjs']),
  {
    rules: {
      'no-console': 'warn',
    },
  },
];