|
| 1 | +import jest from 'eslint-plugin-jest' |
| 2 | +import globals from 'globals' |
| 3 | +import babelParser from '@babel/eslint-parser' |
| 4 | +import path from 'node:path' |
| 5 | +import { fileURLToPath } from 'node:url' |
| 6 | +import js from '@eslint/js' |
| 7 | +import { FlatCompat } from '@eslint/eslintrc' |
| 8 | + |
| 9 | +const __filename = fileURLToPath(import.meta.url) |
| 10 | +const __dirname = path.dirname(__filename) |
| 11 | +const compat = new FlatCompat({ |
| 12 | + baseDirectory: __dirname, |
| 13 | + recommendedConfig: js.configs.recommended, |
| 14 | + allConfig: js.configs.all |
| 15 | +}) |
| 16 | + |
| 17 | +export default [ |
| 18 | + { |
| 19 | + ignores: ['node_modules/', 'dist/', 'coverage/', '*.json'] |
| 20 | + }, |
| 21 | + ...compat.extends( |
| 22 | + 'eslint:recommended', |
| 23 | + 'plugin:github/recommended', |
| 24 | + 'plugin:jest/recommended' |
| 25 | + ), |
| 26 | + { |
| 27 | + plugins: { |
| 28 | + jest |
| 29 | + }, |
| 30 | + |
| 31 | + languageOptions: { |
| 32 | + globals: { |
| 33 | + ...globals.commonjs, |
| 34 | + ...globals.jest, |
| 35 | + ...globals.node, |
| 36 | + Atomics: 'readonly', |
| 37 | + SharedArrayBuffer: 'readonly' |
| 38 | + }, |
| 39 | + |
| 40 | + parser: babelParser, |
| 41 | + ecmaVersion: 2023, |
| 42 | + sourceType: 'module', |
| 43 | + |
| 44 | + parserOptions: { |
| 45 | + requireConfigFile: false, |
| 46 | + |
| 47 | + babelOptions: { |
| 48 | + babelrc: false, |
| 49 | + configFile: false, |
| 50 | + presets: ['jest'] |
| 51 | + } |
| 52 | + } |
| 53 | + }, |
| 54 | + |
| 55 | + rules: { |
| 56 | + 'filenames/match-regex': 'off', |
| 57 | + camelcase: 'off', |
| 58 | + 'eslint-comments/no-use': 'off', |
| 59 | + 'eslint-comments/no-unused-disable': 'off', |
| 60 | + 'i18n-text/no-en': 'off', |
| 61 | + 'import/no-commonjs': 'off', |
| 62 | + 'import/no-namespace': 'off', |
| 63 | + 'no-console': 'off', |
| 64 | + 'no-unused-vars': 'off', |
| 65 | + 'prettier/prettier': 'error', |
| 66 | + semi: 'off' |
| 67 | + } |
| 68 | + } |
| 69 | +] |
0 commit comments