-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmeocord.eslint.cjs
More file actions
93 lines (85 loc) · 2.17 KB
/
Copy pathmeocord.eslint.cjs
File metadata and controls
93 lines (85 loc) · 2.17 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
85
86
87
88
89
90
91
92
93
/**
* MeoCord Framework
* Copyright (c) 2025 Ukasyah Rahmatullah Zada
* SPDX-License-Identifier: MIT
*/
const { importX } = require('eslint-plugin-import-x')
const globals = require('globals')
const tsParser = require('@typescript-eslint/parser')
const eslintTs = require('typescript-eslint')
const eslintConfigPrettier = require('eslint-config-prettier')
const eslintPluginPrettier = require('eslint-plugin-prettier')
const tsFiles = ['**/*.ts']
const languageOptions = {
globals: {
...globals.node,
...globals.jest,
},
ecmaVersion: 2023,
sourceType: 'module',
parserOptions: {
project: ['./tsconfig.json', './tsconfig.test.json', './tsconfig.eslint.json'],
},
}
const typescriptConfig = {
files: tsFiles,
plugins: {
'import-x': importX,
prettier: eslintPluginPrettier,
},
languageOptions: {
...languageOptions,
parser: tsParser,
},
settings: {
'import-x/parsers': {
'@typescript-eslint/parser': ['.ts'],
},
'import-x/resolver': {
typescript: {
alwaysTryTypes: true,
project: ['./tsconfig.json', './tsconfig.test.json', './tsconfig.eslint.json'],
},
},
},
rules: {
'prettier/prettier': 'error',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-var-requires': 'warn',
'@typescript-eslint/no-unused-expressions': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{
vars: 'all',
varsIgnorePattern: '^_',
args: 'all',
argsIgnorePattern: '^_',
},
],
},
}
const recommendedTypeScriptConfigs = [
...eslintTs.configs.recommended.map(config => ({
...config,
files: tsFiles,
})),
...eslintTs.configs.stylistic.map(config => ({
...config,
files: tsFiles,
})),
]
const specConfig = {
files: ['**/*.spec.ts'],
rules: {
'@typescript-eslint/no-empty-function': 'off',
},
}
module.exports = [
{ ignores: ['docs/*', 'build/*', 'lib/*', 'dist/*', 'meocord.config.ts', 'vitest.config.ts'] },
...recommendedTypeScriptConfigs,
specConfig,
eslintConfigPrettier,
typescriptConfig,
]
module.exports.typescriptConfig = typescriptConfig