-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patheslint.config.mjs
More file actions
77 lines (74 loc) · 2 KB
/
Copy patheslint.config.mjs
File metadata and controls
77 lines (74 loc) · 2 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
import js from '@eslint/js';
import obsidianmd from 'eslint-plugin-obsidianmd';
import tseslint from 'typescript-eslint';
const scannerRulesDisabledForTests = Object.fromEntries(
obsidianmd.configs.recommended.flatMap((config) => Object.keys(config.rules ?? {})).map((rule) => [rule, 'off']),
);
const recommendedTestRules = Object.assign(
{},
js.configs.recommended.rules,
...tseslint.configs.recommended.map((config) => config.rules ?? {}),
);
export default tseslint.config(
{
ignores: ['build/', 'node_modules/', 'Temp/', 'scripts/', 'esbuild.config.mjs'],
},
...obsidianmd.configs.recommended,
{
files: ['**/*.{ts,cts,mts,tsx}'],
languageOptions: {
parserOptions: {
project: './tsconfig.json',
tsconfigRootDir: import.meta.dirname,
},
},
},
{
files: ['src/**/*.ts'],
rules: {
'obsidianmd/ui/sentence-case': [
'warn',
{
brands: ['Acaia', 'Pearl S', 'Bluetooth', 'BLE', 'Obsidian', 'GitHub', 'CubicJ Brewing', '°C'],
acronyms: ['RPM', 'MB', 'UI', '°C'],
enforceCamelCaseLower: true,
},
],
},
},
{
files: ['src/i18n/locales/en.json'],
languageOptions: {
parser: tseslint.parser,
parserOptions: {
extraFileExtensions: ['.json'],
project: false,
},
},
rules: {
'no-unused-expressions': 'off',
'@typescript-eslint/no-unused-expressions': 'off',
'obsidianmd/ui/sentence-case-json': [
'warn',
{
brands: ['Acaia', 'Pearl S', 'Bluetooth', 'BLE', 'Obsidian', 'GitHub', 'CubicJ Brewing', '°C'],
acronyms: ['RPM', 'MB', 'UI', '°C'],
enforceCamelCaseLower: true,
},
],
},
},
{
files: ['tests/**/*.ts'],
...tseslint.configs.disableTypeChecked,
rules: {
...tseslint.configs.disableTypeChecked.rules,
...scannerRulesDisabledForTests,
...recommendedTestRules,
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }],
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-require-imports': 'off',
'no-empty': 'error',
},
},
);