Registry / testing / eslint-config-openlayers

eslint-config-openlayers

JSON →
library21.0.0jsnpmunverified

Shareable ESLint configuration enforcing OpenLayers coding style. v21.0.0 (stable), updated regularly with dependency bumps. Supports ESLint flat config (eslint.config.js). Differentiator: opinionated set of rules for OpenLayers projects, includes JSdoc and Prettier integration. Requires ESLint as peer dependency.

npm install eslint-config-openlayers
INSTALL
IMPORT
SIG · ESLINT-CONFIG-OPEN
E
eslint-config-openlayers
testingjavascriptv21.0.0
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.

default
import openlayers from 'eslint-config-openlayers';
const openlayers = require('eslint-config-openlayers');
ESM-only; CommonJS require() fails. Use `createRequire` if needed.
openlayers
import openlayers from 'eslint-config-openlayers';
import openlayers from 'eslint-config-openlayers'; // correct
Default import returns an array of flat config objects.
FlatConfig
import openlayers from 'eslint-config-openlayers'; export default [...openlayers];
module.exports = require('eslint-config-openlayers');
Flat config must be spread; no direct `module.exports`.

Creates an ESLint flat config extending OpenLayers config with overrides.

// eslint.config.js import openlayers from 'eslint-config-openlayers'; export default [ ...openlayers, { rules: { // Custom overrides 'no-console': 'warn', }, }, ];
Debug
Known issues
breakingFlat config syntax required as of v18.0.0; .eslintrc files no longer supported
fix
Use eslint.config.js with export default [...openlayers];
affects: >=18.0.0
breakingNo else-if return rule added in v18.0.0 may cause new lint errors
fix
Refactor code to avoid else-if after return, e.g. remove else block.
affects: >=18.0.0
deprecatedESLint 8 support ends; v18+ uses ESLint 9 flat config only
fix
Upgrade ESLint to 9.x and use flat config.
affects: >=18.0.0
gotchaPrettier integration requires eslint-config-prettier and eslint-plugin-prettier to be installed
fix
Add 'eslint-config-prettier' and 'eslint-plugin-prettier' as devDependencies.
affects: all
breakingPrefer Object to object rule added in v16.2.2 may cause errors
fix
Use `Object` instead of `object` in TypeScript types or JSDoc.
affects: >=16.2.2
gotchaVSCode users must enable flat config in settings
fix
Set 'eslint.useFlatConfig': true in VSCode settings.
affects: >=18.0.0
Errors
Common errors & fixes
Error [ERR_REQUIRE_ESM]: require() of ES Module /path/to/eslint-config-openlayers/index.js not supported.
Using CommonJS require() on an ESM-only package.
fix
Use import syntax in your eslint.config.js or convert to ES module.
Error: Failed to load config 'openlayers' to extend from.
Using .eslintrc file with extends; flat config required since v18.
fix
Create eslint.config.js and use import openlayers from 'eslint-config-openlayers'; export default [...openlayers];
Error: Configuration for rule 'no-else-return' is invalid: value 'error' is not allowed.
Rule 'no-else-return' uses allowElseIf option not present in ESLint config.
fix
Remove you can use the built-in 'no-else-return' rule configuration or otherwise adjust.
Parsing error: The keyword 'const' is reserved.
ESLint is not configured for ES6+ syntax; config may not include ecmaVersion.
fix
Ensure eslint-config-openlayers is correctly imported; if using custom parser, set ecmaVersion: 2022.
Upgrade
Version history
21.0.0latest on npm
Audit
Dependencies
eslintrequiredpeer dependency required as the linter engine
Agent activity
4 hits · last 30 days
node
4
Resources
eslint-config-openlayers — npm install eslint-config-openlayers · libregistry