-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy path.oxlintrc.json
More file actions
100 lines (85 loc) · 3.29 KB
/
Copy path.oxlintrc.json
File metadata and controls
100 lines (85 loc) · 3.29 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
96
97
98
99
100
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"plugins": ["typescript", "unicorn", "oxc", "import", "promise", "node"],
"categories": {
"correctness": "error",
"suspicious": "error",
"pedantic": "error",
"perf": "error",
"style": "error"
},
"env": {
"builtin": true,
"node": true,
"es2024": true
},
"rules": {
// Source files use snake_case names.
"unicorn/filename-case": ["error", { "case": "snakeCase" }],
// `T[]` for simple element types, `Array<T>` for anything else.
"typescript/array-type": ["error", { "default": "array-simple" }],
// Keep type-only imports inline instead of splitting every module into two
// import statements.
"typescript/consistent-type-imports": [
"error",
{ "fixStyle": "inline-type-imports" }
],
"import/consistent-type-specifier-style": ["error", "prefer-inline"],
// `== null` is the idiomatic null-or-undefined check.
"eqeqeq": ["error", "always", { "null": "ignore" }],
// Destructuring reads well for object properties, less so for indexing
// into a regex match.
"prefer-destructuring": [
"error",
{
"VariableDeclarator": { "array": false, "object": true },
"AssignmentExpression": { "array": false, "object": false }
}
],
// Size and complexity metrics: the device matrix and the forwarder setup
// are intentionally long, table-driven blocks.
"max-classes-per-file": "off",
"max-depth": "off",
"max-lines": "off",
"max-lines-per-function": "off",
"max-params": "off",
"max-statements": "off",
// Protocol constants (device types, firmware versions, byte offsets) are
// documented in place and would only get less readable behind names.
"no-magic-numbers": "off",
// oxfmt normalizes numeric literals to lowercase, so the rule and the
// formatter would fight over every hex literal.
"unicorn/number-literal-case": "off",
// Formatting/ordering opinions that oxfmt does not enforce and that would
// only add churn.
"capitalized-comments": "off",
"no-inline-comments": "off",
"sort-imports": "off",
"sort-keys": "off",
// Style preferences that contradict how this codebase is written.
"func-style": "off",
"id-length": "off",
"init-declarations": "off",
"no-ternary": "off",
"no-underscore-dangle": "off",
"unicorn/no-null": "off",
// This is a Node application with named exports throughout.
"import/no-nodejs-modules": "off",
"import/no-named-export": "off",
"import/prefer-default-export": "off",
"import/group-exports": "off",
"import/exports-last": "off",
// Sequential awaits are deliberate: retry backoff and start-up ordering.
"no-await-in-loop": "off",
// Config is read once at start-up, before the event loop matters.
"node/no-sync": "off",
// Static-only helper classes mirror the device protocol implementation.
"typescript/no-extraneous-class": "off",
"unicorn/no-static-only-class": "off",
// Constructor parameter properties are idiomatic TypeScript.
"typescript/parameter-properties": "off",
// MQTT.js is callback-based, and a delay needs a hand-rolled promise.
"promise/prefer-await-to-callbacks": "off",
"promise/avoid-new": "off"
}
}