-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.mjs
More file actions
73 lines (69 loc) · 2.86 KB
/
eslint.config.mjs
File metadata and controls
73 lines (69 loc) · 2.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
// @ts-check
import eslint from '@eslint/js';
import { defineConfig } from 'eslint/config';
import tsEslint from 'typescript-eslint';
import simpleImportSort from 'eslint-plugin-simple-import-sort';
import globals from 'globals';
const __dirname = new URL('.', import.meta.url).href;
export default defineConfig(
eslint.configs.recommended,
tsEslint.configs.recommendedTypeChecked,
{
plugins: {
'simple-import-sort': simpleImportSort,
},
rules: {
'simple-import-sort/imports': 'warn',
'simple-import-sort/exports': 'warn',
},
},
{ languageOptions: { parserOptions: { projectService: true, tsconfigRootDir: __dirname } } },
{
ignores: [
'**/*.d.ts',
'**/node_modules/**',
'lib',
'dist',
'out',
'eslint.*',
'examples',
'test-packages',
'workerTerminate.mjs',
'*.config.ts',
'scripts',
'browser.js',
'index.js',
'coverage',
'website',
],
},
{
languageOptions: {
ecmaVersion: 2023,
sourceType: 'module',
globals: { ...globals.node },
parserOptions: {
// Work around for: https://github.com/typescript-eslint/typescript-eslint/issues/11530
tsconfigRootDir: import.meta.dirname,
},
},
rules: {
// Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs
quotes: ['warn', 'single', { avoidEscape: true }],
'no-use-before-define': 'off',
'no-unused-vars': 'off',
// e.g. "@typescript-eslint/explicit-function-return-type": "off",
'@typescript-eslint/consistent-type-exports': ['error', { fixMixedExportsWithInlineTypeSpecifier: false }],
'@typescript-eslint/consistent-type-imports': ['error', { fixStyle: 'separate-type-imports', prefer: 'type-imports' }],
'@typescript-eslint/explicit-function-return-type': ['error', { allowExpressions: true }],
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/no-inferrable-types': 'off', // We do NOT want this. It goes against `isolatedDeclarations`
'@typescript-eslint/no-non-null-assertion': 'error',
'@typescript-eslint/no-redundant-type-constituents': 'off', // allowed to communicate expected type in a union with `unknown`
'@typescript-eslint/no-unused-vars': ['error', { ignoreRestSiblings: true, argsIgnorePattern: '^_' }],
'@typescript-eslint/no-use-before-define': 'off', // this is a bit too aggressive.',
},
},
);