Config Files · 1 file

Sample ESLint Config File

ESLint’s flat config (eslint.config.js) sets lint rules and file globs. Our sample is realistic and valid for its tool, with fake hosts and secrets.

ESLint config · 554 B

ESLint flat config

An ESLint 9 flat config with the recommended rules, browser globals, ignores and a TypeScript-specific block. All hosts, keys and secrets are fake.

CC0 · free for any use · Verified by an independent tool · Report a problem

eslint.config.js — first linesJavaScript
// Sample eslint.config.js (flat config) — samplefiles.com
import js from '@eslint/js';
import globals from 'globals';

export default [
  { ignores: ['dist/', 'coverage/', '**/*.min.js'] },
  js.configs.recommended,
  {
    files: ['**/*.{js,mjs}'],
    languageOptions: {
      ecmaVersion: 'latest',
      sourceType: 'module',
      globals: { ...globals.browser, ...globals.node },
    },
    rules: {
      'no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
      eqeqeq: ['error', 'always'],
      'prefer-const': 'error',
    },
  },
];

File details

Size
554 B (554 bytes)
MIME type
text/javascript
SHA-256
7f6ab4716e4568ef5f7188a0e876b2cbf4146b9ba26d9a9a4c9b65a2f9672761
MD5
ac301ba9f50eb0b18e75bb5ef2b01f22

Download from the command line

curl -L -o eslint.config.js https://files.samplefiles.com/config/eslint/eslint.config.js

Or check the download in your browser with the checksum calculator.