-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patheslint.config.js
More file actions
53 lines (51 loc) · 1.63 KB
/
Copy patheslint.config.js
File metadata and controls
53 lines (51 loc) · 1.63 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
import eslint from '@eslint/js';
import {defineConfig} from 'eslint/config';
import tseslint from 'typescript-eslint';
import {includeIgnoreFile} from '@eslint/compat';
import {fileURLToPath} from 'node:url';
import path from 'node:path';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
export default defineConfig(
// Include ignores from .gitignore and package-level .gitignore files
includeIgnoreFile(path.resolve(__dirname, '.gitignore')),
includeIgnoreFile(path.resolve(__dirname, 'packages/core/.gitignore')),
includeIgnoreFile(path.resolve(__dirname, 'packages/supertalk/.gitignore')),
eslint.configs.recommended,
tseslint.configs.strictTypeChecked,
tseslint.configs.stylisticTypeChecked,
{
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
},
{
rules: {
// Customize as needed
'@typescript-eslint/no-unused-vars': [
'error',
{argsIgnorePattern: '^_', varsIgnorePattern: '^_'},
],
'@typescript-eslint/consistent-type-imports': 'error',
'@typescript-eslint/consistent-type-exports': 'error',
// Allow async functions in void positions (e.g., event handlers)
'@typescript-eslint/no-misused-promises': [
'error',
{checksVoidReturn: false},
],
// Prefer Array<T> over T[]
'@typescript-eslint/array-type': ['error', {default: 'generic'}],
'@typescript-eslint/no-confusing-void-expression': 'off',
},
},
{
ignores: [
'**/node_modules/**',
'**/*.js',
'**/*.mjs',
'packages/supertalk/**',
],
},
);