-
Notifications
You must be signed in to change notification settings - Fork 40
Expand file tree
/
Copy pathoxlint.config.ts
More file actions
95 lines (90 loc) · 2.38 KB
/
Copy pathoxlint.config.ts
File metadata and controls
95 lines (90 loc) · 2.38 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
94
95
import oxlintConfig from '@readme/oxlint-config';
import oxlintConfigVitest from '@readme/oxlint-config/testing/vitest';
import oxlintConfigTS from '@readme/oxlint-config/typescript';
import { defineConfig } from 'oxlint';
export default defineConfig({
extends: [oxlintConfig, oxlintConfigTS],
options: {
reportUnusedDisableDirectives: 'error',
},
ignorePatterns: ['**/coverage', '**/dist'],
categories: {
suspicious: 'error',
},
env: {
browser: true,
commonjs: true,
es2022: true,
node: true,
},
rules: {
'class-methods-use-this': 'off',
},
overrides: [
{
files: ['packages/**/*.test.{js,ts}'],
...oxlintConfigVitest,
rules: Object.assign(structuredClone(oxlintConfigVitest.rules), {
'jest/max-nested-describe': 'off',
'jest/require-hook': 'off',
// Unsafe optional chaining in tests is fine because if it fails we'll fail the test.
'no-unsafe-optional-chaining': 'off',
'vitest/warn-todo': 'off',
}),
},
{
files: [
'packages/jest-expect-har/**/*.{js,ts}',
'packages/jest-expect-jsonschema/**/*.{js,ts}',
'packages/jest-expect-openapi/**/*.{js,ts}',
],
rules: {
'oxc/no-this-in-exported-function': 'off',
},
},
{
files: [
'packages/jest-expect-har/test/*.test.{js,ts}',
'packages/jest-expect-jsonschema/test/*.test.{js,ts}',
'packages/jest-expect-openapi/test/*.test.{js,ts}',
],
env: {
jest: true,
vitest: true,
},
},
{
files: ['packages/oas/src/**/*.ts'],
rules: {
'max-classes-per-file': 'off',
'no-continue': 'off',
'no-param-reassign': 'off',
'no-plusplus': 'off',
'no-underscore-dangle': [
'error',
{
allow: ['_key', '_requirements', '__INTERNAL__', '__pending'],
},
],
'no-use-before-define': 'off',
},
},
{
files: ['packages/parser/**/*.ts'],
rules: {
'no-continue': 'off',
'no-param-reassign': 'off',
'no-plusplus': 'off',
'no-use-before-define': 'off',
},
},
{
files: ['packages/parser/test/**/*.ts'],
rules: {
'no-conditional-expect': 'off',
'no-multi-assign': 'off',
'oxc/no-this-in-exported-function': 'off',
},
},
],
});