|
| 1 | +import globals from 'globals'; |
| 2 | +import path from 'node:path'; |
| 3 | +import {fileURLToPath} from 'node:url'; |
| 4 | +import js from '@eslint/js'; |
| 5 | +import {FlatCompat} from '@eslint/eslintrc'; |
| 6 | + |
| 7 | +const __filename = fileURLToPath(import.meta.url); |
| 8 | +const __dirname = path.dirname(__filename); |
| 9 | +const compat = new FlatCompat({ |
| 10 | + baseDirectory: __dirname, |
| 11 | + recommendedConfig: js.configs.recommended, |
| 12 | + allConfig: js.configs.all |
| 13 | +}); |
| 14 | + |
| 15 | +export default [...compat.extends('eslint:recommended'), { |
| 16 | + languageOptions: { |
| 17 | + globals: { |
| 18 | + ...globals.node, |
| 19 | + }, |
| 20 | + ecmaVersion: 2024, |
| 21 | + sourceType: 'module', |
| 22 | + }, |
| 23 | + rules: { |
| 24 | + eqeqeq: ['error', 'always'], |
| 25 | + indent: ['warn', 2], |
| 26 | + 'keyword-spacing': ['warn'], |
| 27 | + 'key-spacing': ['warn', { |
| 28 | + beforeColon: false, |
| 29 | + afterColon: true, |
| 30 | + mode: 'minimum', |
| 31 | + }], |
| 32 | + 'linebreak-style': ['warn', 'unix'], |
| 33 | + 'no-useless-rename': ['warn'], |
| 34 | + 'object-shorthand': ['warn', 'always'], |
| 35 | + quotes: ['warn', 'single'], |
| 36 | + semi: ['warn', 'always'], |
| 37 | + 'space-before-blocks': ['warn', 'always'], |
| 38 | + 'space-infix-ops': ['warn'], |
| 39 | + }, |
| 40 | +}]; |
0 commit comments