@kamaal111/kamaal-quality-config 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.
- package/LICENSE +21 -0
- package/README.md +91 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/oxfmt.d.ts +7 -0
- package/dist/oxfmt.d.ts.map +1 -0
- package/dist/oxfmt.js +7 -0
- package/dist/oxfmt.js.map +1 -0
- package/dist/oxlintrc.json +28 -0
- package/package.json +73 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Kamaal Farah
|
|
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,91 @@
|
|
|
1
|
+
# @kamaal111/kamaal-quality-config
|
|
2
|
+
|
|
3
|
+
Kamaal Farah's shared [oxlint](https://oxc.rs) quality config.
|
|
4
|
+
|
|
5
|
+
Currently enables every rule from [`@kamaal111/oxlint-plugin-anti-slop`](https://github.com/kamaal111/anti-slop),
|
|
6
|
+
Kamaal's fork of [`dmmulroy/anti-slop`](https://github.com/dmmulroy/anti-slop). More rule sources
|
|
7
|
+
will be folded in over time.
|
|
8
|
+
|
|
9
|
+
## Table of contents
|
|
10
|
+
|
|
11
|
+
- [Install](#install)
|
|
12
|
+
- [Usage](#usage)
|
|
13
|
+
- [oxlint](#oxlint)
|
|
14
|
+
- [oxfmt](#oxfmt)
|
|
15
|
+
- [Development](#development)
|
|
16
|
+
|
|
17
|
+
## Install
|
|
18
|
+
|
|
19
|
+
```sh
|
|
20
|
+
pnpm add -D @kamaal111/kamaal-quality-config
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Usage
|
|
24
|
+
|
|
25
|
+
### oxlint
|
|
26
|
+
|
|
27
|
+
Extend it from your `.oxlintrc.json`:
|
|
28
|
+
|
|
29
|
+
```jsonc
|
|
30
|
+
{
|
|
31
|
+
"extends": ["node_modules/@kamaal111/kamaal-quality-config/dist/oxlintrc.json"],
|
|
32
|
+
// ...the rest of your project's own oxlint config
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
The package ships a plain, statically-generated `dist/oxlintrc.json` — no `oxlint.config.ts` or
|
|
37
|
+
package-import support is needed, since `.oxlintrc.json`'s `extends` field accepts plain file paths.
|
|
38
|
+
|
|
39
|
+
Alternatively, if your project already uses `oxlint.config.ts`, you can import the same config as a
|
|
40
|
+
JS object instead:
|
|
41
|
+
|
|
42
|
+
```ts
|
|
43
|
+
import kamaalQualityConfig from '@kamaal111/kamaal-quality-config';
|
|
44
|
+
import { defineConfig } from 'oxlint';
|
|
45
|
+
|
|
46
|
+
export default defineConfig({
|
|
47
|
+
extends: [kamaalQualityConfig],
|
|
48
|
+
});
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Both forms carry the same rules — `dist/oxlintrc.json` is generated from the same config object at
|
|
52
|
+
build time.
|
|
53
|
+
|
|
54
|
+
### oxfmt
|
|
55
|
+
|
|
56
|
+
The package also ships a shared [oxfmt](https://oxc.rs) style config at the `./oxfmt` subpath. Unlike
|
|
57
|
+
the oxlint side, this has no JSON form — oxfmt has no `extends` mechanism at all, so the only way to
|
|
58
|
+
consume it is from an `oxfmt.config.ts` (oxfmt auto-discovers this file the same way it does
|
|
59
|
+
`.oxfmtrc.json`; the two can't coexist in the same directory):
|
|
60
|
+
|
|
61
|
+
```ts
|
|
62
|
+
import kamaalOxfmtStyle from '@kamaal111/kamaal-quality-config/oxfmt';
|
|
63
|
+
import { defineConfig } from 'oxfmt';
|
|
64
|
+
|
|
65
|
+
export default defineConfig({
|
|
66
|
+
...kamaalOxfmtStyle,
|
|
67
|
+
ignorePatterns: ['dist', 'pnpm-lock.yaml' /* ...your project's own paths */],
|
|
68
|
+
});
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
`./oxfmt` exports a plain style object (`printWidth`, `arrowParens`, `singleQuote`) with no
|
|
72
|
+
`ignorePatterns` — those are inherently project-specific, so each consumer supplies its own via the
|
|
73
|
+
spread above.
|
|
74
|
+
|
|
75
|
+
If your project calls oxfmt's programmatic API directly (e.g. a script formatting generated output,
|
|
76
|
+
rather than the `oxfmt` CLI), there's no file-based auto-discovery to rely on — import your own
|
|
77
|
+
`oxfmt.config.ts` and read its `default` export:
|
|
78
|
+
|
|
79
|
+
```ts
|
|
80
|
+
import { format } from 'oxfmt';
|
|
81
|
+
|
|
82
|
+
const { default: options } = await import(pathToFileURL(path.join(repoRoot, 'oxfmt.config.ts')).href);
|
|
83
|
+
const result = await format(filepath, sourceText, options);
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Development
|
|
87
|
+
|
|
88
|
+
```sh
|
|
89
|
+
pnpm install
|
|
90
|
+
pnpm quality
|
|
91
|
+
```
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import antiSlopPlugin from '@kamaal111/oxlint-plugin-anti-slop';
|
|
2
|
+
import { defineConfig } from 'oxlint';
|
|
3
|
+
const antiSlopRules = Object.fromEntries(Object.keys(antiSlopPlugin.rules).map(ruleName => [`anti-slop/${ruleName}`, 'error']));
|
|
4
|
+
export default defineConfig({
|
|
5
|
+
jsPlugins: [{ name: 'anti-slop', specifier: '@kamaal111/oxlint-plugin-anti-slop' }],
|
|
6
|
+
rules: antiSlopRules,
|
|
7
|
+
});
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,oCAAoC,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAEtC,MAAM,aAAa,GAAG,MAAM,CAAC,WAAW,CACtC,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,aAAa,QAAQ,EAAE,EAAE,OAAO,CAAU,CAAC,CAC/F,CAAC;AAEF,eAAe,YAAY,CAAC;IAC1B,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,oCAAoC,EAAE,CAAC;IACnF,KAAK,EAAE,aAAa;CACrB,CAAC,CAAC"}
|
package/dist/oxfmt.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oxfmt.d.ts","sourceRoot":"","sources":["../src/oxfmt.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,gBAAgB;aACpB,UAAU,EAAE,GAAG;aACf,WAAW,EAAE,OAAO;aACpB,WAAW;CACH,CAAC;eAEI,gBAAgB"}
|
package/dist/oxfmt.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oxfmt.js","sourceRoot":"","sources":["../src/oxfmt.ts"],"names":[],"mappings":"AAAA,MAAM,gBAAgB,GAAG;IACvB,UAAU,EAAE,GAAG;IACf,WAAW,EAAE,OAAO;IACpB,WAAW,EAAE,IAAI;CACT,CAAC;AAEX,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"jsPlugins": [
|
|
3
|
+
{
|
|
4
|
+
"name": "anti-slop",
|
|
5
|
+
"specifier": "@kamaal111/oxlint-plugin-anti-slop"
|
|
6
|
+
}
|
|
7
|
+
],
|
|
8
|
+
"rules": {
|
|
9
|
+
"anti-slop/no-array-filter-map": "error",
|
|
10
|
+
"anti-slop/no-reduce-accumulator-copy": "error",
|
|
11
|
+
"anti-slop/no-chained-type-assertions": "error",
|
|
12
|
+
"anti-slop/no-conditional-empty-object-spread": "error",
|
|
13
|
+
"anti-slop/no-known-value-widening": "error",
|
|
14
|
+
"anti-slop/no-module-mocking": "error",
|
|
15
|
+
"anti-slop/no-object-parameters": "error",
|
|
16
|
+
"anti-slop/no-reflect-apply": "error",
|
|
17
|
+
"anti-slop/no-reflect-get": "error",
|
|
18
|
+
"anti-slop/no-runtime-typeof": "error",
|
|
19
|
+
"anti-slop/no-unsafe-dictionary-type": "error",
|
|
20
|
+
"anti-slop/no-shape-in-symbol-names": "error",
|
|
21
|
+
"anti-slop/no-unknown-parameters": "error",
|
|
22
|
+
"anti-slop/no-unknown-returns": "error",
|
|
23
|
+
"anti-slop/no-unknown-type-aliases": "error",
|
|
24
|
+
"anti-slop/no-widen-then-assert": "error",
|
|
25
|
+
"anti-slop/require-readable-spacing": "error",
|
|
26
|
+
"anti-slop/require-safety-comment-for-type-assertion": "error"
|
|
27
|
+
}
|
|
28
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@kamaal111/kamaal-quality-config",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Kamaal Farah's shared oxlint quality config.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"lint",
|
|
7
|
+
"oxlint",
|
|
8
|
+
"oxlint-config",
|
|
9
|
+
"quality"
|
|
10
|
+
],
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"author": "Kamaal Farah",
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "git+https://github.com/kamaal111/kamaal-quality-config.git"
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist"
|
|
19
|
+
],
|
|
20
|
+
"type": "module",
|
|
21
|
+
"main": "./dist/index.js",
|
|
22
|
+
"types": "./dist/index.d.ts",
|
|
23
|
+
"exports": {
|
|
24
|
+
".": {
|
|
25
|
+
"types": "./dist/index.d.ts",
|
|
26
|
+
"default": "./dist/index.js"
|
|
27
|
+
},
|
|
28
|
+
"./oxfmt": {
|
|
29
|
+
"types": "./dist/oxfmt.d.ts",
|
|
30
|
+
"default": "./dist/oxfmt.js"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"publishConfig": {
|
|
34
|
+
"access": "public"
|
|
35
|
+
},
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"@kamaal111/oxlint-plugin-anti-slop": "^0.0.4"
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@oxlint/plugins": "^1.82.0",
|
|
41
|
+
"@types/node": "^26.5.1",
|
|
42
|
+
"husky": "^9.1.7",
|
|
43
|
+
"lint-staged": "^17.5.1",
|
|
44
|
+
"oxfmt": "^0.67.0",
|
|
45
|
+
"oxlint": "^1.82.0",
|
|
46
|
+
"oxlint-tsgolint": "^7.0.2001",
|
|
47
|
+
"typescript": "^7.0.2"
|
|
48
|
+
},
|
|
49
|
+
"lint-staged": {
|
|
50
|
+
"*.{js,mjs,cjs,ts}": "pnpm run lint",
|
|
51
|
+
"*": "oxfmt --no-error-on-unmatched-pattern"
|
|
52
|
+
},
|
|
53
|
+
"devEngines": {
|
|
54
|
+
"packageManager": {
|
|
55
|
+
"name": "pnpm",
|
|
56
|
+
"version": "12.4.1",
|
|
57
|
+
"onFail": "error"
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
"engines": {
|
|
61
|
+
"node": ">=26.0.0"
|
|
62
|
+
},
|
|
63
|
+
"scripts": {
|
|
64
|
+
"build": "rm -rf dist && tsc -p tsconfig.build.json && node scripts/generate-json-config.ts",
|
|
65
|
+
"clean:build": "rm -rf dist tsconfig.tsbuildinfo && pnpm run build",
|
|
66
|
+
"lint": "oxlint",
|
|
67
|
+
"format": "oxfmt",
|
|
68
|
+
"format:check": "oxfmt --check",
|
|
69
|
+
"type-check": "tsc --noEmit",
|
|
70
|
+
"quality": "pnpm run lint && pnpm run format:check && pnpm run type-check",
|
|
71
|
+
"release": "node ./scripts/publish.ts"
|
|
72
|
+
}
|
|
73
|
+
}
|