simplesense ESLint Config

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

ESLint shareable config for Simplesense coding styles. Current version 6.0.38, compatible with ESLint 9.x. Released regularly with many versions. Provides a flat config setup with recommended rules and plugin configurations. Key differentiator: integrated documentation generation for rules, supporting multiple documentation sources (module, GitHub, static). Includes file type linting support. Requires ESLint 9.x as a peer dependency.

error Error [ERR_REQUIRE_ESM]: require() of ES Module
cause Using CommonJS require to load the config which is ESM-only
fix
Change to import syntax or use dynamic import() inside a CommonJS file.
error TypeError: config is not iterable
cause Forgetting to spread the default export array in eslint.config.js
fix
Use export default [...config]; instead of export default config;
error ESLint couldn't find the config 'eslint-config-simplesense'
cause Missing install of the package or mismatched version
fix
Run npm install eslint-config-simplesense --save-dev and ensure ESLint 9.x is installed.
breaking v6.0.0 switched from .eslintrc to flat config format
fix Migrate to eslint.config.js using the flat config array import.
deprecated ESLint 8.x is not supported in v6.x
fix Update ESLint to 9.x.
gotcha CommonJS require() will throw because config uses ESM syntax
fix Use import syntax in an ESM module or rename file to .mjs.
gotcha Default export is an array, not an object; spreading into your config array is required
fix Use ...config to flatten the configs into your array.
npm install eslint-config-simplesense
yarn add eslint-config-simplesense
pnpm add eslint-config-simplesense

Shows how to use the flat config array in an eslint.config.js file.

import config from 'eslint-config-simplesense';

export default [
  ...config,
  {
    rules: {
      'no-console': 'warn',
    },
  },
];