@kvoon/oxlint-config 0.1.2
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/LICENCE +21 -0
- package/README.md +42 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +129 -0
- package/package.json +70 -0
package/LICENCE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025-present Kevin Kwong (https://github.com/kvoon3)
|
|
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,42 @@
|
|
|
1
|
+
# @kvoon/oxlint-config
|
|
2
|
+
|
|
3
|
+
Opinionated shareable [oxlint](https://oxc.rs/docs/guide/usage/linter) preset:
|
|
4
|
+
|
|
5
|
+
- style via `@stylistic/eslint-plugin` (curated; **single quotes**, **no semis** as errors)
|
|
6
|
+
- vue rules (plugin on, rules scoped to `*.vue`)
|
|
7
|
+
- sort via `eslint-plugin-perfectionist`
|
|
8
|
+
- `typeAware` + `typeCheck` on
|
|
9
|
+
- correctness `error`; suspicious/sort mostly `warn`
|
|
10
|
+
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
pnpm add -D @kvoon/oxlint-config oxlint oxlint-tsgolint
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Peers: `oxlint` `^1.74.0`, `oxlint-tsgolint` `^0.24.0`. Stylistic + perfectionist ship as dependencies of this package.
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
// oxlint.config.ts
|
|
23
|
+
import kvoon from '@kvoon/oxlint-config'
|
|
24
|
+
|
|
25
|
+
export default kvoon()
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Local overrides:
|
|
29
|
+
|
|
30
|
+
```ts
|
|
31
|
+
import kvoon from '@kvoon/oxlint-config'
|
|
32
|
+
import { defineConfig } from 'oxlint'
|
|
33
|
+
|
|
34
|
+
export default defineConfig({
|
|
35
|
+
extends: [kvoon()],
|
|
36
|
+
rules: {
|
|
37
|
+
'no-console': 'off',
|
|
38
|
+
},
|
|
39
|
+
})
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
This repo dogfoods the preset (`oxlint.config.ts`). `playground/vue3` is a Vite Vue3+TS app for manual lint checks.
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { defineConfig } from "oxlint";
|
|
2
|
+
//#region src/index.ts
|
|
3
|
+
/** Opinionated oxlint preset. Zero-arg; local overrides via `extends: [kvoon()]`. */
|
|
4
|
+
function kvoon() {
|
|
5
|
+
return defineConfig({
|
|
6
|
+
plugins: [
|
|
7
|
+
"eslint",
|
|
8
|
+
"typescript",
|
|
9
|
+
"unicorn",
|
|
10
|
+
"oxc",
|
|
11
|
+
"import",
|
|
12
|
+
"vue"
|
|
13
|
+
],
|
|
14
|
+
categories: {
|
|
15
|
+
correctness: "error",
|
|
16
|
+
suspicious: "warn",
|
|
17
|
+
style: "off"
|
|
18
|
+
},
|
|
19
|
+
options: {
|
|
20
|
+
typeAware: true,
|
|
21
|
+
typeCheck: true
|
|
22
|
+
},
|
|
23
|
+
ignorePatterns: [
|
|
24
|
+
"dist/**",
|
|
25
|
+
"build/**",
|
|
26
|
+
"coverage/**",
|
|
27
|
+
"node_modules/**",
|
|
28
|
+
".output/**",
|
|
29
|
+
".nuxt/**",
|
|
30
|
+
".vitepress/cache/**",
|
|
31
|
+
"playground/*/dist/**"
|
|
32
|
+
],
|
|
33
|
+
jsPlugins: [{
|
|
34
|
+
name: "stylistic",
|
|
35
|
+
specifier: "@stylistic/eslint-plugin"
|
|
36
|
+
}, {
|
|
37
|
+
name: "perfectionist",
|
|
38
|
+
specifier: "eslint-plugin-perfectionist"
|
|
39
|
+
}],
|
|
40
|
+
rules: {
|
|
41
|
+
"import/no-named-export": "off",
|
|
42
|
+
"import/prefer-default-export": "off",
|
|
43
|
+
"import/group-exports": "off",
|
|
44
|
+
"import/no-unassigned-import": "off",
|
|
45
|
+
"sort-imports": "off",
|
|
46
|
+
"typescript/consistent-type-imports": ["warn", {
|
|
47
|
+
prefer: "type-imports",
|
|
48
|
+
fixStyle: "separate-type-imports"
|
|
49
|
+
}],
|
|
50
|
+
"import/consistent-type-specifier-style": ["warn", "prefer-top-level"],
|
|
51
|
+
"stylistic/indent": ["error", 2],
|
|
52
|
+
"stylistic/spaced-comment": "warn",
|
|
53
|
+
"stylistic/quotes": [
|
|
54
|
+
"error",
|
|
55
|
+
"single",
|
|
56
|
+
{ avoidEscape: true }
|
|
57
|
+
],
|
|
58
|
+
"stylistic/jsx-quotes": ["error", "prefer-single"],
|
|
59
|
+
"stylistic/comma-dangle": ["warn", "always-multiline"],
|
|
60
|
+
"stylistic/semi": ["error", "never"],
|
|
61
|
+
"stylistic/object-curly-spacing": ["warn", "always"],
|
|
62
|
+
"stylistic/arrow-parens": ["warn", "as-needed"],
|
|
63
|
+
"stylistic/brace-style": [
|
|
64
|
+
"warn",
|
|
65
|
+
"1tbs",
|
|
66
|
+
{ allowSingleLine: true }
|
|
67
|
+
],
|
|
68
|
+
"stylistic/keyword-spacing": "warn",
|
|
69
|
+
"stylistic/space-before-blocks": "warn",
|
|
70
|
+
"stylistic/comma-spacing": "warn",
|
|
71
|
+
"stylistic/no-trailing-spaces": "warn",
|
|
72
|
+
"stylistic/no-multi-spaces": "warn",
|
|
73
|
+
"stylistic/block-spacing": "warn",
|
|
74
|
+
"stylistic/key-spacing": "warn",
|
|
75
|
+
"perfectionist/sort-imports": "warn",
|
|
76
|
+
"perfectionist/sort-named-imports": "warn",
|
|
77
|
+
"perfectionist/sort-exports": "warn",
|
|
78
|
+
"perfectionist/sort-named-exports": "warn",
|
|
79
|
+
"perfectionist/sort-objects": "warn",
|
|
80
|
+
"perfectionist/sort-object-types": "warn",
|
|
81
|
+
"perfectionist/sort-interfaces": "warn",
|
|
82
|
+
"perfectionist/sort-enums": "warn",
|
|
83
|
+
"perfectionist/sort-union-types": "warn",
|
|
84
|
+
"perfectionist/sort-intersection-types": "warn",
|
|
85
|
+
"perfectionist/sort-array-includes": "warn",
|
|
86
|
+
"perfectionist/sort-classes": "warn",
|
|
87
|
+
"perfectionist/sort-maps": "warn",
|
|
88
|
+
"perfectionist/sort-sets": "warn",
|
|
89
|
+
"perfectionist/sort-switch-case": "warn",
|
|
90
|
+
"perfectionist/sort-jsx-props": "warn",
|
|
91
|
+
"perfectionist/sort-heritage-clauses": "warn",
|
|
92
|
+
"perfectionist/sort-decorators": "warn",
|
|
93
|
+
"perfectionist/sort-modules": "warn",
|
|
94
|
+
"perfectionist/sort-variable-declarations": "warn",
|
|
95
|
+
"perfectionist/sort-import-attributes": "warn",
|
|
96
|
+
"perfectionist/sort-export-attributes": "warn",
|
|
97
|
+
"perfectionist/sort-arrays": "warn"
|
|
98
|
+
},
|
|
99
|
+
overrides: [{
|
|
100
|
+
files: ["**/*.vue"],
|
|
101
|
+
rules: {
|
|
102
|
+
"vue/component-definition-name-casing": "warn",
|
|
103
|
+
"vue/define-emits-declaration": "warn",
|
|
104
|
+
"vue/define-props-declaration": "warn",
|
|
105
|
+
"vue/define-props-destructuring": "warn",
|
|
106
|
+
"vue/no-export-in-script-setup": "warn",
|
|
107
|
+
"vue/no-import-compiler-macros": "warn",
|
|
108
|
+
"vue/no-lifecycle-after-await": "warn",
|
|
109
|
+
"vue/no-watch-after-await": "warn",
|
|
110
|
+
"vue/no-expose-after-await": "warn",
|
|
111
|
+
"vue/no-deprecated-destroyed-lifecycle": "warn",
|
|
112
|
+
"vue/no-deprecated-events-api": "warn",
|
|
113
|
+
"vue/no-side-effects-in-computed-properties": "warn",
|
|
114
|
+
"vue/no-async-in-computed-properties": "warn",
|
|
115
|
+
"vue/prefer-import-from-vue": "warn",
|
|
116
|
+
"vue/prop-name-casing": "warn",
|
|
117
|
+
"vue/require-default-export": "warn",
|
|
118
|
+
"vue/return-in-computed-property": "warn",
|
|
119
|
+
"vue/return-in-emits-validator": "warn",
|
|
120
|
+
"vue/valid-define-emits": "warn",
|
|
121
|
+
"vue/valid-define-props": "warn",
|
|
122
|
+
"vue/valid-define-options": "warn",
|
|
123
|
+
"vue/valid-next-tick": "warn"
|
|
124
|
+
}
|
|
125
|
+
}]
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
//#endregion
|
|
129
|
+
export { kvoon as default };
|
package/package.json
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@kvoon/oxlint-config",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "0.1.2",
|
|
5
|
+
"description": "Opinionated shareable oxlint config (style, vue, sort, type-aware)",
|
|
6
|
+
"author": "Kevin Kwong <kwongliegaai@gmail.com>",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"homepage": "https://github.com/kvoon3/oxlint-config#readme",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/kvoon3/oxlint-config.git"
|
|
12
|
+
},
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/kvoon3/oxlint-config/issues"
|
|
15
|
+
},
|
|
16
|
+
"funding": {
|
|
17
|
+
"type": "github",
|
|
18
|
+
"url": "https://github.com/sponsors/kvoon3"
|
|
19
|
+
},
|
|
20
|
+
"keywords": [
|
|
21
|
+
"oxlint",
|
|
22
|
+
"oxlint-config",
|
|
23
|
+
"stylistic",
|
|
24
|
+
"vue",
|
|
25
|
+
"perfectionist"
|
|
26
|
+
],
|
|
27
|
+
"exports": {
|
|
28
|
+
"types": "./dist/index.d.ts",
|
|
29
|
+
"import": "./dist/index.js"
|
|
30
|
+
},
|
|
31
|
+
"main": "./dist/index.js",
|
|
32
|
+
"types": "./dist/index.d.ts",
|
|
33
|
+
"files": [
|
|
34
|
+
"dist"
|
|
35
|
+
],
|
|
36
|
+
"publishConfig": {
|
|
37
|
+
"access": "public"
|
|
38
|
+
},
|
|
39
|
+
"peerDependencies": {
|
|
40
|
+
"oxlint": "^1.74.0",
|
|
41
|
+
"oxlint-tsgolint": "^0.24.0"
|
|
42
|
+
},
|
|
43
|
+
"dependencies": {
|
|
44
|
+
"@stylistic/eslint-plugin": "^5.10.0",
|
|
45
|
+
"eslint-plugin-perfectionist": "^5.10.0"
|
|
46
|
+
},
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@antfu/ni": "^30.1.0",
|
|
49
|
+
"oxlint": "^1.74.0",
|
|
50
|
+
"oxlint-tsgolint": "^0.24.0",
|
|
51
|
+
"tsdown": "^0.22.2",
|
|
52
|
+
"tsx": "latest",
|
|
53
|
+
"typescript": "^6.0.3",
|
|
54
|
+
"vitest": "^3.0.0"
|
|
55
|
+
},
|
|
56
|
+
"simple-git-hooks": {
|
|
57
|
+
"pre-commit": "pnpm exec oxlint ."
|
|
58
|
+
},
|
|
59
|
+
"scripts": {
|
|
60
|
+
"dev": "tsdown --watch",
|
|
61
|
+
"build": "tsdown",
|
|
62
|
+
"release": "nlx bumpp && pnpm publish",
|
|
63
|
+
"publish:ci": "pnpm publish --no-git-checks",
|
|
64
|
+
"up": "nlx taze -I major",
|
|
65
|
+
"typecheck": "tsc --noEmit",
|
|
66
|
+
"test": "vitest",
|
|
67
|
+
"lint": "oxlint .",
|
|
68
|
+
"lint:fix": "oxlint --fix ."
|
|
69
|
+
}
|
|
70
|
+
}
|