-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
72 lines (71 loc) · 2.01 KB
/
eslint.config.js
File metadata and controls
72 lines (71 loc) · 2.01 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
const typescriptEslint = require('@typescript-eslint/eslint-plugin');
const typescriptParser = require('@typescript-eslint/parser');
const prettierConfig = require('eslint-config-prettier');
module.exports = [
{
files: ['src/**/*.{ts}'],
languageOptions: {
parser: typescriptParser,
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
project: './tsconfig.eslint.json',
},
},
plugins: {
'@typescript-eslint': typescriptEslint,
},
rules: {
...typescriptEslint.configs.recommended.rules,
// Disable rules that might conflict with Prettier
...prettierConfig.rules,
// Additional rules that make sense for this project
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/no-explicit-any': 'warn',
'prefer-const': 'error',
'no-console': 'off', // Allow console.log since this is a CLI tool
'@typescript-eslint/no-require-imports': 'off', // Allow require in CommonJS files
},
},
{
files: ['src/**/*.test.ts', 'src/**/*.spec.ts'],
languageOptions: {
parser: typescriptParser,
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
project: './tsconfig.eslint.json',
},
globals: {
describe: 'readonly',
it: 'readonly',
test: 'readonly',
expect: 'readonly',
beforeEach: 'readonly',
beforeAll: 'readonly',
afterEach: 'readonly',
afterAll: 'readonly',
jest: 'readonly',
},
},
plugins: {
'@typescript-eslint': typescriptEslint,
},
rules: {
...typescriptEslint.configs.recommended.rules,
...prettierConfig.rules,
// Allow any in tests for mocking
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/no-require-imports': 'off',
},
},
{
ignores: [
'dist/**',
'node_modules/**',
'mastodon-documentation/**',
'*.js',
],
},
];