@blogic-cz/oxc-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/.oxfmtrc.base.jsonc +57 -0
- package/.oxlintrc.ts-react.json +41 -0
- package/.oxlintrc.ts.json +128 -0
- package/LICENSE +21 -0
- package/README.md +115 -0
- package/package.json +33 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://raw.githubusercontent.com/niconiconainu/oxfmt/HEAD/configuration_schema.json",
|
|
3
|
+
"semi": true,
|
|
4
|
+
"trailingComma": "es5",
|
|
5
|
+
"singleQuote": false,
|
|
6
|
+
"printWidth": 60,
|
|
7
|
+
"tabWidth": 2,
|
|
8
|
+
"useTabs": false,
|
|
9
|
+
"bracketSpacing": true,
|
|
10
|
+
"arrowParens": "always",
|
|
11
|
+
"endOfLine": "lf",
|
|
12
|
+
"bracketSameLine": false,
|
|
13
|
+
"quoteProps": "as-needed",
|
|
14
|
+
"sortImports": {
|
|
15
|
+
"groups": [
|
|
16
|
+
"type-import",
|
|
17
|
+
["value-builtin", "value-external"],
|
|
18
|
+
"type-internal",
|
|
19
|
+
"value-internal",
|
|
20
|
+
["type-parent", "type-sibling", "type-index"],
|
|
21
|
+
["value-parent", "value-sibling", "value-index"],
|
|
22
|
+
"unknown"
|
|
23
|
+
]
|
|
24
|
+
},
|
|
25
|
+
"ignorePatterns": [
|
|
26
|
+
"**/*.css",
|
|
27
|
+
"**/*.eot",
|
|
28
|
+
"**/*.gen.ts",
|
|
29
|
+
"**/*.gif",
|
|
30
|
+
"**/*.gz",
|
|
31
|
+
"**/*.ico",
|
|
32
|
+
"**/*.jpeg",
|
|
33
|
+
"**/*.jpg",
|
|
34
|
+
"**/*.json",
|
|
35
|
+
"**/*.json5",
|
|
36
|
+
"**/*.jsonc",
|
|
37
|
+
"**/*.md",
|
|
38
|
+
"**/*.pdf",
|
|
39
|
+
"**/*.png",
|
|
40
|
+
"**/*.svg",
|
|
41
|
+
"**/*.tar",
|
|
42
|
+
"**/*.ttf",
|
|
43
|
+
"**/*.woff",
|
|
44
|
+
"**/*.woff2",
|
|
45
|
+
"**/*.yaml",
|
|
46
|
+
"**/*.yml",
|
|
47
|
+
"**/*.zip",
|
|
48
|
+
"**/.drizzle",
|
|
49
|
+
"**/.nitro",
|
|
50
|
+
"**/.output",
|
|
51
|
+
"**/build",
|
|
52
|
+
"**/coverage",
|
|
53
|
+
"**/dist",
|
|
54
|
+
"**/drizzle/meta",
|
|
55
|
+
"**/node_modules"
|
|
56
|
+
]
|
|
57
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://raw.githubusercontent.com/niconiconainu/oxc/HEAD/npm/oxc-types/src/generated/schema/oxlintrc.json",
|
|
3
|
+
"extends": [
|
|
4
|
+
"./.oxlintrc.ts.json"
|
|
5
|
+
],
|
|
6
|
+
"plugins": [
|
|
7
|
+
"jsx-a11y",
|
|
8
|
+
"react",
|
|
9
|
+
"react-perf"
|
|
10
|
+
],
|
|
11
|
+
"rules": {
|
|
12
|
+
"jsx-a11y/anchor-is-valid": "error",
|
|
13
|
+
"jsx-a11y/label-has-associated-control": "error",
|
|
14
|
+
"jsx-a11y/img-redundant-alt": "error",
|
|
15
|
+
"react/jsx-curly-brace-presence": "error",
|
|
16
|
+
"react/jsx-no-target-blank": "error",
|
|
17
|
+
"react/no-unstable-nested-components": "error",
|
|
18
|
+
"react/no-unescaped-entities": "error",
|
|
19
|
+
"react/react-in-jsx-scope": "off",
|
|
20
|
+
"react/rules-of-hooks": "error",
|
|
21
|
+
"react/self-closing-comp": "error",
|
|
22
|
+
"react/jsx-no-useless-fragment": "error",
|
|
23
|
+
"react/no-array-index-key": "error",
|
|
24
|
+
"react-hooks/exhaustive-deps": "error",
|
|
25
|
+
"react-perf/jsx-no-new-function-as-prop": "off",
|
|
26
|
+
"react-perf/jsx-no-new-object-as-style": "error",
|
|
27
|
+
"react-perf/jsx-no-jsx-as-prop": "off",
|
|
28
|
+
"react-perf/jsx-no-new-array-as-prop": "off",
|
|
29
|
+
"react-perf/jsx-no-new-object-as-prop": "off"
|
|
30
|
+
},
|
|
31
|
+
"overrides": [
|
|
32
|
+
{
|
|
33
|
+
"files": [
|
|
34
|
+
"apps/web-app/src/routes/**"
|
|
35
|
+
],
|
|
36
|
+
"rules": {
|
|
37
|
+
"typescript/only-throw-error": "off"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://raw.githubusercontent.com/niconiconainu/oxc/HEAD/npm/oxc-types/src/generated/schema/oxlintrc.json",
|
|
3
|
+
"plugins": [
|
|
4
|
+
"import",
|
|
5
|
+
"node",
|
|
6
|
+
"oxc",
|
|
7
|
+
"promise",
|
|
8
|
+
"typescript",
|
|
9
|
+
"unicorn",
|
|
10
|
+
"vitest"
|
|
11
|
+
],
|
|
12
|
+
"categories": {
|
|
13
|
+
"correctness": "error",
|
|
14
|
+
"perf": "error",
|
|
15
|
+
"suspicious": "error"
|
|
16
|
+
},
|
|
17
|
+
"rules": {
|
|
18
|
+
"eslint/array-callback-return": "error",
|
|
19
|
+
"eslint/default-param-last": "error",
|
|
20
|
+
"eslint/eqeqeq": "error",
|
|
21
|
+
"eslint/no-else-return": "error",
|
|
22
|
+
"eslint/no-promise-executor-return": "error",
|
|
23
|
+
"eslint/no-empty": "error",
|
|
24
|
+
"eslint/no-empty-function": "error",
|
|
25
|
+
"eslint/require-await": "error",
|
|
26
|
+
"eslint/no-self-compare": "error",
|
|
27
|
+
"eslint/no-template-curly-in-string": "error",
|
|
28
|
+
"eslint/no-var": "error",
|
|
29
|
+
"import/no-cycle": "error",
|
|
30
|
+
"import/no-duplicates": "error",
|
|
31
|
+
"import/no-relative-parent-imports": "error",
|
|
32
|
+
"typescript/ban-ts-comment": "error",
|
|
33
|
+
"typescript/consistent-type-definitions": [
|
|
34
|
+
"error",
|
|
35
|
+
"type"
|
|
36
|
+
],
|
|
37
|
+
"typescript/consistent-type-imports": "error",
|
|
38
|
+
"typescript/no-deprecated": "error",
|
|
39
|
+
"typescript/no-explicit-any": "error",
|
|
40
|
+
"typescript/no-import-type-side-effects": "error",
|
|
41
|
+
"typescript/no-invalid-void-type": "error",
|
|
42
|
+
"typescript/no-non-null-assertion": "error",
|
|
43
|
+
"typescript/no-unnecessary-type-assertion": "off",
|
|
44
|
+
"typescript/no-unsafe-type-assertion": "off",
|
|
45
|
+
"typescript/no-unnecessary-boolean-literal-compare": "off",
|
|
46
|
+
"typescript/prefer-nullish-coalescing": "off",
|
|
47
|
+
"unicorn/error-message": "error",
|
|
48
|
+
"unicorn/consistent-function-scoping": "error",
|
|
49
|
+
"unicorn/no-array-sort": "error",
|
|
50
|
+
"unicorn/prefer-set-has": "error",
|
|
51
|
+
"unicorn/require-module-specifiers": "off",
|
|
52
|
+
"unicorn/throw-new-error": "error",
|
|
53
|
+
"vitest/no-import-node-test": "error",
|
|
54
|
+
"oxc/no-map-spread": "error",
|
|
55
|
+
"promise/always-return": "error"
|
|
56
|
+
},
|
|
57
|
+
"overrides": [
|
|
58
|
+
{
|
|
59
|
+
"files": [
|
|
60
|
+
"**/*.test.ts",
|
|
61
|
+
"**/*.test.tsx",
|
|
62
|
+
"**/__tests__/**",
|
|
63
|
+
"**/e2e/**"
|
|
64
|
+
],
|
|
65
|
+
"rules": {
|
|
66
|
+
"eslint/no-await-in-loop": "off",
|
|
67
|
+
"eslint/no-empty-function": "off",
|
|
68
|
+
"eslint/no-promise-executor-return": "off",
|
|
69
|
+
"eslint/no-shadow": "error",
|
|
70
|
+
"typescript/no-non-null-assertion": "off",
|
|
71
|
+
"typescript/no-unsafe-type-assertion": "off",
|
|
72
|
+
"unicorn/consistent-function-scoping": "off",
|
|
73
|
+
"vitest/no-conditional-expect": "off",
|
|
74
|
+
"vitest/no-conditional-tests": "off",
|
|
75
|
+
"vitest/no-disabled-tests": "off",
|
|
76
|
+
"vitest/require-to-throw-message": "off",
|
|
77
|
+
"unicorn/no-array-sort": "off"
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"files": [
|
|
82
|
+
".claude/**",
|
|
83
|
+
".opencode/**",
|
|
84
|
+
"jobs/**",
|
|
85
|
+
"packages/**/__tests__/**",
|
|
86
|
+
"scripts/**"
|
|
87
|
+
],
|
|
88
|
+
"rules": {
|
|
89
|
+
"eslint/no-await-in-loop": "off",
|
|
90
|
+
"eslint/no-shadow": "off",
|
|
91
|
+
"eslint/require-await": "off",
|
|
92
|
+
"import/no-relative-parent-imports": "off",
|
|
93
|
+
"typescript/no-unsafe-type-assertion": "off",
|
|
94
|
+
"unicorn/no-array-sort": "off"
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"files": [
|
|
99
|
+
"packages/common/src/**",
|
|
100
|
+
"packages/services/src/**"
|
|
101
|
+
],
|
|
102
|
+
"rules": {
|
|
103
|
+
"eslint/no-new": "off",
|
|
104
|
+
"import/no-relative-parent-imports": "off",
|
|
105
|
+
"typescript/consistent-type-definitions": "off",
|
|
106
|
+
"typescript/no-import-type-side-effects": "off",
|
|
107
|
+
"typescript/no-non-null-assertion": "off"
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"files": [
|
|
112
|
+
"packages/db/src/queries/**",
|
|
113
|
+
"packages/services/src/health/**"
|
|
114
|
+
],
|
|
115
|
+
"rules": {
|
|
116
|
+
"import/no-relative-parent-imports": "off"
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"files": [
|
|
121
|
+
"packages/logger/src/**"
|
|
122
|
+
],
|
|
123
|
+
"rules": {
|
|
124
|
+
"eslint/require-await": "off"
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
]
|
|
128
|
+
}
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 blogic-cz
|
|
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,115 @@
|
|
|
1
|
+
# @blogic-cz/oxc-config
|
|
2
|
+
|
|
3
|
+
Shared oxlint and oxfmt configs for blogic projects. Layered TypeScript, React, and formatter presets.
|
|
4
|
+
|
|
5
|
+
## Configs
|
|
6
|
+
|
|
7
|
+
### Linter (oxlint)
|
|
8
|
+
|
|
9
|
+
| Config | Use case | Plugins |
|
|
10
|
+
|--------|----------|---------|
|
|
11
|
+
| `.oxlintrc.ts.json` | TypeScript projects (CLI, services, libraries) | eslint, import, node, oxc, promise, typescript, unicorn, vitest |
|
|
12
|
+
| `.oxlintrc.ts-react.json` | React + TypeScript projects | extends `ts.json` + jsx-a11y, react, react-perf |
|
|
13
|
+
|
|
14
|
+
### Formatter (oxfmt)
|
|
15
|
+
|
|
16
|
+
| Config | Use case | What's shared |
|
|
17
|
+
|--------|----------|---------------|
|
|
18
|
+
| `.oxfmtrc.base.jsonc` | All projects | semi, quotes, width, tabs, import sort groups, ignore patterns |
|
|
19
|
+
|
|
20
|
+
> **Note:** `sortImports.internalPattern` and `sortTailwindcss` are project-specific — set them in your local `.oxfmtrc.jsonc`.
|
|
21
|
+
|
|
22
|
+
## Usage
|
|
23
|
+
|
|
24
|
+
Install:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
bun add -d @blogic-cz/oxc-config
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Linter
|
|
31
|
+
|
|
32
|
+
In your project's `.oxlintrc.json`:
|
|
33
|
+
|
|
34
|
+
```json
|
|
35
|
+
{
|
|
36
|
+
"extends": ["./node_modules/@blogic-cz/oxc-config/.oxlintrc.ts-react.json"],
|
|
37
|
+
"rules": {
|
|
38
|
+
// project-specific rules only
|
|
39
|
+
},
|
|
40
|
+
"overrides": [
|
|
41
|
+
// project-specific overrides only
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
For non-React projects:
|
|
47
|
+
|
|
48
|
+
```json
|
|
49
|
+
{
|
|
50
|
+
"extends": ["./node_modules/@blogic-cz/oxc-config/.oxlintrc.ts.json"]
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### Formatter
|
|
55
|
+
|
|
56
|
+
oxfmt doesn't support `extends` yet, so copy the base and add project-specific settings:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
cp node_modules/@blogic-cz/oxc-config/.oxfmtrc.base.jsonc .oxfmtrc.jsonc
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Then add your project-specific `sortImports.internalPattern` and `sortTailwindcss`:
|
|
63
|
+
|
|
64
|
+
```jsonc
|
|
65
|
+
{
|
|
66
|
+
// ... base settings from @blogic-cz/oxc-config ...
|
|
67
|
+
"sortImports": {
|
|
68
|
+
"internalPattern": ["@/", "@your-project/"],
|
|
69
|
+
"groups": [ /* already in base */ ]
|
|
70
|
+
},
|
|
71
|
+
"sortTailwindcss": {
|
|
72
|
+
"stylesheet": "./apps/web-app/src/styles/app.css",
|
|
73
|
+
"functions": ["clsx", "cn"]
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## What's included
|
|
79
|
+
|
|
80
|
+
### Linter — categories (error by default)
|
|
81
|
+
|
|
82
|
+
- `correctness`
|
|
83
|
+
- `perf`
|
|
84
|
+
- `suspicious`
|
|
85
|
+
|
|
86
|
+
### Linter — key rules (all `error`)
|
|
87
|
+
|
|
88
|
+
- No `any`, no `as Type` suppression, consistent type imports
|
|
89
|
+
- No relative parent imports, no import cycles
|
|
90
|
+
- `eqeqeq`, `require-await`, `no-var`
|
|
91
|
+
- `unicorn/consistent-function-scoping`, `unicorn/prefer-set-has`
|
|
92
|
+
- `promise/always-return`
|
|
93
|
+
- `oxc/no-map-spread`
|
|
94
|
+
|
|
95
|
+
### Linter — React layer adds
|
|
96
|
+
|
|
97
|
+
- `jsx-a11y/*` accessibility rules
|
|
98
|
+
- `react/rules-of-hooks`, `react-hooks/exhaustive-deps`
|
|
99
|
+
- `react/no-array-index-key`, `react/self-closing-comp`
|
|
100
|
+
- `react-perf/jsx-no-new-object-as-style`
|
|
101
|
+
|
|
102
|
+
### Linter — shared overrides
|
|
103
|
+
|
|
104
|
+
Test files, scripts, and tooling paths have relaxed rules where appropriate.
|
|
105
|
+
|
|
106
|
+
### Formatter — what's shared
|
|
107
|
+
|
|
108
|
+
- `semi: true`, `singleQuote: false`, `printWidth: 60`
|
|
109
|
+
- `tabWidth: 2`, `useTabs: false`, `trailingComma: "es5"`
|
|
110
|
+
- Import sort groups (type-first, then builtin/external, then internal)
|
|
111
|
+
- Standard ignore patterns (assets, build output, node_modules)
|
|
112
|
+
|
|
113
|
+
## License
|
|
114
|
+
|
|
115
|
+
MIT
|
package/package.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@blogic-cz/oxc-config",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Shared oxlint and oxfmt configs for blogic projects — layered TypeScript, React, and formatter presets",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"oxlint",
|
|
7
|
+
"oxfmt",
|
|
8
|
+
"oxc",
|
|
9
|
+
"eslint",
|
|
10
|
+
"config",
|
|
11
|
+
"shared",
|
|
12
|
+
"typescript",
|
|
13
|
+
"react",
|
|
14
|
+
"lint",
|
|
15
|
+
"formatter"
|
|
16
|
+
],
|
|
17
|
+
"homepage": "https://github.com/blogic-cz/oxc-config#readme",
|
|
18
|
+
"license": "MIT",
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "https://github.com/blogic-cz/oxc-config.git"
|
|
22
|
+
},
|
|
23
|
+
"files": [
|
|
24
|
+
".oxlintrc.ts.json",
|
|
25
|
+
".oxlintrc.ts-react.json",
|
|
26
|
+
".oxfmtrc.base.jsonc",
|
|
27
|
+
"README.md",
|
|
28
|
+
"LICENSE"
|
|
29
|
+
],
|
|
30
|
+
"publishConfig": {
|
|
31
|
+
"access": "public"
|
|
32
|
+
}
|
|
33
|
+
}
|