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
// 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
Download from the command line
curl -L -o eslint.config.js https://files.samplefiles.com/config/eslint/eslint.config.jswget https://files.samplefiles.com/config/eslint/eslint.config.jshttps://files.samplefiles.com/config/eslint/eslint.config.jsprintf '%s %s\n' 7f6ab4716e4568ef5f7188a0e876b2cbf4146b9ba26d9a9a4c9b65a2f9672761 eslint.config.js | shasum -a 256 -cOr check the download in your browser with the checksum calculator.