@clipboard-health/oxlint-config 1.0.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/README.md +68 -0
- package/package.json +23 -0
- package/src/base.json +92 -0
- package/src/index.d.ts +1 -0
- package/src/index.js +7 -0
- package/src/index.js.map +1 -0
package/README.md
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# @clipboard-health/oxlint-config <!-- omit from toc -->
|
|
2
|
+
|
|
3
|
+
Shared [Oxlint](https://oxc.rs/docs/guide/usage/linter) configuration for Clipboard Health repositories.
|
|
4
|
+
|
|
5
|
+
## Table of contents <!-- omit from toc -->
|
|
6
|
+
|
|
7
|
+
- [Install](#install)
|
|
8
|
+
- [Usage](#usage)
|
|
9
|
+
- [What is shared](#what-is-shared)
|
|
10
|
+
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install @clipboard-health/oxlint-config
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
Oxlint's `extends` only inherits `rules`, `plugins`, and `overrides`. Properties like `categories`, `options`, `settings`, and `ignorePatterns` must be set in each repo's local config.
|
|
20
|
+
|
|
21
|
+
Create an `.oxlintrc.json` in your repo root:
|
|
22
|
+
|
|
23
|
+
```json
|
|
24
|
+
{
|
|
25
|
+
"$schema": "./node_modules/oxlint/configuration_schema.json",
|
|
26
|
+
"extends": ["./node_modules/@clipboard-health/oxlint-config/src/base.json"],
|
|
27
|
+
"categories": {
|
|
28
|
+
"correctness": "error",
|
|
29
|
+
"nursery": "error",
|
|
30
|
+
"pedantic": "error",
|
|
31
|
+
"perf": "error",
|
|
32
|
+
"restriction": "error",
|
|
33
|
+
"style": "error",
|
|
34
|
+
"suspicious": "error"
|
|
35
|
+
},
|
|
36
|
+
"ignorePatterns": [".agents", "coverage/", "node_modules/"],
|
|
37
|
+
"options": {
|
|
38
|
+
"denyWarnings": true,
|
|
39
|
+
"reportUnusedDisableDirectives": "error",
|
|
40
|
+
"typeAware": true,
|
|
41
|
+
"typeCheck": true
|
|
42
|
+
},
|
|
43
|
+
"settings": {
|
|
44
|
+
"node": {
|
|
45
|
+
"version": ">=24.14.0"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Override shared rules as needed:
|
|
52
|
+
|
|
53
|
+
```json
|
|
54
|
+
{
|
|
55
|
+
"extends": ["./node_modules/@clipboard-health/oxlint-config/src/base.json"],
|
|
56
|
+
"rules": {
|
|
57
|
+
"no-console": "off"
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## What is shared
|
|
63
|
+
|
|
64
|
+
The `base.json` config includes:
|
|
65
|
+
|
|
66
|
+
- **Plugins**: eslint, typescript, unicorn, oxc, import, jsdoc, node, promise
|
|
67
|
+
- **Rules**: Opinionated defaults with select rules disabled
|
|
68
|
+
- **Overrides**: Root-level files, vitest config, test files, and script files
|
package/package.json
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@clipboard-health/oxlint-config",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Shared Oxlint configuration for Clipboard Health repositories.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"config",
|
|
7
|
+
"oxlint"
|
|
8
|
+
],
|
|
9
|
+
"bugs": "https://github.com/ClipboardHealth/core-utils/issues",
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "git+https://github.com/ClipboardHealth/core-utils.git",
|
|
14
|
+
"directory": "packages/oxlint-config"
|
|
15
|
+
},
|
|
16
|
+
"type": "commonjs",
|
|
17
|
+
"main": "./src/index.js",
|
|
18
|
+
"typings": "./src/index.d.ts",
|
|
19
|
+
"publishConfig": {
|
|
20
|
+
"access": "public"
|
|
21
|
+
},
|
|
22
|
+
"types": "./src/index.d.ts"
|
|
23
|
+
}
|
package/src/base.json
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
{
|
|
2
|
+
"plugins": ["eslint", "typescript", "unicorn", "oxc", "import", "jsdoc", "node", "promise"],
|
|
3
|
+
"rules": {
|
|
4
|
+
"curly": ["error", "all"],
|
|
5
|
+
"func-style": ["error", "declaration"],
|
|
6
|
+
"id-length": "off",
|
|
7
|
+
"import/consistent-type-specifier-style": "off",
|
|
8
|
+
"import/exports-last": "off",
|
|
9
|
+
"import/group-exports": "off",
|
|
10
|
+
"import/no-cycle": ["error", { "ignoreExternal": true, "maxDepth": 16 }],
|
|
11
|
+
"import/no-nodejs-modules": "off",
|
|
12
|
+
"import/no-relative-parent-imports": "off",
|
|
13
|
+
"import/prefer-default-export": "off",
|
|
14
|
+
"init-declarations": "off",
|
|
15
|
+
"max-statements": "off",
|
|
16
|
+
"no-magic-numbers": "off",
|
|
17
|
+
"no-named-export": "off",
|
|
18
|
+
"no-ternary": "off",
|
|
19
|
+
"no-undef": "off",
|
|
20
|
+
"no-unused-vars": [
|
|
21
|
+
"warn",
|
|
22
|
+
{
|
|
23
|
+
"argsIgnorePattern": "^_",
|
|
24
|
+
"varsIgnorePattern": "^_",
|
|
25
|
+
"caughtErrorsIgnorePattern": "^_"
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"no-undefined": "off",
|
|
29
|
+
"no-use-before-define": "off",
|
|
30
|
+
"object-shorthand": ["error", "properties"],
|
|
31
|
+
"oxc/no-async-await": "off",
|
|
32
|
+
"oxc/no-optional-chaining": "off",
|
|
33
|
+
"oxc/no-rest-spread-properties": "off",
|
|
34
|
+
"promise/avoid-new": "off",
|
|
35
|
+
"promise/prefer-await-to-callbacks": "off",
|
|
36
|
+
"require-await": "off",
|
|
37
|
+
"typescript/prefer-readonly-parameter-types": "off",
|
|
38
|
+
"typescript/promise-function-async": "off",
|
|
39
|
+
"unicorn/filename-case": ["error", { "case": "camelCase" }],
|
|
40
|
+
"unicorn/no-null": "off",
|
|
41
|
+
"unicorn/prevent-abbreviations": ["error", { "ignore": ["config", "params", "props", "ref"] }]
|
|
42
|
+
},
|
|
43
|
+
"overrides": [
|
|
44
|
+
{
|
|
45
|
+
"files": ["./*.ts", "./*.js", "./*.cjs"],
|
|
46
|
+
"rules": {
|
|
47
|
+
"import/no-anonymous-default-export": "off",
|
|
48
|
+
"import/no-commonjs": "off",
|
|
49
|
+
"import/no-default-export": "off",
|
|
50
|
+
"import/unambiguous": "off",
|
|
51
|
+
"sort-imports": "off",
|
|
52
|
+
"typescript/no-unsafe-argument": "off",
|
|
53
|
+
"typescript/no-unsafe-assignment": "off",
|
|
54
|
+
"typescript/no-unsafe-call": "off",
|
|
55
|
+
"typescript/no-unsafe-return": "off",
|
|
56
|
+
"typescript/no-unsafe-member-access": "off",
|
|
57
|
+
"typescript/strict-boolean-expressions": "off",
|
|
58
|
+
"unicorn/prefer-module": "off"
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"files": ["**/vitest.config.ts"],
|
|
63
|
+
"rules": {
|
|
64
|
+
"import/no-default-export": "off"
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"files": ["**/*.test.ts", "**/*.spec.ts"],
|
|
69
|
+
"rules": {
|
|
70
|
+
"max-lines": "off",
|
|
71
|
+
"max-lines-per-function": "off"
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"files": ["**/scripts/**/*.ts"],
|
|
76
|
+
"rules": {
|
|
77
|
+
"max-lines": "off",
|
|
78
|
+
"max-lines-per-function": "off",
|
|
79
|
+
"no-console": "off",
|
|
80
|
+
"no-plusplus": "off",
|
|
81
|
+
"node/no-process-env": "off",
|
|
82
|
+
"sort-imports": "off",
|
|
83
|
+
"sort-keys": "off",
|
|
84
|
+
"typescript/no-non-null-assertion": "off",
|
|
85
|
+
"typescript/no-unnecessary-condition": "off",
|
|
86
|
+
"typescript/no-unsafe-type-assertion": "off",
|
|
87
|
+
"typescript/strict-boolean-expressions": "off",
|
|
88
|
+
"unicorn/no-process-exit": "off"
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
]
|
|
92
|
+
}
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as base } from "./base.json";
|
package/src/index.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.base = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
var base_json_1 = require("./base.json");
|
|
6
|
+
Object.defineProperty(exports, "base", { enumerable: true, get: function () { return tslib_1.__importDefault(base_json_1).default; } });
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/oxlint-config/src/index.ts"],"names":[],"mappings":";;;;AAAA,yCAA8C;AAArC,0HAAA,OAAO,OAAQ"}
|