@boringnode/tooling 0.0.0-stage → 0.1.0

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.
package/LICENSE.md ADDED
@@ -0,0 +1,9 @@
1
+ # The MIT License
2
+
3
+ Copyright 2026 Romain Lanz, contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,97 @@
1
- # Temporary Holding Version
1
+ # @boringnode/tooling
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Shared OXLint and OXFmt configurations.
4
+
5
+ ## Installation
6
+
7
+ ```sh
8
+ yarn add --dev @boringnode/tooling oxlint oxfmt
9
+ ```
10
+
11
+ ## OXLint
12
+
13
+ ```ts
14
+ // oxlint.config.ts
15
+ import { boringnodePreset } from '@boringnode/tooling/oxlint';
16
+
17
+ export default boringnodePreset();
18
+ ```
19
+
20
+ React and Vue rules are opt-in:
21
+
22
+ ```ts
23
+ export default boringnodePreset({ react: true });
24
+ ```
25
+
26
+ The preset enables these general rules by default:
27
+
28
+ - `complexity`
29
+ - `curly`
30
+ - `eqeqeq`
31
+ - `max-depth`
32
+ - `no-else-return`
33
+ - `no-nested-ternary`
34
+ - `oxc/no-accumulating-spread`, the native companion of `anti-slop/no-reduce-accumulator-copy`
35
+ - `prefer-const`
36
+ - `typescript/consistent-type-definitions`
37
+ - `typescript/no-explicit-any`
38
+ - `typescript/no-non-null-assertion`
39
+
40
+ It also enables the BoringNode-specific rules:
41
+
42
+ - `boringnode/blank-line-after-imports`
43
+ - `boringnode/max-logical-operands` (warning): name an inline `&&`/`||` chain of more than three operands
44
+ - `boringnode/max-params`: at most four parameters, except the constructor of an `@inject()` class
45
+ - `boringnode/no-await-in-call-arguments`: store `await` results before passing them to a call
46
+ - `boringnode/no-await-in-call-targets`: rejects `(await x).method()`
47
+ - `boringnode/no-await-in-conditions`: store `await` results before testing them
48
+ - `boringnode/no-constructor-defaults`: inject a dependency instead of building it in a constructor default
49
+ - `boringnode/no-typescript-private`: use `#private` members; private constructors and readonly constructor
50
+ dependencies remain allowed
51
+
52
+ Finally, it enables all 18 generic rules from
53
+ [`dmmulroy/anti-slop`](https://github.com/dmmulroy/anti-slop). They reject low-evidence type assertions,
54
+ unsafe dictionary and `unknown` types, module mocking, reflection, runtime `typeof` narrowing, eager
55
+ `filter().map()` passes, accumulator copies in reducers, and similar patterns. `require-readable-spacing`
56
+ autofixes missing blank lines before control flow and `return`, after blocks, and around multiline
57
+ declarations, while keeping comments attached to their statement. The vendored source tracks upstream commit
58
+ `13909c9e07590f5a85d93c62712259fe14a883f7`; the optional Effect rules are not included.
59
+
60
+ OXLint options and rules can be overridden in the same object:
61
+
62
+ ```ts
63
+ export default boringnodePreset({
64
+ ignorePatterns: ['generated/**'],
65
+ rules: { complexity: 'off' },
66
+ });
67
+ ```
68
+
69
+ ## OXFmt
70
+
71
+ ```ts
72
+ // oxfmt.config.ts
73
+ import { boringnodePreset } from '@boringnode/tooling/oxfmt';
74
+
75
+ export default boringnodePreset();
76
+ ```
77
+
78
+ Every OXFmt option can be overridden:
79
+
80
+ ```ts
81
+ export default boringnodePreset({ printWidth: 100, useTabs: false });
82
+ ```
83
+
84
+ ## Scripts
85
+
86
+ ```json
87
+ {
88
+ "scripts": {
89
+ "format": "oxfmt --check .",
90
+ "format:fix": "oxfmt --write .",
91
+ "lint": "oxlint",
92
+ "lint:fix": "oxlint --fix"
93
+ }
94
+ }
95
+ ```
96
+
97
+ New rules and formatting defaults may be added in minor releases. API changes follow semantic versioning.
@@ -0,0 +1,58 @@
1
+ # Third-party licenses
2
+
3
+ ## anti-slop
4
+
5
+ The anti-slop OXLint rules under `src/anti_slop` come from
6
+ [`dmmulroy/anti-slop`](https://github.com/dmmulroy/anti-slop), commit
7
+ `13909c9e07590f5a85d93c62712259fe14a883f7`.
8
+
9
+ MIT License
10
+
11
+ Copyright (c) 2026 Dillon Mulroy
12
+
13
+ Permission is hereby granted, free of charge, to any person obtaining a copy
14
+ of this software and associated documentation files (the "Software"), to deal
15
+ in the Software without restriction, including without limitation the rights
16
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17
+ copies of the Software, and to permit persons to whom the Software is
18
+ furnished to do so, subject to the following conditions:
19
+
20
+ The above copyright notice and this permission notice shall be included in all
21
+ copies or substantial portions of the Software.
22
+
23
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
28
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
29
+ SOFTWARE.
30
+
31
+ ## ESLint Stylistic
32
+
33
+ The padding engine under `src/anti_slop/vendor/eslint-stylistic`, used by `anti-slop/require-readable-spacing`,
34
+ comes from [`eslint-stylistic/eslint-stylistic`](https://github.com/eslint-stylistic/eslint-stylistic), commit
35
+ `435c3ea0fd26a5fef9042c4b36b6e165fbbf8d08`.
36
+
37
+ MIT License
38
+
39
+ Copyright OpenJS Foundation and other contributors, <www.openjsf.org>
40
+ Copyright (c) 2023-PRESENT ESLint Stylistic contributors
41
+
42
+ Permission is hereby granted, free of charge, to any person obtaining a copy
43
+ of this software and associated documentation files (the "Software"), to deal
44
+ in the Software without restriction, including without limitation the rights
45
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
46
+ copies of the Software, and to permit persons to whom the Software is
47
+ furnished to do so, subject to the following conditions:
48
+
49
+ The above copyright notice and this permission notice shall be included in all
50
+ copies or substantial portions of the Software.
51
+
52
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
53
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
54
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
55
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
56
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
57
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
58
+ SOFTWARE.
@@ -0,0 +1,6 @@
1
+ import * as _oxlint_plugins from '@oxlint/plugins';
2
+
3
+ /** Generic Oxlint rules that reject low-evidence and low-signal implementation patterns. */
4
+ declare const antiSlopPlugin: _oxlint_plugins.Plugin;
5
+
6
+ export { antiSlopPlugin as default };