@minimalstuff/tooling 0.8.0 → 0.8.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/dist/oxc/lint.mjs +20 -2
- package/package.json +1 -1
package/dist/oxc/lint.mjs
CHANGED
|
@@ -2,6 +2,16 @@ import { n as COMMON_IGNORE_PATTERNS, t as ADONISJS_IGNORE_PATTERNS } from "../s
|
|
|
2
2
|
import { defineConfig } from "oxlint";
|
|
3
3
|
// src/oxc/lint.ts
|
|
4
4
|
const INERTIA_FRONTEND_FILES = ["**/inertia/**/*.{ts,tsx}"];
|
|
5
|
+
/**
|
|
6
|
+
* AdonisJS server code receives dependencies through `@inject()` constructor
|
|
7
|
+
* injection, which relies on `emitDecoratorMetadata`: the injected class must be
|
|
8
|
+
* a value import, so `typescript/consistent-type-imports` must not rewrite it.
|
|
9
|
+
*/
|
|
10
|
+
const ADONISJS_INJECTION_FILES = [
|
|
11
|
+
"**/app/**",
|
|
12
|
+
"**/commands/**",
|
|
13
|
+
"**/providers/**"
|
|
14
|
+
];
|
|
5
15
|
const TEST_FILES = ["**/*.{test,spec}.{ts,tsx,js,jsx}", "**/tests/**"];
|
|
6
16
|
const RELATIVE_IMPORT_MESSAGE = "Use a subpath import (#folder/file.ts) instead of a relative path.";
|
|
7
17
|
function createBasePreset() {
|
|
@@ -50,7 +60,11 @@ function createReactPreset() {
|
|
|
50
60
|
rules: {
|
|
51
61
|
"react/rules-of-hooks": "error",
|
|
52
62
|
"react/only-export-components": ["warn", { allowConstantExport: true }]
|
|
53
|
-
}
|
|
63
|
+
},
|
|
64
|
+
overrides: [{
|
|
65
|
+
files: TEST_FILES,
|
|
66
|
+
rules: { "react/only-export-components": "off" }
|
|
67
|
+
}]
|
|
54
68
|
});
|
|
55
69
|
}
|
|
56
70
|
function createVitestPreset() {
|
|
@@ -85,7 +99,11 @@ function createAdonisjsPreset() {
|
|
|
85
99
|
package: "knex",
|
|
86
100
|
name: "QueryBuilder"
|
|
87
101
|
}] }]
|
|
88
|
-
}
|
|
102
|
+
},
|
|
103
|
+
overrides: [{
|
|
104
|
+
files: ADONISJS_INJECTION_FILES,
|
|
105
|
+
rules: { "typescript/consistent-type-imports": "off" }
|
|
106
|
+
}]
|
|
89
107
|
});
|
|
90
108
|
}
|
|
91
109
|
function createSubpathImportsPreset() {
|