-
-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy path.oxlintrc.json
More file actions
123 lines (106 loc) · 5.09 KB
/
.oxlintrc.json
File metadata and controls
123 lines (106 loc) · 5.09 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
// vim: set filetype=jsonc:
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"ignorePatterns": [
// not our code
"src/glide/generated/@types/generated/**",
// includes c preprocessor directives
"src/browser/app/profile/glide.js"
],
"jsPlugins": [
"eslint-plugin-mozilla",
"./.oxlint-plugin.mjs"
],
"rules": {
// our rules
"glide/require-using-for-scoped-prefs": "error",
// ----
// we're in a unique situation where this is better
"typescript/triple-slash-reference": "off",
// I do not care
"typescript/no-this-alias": "off",
"no-empty-file": "off",
// Mozilla rules
"eslint-plugin-mozilla/no-addtask-setup": "error",
"eslint-plugin-mozilla/no-cu-reportError": "error",
"eslint-plugin-mozilla/no-throw-cr-literal": "error",
"eslint-plugin-mozilla/no-useless-run-test": "error",
"eslint-plugin-mozilla/no-browser-refs-in-toolkit": "error",
"eslint-plugin-mozilla/no-comparison-or-assignment-inside-ok": "error",
"eslint-plugin-mozilla/reject-addtask-only": "error",
"eslint-plugin-mozilla/reject-multiple-getters-calls": "error",
"eslint-plugin-mozilla/reject-relative-requires": "error",
"eslint-plugin-mozilla/reject-lazy-imports-into-globals": "error",
// TODO: requires a patch so that it doesn't apply to type imports
"eslint-plugin-mozilla/reject-import-system-module-from-non-system": "off",
"eslint-plugin-mozilla/use-services": "error",
"eslint-plugin-mozilla/use-chromeutils-generateqi": "error",
"eslint-plugin-mozilla/use-console-createInstance": "error",
"eslint-plugin-mozilla/use-default-preference-values": "error",
"eslint-plugin-mozilla/use-includes-instead-of-indexOf": "error",
"eslint-plugin-mozilla/prefer-formatValues": "error",
// this is not true in our environment
"eslint-plugin-mozilla/reject-top-level-await": "off"
// --------------------------- TODO: check what we want from this list
// "eslint-plugin-mozilla/avoid-Date-timing": "error",
// "eslint-plugin-mozilla/avoid-removeChild": "error",
// "eslint-plugin-mozilla/balanced-listeners": "error",
// "eslint-plugin-mozilla/balanced-observers": "error",
// "eslint-plugin-mozilla/lazy-getter-object-name": "error",
// "eslint-plugin-mozilla/no-aArgs": "error",
// "eslint-plugin-mozilla/no-compare-against-boolean-literals": "error",
// "eslint-plugin-mozilla/no-define-cc-etc": "error",
// "eslint-plugin-mozilla/no-useless-parameters": "error",
// "eslint-plugin-mozilla/no-useless-removeEventListener": "error",
// "eslint-plugin-mozilla/prefer-boolean-length-check": "error",
// "eslint-plugin-mozilla/reject-eager-module-in-lazy-getter": "error",
// "eslint-plugin-mozilla/reject-globalThis-modification": "error",
// "eslint-plugin-mozilla/reject-importGlobalProperties": "error",
// "eslint-plugin-mozilla/reject-mixing-eager-and-lazy": "error",
// "eslint-plugin-mozilla/reject-multiple-await": "error",
// "eslint-plugin-mozilla/reject-scriptableunicodeconverter": "error",
// "eslint-plugin-mozilla/rejects-requires-await": "error",
// "eslint-plugin-mozilla/use-cc-etc": "error",
// "eslint-plugin-mozilla/use-ownerGlobal": "error",
// "eslint-plugin-mozilla/use-returnValue": "error",
// "eslint-plugin-mozilla/use-static-import": "error",
// "eslint-plugin-mozilla/valid-lazy": "error",
// "eslint-plugin-mozilla/valid-services": "error",
// --------------------------- unsupported rules
// `getFileName()` is not a function
// "eslint-plugin-mozilla/mark-test-function-used": "error",
// "eslint-plugin-mozilla/no-arbitrary-setTimeout": "error",
// "eslint-plugin-mozilla/no-newtab-refs-outside-newtab": "error",
// "eslint-plugin-mozilla/import-browser-window-globals": "error",
// "eslint-plugin-mozilla/import-globals": "error",
// "eslint-plugin-mozilla/import-headjs-globals": "error",
// `TypeError: Cannot read private member #internal from an object whose class did not declare it`
// "eslint-plugin-mozilla/no-redeclare-with-import-autofix": "error",
// seems to require some more config
// "eslint-plugin-mozilla/reject-some-requires": "error",
// "eslint-plugin-mozilla/valid-ci-uses": "error",
// "eslint-plugin-mozilla/valid-services-property": "error",
// `getScope()` is not a function
// "eslint-plugin-mozilla/use-isInstance": "error",
// "eslint-plugin-mozilla/import-content-task-globals": "error",
},
"overrides": [
{
// this rule is incorrect in this case
"files": ["**/*.d.ts", "**/*.d.mts", "src/glide/browser/base/content/browser-api.mts"],
"rules": { "mozilla/no-browser-refs-in-toolkit": "off" }
},
{
"files": ["src/glide/browser/base/content/extension-api.d.ts"],
"rules": {
// this is generated, we don't *really* care enough right now
"typescript/no-redundant-type-constituents": "off"
}
},
{
// the mozilla plugin reports issues in .d.ts files, that we don't care about
"files": ["src/glide/generated/**"],
"jsPlugins": []
}
]
}