forked from dotnet/vscode-csharp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.mjs
More file actions
84 lines (82 loc) · 3.03 KB
/
Copy patheslint.config.mjs
File metadata and controls
84 lines (82 loc) · 3.03 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
74
75
76
77
78
79
80
81
82
83
84
import { fixupPluginRules } from '@eslint/compat';
import js from '@eslint/js';
import { defineConfig } from 'eslint/config';
import headerPlugin from 'eslint-plugin-header';
import prettierPlugin from 'eslint-plugin-prettier';
import unicornPlugin from 'eslint-plugin-unicorn';
import globals from 'globals';
import tseslint from 'typescript-eslint';
const compatibleHeaderPlugin = fixupPluginRules({
...headerPlugin,
rules: {
...headerPlugin.rules,
header: {
...headerPlugin.rules.header,
meta: {
...headerPlugin.rules.header.meta,
schema: [{ enum: ['block', 'line'] }, { type: 'array', items: { type: 'string' } }],
},
},
},
});
export default defineConfig([
{
ignores: ['out/**', 'dist/**', 'wallaby.js', 'eslint.config.mjs', 'esbuild.js', '**/*.d.ts'],
},
{
files: ['**/*.ts'],
extends: [js.configs.recommended, tseslint.configs.recommended],
languageOptions: {
globals: globals.node,
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
linterOptions: {
reportUnusedDisableDirectives: 'off',
},
plugins: {
header: compatibleHeaderPlugin,
prettier: prettierPlugin,
unicorn: unicornPlugin,
},
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-require-imports': 'off',
'@typescript-eslint/no-unused-vars': [
'warn',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
},
],
'@typescript-eslint/no-namespace': 'off',
'@typescript-eslint/promise-function-async': 'error',
'@typescript-eslint/no-floating-promises': 'error',
'prefer-promise-reject-errors': 'error',
curly: 'error',
'prettier/prettier': ['error', { endOfLine: 'auto' }],
'unicorn/filename-case': [
'error',
{
case: 'camelCase',
checkDirectories: false,
ignore: ['I[A-Z].*\\.ts$', 'vscode-tasks\\.d\\.ts'],
},
],
'header/header': [
'error',
'block',
[
'---------------------------------------------------------------------------------------------',
' * Copyright (c) Microsoft Corporation. All rights reserved.',
' * Licensed under the MIT License. See License.txt in the project root for license information.',
' *--------------------------------------------------------------------------------------------',
],
],
},
},
]);