@projectwallace/preset-oxlint 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +34 -0
  3. package/index.json +104 -0
  4. package/package.json +20 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Project Wallace
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,34 @@
1
+ # Oxlint preset
2
+
3
+ ## Installation
4
+
5
+ ```sh
6
+ npm i --save-dev oxlint @projectwallace/preset-oxlint
7
+ ```
8
+
9
+ ## Usage
10
+
11
+ In `package.json`:
12
+
13
+ ```jsonc
14
+ {
15
+ "scripts": {
16
+ "lint": "oxlint --config .oxlintrc.json"
17
+ }
18
+ }
19
+ ```
20
+
21
+ Create an `.oxlintrc.json`:
22
+
23
+ ```jsonc
24
+ {
25
+ "$schema": "./node_modules/oxlint/configuration_schema.json",
26
+ "extends": ["@projectwallace/preset-oxlint"],
27
+ "env": [
28
+ "node": true, // or false, but be explicit
29
+ "browser": true, // or false, but be explicit
30
+ ],
31
+ "rules": {}, // override what you need for the whole project
32
+ "overrides": {} // override per file type, per folder, etc.
33
+ }
34
+ ```
package/index.json ADDED
@@ -0,0 +1,104 @@
1
+ {
2
+ "$schema": "./node_modules/oxlint/configuration_schema.json",
3
+ "plugins": [
4
+ "import",
5
+ "typescript",
6
+ "oxc",
7
+ "unicorn",
8
+ "vitest"
9
+ ],
10
+ "env": {
11
+ "es2024": true
12
+ },
13
+ "categories": {
14
+ "perf": "error",
15
+ "correctness": "error",
16
+ "pedantic": "error"
17
+ },
18
+ "rules": {
19
+ // ============================================================
20
+ // Core/ESLint rules
21
+ // ============================================================
22
+ // Allow using any TypeScript types without restrictions
23
+ "ban-types": "off",
24
+ // Switch statements don't require a default case
25
+ "default-case": "off",
26
+ // Functions don't require explicit return type annotations
27
+ "explicit-function-return-type": "off",
28
+ // No limit on the number of classes per file
29
+ "max-classes-per-file": "off",
30
+ // Warn when nesting exceeds 5 levels to maintain readability
31
+ "max-depth": [
32
+ "warn",
33
+ {
34
+ "max": 5
35
+ }
36
+ ],
37
+ // No limit on the number of import/require statements per file
38
+ "max-dependencies": "off",
39
+ // No limit on file length
40
+ "max-lines": "off",
41
+ // No limit on function length
42
+ "max-lines-per-function": "off",
43
+ // Allow using async/await syntax
44
+ "no-async-await": "off",
45
+ // Allow await inside loops
46
+ "no-await-in-loop": "off",
47
+ // Allow bitwise operators (&, |, ^, ~, <<, >>, >>>)
48
+ "no-bitwise": "off",
49
+ // Allow CommonJS require/module.exports
50
+ "no-commonjs": "off",
51
+ // Allow console statements
52
+ "no-console": "warn",
53
+ // Allow default exports
54
+ "no-default-export": "off",
55
+ // Warn about disabled tests to prevent them from being forgotten
56
+ "no-disabled-tests": "warn",
57
+ // Allow if statements without else after an else block
58
+ "no-lonely-if": "off",
59
+ // Allow TypeScript non-null assertions (!)
60
+ "no-non-null-assertion": "off",
61
+ // Allow optional chaining (?.)
62
+ "no-optional-chaining": "off",
63
+ // Allow unary ++ and -- operators
64
+ "no-plusplus": "off",
65
+ // Allow rest/spread syntax (...obj, { ...rest })
66
+ "no-rest-spread-properties": "off",
67
+ // Allow using undefined as a value
68
+ "no-undefined": "off",
69
+ // Allow unused variables (handled by TypeScript)
70
+ "no-unused-vars": "off",
71
+ // Allow explicit return of undefined
72
+ "no-useless-undefined": "off",
73
+ // Don't enforce String.codePointAt over String.charCodeAt
74
+ "prefer-code-point": "off",
75
+ // Don't enforce Math.trunc over bitwise operations
76
+ "prefer-math-trunc": "off",
77
+ // Don't enforce querySelector over getElementById
78
+ "prefer-query-selector": "off",
79
+ // Don't enforce String.slice over String.substr/substring
80
+ "prefer-string-slice": "off",
81
+ // Warn about async functions that don't use await
82
+ "require-await": "warn",
83
+
84
+ // ============================================================
85
+ // Unicorn plugin rules
86
+ // ============================================================
87
+ // Prefer using `undefined` over `null` for consistency
88
+ "unicorn/no-null": "error",
89
+ // Don't enforce Set.has() over Array.includes()
90
+ "unicorn/prefer-set-has": "off",
91
+
92
+ // ============================================================
93
+ // Vitest plugin rules
94
+ // ============================================================
95
+ // Always use `test()` instead of `it()` for consistency
96
+ "vitest/consistent-test-it": [
97
+ "error",
98
+ {
99
+ "fn": "test",
100
+ "withinDescribe": "test"
101
+ }
102
+ ]
103
+ }
104
+ }
package/package.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "@projectwallace/preset-oxlint",
3
+ "version": "0.0.1",
4
+ "description": "Opinionated preset for Oxlint",
5
+ "main": "index.json",
6
+ "scripts": {},
7
+ "keywords": [
8
+ "oxlint",
9
+ "preset"
10
+ ],
11
+ "author": "Bart Veneman",
12
+ "license": "MIT",
13
+ "type": "module",
14
+ "files": [
15
+ "index.json"
16
+ ],
17
+ "peerDependencies": {
18
+ "oxlint": "^1.0.0"
19
+ }
20
+ }