@hypernym/oxlint-config 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.txt +22 -0
- package/README.md +90 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +148 -0
- package/package.json +56 -0
package/LICENSE.txt
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026, Ivo Dolenc <https://github.com/ivodolenc>
|
|
4
|
+
Copyright (c) 2026, Hypernym Studio <https://github.com/hypernym-studio>
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
<h1 align="center">@hypernym/oxlint-config</h1>
|
|
2
|
+
|
|
3
|
+
<p align="center">Hypernym's internal config for OXLint.</p>
|
|
4
|
+
|
|
5
|
+
<p align="center">
|
|
6
|
+
<a href="https://github.com/hypernym-studio/oxlint-config">Repository</a>
|
|
7
|
+
<span>✦</span>
|
|
8
|
+
<a href="https://www.npmjs.com/package/@hypernym/oxlint-config">Package</a>
|
|
9
|
+
<span>✦</span>
|
|
10
|
+
<a href="https://github.com/hypernym-studio/oxlint-config/releases">Releases</a>
|
|
11
|
+
<span>✦</span>
|
|
12
|
+
<a href="https://github.com/hypernym-studio/oxlint-config/discussions">Discussions</a>
|
|
13
|
+
</p>
|
|
14
|
+
|
|
15
|
+
<br>
|
|
16
|
+
|
|
17
|
+
<pre align="center">pnpm add -D @hypernym/oxlint-config</pre>
|
|
18
|
+
|
|
19
|
+
<br>
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
Add `lint` commands for manual linting (optional):
|
|
24
|
+
|
|
25
|
+
```json
|
|
26
|
+
{
|
|
27
|
+
"scripts": {
|
|
28
|
+
"lint": "oxlint",
|
|
29
|
+
"lint:fix": "oxlint --fix"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Run command:
|
|
35
|
+
|
|
36
|
+
```sh
|
|
37
|
+
pnpm lint
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Default Config
|
|
41
|
+
|
|
42
|
+
Includes `recommended` rules for `JavaScript` and `TypeScript` out of the box.
|
|
43
|
+
|
|
44
|
+
```ts
|
|
45
|
+
// oxlint.config.ts
|
|
46
|
+
|
|
47
|
+
import { defineConfig, defaultConfig } from '@hypernym/oxlint-config'
|
|
48
|
+
|
|
49
|
+
export default defineConfig(defaultConfig)
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Custom Setup
|
|
53
|
+
|
|
54
|
+
```ts
|
|
55
|
+
// oxlint.config.ts
|
|
56
|
+
|
|
57
|
+
import {
|
|
58
|
+
defineConfig,
|
|
59
|
+
defaultConfig,
|
|
60
|
+
overrides,
|
|
61
|
+
ignorePatterns,
|
|
62
|
+
} from '@hypernym/oxlint-config'
|
|
63
|
+
|
|
64
|
+
export default defineConfig({
|
|
65
|
+
...defaultConfig,
|
|
66
|
+
categories: {
|
|
67
|
+
correctness: 'warn',
|
|
68
|
+
},
|
|
69
|
+
overrides: [
|
|
70
|
+
...overrides,
|
|
71
|
+
{
|
|
72
|
+
files: [],
|
|
73
|
+
rules: {},
|
|
74
|
+
},
|
|
75
|
+
],
|
|
76
|
+
ignorePatterns: [
|
|
77
|
+
...ignorePatterns,
|
|
78
|
+
'**/dir/',
|
|
79
|
+
'**/file.ts',
|
|
80
|
+
// ...
|
|
81
|
+
],
|
|
82
|
+
// ...
|
|
83
|
+
})
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## License
|
|
87
|
+
|
|
88
|
+
Developed in 🇭🇷 Croatia, © Hypernym Studio.
|
|
89
|
+
|
|
90
|
+
Released under the [MIT](LICENSE.txt) license.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { OxlintConfig, OxlintEnv, OxlintOverride, RuleCategories, defineConfig } from "oxlint";
|
|
2
|
+
export * from "oxlint";
|
|
3
|
+
|
|
4
|
+
//#region src/index.d.ts
|
|
5
|
+
declare const jsOverride: OxlintOverride;
|
|
6
|
+
declare const tsOverride: OxlintOverride;
|
|
7
|
+
declare const categories: RuleCategories;
|
|
8
|
+
declare const env: OxlintEnv;
|
|
9
|
+
declare const overrides: OxlintOverride[];
|
|
10
|
+
declare const ignorePatterns: string[];
|
|
11
|
+
declare const defaultConfig: OxlintConfig;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { categories, defaultConfig, defineConfig, env, ignorePatterns, jsOverride, overrides, tsOverride };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { defineConfig } from "oxlint";
|
|
2
|
+
|
|
3
|
+
//#region src/index.ts
|
|
4
|
+
const jsOverride = {
|
|
5
|
+
files: ["**/*.{js,mjs,cjs}"],
|
|
6
|
+
rules: {
|
|
7
|
+
"constructor-super": "error",
|
|
8
|
+
"for-direction": "error",
|
|
9
|
+
"no-async-promise-executor": "error",
|
|
10
|
+
"no-case-declarations": "error",
|
|
11
|
+
"no-class-assign": "error",
|
|
12
|
+
"no-compare-neg-zero": "error",
|
|
13
|
+
"no-cond-assign": "error",
|
|
14
|
+
"no-const-assign": "error",
|
|
15
|
+
"no-constant-binary-expression": "error",
|
|
16
|
+
"no-constant-condition": "error",
|
|
17
|
+
"no-control-regex": "error",
|
|
18
|
+
"no-debugger": "error",
|
|
19
|
+
"no-delete-var": "error",
|
|
20
|
+
"no-dupe-class-members": "error",
|
|
21
|
+
"no-dupe-else-if": "error",
|
|
22
|
+
"no-dupe-keys": "error",
|
|
23
|
+
"no-duplicate-case": "error",
|
|
24
|
+
"no-empty": ["error", { allowEmptyCatch: true }],
|
|
25
|
+
"no-empty-character-class": "error",
|
|
26
|
+
"no-empty-pattern": "error",
|
|
27
|
+
"no-empty-static-block": "error",
|
|
28
|
+
"no-ex-assign": "error",
|
|
29
|
+
"no-extra-boolean-cast": "error",
|
|
30
|
+
"no-fallthrough": "error",
|
|
31
|
+
"no-func-assign": "error",
|
|
32
|
+
"no-global-assign": "error",
|
|
33
|
+
"no-import-assign": "error",
|
|
34
|
+
"no-invalid-regexp": "error",
|
|
35
|
+
"no-irregular-whitespace": "error",
|
|
36
|
+
"no-loss-of-precision": "error",
|
|
37
|
+
"no-misleading-character-class": "error",
|
|
38
|
+
"no-new-native-nonconstructor": "error",
|
|
39
|
+
"no-nonoctal-decimal-escape": "error",
|
|
40
|
+
"no-obj-calls": "error",
|
|
41
|
+
"no-prototype-builtins": "error",
|
|
42
|
+
"no-redeclare": "error",
|
|
43
|
+
"no-regex-spaces": "error",
|
|
44
|
+
"no-self-assign": "error",
|
|
45
|
+
"no-setter-return": "error",
|
|
46
|
+
"no-shadow-restricted-names": "error",
|
|
47
|
+
"no-sparse-arrays": "error",
|
|
48
|
+
"no-this-before-super": "error",
|
|
49
|
+
"no-unexpected-multiline": "error",
|
|
50
|
+
"no-unsafe-finally": "error",
|
|
51
|
+
"no-unsafe-negation": "error",
|
|
52
|
+
"no-unsafe-optional-chaining": "error",
|
|
53
|
+
"no-unused-labels": "error",
|
|
54
|
+
"no-unused-private-class-members": "error",
|
|
55
|
+
"no-unused-vars": ["error", { ignoreRestSiblings: true }],
|
|
56
|
+
"no-useless-backreference": "error",
|
|
57
|
+
"no-useless-catch": "error",
|
|
58
|
+
"no-useless-escape": "error",
|
|
59
|
+
"no-with": "error",
|
|
60
|
+
"require-yield": "error",
|
|
61
|
+
"use-isnan": "error",
|
|
62
|
+
"valid-typeof": "error"
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
const tsOverride = {
|
|
66
|
+
files: ["**/*.{ts,mts,cts}"],
|
|
67
|
+
rules: {
|
|
68
|
+
...jsOverride.rules,
|
|
69
|
+
"@typescript-eslint/ban-ts-comment": "error",
|
|
70
|
+
"no-array-constructor": "off",
|
|
71
|
+
"@typescript-eslint/no-array-constructor": "error",
|
|
72
|
+
"@typescript-eslint/no-duplicate-enum-values": "error",
|
|
73
|
+
"@typescript-eslint/no-empty-object-type": "error",
|
|
74
|
+
"@typescript-eslint/no-extra-non-null-assertion": "error",
|
|
75
|
+
"@typescript-eslint/no-misused-new": "error",
|
|
76
|
+
"@typescript-eslint/no-namespace": "error",
|
|
77
|
+
"@typescript-eslint/no-non-null-asserted-optional-chain": "error",
|
|
78
|
+
"@typescript-eslint/no-require-imports": "error",
|
|
79
|
+
"@typescript-eslint/no-this-alias": "error",
|
|
80
|
+
"@typescript-eslint/no-unnecessary-type-constraint": "error",
|
|
81
|
+
"@typescript-eslint/no-unsafe-declaration-merging": "error",
|
|
82
|
+
"@typescript-eslint/no-unsafe-function-type": "error",
|
|
83
|
+
"no-unused-expressions": "off",
|
|
84
|
+
"@typescript-eslint/no-unused-expressions": "error",
|
|
85
|
+
"@typescript-eslint/no-wrapper-object-types": "error",
|
|
86
|
+
"@typescript-eslint/prefer-as-const": "error",
|
|
87
|
+
"@typescript-eslint/prefer-namespace-keyword": "error",
|
|
88
|
+
"@typescript-eslint/triple-slash-reference": "error",
|
|
89
|
+
"no-undef": "off",
|
|
90
|
+
"@typescript-eslint/no-explicit-any": "off",
|
|
91
|
+
"@typescript-eslint/no-unused-vars": ["error", { ignoreRestSiblings: true }]
|
|
92
|
+
},
|
|
93
|
+
plugins: ["typescript"]
|
|
94
|
+
};
|
|
95
|
+
const categories = {
|
|
96
|
+
correctness: "off",
|
|
97
|
+
nursery: "off",
|
|
98
|
+
pedantic: "off",
|
|
99
|
+
perf: "off",
|
|
100
|
+
restriction: "off",
|
|
101
|
+
style: "off",
|
|
102
|
+
suspicious: "off"
|
|
103
|
+
};
|
|
104
|
+
const env = {
|
|
105
|
+
builtin: true,
|
|
106
|
+
es2026: true,
|
|
107
|
+
browser: true
|
|
108
|
+
};
|
|
109
|
+
const overrides = [jsOverride, tsOverride];
|
|
110
|
+
const ignorePatterns = [
|
|
111
|
+
"**/.git/",
|
|
112
|
+
"**/.private/",
|
|
113
|
+
"**/.build/",
|
|
114
|
+
"**/.coverage/",
|
|
115
|
+
"**/.history/",
|
|
116
|
+
"**/.output/",
|
|
117
|
+
"**/.cache/",
|
|
118
|
+
"**/.temp/",
|
|
119
|
+
"**/.tmp/",
|
|
120
|
+
"**/.out/",
|
|
121
|
+
"**/node_modules/",
|
|
122
|
+
"**/dist/",
|
|
123
|
+
"**/build/",
|
|
124
|
+
"**/coverage/",
|
|
125
|
+
"**/public/",
|
|
126
|
+
"**/output/",
|
|
127
|
+
"**/cache/",
|
|
128
|
+
"**/temp/",
|
|
129
|
+
"**/tmp/",
|
|
130
|
+
"**/out/",
|
|
131
|
+
"**/.DS_Store",
|
|
132
|
+
"**/.env*",
|
|
133
|
+
"**/*-lock.*",
|
|
134
|
+
"**/*.lock",
|
|
135
|
+
"**/*.log*",
|
|
136
|
+
"**/*.min.*",
|
|
137
|
+
"**/*.d.ts"
|
|
138
|
+
];
|
|
139
|
+
const defaultConfig = {
|
|
140
|
+
plugins: [],
|
|
141
|
+
categories,
|
|
142
|
+
env,
|
|
143
|
+
ignorePatterns,
|
|
144
|
+
overrides
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
//#endregion
|
|
148
|
+
export { categories, defaultConfig, defineConfig, env, ignorePatterns, jsOverride, overrides, tsOverride };
|
package/package.json
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@hypernym/oxlint-config",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"author": "Hypernym Studio",
|
|
5
|
+
"description": "Hypernym's internal config for OXLint.",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/hypernym-studio/oxlint-config.git"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://github.com/hypernym-studio/oxlint-config",
|
|
12
|
+
"funding": "https://github.com/sponsors/ivodolenc",
|
|
13
|
+
"type": "module",
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"import": "./dist/index.js"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"dist"
|
|
22
|
+
],
|
|
23
|
+
"keywords": [
|
|
24
|
+
"hyper",
|
|
25
|
+
"hypernym",
|
|
26
|
+
"oxlint",
|
|
27
|
+
"oxlint-config",
|
|
28
|
+
"configuration",
|
|
29
|
+
"shareable",
|
|
30
|
+
"presets",
|
|
31
|
+
"config",
|
|
32
|
+
"esm"
|
|
33
|
+
],
|
|
34
|
+
"scripts": {
|
|
35
|
+
"build": "hyperbundler",
|
|
36
|
+
"lint": "oxlint",
|
|
37
|
+
"format": "oxfmt",
|
|
38
|
+
"prepublishOnly": "pnpm build"
|
|
39
|
+
},
|
|
40
|
+
"peerDependencies": {
|
|
41
|
+
"oxlint": ">=1.50.0",
|
|
42
|
+
"typescript": ">=5.0.0"
|
|
43
|
+
},
|
|
44
|
+
"peerDependenciesMeta": {
|
|
45
|
+
"typescript": {
|
|
46
|
+
"optional": true
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"@hypernym/bundler": "^0.32.0",
|
|
51
|
+
"@hypernym/tsconfig": "^2.7.0",
|
|
52
|
+
"oxfmt": "^0.35.0",
|
|
53
|
+
"oxlint": "^1.50.0",
|
|
54
|
+
"typescript": "^5.9.3"
|
|
55
|
+
}
|
|
56
|
+
}
|