|
1 |
| -import path from 'node:path' |
2 |
| -import { fileURLToPath } from 'node:url' |
3 |
| - |
4 |
| -import { FlatCompat } from '@eslint/eslintrc' |
5 |
| -import js from '@eslint/js' |
6 |
| -import typescriptEslint from '@typescript-eslint/eslint-plugin' |
7 | 1 | import parser from '@typescript-eslint/parser'
|
8 | 2 | import simpleImportSort from 'eslint-plugin-simple-import-sort'
|
9 | 3 | import sortKeysFix from 'eslint-plugin-sort-keys-fix'
|
| 4 | +import tseslint from 'typescript-eslint' |
10 | 5 |
|
11 |
| -const __filename = fileURLToPath(import.meta.url) |
12 |
| -const __dirname = path.dirname(__filename) |
13 |
| -const compat = new FlatCompat({ |
14 |
| - allConfig: js.configs.all, |
15 |
| - baseDirectory: __dirname, |
16 |
| - recommendedConfig: js.configs.recommended, |
17 |
| -}) |
18 |
| - |
| 6 | +/** @type {import('eslint').Linter.Config[]} */ |
19 | 7 | export default [
|
20 |
| - { |
21 |
| - ignores: ['**/*.d.*', '**/*.js', 'android/', 'ios/', 'node_modules/'], |
22 |
| - }, |
23 |
| - { |
24 |
| - files: ['**/*.ts', '**/*.tsx'], |
25 |
| - }, |
26 |
| - ...compat.extends( |
27 |
| - 'eslint:recommended', |
28 |
| - 'plugin:@typescript-eslint/recommended', |
29 |
| - ), |
| 8 | + { ignores: ['**/*.d.*', '**/*.js', 'android', 'ios', 'node_modules'] }, |
| 9 | + { files: ['**/*.ts', '**/*.tsx'] }, |
30 | 10 | {
|
31 | 11 | languageOptions: {
|
32 |
| - ecmaVersion: 14, |
33 | 12 | globals: {},
|
34 | 13 | parser,
|
35 |
| - parserOptions: { |
36 |
| - ecmaFeatures: { |
37 |
| - jsx: true, |
38 |
| - }, |
39 |
| - }, |
| 14 | + parserOptions: { ecmaFeatures: { jsx: true } }, |
40 | 15 | sourceType: 'script',
|
41 | 16 | },
|
42 |
| - |
43 | 17 | plugins: {
|
44 |
| - '@typescript-eslint': typescriptEslint, |
45 | 18 | 'simple-import-sort': simpleImportSort,
|
46 | 19 | 'sort-keys-fix': sortKeysFix,
|
47 | 20 | },
|
48 |
| - |
49 | 21 | rules: {
|
50 |
| - '@typescript-eslint/ban-types': 'off', |
51 |
| - '@typescript-eslint/no-explicit-any': 'off', |
52 | 22 | 'no-console': ['warn', { allow: ['error'] }],
|
53 | 23 | 'no-duplicate-imports': ['error', { includeExports: true }],
|
| 24 | + 'simple-import-sort/exports': 'error', |
54 | 25 | 'simple-import-sort/imports': 'error',
|
55 | 26 | 'sort-keys-fix/sort-keys-fix': 'error',
|
56 | 27 | },
|
57 | 28 | },
|
| 29 | + ...tseslint.configs.recommended, |
58 | 30 | ]
|
0 commit comments