-
Notifications
You must be signed in to change notification settings - Fork 250
/
eslint.config.js
72 lines (65 loc) · 2.21 KB
/
eslint.config.js
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
// @ts-check
import eslint from '@eslint/js';
import path from 'path';
import { fileURLToPath } from 'url';
import tseslint from 'typescript-eslint';
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
// @ts-expect-error: No types available
import pluginChaiFriendly from 'eslint-plugin-chai-friendly';
/** @type {import('@typescript-eslint/utils').TSESLint.FlatConfig.Rules} */
export const rules = {
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_*', ignoreRestSiblings: true, varsIgnorePattern: '^_' }],
// fix - separate PR
'@typescript-eslint/unbound-method': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
// Handled by typescript
'no-undef': 'off',
// We don't care
'@typescript-eslint/no-explicit-any': 'off',
};
export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
eslintPluginPrettierRecommended,
{
languageOptions: {
parserOptions: {
project: 'tsconfig.lint.json',
tsconfigRootDir: path.dirname(fileURLToPath(import.meta.url)),
},
},
rules,
},
{
plugins: { 'chai-friendly': pluginChaiFriendly },
files: ['packages/*/test/**/*.@(ts|js|mts|cts)'],
rules: {
'no-unused-expressions': 'off', // disable original rule
'@typescript-eslint/no-unused-expressions': 'off', // disable original rule
'chai-friendly/no-unused-expressions': 'error',
},
},
{
ignores: [
'**/node_modules/**',
'*.d.ts',
'packages/*/dist/',
'packages/*/testResources/**',
'packages/*/src-generated/**',
'packages/*/reports/**',
'packages/*/coverage/**',
'packages/*/@(stryker.conf.js|.mocharc.cjs|stryker-karma.conf.cjs)',
// Ignore specific files
'packages/jasmine-runner/typings/jasmine-types.d.ts',
'packages/karma-runner/src/karma-plugins/stryker-mutant-coverage-adapter.ts',
'packages/grunt-stryker/tasks/stryker.js',
// e2e is linted in the e2e package
'e2e/',
'perf/',
'helpers/',
],
},
);