|
| 1 | +/* eslint-disable max-len */ |
| 2 | +import { defineConfig, globalIgnores } from 'eslint/config'; |
| 3 | +import globals from 'globals'; |
| 4 | +import react from '@hydrooj/eslint-config'; |
| 5 | + |
| 6 | +export default defineConfig([globalIgnores([ |
| 7 | + '**/dist', |
| 8 | + '**/*.d.ts', |
| 9 | + '**/node_modules', |
| 10 | + '**/.*.js', |
| 11 | +]), { |
| 12 | + extends: [react], |
| 13 | + |
| 14 | + languageOptions: { |
| 15 | + ecmaVersion: 5, |
| 16 | + sourceType: 'module', |
| 17 | + }, |
| 18 | + |
| 19 | + settings: { |
| 20 | + 'import/parsers': { |
| 21 | + '@typescript-eslint/parser': ['.ts', '.js', '.jsx', '.tsx'], |
| 22 | + }, |
| 23 | + }, |
| 24 | + |
| 25 | + rules: { |
| 26 | + '@typescript-eslint/no-invalid-this': 1, |
| 27 | + |
| 28 | + 'simple-import-sort/imports': ['warn', { |
| 29 | + groups: [ |
| 30 | + ['^\\u0000'], |
| 31 | + [ |
| 32 | + '^(node:)?(assert|buffer|child_process|cluster|console|constants|crypto|dgram|dns|domain|events|fs|http|https|module|net|os|path|punycode|querystring|readline|repl|stream|string_decoder|sys|timers|tls|tty|url|util|vm|zlib|freelist|v8|process|async_hooks|http2|perf_hooks)(/.*|$)', |
| 33 | + '^(?!@?hydrooj)(@?\\w.+)', |
| 34 | + '^@?hydrooj', |
| 35 | + '^', |
| 36 | + '^\\.', |
| 37 | + ]], |
| 38 | + }], |
| 39 | + }, |
| 40 | +}, { |
| 41 | + files: [ |
| 42 | + '**/packages/ui/**/*.{cjs,ts,tsx}', |
| 43 | + ], |
| 44 | + |
| 45 | + languageOptions: { |
| 46 | + globals: { |
| 47 | + ...globals.browser, |
| 48 | + }, |
| 49 | + parserOptions: { |
| 50 | + sourceType: 'module', |
| 51 | + ecmaVersion: 2020, |
| 52 | + ecmaFeatures: { |
| 53 | + impliedStrict: true, |
| 54 | + experimentalObjectRestSpread: true, |
| 55 | + jsx: true, |
| 56 | + defaultParams: true, |
| 57 | + legacyDecorators: true, |
| 58 | + allowImportExportEverywhere: true, |
| 59 | + }, |
| 60 | + }, |
| 61 | + }, |
| 62 | + |
| 63 | + settings: { |
| 64 | + 'react-x': { |
| 65 | + version: '18.3.1', |
| 66 | + }, |
| 67 | + }, |
| 68 | + |
| 69 | + rules: { |
| 70 | + 'github/array-foreach': 0, |
| 71 | + '@typescript-eslint/no-invalid-this': 0, |
| 72 | + |
| 73 | + // FIXME A bug with eslint-parser |
| 74 | + // 'template-curly-spacing': 'off', |
| 75 | + |
| 76 | + '@stylistic/indent': [ |
| 77 | + 'warn', |
| 78 | + 2, |
| 79 | + { SwitchCase: 1 }, |
| 80 | + ], |
| 81 | + 'function-paren-newline': 'off', |
| 82 | + 'no-mixed-operators': 'off', |
| 83 | + 'no-await-in-loop': 'off', |
| 84 | + 'no-lonely-if': 'off', |
| 85 | + 'no-script-url': 'off', |
| 86 | + }, |
| 87 | +}]); |
0 commit comments