@hooshid/ox-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.
@@ -0,0 +1,13 @@
1
+ import { OxfmtConfig } from "oxfmt";
2
+ //#region src/format.d.ts
3
+ /** Base format preset. Pass overrides to customize. */
4
+ export declare function format(overrides?: Record<string, unknown>): OxfmtConfig;
5
+ /**
6
+ * Oxfmt Tailwind class-sorting preset.
7
+ * Spread into your format config alongside `format()` to enable.
8
+ */
9
+ export declare function tailwindFormat(options?: {
10
+ stylesheet?: string;
11
+ }): OxfmtConfig;
12
+ //#endregion
13
+ //# sourceMappingURL=format.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format.d.mts","names":[],"sources":["../src/format.ts"],"mappings":";;;wBAqBgB,OAAO,YAAY,0BAA0B;;;;;wBAsC7C,eAAe;EAAW;IAA6B"}
@@ -0,0 +1,68 @@
1
+ import { defu } from "defu";
2
+ //#region src/format.ts
3
+ /**
4
+ * Oxfmt format presets.
5
+ *
6
+ * @example
7
+ * ```ts
8
+ * // oxfmt.config.ts
9
+ * import { format, tailwindFormat } from '@hooshid/ox-config/format'
10
+ * import { defineConfig } from 'oxfmt'
11
+ *
12
+ * export default defineConfig({
13
+ * ...format(),
14
+ * ...tailwindFormat({ stylesheet: 'src/styles/globals.css' }),
15
+ * })
16
+ * ```
17
+ */
18
+ /** Base format preset. Pass overrides to customize. */
19
+ function format(overrides) {
20
+ return defu(overrides, {
21
+ semi: false,
22
+ singleQuote: true,
23
+ trailingComma: "all",
24
+ printWidth: 100,
25
+ tabWidth: 2,
26
+ useTabs: false,
27
+ arrowParens: "always",
28
+ bracketSpacing: true,
29
+ endOfLine: "lf",
30
+ quoteProps: "consistent",
31
+ sortImports: {
32
+ groups: [
33
+ "builtin",
34
+ { newlinesBetween: true },
35
+ "external",
36
+ { newlinesBetween: true },
37
+ "internal",
38
+ { newlinesBetween: true },
39
+ ["parent", "sibling"],
40
+ { newlinesBetween: true },
41
+ "index",
42
+ { newlinesBetween: true },
43
+ "type"
44
+ ],
45
+ internalPattern: ["~/", "@/"]
46
+ },
47
+ sortPackageJson: true
48
+ });
49
+ }
50
+ /**
51
+ * Oxfmt Tailwind class-sorting preset.
52
+ * Spread into your format config alongside `format()` to enable.
53
+ */
54
+ function tailwindFormat(options = {}) {
55
+ return { sortTailwindcss: {
56
+ stylesheet: options.stylesheet ?? "src/styles/globals.css",
57
+ functions: [
58
+ "cn",
59
+ "clsx",
60
+ "cva",
61
+ "tw"
62
+ ]
63
+ } };
64
+ }
65
+ //#endregion
66
+ export { format, tailwindFormat };
67
+
68
+ //# sourceMappingURL=format.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format.mjs","names":[],"sources":["../src/format.ts"],"sourcesContent":["/**\r\n * Oxfmt format presets.\r\n *\r\n * @example\r\n * ```ts\r\n * // oxfmt.config.ts\r\n * import { format, tailwindFormat } from '@hooshid/ox-config/format'\r\n * import { defineConfig } from 'oxfmt'\r\n *\r\n * export default defineConfig({\r\n * ...format(),\r\n * ...tailwindFormat({ stylesheet: 'src/styles/globals.css' }),\r\n * })\r\n * ```\r\n */\r\n\r\nimport { defu } from 'defu'\r\n\r\nimport type { OxfmtConfig } from 'oxfmt'\r\n\r\n/** Base format preset. Pass overrides to customize. */\r\nexport function format(overrides?: Record<string, unknown>): OxfmtConfig {\r\n return defu(overrides, {\r\n semi: false,\r\n singleQuote: true,\r\n trailingComma: 'all' as const,\r\n printWidth: 100,\r\n tabWidth: 2,\r\n useTabs: false,\r\n arrowParens: 'always' as const,\r\n bracketSpacing: true,\r\n endOfLine: 'lf' as const,\r\n quoteProps: 'consistent' as const,\r\n\r\n sortImports: {\r\n groups: [\r\n 'builtin',\r\n { newlinesBetween: true },\r\n 'external',\r\n { newlinesBetween: true },\r\n 'internal',\r\n { newlinesBetween: true },\r\n ['parent', 'sibling'],\r\n { newlinesBetween: true },\r\n 'index',\r\n { newlinesBetween: true },\r\n 'type',\r\n ],\r\n internalPattern: ['~/', '@/'],\r\n },\r\n\r\n sortPackageJson: true,\r\n }) as OxfmtConfig\r\n}\r\n\r\n/**\r\n * Oxfmt Tailwind class-sorting preset.\r\n * Spread into your format config alongside `format()` to enable.\r\n */\r\nexport function tailwindFormat(options: { stylesheet?: string } = {}): OxfmtConfig {\r\n return {\r\n sortTailwindcss: {\r\n stylesheet: options.stylesheet ?? 'src/styles/globals.css',\r\n functions: ['cn', 'clsx', 'cva', 'tw'] as string[],\r\n },\r\n }\r\n}"],"mappings":";;;;;;;;;;;;;;;;;;AAqBA,SAAgB,OAAO,WAAkD;CACvE,OAAO,KAAK,WAAW;EACrB,MAAM;EACN,aAAa;EACb,eAAe;EACf,YAAY;EACZ,UAAU;EACV,SAAS;EACT,aAAa;EACb,gBAAgB;EAChB,WAAW;EACX,YAAY;EAEZ,aAAa;GACX,QAAQ;IACN;IACA,EAAE,iBAAiB,KAAK;IACxB;IACA,EAAE,iBAAiB,KAAK;IACxB;IACA,EAAE,iBAAiB,KAAK;IACxB,CAAC,UAAU,SAAS;IACpB,EAAE,iBAAiB,KAAK;IACxB;IACA,EAAE,iBAAiB,KAAK;IACxB;GACF;GACA,iBAAiB,CAAC,MAAM,IAAI;EAC9B;EAEA,iBAAiB;CACnB,CAAC;AACH;;;;;AAMA,SAAgB,eAAe,UAAmC,CAAC,GAAgB;CACjF,OAAO,EACL,iBAAiB;EACf,YAAY,QAAQ,cAAc;EAClC,WAAW;GAAC;GAAM;GAAQ;GAAO;EAAI;CACvC,EACF;AACF"}
@@ -0,0 +1,62 @@
1
+ import { OxlintConfig, defineConfig } from "oxlint";
2
+ //#region src/utils.d.ts
3
+ /** All JS/TS source files */
4
+ export declare const GLOB_SRC = "**/*.{js,mjs,cjs,jsx,ts,mts,cts,tsx}";
5
+ /** JavaScript files only */
6
+ export declare const GLOB_JS = "**/*.{js,mjs,cjs,jsx}";
7
+ /** TypeScript files only */
8
+ export declare const GLOB_TS = "**/*.{ts,mts,cts,tsx}";
9
+ /** JSX/TSX files (React-related) */
10
+ export declare const GLOB_JSX = "**/*.{jsx,tsx}";
11
+ /** Test files */
12
+ export declare const GLOB_TESTS: string[];
13
+ /** JSON files */
14
+ export declare const GLOB_JSON = "**/*.json";
15
+ /** Markdown files */
16
+ export declare const GLOB_MARKDOWN = "**/*.md";
17
+ //#endregion
18
+ //#region src/lint.d.ts
19
+ /**
20
+ * Base lint preset — TypeScript + Import plugins, categories, env, ignores.
21
+ * Always include first.
22
+ */
23
+ export declare function base(overrides?: Partial<OxlintConfig>): OxlintConfig;
24
+ /** Type-aware lint preset — enables 59 type-aware rules via tsgolint. */
25
+ export declare function typeAware(overrides?: Partial<OxlintConfig>): OxlintConfig;
26
+ /** Unicorn lint preset — 100+ code quality rules. */
27
+ export declare function unicorn(overrides?: Partial<OxlintConfig>): OxlintConfig;
28
+ /** Dependency optimization — flags packages replaceable with native APIs. */
29
+ export declare function depend(overrides?: Partial<OxlintConfig>): OxlintConfig;
30
+ /** Node.js lint preset — native node plugin. */
31
+ export declare function node(overrides?: Partial<OxlintConfig>): OxlintConfig;
32
+ /** Promise lint preset — native promise plugin. */
33
+ export declare function promise(overrides?: Partial<OxlintConfig>): OxlintConfig;
34
+ /**
35
+ * React lint preset — React + react-refresh (for Vite/TanStack Start).
36
+ */
37
+ export declare function react(overrides?: Partial<OxlintConfig>): OxlintConfig;
38
+ /**
39
+ * TanStack Router lint preset — loads @tanstack/eslint-plugin-router.
40
+ * Covers route-param-names and create-route-property-order.
41
+ */
42
+ export declare function tanstackRouter(overrides?: Partial<OxlintConfig>): OxlintConfig;
43
+ interface TailwindOptions extends Partial<OxlintConfig> {
44
+ entryPoint?: string;
45
+ rootFontSize?: number;
46
+ /** File glob patterns for tailwind rules. @default GLOB_JSX */
47
+ files?: string[];
48
+ }
49
+ /** Tailwind CSS lint preset — eslint-plugin-better-tailwindcss. */
50
+ export declare function tailwind(options?: TailwindOptions): OxlintConfig;
51
+ interface VitestOptions extends Partial<OxlintConfig> {
52
+ files?: string[];
53
+ }
54
+ /** Vitest lint preset — native vitest plugin with test-file scoping. */
55
+ export declare function vitest(options?: VitestOptions): OxlintConfig;
56
+ /** NestJS lint preset — @darraghor/eslint-plugin-nestjs-typed. */
57
+ export declare function nestjs(overrides?: Partial<OxlintConfig>): OxlintConfig;
58
+ /** Drizzle ORM lint preset — eslint-plugin-drizzle. */
59
+ export declare function drizzle(overrides?: Partial<OxlintConfig>): OxlintConfig;
60
+ //#endregion
61
+ export { defineConfig };
62
+ //# sourceMappingURL=lint.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lint.d.mts","names":[],"sources":["../src/utils.ts","../src/lint.ts"],"mappings":";;;qBAgDa;;qBAGA;;qBAGA;;qBAGA;;qBAGA;;qBAMA;;qBAGA;;;;;;;wBC8BG,KAAK,YAAY,QAAQ,gBAAgB;;wBA+FzC,UAAU,YAAY,QAAQ,gBAAgB;;wBAa9C,QAAQ,YAAY,QAAQ,gBAAgB;;wBA6B5C,OAAO,YAAY,QAAQ,gBAAgB;;wBAwB3C,KAAK,YAAY,QAAQ,gBAAgB;;wBAKzC,QAAQ,YAAY,QAAQ,gBAAgB;;;;wBAoB5C,MAAM,YAAY,QAAQ,gBAAgB;;;;;wBAkB1C,eAAe,YAAY,QAAQ,gBAAgB;UAmBzD,wBAAwB,QAAQ;EACxC;EACA;;EAEA;;;wBAIc,SAAS,UAAS,kBAAuB;UAyB/C,sBAAsB,QAAQ;EACtC;;;wBAIc,OAAO,UAAU,gBAAgB;;wBA2CjC,OAAO,YAAY,QAAQ,gBAAgB;;wBA4B3C,QAAQ,YAAY,QAAQ,gBAAgB"}
package/dist/lint.mjs ADDED
@@ -0,0 +1,381 @@
1
+ import { createRequire } from "node:module";
2
+ import { existsSync, readFileSync } from "node:fs";
3
+ import path from "node:path";
4
+ import { defu } from "defu";
5
+ import { defineConfig, defineConfig as defineConfig$1 } from "oxlint";
6
+ //#region src/utils.ts
7
+ /**
8
+ * Utility functions and constants
9
+ */
10
+ const env = process.env;
11
+ function isCI() {
12
+ return !!(env["CI"] || env["CONTINUOUS_INTEGRATION"] || env["BUILD_ID"] || env["BUILD_NUMBER"] || env["RUN_ID"]);
13
+ }
14
+ function isInGitHooksOrLintStaged() {
15
+ return !!(env["GIT_PARAMS"] || env["VSCODE_GIT_COMMAND"]) || env["npm_lifecycle_script"]?.startsWith("lint-staged") === true;
16
+ }
17
+ /**
18
+ * Detects whether running in an editor environment.
19
+ * Returns false in CI, Git Hooks, or lint-staged.
20
+ */
21
+ function isInEditorEnv() {
22
+ if (isCI()) return false;
23
+ if (isInGitHooksOrLintStaged()) return false;
24
+ return !!(env["VSCODE_PID"] || env["VSCODE_CWD"] || env["JETBRAINS_IDE"] || env["VIM"] || env["NVIM"]);
25
+ }
26
+ /** All JS/TS source files */
27
+ const GLOB_SRC = "**/*.{js,mjs,cjs,jsx,ts,mts,cts,tsx}";
28
+ /** JavaScript files only */
29
+ const GLOB_JS = "**/*.{js,mjs,cjs,jsx}";
30
+ /** TypeScript files only */
31
+ const GLOB_TS = "**/*.{ts,mts,cts,tsx}";
32
+ /** JSX/TSX files (React-related) */
33
+ const GLOB_JSX = "**/*.{jsx,tsx}";
34
+ /** Test files */
35
+ const GLOB_TESTS = ["**/*.{test,spec}.{js,mjs,cjs,jsx,ts,mts,cts,tsx}", "**/__tests__/**/*.{js,mjs,cjs,jsx,ts,mts,cts,tsx}"];
36
+ /** JSON files */
37
+ const GLOB_JSON = "**/*.json";
38
+ /** Markdown files */
39
+ const GLOB_MARKDOWN = "**/*.md";
40
+ //#endregion
41
+ //#region src/lint.ts
42
+ /**
43
+ * Oxlint lint presets.
44
+ *
45
+ * Every preset is a function that accepts optional overrides, merged via `defu`.
46
+ * User overrides take priority over preset defaults.
47
+ *
48
+ * @example
49
+ * ```ts
50
+ * // oxlint.config.ts
51
+ * import { base, unicorn, react, tailwind, vitest } from '@hooshid/ox-config/lint'
52
+ * import { defineConfig } from 'oxlint'
53
+ *
54
+ * export default defineConfig({
55
+ * extends: [base(), unicorn(), react(), tailwind(), vitest()],
56
+ * })
57
+ * ```
58
+ */
59
+ const require = createRequire(import.meta.url);
60
+ const DEFAULT_IGNORES = [
61
+ "**/node_modules/**",
62
+ "**/dist/**",
63
+ "**/build/**",
64
+ "**/out/**",
65
+ "**/.next/**",
66
+ "**/.cache/**",
67
+ "**/.turbo/**",
68
+ "**/.output/**",
69
+ "**/.nitro/**",
70
+ "**/.tanstack/**",
71
+ "**/.vinxi/**",
72
+ "**/.git/**",
73
+ "**/public/**",
74
+ "**/*.d.ts"
75
+ ];
76
+ function loadGitignorePatterns() {
77
+ const gitignoreFile = path.resolve(process.cwd(), ".gitignore");
78
+ if (!existsSync(gitignoreFile)) return [];
79
+ return readFileSync(gitignoreFile, "utf8").split(/\r?\n/u).map((line) => line.trim()).filter((line) => line && !line.startsWith("#")).map((pattern) => {
80
+ let p = pattern.trimEnd();
81
+ if (p.startsWith("/")) p = p.slice(1);
82
+ if (!p.includes("/") && !p.includes("*")) p = `**/${p}`;
83
+ if (p.endsWith("/")) p = `${p}**`;
84
+ return p;
85
+ });
86
+ }
87
+ function preset(defaults, overrides) {
88
+ return defineConfig$1(defu(overrides ?? {}, defaults));
89
+ }
90
+ function resolvePlugin(name) {
91
+ try {
92
+ return require.resolve(name);
93
+ } catch {
94
+ return name;
95
+ }
96
+ }
97
+ function resolvePlugins(plugins) {
98
+ return plugins.map((p) => {
99
+ if (typeof p === "string") return resolvePlugin(p);
100
+ return {
101
+ ...p,
102
+ specifier: resolvePlugin(p.specifier)
103
+ };
104
+ });
105
+ }
106
+ /**
107
+ * Base lint preset — TypeScript + Import plugins, categories, env, ignores.
108
+ * Always include first.
109
+ */
110
+ function base(overrides) {
111
+ return preset({
112
+ plugins: ["typescript", "import"],
113
+ categories: {
114
+ correctness: "error",
115
+ suspicious: "error",
116
+ perf: "error",
117
+ pedantic: "warn"
118
+ },
119
+ rules: {
120
+ "no-await-in-loop": "off",
121
+ "typescript/prefer-readonly-parameter-types": "off",
122
+ "typescript/strict-boolean-expressions": "off",
123
+ "max-lines": "off",
124
+ "max-lines-per-function": "off",
125
+ "no-inline-comments": "off",
126
+ "no-warning-comments": "off",
127
+ "import/max-dependencies": "off",
128
+ "react/no-unescaped-entities": "off",
129
+ "require-await": "off"
130
+ },
131
+ env: {
132
+ browser: true,
133
+ node: true,
134
+ es2026: true,
135
+ builtin: true
136
+ },
137
+ ignorePatterns: [...DEFAULT_IGNORES, ...loadGitignorePatterns()],
138
+ overrides: [
139
+ {
140
+ files: [GLOB_TS],
141
+ rules: {
142
+ "typescript/consistent-type-definitions": "off",
143
+ "typescript/consistent-type-imports": "error",
144
+ "no-unused-vars": "off",
145
+ "typescript/array-type": "error",
146
+ "typescript/consistent-generic-constructors": "error",
147
+ "typescript/consistent-indexed-object-style": "error",
148
+ "typescript/consistent-type-assertions": "error",
149
+ "typescript/ban-tslint-comment": "error",
150
+ "typescript/no-empty-interface": "error",
151
+ "typescript/no-inferrable-types": "error",
152
+ "typescript/prefer-for-of": "error",
153
+ "typescript/prefer-function-type": "error",
154
+ "typescript/unified-signatures": "error"
155
+ }
156
+ },
157
+ {
158
+ files: [GLOB_SRC],
159
+ rules: {
160
+ "import/no-unassigned-import": "off",
161
+ "import/no-relative-parent-imports": "error",
162
+ "import/first": "error",
163
+ "import/no-duplicates": "error",
164
+ "import/consistent-type-specifier-style": "error",
165
+ "import/no-mutable-exports": "error",
166
+ "import/no-named-default": "error"
167
+ }
168
+ },
169
+ {
170
+ files: ["**/*.config.{ts,mts,cts,js,mjs,cjs}"],
171
+ rules: { "import/no-relative-parent-imports": "off" }
172
+ },
173
+ {
174
+ files: GLOB_TESTS,
175
+ rules: {
176
+ "import/first": "off",
177
+ "import/no-duplicates": "off",
178
+ "import/consistent-type-specifier-style": "off",
179
+ "unicorn/no-useless-undefined": "off",
180
+ "typescript/no-empty-function": "off",
181
+ "unicorn/prefer-string-replace-all": "off",
182
+ "unicorn/no-array-callback-reference": "off",
183
+ "unicorn/prefer-spread": "off",
184
+ "typescript/no-non-null-assertion": "off",
185
+ "no-magic-numbers": "off",
186
+ "typescript/no-explicit-any": "off",
187
+ "typescript/no-unsafe-assignment": "off",
188
+ "typescript/no-unsafe-call": "off",
189
+ "typescript/no-unsafe-member-access": "off",
190
+ "typescript/no-unsafe-return": "off",
191
+ "typescript/no-unsafe-argument": "off",
192
+ "react/no-array-index-key": "off"
193
+ }
194
+ }
195
+ ]
196
+ }, overrides);
197
+ }
198
+ /** Type-aware lint preset — enables 59 type-aware rules via tsgolint. */
199
+ function typeAware(overrides) {
200
+ return preset({ options: {
201
+ typeAware: true,
202
+ typeCheck: true
203
+ } }, overrides);
204
+ }
205
+ /** Unicorn lint preset — 100+ code quality rules. */
206
+ function unicorn(overrides) {
207
+ return preset({
208
+ plugins: ["unicorn"],
209
+ rules: {
210
+ "unicorn/no-null": "off",
211
+ "unicorn/filename-case": ["error", { case: "kebabCase" }],
212
+ "unicorn/catch-error-name": "error",
213
+ "unicorn/error-message": "error",
214
+ "unicorn/prefer-optional-catch-binding": "error",
215
+ "unicorn/no-zero-fractions": "error",
216
+ "unicorn/number-literal-case": "error",
217
+ "unicorn/numeric-separators-style": "error",
218
+ "unicorn/prefer-includes": "error",
219
+ "unicorn/prefer-spread": "error",
220
+ "unicorn/prefer-ternary": "error",
221
+ "unicorn/prefer-string-trim-start-end": "error",
222
+ "unicorn/prefer-structured-clone": "error",
223
+ "unicorn/prefer-default-parameters": "error",
224
+ "unicorn/no-console-spaces": "error",
225
+ "unicorn/throw-new-error": "error",
226
+ "unicorn/require-array-join-separator": "error"
227
+ }
228
+ }, overrides);
229
+ }
230
+ /** Dependency optimization — flags packages replaceable with native APIs. */
231
+ function depend(overrides) {
232
+ return preset({
233
+ jsPlugins: resolvePlugins(["eslint-plugin-depend"]),
234
+ rules: { "depend/ban-dependencies": ["error", {
235
+ presets: [
236
+ "native",
237
+ "microutilities",
238
+ "preferred"
239
+ ],
240
+ modules: [],
241
+ allowed: ["dotenv"]
242
+ }] }
243
+ }, overrides);
244
+ }
245
+ /** Node.js lint preset — native node plugin. */
246
+ function node(overrides) {
247
+ return preset({ plugins: ["node"] }, overrides);
248
+ }
249
+ /** Promise lint preset — native promise plugin. */
250
+ function promise(overrides) {
251
+ return preset({ plugins: ["promise"] }, overrides);
252
+ }
253
+ const reactStyleRules = {
254
+ "react/jsx-pascal-case": "error",
255
+ "react/jsx-boolean-value": "error",
256
+ "react/jsx-curly-brace-presence": "error",
257
+ "react/jsx-fragments": "error",
258
+ "react/self-closing-comp": "error",
259
+ "react/hook-use-state": "error"
260
+ };
261
+ /**
262
+ * React lint preset — React + react-refresh (for Vite/TanStack Start).
263
+ */
264
+ function react(overrides) {
265
+ return preset({
266
+ plugins: ["react"],
267
+ jsPlugins: resolvePlugins(["eslint-plugin-react-refresh"]),
268
+ rules: {
269
+ "react/react-in-jsx-scope": "off",
270
+ ...reactStyleRules
271
+ }
272
+ }, overrides);
273
+ }
274
+ /**
275
+ * TanStack Router lint preset — loads @tanstack/eslint-plugin-router.
276
+ * Covers route-param-names and create-route-property-order.
277
+ */
278
+ function tanstackRouter(overrides) {
279
+ return preset({
280
+ jsPlugins: resolvePlugins([{
281
+ name: "tanstack-router",
282
+ specifier: "@tanstack/eslint-plugin-router"
283
+ }]),
284
+ rules: {
285
+ "tanstack-router/route-param-names": "error",
286
+ "tanstack-router/create-route-property-order": "error"
287
+ }
288
+ }, overrides);
289
+ }
290
+ /** Tailwind CSS lint preset — eslint-plugin-better-tailwindcss. */
291
+ function tailwind(options = {}) {
292
+ const { entryPoint = "src/styles/globals.css", rootFontSize = 16, files, ...overrides } = options;
293
+ return preset({
294
+ jsPlugins: resolvePlugins(["eslint-plugin-better-tailwindcss"]),
295
+ settings: { "better-tailwindcss": {
296
+ entryPoint,
297
+ rootFontSize
298
+ } },
299
+ overrides: [{
300
+ files: files ?? ["**/*.{jsx,tsx}"],
301
+ rules: {
302
+ "better-tailwindcss/enforce-consistent-line-wrapping": ["error", { printWidth: 0 }],
303
+ "better-tailwindcss/enforce-canonical-classes": "error"
304
+ }
305
+ }]
306
+ }, overrides);
307
+ }
308
+ /** Vitest lint preset — native vitest plugin with test-file scoping. */
309
+ function vitest(options) {
310
+ const { files, ...overrides } = options ?? {};
311
+ return preset({
312
+ plugins: ["vitest"],
313
+ settings: { vitest: { typecheck: true } },
314
+ overrides: [{
315
+ files: files ?? GLOB_TESTS,
316
+ rules: {
317
+ "vitest/expect-expect": "error",
318
+ "vitest/no-conditional-expect": "error",
319
+ "vitest/no-identical-title": "error",
320
+ "vitest/no-import-node-test": "error",
321
+ "vitest/no-interpolation-in-snapshots": "error",
322
+ "vitest/no-mocks-import": "error",
323
+ "vitest/no-standalone-expect": "error",
324
+ "vitest/valid-describe-callback": "error",
325
+ "vitest/valid-expect": "error",
326
+ "vitest/valid-title": "error",
327
+ "vitest/consistent-test-it": ["error", {
328
+ fn: "it",
329
+ withinDescribe: "it"
330
+ }],
331
+ "vitest/prefer-hooks-in-order": "error",
332
+ "vitest/prefer-lowercase-title": "error",
333
+ "vitest/no-disabled-tests": isInEditorEnv() ? "warn" : "error",
334
+ "vitest/no-focused-tests": isInEditorEnv() ? "warn" : "error",
335
+ "vitest/require-mock-type-parameters": "off",
336
+ "no-console": "off",
337
+ "unicorn/no-null": "off",
338
+ "typescript/ban-ts-comment": "off"
339
+ }
340
+ }]
341
+ }, overrides);
342
+ }
343
+ /** NestJS lint preset — @darraghor/eslint-plugin-nestjs-typed. */
344
+ function nestjs(overrides) {
345
+ return preset({
346
+ jsPlugins: resolvePlugins([{
347
+ name: "nestjs-typed",
348
+ specifier: "@darraghor/eslint-plugin-nestjs-typed"
349
+ }]),
350
+ rules: {
351
+ "nestjs-typed/injectable-should-be-provided": "error",
352
+ "nestjs-typed/provided-injected-should-match-factory-parameters": "error",
353
+ "nestjs-typed/use-injectable-provided-token": "error",
354
+ "nestjs-typed/api-property-matches-property-optionality": "error",
355
+ "nestjs-typed/controllers-should-supply-api-tags": "error",
356
+ "nestjs-typed/api-method-should-specify-api-response": "error",
357
+ "nestjs-typed/api-property-returning-array-should-set-array": "error",
358
+ "nestjs-typed/api-property-should-have-api-extra-models": "error",
359
+ "nestjs-typed/api-operation-summary-description-capitalized": "error",
360
+ "nestjs-typed/param-decorator-name-matches-route-param": "error",
361
+ "nestjs-typed/validate-nested-of-array-should-set-each": "error",
362
+ "nestjs-typed/all-properties-are-whitelisted": "error",
363
+ "nestjs-typed/no-duplicate-decorators": "error",
364
+ "nestjs-typed/validation-pipe-should-use-forbid-unknown": "error"
365
+ }
366
+ }, overrides);
367
+ }
368
+ /** Drizzle ORM lint preset — eslint-plugin-drizzle. */
369
+ function drizzle(overrides) {
370
+ return preset({
371
+ jsPlugins: resolvePlugins(["eslint-plugin-drizzle"]),
372
+ rules: {
373
+ "drizzle/enforce-delete-with-where": "error",
374
+ "drizzle/enforce-update-with-where": "error"
375
+ }
376
+ }, overrides);
377
+ }
378
+ //#endregion
379
+ export { GLOB_JS, GLOB_JSON, GLOB_JSX, GLOB_MARKDOWN, GLOB_SRC, GLOB_TESTS, GLOB_TS, base, defineConfig, depend, drizzle, nestjs, node, promise, react, tailwind, tanstackRouter, typeAware, unicorn, vitest };
380
+
381
+ //# sourceMappingURL=lint.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lint.mjs","names":["defineConfig"],"sources":["../src/utils.ts","../src/lint.ts"],"sourcesContent":["/**\r\n * Utility functions and constants\r\n */\r\n\r\n// ============================================================================\r\n// Environment detection\r\n// ============================================================================\r\n\r\nconst env = process.env\r\n\r\nfunction isCI(): boolean {\r\n return !!(\r\n env['CI'] ||\r\n env['CONTINUOUS_INTEGRATION'] ||\r\n env['BUILD_ID'] ||\r\n env['BUILD_NUMBER'] ||\r\n env['RUN_ID']\r\n )\r\n}\r\n\r\nfunction isInGitHooksOrLintStaged(): boolean {\r\n return (\r\n !!(env['GIT_PARAMS'] || env['VSCODE_GIT_COMMAND']) ||\r\n env['npm_lifecycle_script']?.startsWith('lint-staged') === true\r\n )\r\n}\r\n\r\n/**\r\n * Detects whether running in an editor environment.\r\n * Returns false in CI, Git Hooks, or lint-staged.\r\n */\r\nexport function isInEditorEnv(): boolean {\r\n if (isCI()) return false\r\n if (isInGitHooksOrLintStaged()) return false\r\n return !!(\r\n env['VSCODE_PID'] ||\r\n env['VSCODE_CWD'] ||\r\n env['JETBRAINS_IDE'] ||\r\n env['VIM'] ||\r\n env['NVIM']\r\n )\r\n}\r\n\r\n// ============================================================================\r\n// File matching patterns (Globs)\r\n// ============================================================================\r\n\r\n/** All JS/TS source files */\r\nexport const GLOB_SRC = '**/*.{js,mjs,cjs,jsx,ts,mts,cts,tsx}'\r\n\r\n/** JavaScript files only */\r\nexport const GLOB_JS = '**/*.{js,mjs,cjs,jsx}'\r\n\r\n/** TypeScript files only */\r\nexport const GLOB_TS = '**/*.{ts,mts,cts,tsx}'\r\n\r\n/** JSX/TSX files (React-related) */\r\nexport const GLOB_JSX = '**/*.{jsx,tsx}'\r\n\r\n/** Test files */\r\nexport const GLOB_TESTS: string[] = [\r\n '**/*.{test,spec}.{js,mjs,cjs,jsx,ts,mts,cts,tsx}',\r\n '**/__tests__/**/*.{js,mjs,cjs,jsx,ts,mts,cts,tsx}',\r\n]\r\n\r\n/** JSON files */\r\nexport const GLOB_JSON = '**/*.json'\r\n\r\n/** Markdown files */\r\nexport const GLOB_MARKDOWN = '**/*.md'","/**\r\n * Oxlint lint presets.\r\n *\r\n * Every preset is a function that accepts optional overrides, merged via `defu`.\r\n * User overrides take priority over preset defaults.\r\n *\r\n * @example\r\n * ```ts\r\n * // oxlint.config.ts\r\n * import { base, unicorn, react, tailwind, vitest } from '@hooshid/ox-config/lint'\r\n * import { defineConfig } from 'oxlint'\r\n *\r\n * export default defineConfig({\r\n * extends: [base(), unicorn(), react(), tailwind(), vitest()],\r\n * })\r\n * ```\r\n */\r\nimport { existsSync, readFileSync } from 'node:fs'\r\nimport { createRequire } from 'node:module'\r\nimport path from 'node:path'\r\n\r\nimport { defu } from 'defu'\r\nimport { defineConfig } from 'oxlint'\r\n\r\nimport { GLOB_JSX, GLOB_SRC, GLOB_TESTS, GLOB_TS, isInEditorEnv } from './utils'\r\n\r\nimport type { ExternalPluginEntry, OxlintConfig } from 'oxlint'\r\n\r\nconst require = createRequire(import.meta.url)\r\n\r\n// ============================================================================\r\n// Ignore patterns\r\n// ============================================================================\r\n\r\nconst DEFAULT_IGNORES: string[] = [\r\n '**/node_modules/**',\r\n '**/dist/**',\r\n '**/build/**',\r\n '**/out/**',\r\n '**/.next/**',\r\n '**/.cache/**',\r\n '**/.turbo/**',\r\n '**/.output/**',\r\n '**/.nitro/**',\r\n '**/.tanstack/**',\r\n '**/.vinxi/**',\r\n '**/.git/**',\r\n '**/public/**',\r\n '**/*.d.ts',\r\n]\r\n\r\nfunction loadGitignorePatterns(): string[] {\r\n const gitignoreFile = path.resolve(process.cwd(), '.gitignore')\r\n if (!existsSync(gitignoreFile)) return []\r\n\r\n return readFileSync(gitignoreFile, 'utf8')\r\n .split(/\\r?\\n/u)\r\n .map((line) => line.trim())\r\n .filter((line) => line && !line.startsWith('#'))\r\n .map((pattern) => {\r\n let p = pattern.trimEnd()\r\n if (p.startsWith('/')) p = p.slice(1)\r\n if (!p.includes('/') && !p.includes('*')) p = `**/${p}`\r\n if (p.endsWith('/')) p = `${p}**`\r\n return p\r\n })\r\n}\r\n\r\n// ============================================================================\r\n// Helpers\r\n// ============================================================================\r\n\r\nfunction preset(defaults: OxlintConfig, overrides?: Partial<OxlintConfig>): OxlintConfig {\r\n return defineConfig(defu(overrides ?? {}, defaults))\r\n}\r\n\r\nfunction resolvePlugin(name: string): string {\r\n try {\r\n return require.resolve(name)\r\n } catch {\r\n return name\r\n }\r\n}\r\n\r\nfunction resolvePlugins(plugins: ExternalPluginEntry[]): ExternalPluginEntry[] {\r\n return plugins.map((p) => {\r\n if (typeof p === 'string') return resolvePlugin(p)\r\n return { ...p, specifier: resolvePlugin(p.specifier) }\r\n })\r\n}\r\n\r\n// ============================================================================\r\n// Core\r\n// ============================================================================\r\n\r\n/**\r\n * Base lint preset — TypeScript + Import plugins, categories, env, ignores.\r\n * Always include first.\r\n */\r\nexport function base(overrides?: Partial<OxlintConfig>): OxlintConfig {\r\n return preset(\r\n {\r\n plugins: ['typescript', 'import'],\r\n categories: {\r\n correctness: 'error',\r\n suspicious: 'error',\r\n perf: 'error',\r\n pedantic: 'warn',\r\n },\r\n rules: {\r\n 'no-await-in-loop': 'off',\r\n 'typescript/prefer-readonly-parameter-types': 'off',\r\n 'typescript/strict-boolean-expressions': 'off',\r\n 'max-lines': 'off',\r\n 'max-lines-per-function': 'off',\r\n 'no-inline-comments': 'off',\r\n 'no-warning-comments': 'off',\r\n 'import/max-dependencies': 'off',\r\n 'react/no-unescaped-entities': 'off',\r\n 'require-await': 'off',\r\n },\r\n env: {\r\n browser: true,\r\n node: true,\r\n es2026: true,\r\n builtin: true,\r\n },\r\n ignorePatterns: [...DEFAULT_IGNORES, ...loadGitignorePatterns()],\r\n overrides: [\r\n {\r\n files: [GLOB_TS],\r\n rules: {\r\n 'typescript/consistent-type-definitions': 'off',\r\n 'typescript/consistent-type-imports': 'error',\r\n 'no-unused-vars': 'off',\r\n 'typescript/array-type': 'error',\r\n 'typescript/consistent-generic-constructors': 'error',\r\n 'typescript/consistent-indexed-object-style': 'error',\r\n 'typescript/consistent-type-assertions': 'error',\r\n 'typescript/ban-tslint-comment': 'error',\r\n 'typescript/no-empty-interface': 'error',\r\n 'typescript/no-inferrable-types': 'error',\r\n 'typescript/prefer-for-of': 'error',\r\n 'typescript/prefer-function-type': 'error',\r\n 'typescript/unified-signatures': 'error',\r\n },\r\n },\r\n {\r\n files: [GLOB_SRC],\r\n rules: {\r\n 'import/no-unassigned-import': 'off',\r\n 'import/no-relative-parent-imports': 'error',\r\n 'import/first': 'error',\r\n 'import/no-duplicates': 'error',\r\n 'import/consistent-type-specifier-style': 'error',\r\n 'import/no-mutable-exports': 'error',\r\n 'import/no-named-default': 'error',\r\n },\r\n },\r\n {\r\n files: ['**/*.config.{ts,mts,cts,js,mjs,cjs}'],\r\n rules: {\r\n 'import/no-relative-parent-imports': 'off',\r\n },\r\n },\r\n {\r\n files: GLOB_TESTS,\r\n rules: {\r\n 'import/first': 'off',\r\n 'import/no-duplicates': 'off',\r\n 'import/consistent-type-specifier-style': 'off',\r\n 'unicorn/no-useless-undefined': 'off',\r\n 'typescript/no-empty-function': 'off',\r\n 'unicorn/prefer-string-replace-all': 'off',\r\n 'unicorn/no-array-callback-reference': 'off',\r\n 'unicorn/prefer-spread': 'off',\r\n 'typescript/no-non-null-assertion': 'off',\r\n 'no-magic-numbers': 'off',\r\n 'typescript/no-explicit-any': 'off',\r\n 'typescript/no-unsafe-assignment': 'off',\r\n 'typescript/no-unsafe-call': 'off',\r\n 'typescript/no-unsafe-member-access': 'off',\r\n 'typescript/no-unsafe-return': 'off',\r\n 'typescript/no-unsafe-argument': 'off',\r\n 'react/no-array-index-key': 'off',\r\n },\r\n },\r\n ],\r\n },\r\n overrides,\r\n )\r\n}\r\n\r\n/** Type-aware lint preset — enables 59 type-aware rules via tsgolint. */\r\nexport function typeAware(overrides?: Partial<OxlintConfig>): OxlintConfig {\r\n return preset(\r\n {\r\n options: {\r\n typeAware: true,\r\n typeCheck: true,\r\n },\r\n },\r\n overrides,\r\n )\r\n}\r\n\r\n/** Unicorn lint preset — 100+ code quality rules. */\r\nexport function unicorn(overrides?: Partial<OxlintConfig>): OxlintConfig {\r\n return preset(\r\n {\r\n plugins: ['unicorn'],\r\n rules: {\r\n 'unicorn/no-null': 'off',\r\n 'unicorn/filename-case': ['error', { case: 'kebabCase' }],\r\n 'unicorn/catch-error-name': 'error',\r\n 'unicorn/error-message': 'error',\r\n 'unicorn/prefer-optional-catch-binding': 'error',\r\n 'unicorn/no-zero-fractions': 'error',\r\n 'unicorn/number-literal-case': 'error',\r\n 'unicorn/numeric-separators-style': 'error',\r\n 'unicorn/prefer-includes': 'error',\r\n 'unicorn/prefer-spread': 'error',\r\n 'unicorn/prefer-ternary': 'error',\r\n 'unicorn/prefer-string-trim-start-end': 'error',\r\n 'unicorn/prefer-structured-clone': 'error',\r\n 'unicorn/prefer-default-parameters': 'error',\r\n 'unicorn/no-console-spaces': 'error',\r\n 'unicorn/throw-new-error': 'error',\r\n 'unicorn/require-array-join-separator': 'error',\r\n },\r\n },\r\n overrides,\r\n )\r\n}\r\n\r\n/** Dependency optimization — flags packages replaceable with native APIs. */\r\nexport function depend(overrides?: Partial<OxlintConfig>): OxlintConfig {\r\n return preset(\r\n {\r\n jsPlugins: resolvePlugins(['eslint-plugin-depend']),\r\n rules: {\r\n 'depend/ban-dependencies': [\r\n 'error',\r\n {\r\n presets: ['native', 'microutilities', 'preferred'],\r\n modules: [],\r\n allowed: ['dotenv'],\r\n },\r\n ],\r\n },\r\n },\r\n overrides,\r\n )\r\n}\r\n\r\n// ============================================================================\r\n// Runtime environments\r\n// ============================================================================\r\n\r\n/** Node.js lint preset — native node plugin. */\r\nexport function node(overrides?: Partial<OxlintConfig>): OxlintConfig {\r\n return preset({ plugins: ['node'] }, overrides)\r\n}\r\n\r\n/** Promise lint preset — native promise plugin. */\r\nexport function promise(overrides?: Partial<OxlintConfig>): OxlintConfig {\r\n return preset({ plugins: ['promise'] }, overrides)\r\n}\r\n\r\n// ============================================================================\r\n// Frontend\r\n// ============================================================================\r\n\r\nconst reactStyleRules = {\r\n 'react/jsx-pascal-case': 'error',\r\n 'react/jsx-boolean-value': 'error',\r\n 'react/jsx-curly-brace-presence': 'error',\r\n 'react/jsx-fragments': 'error',\r\n 'react/self-closing-comp': 'error',\r\n 'react/hook-use-state': 'error',\r\n} as const\r\n\r\n/**\r\n * React lint preset — React + react-refresh (for Vite/TanStack Start).\r\n */\r\nexport function react(overrides?: Partial<OxlintConfig>): OxlintConfig {\r\n return preset(\r\n {\r\n plugins: ['react'],\r\n jsPlugins: resolvePlugins(['eslint-plugin-react-refresh']),\r\n rules: {\r\n 'react/react-in-jsx-scope': 'off',\r\n ...reactStyleRules,\r\n },\r\n },\r\n overrides,\r\n )\r\n}\r\n\r\n/**\r\n * TanStack Router lint preset — loads @tanstack/eslint-plugin-router.\r\n * Covers route-param-names and create-route-property-order.\r\n */\r\nexport function tanstackRouter(overrides?: Partial<OxlintConfig>): OxlintConfig {\r\n return preset(\r\n {\r\n jsPlugins: resolvePlugins([\r\n { name: 'tanstack-router', specifier: '@tanstack/eslint-plugin-router' },\r\n ]),\r\n rules: {\r\n 'tanstack-router/route-param-names': 'error',\r\n 'tanstack-router/create-route-property-order': 'error',\r\n },\r\n },\r\n overrides,\r\n )\r\n}\r\n\r\n// ============================================================================\r\n// Tailwind\r\n// ============================================================================\r\n\r\ninterface TailwindOptions extends Partial<OxlintConfig> {\r\n entryPoint?: string\r\n rootFontSize?: number\r\n /** File glob patterns for tailwind rules. @default GLOB_JSX */\r\n files?: string[]\r\n}\r\n\r\n/** Tailwind CSS lint preset — eslint-plugin-better-tailwindcss. */\r\nexport function tailwind(options: TailwindOptions = {}): OxlintConfig {\r\n const { entryPoint = 'src/styles/globals.css', rootFontSize = 16, files, ...overrides } = options\r\n\r\n return preset(\r\n {\r\n jsPlugins: resolvePlugins(['eslint-plugin-better-tailwindcss']),\r\n settings: { 'better-tailwindcss': { entryPoint, rootFontSize } },\r\n overrides: [\r\n {\r\n files: files ?? [GLOB_JSX],\r\n rules: {\r\n 'better-tailwindcss/enforce-consistent-line-wrapping': ['error', { printWidth: 0 }],\r\n 'better-tailwindcss/enforce-canonical-classes': 'error',\r\n },\r\n },\r\n ],\r\n },\r\n overrides,\r\n )\r\n}\r\n\r\n// ============================================================================\r\n// Testing\r\n// ============================================================================\r\n\r\ninterface VitestOptions extends Partial<OxlintConfig> {\r\n files?: string[]\r\n}\r\n\r\n/** Vitest lint preset — native vitest plugin with test-file scoping. */\r\nexport function vitest(options?: VitestOptions): OxlintConfig {\r\n const { files, ...overrides } = options ?? {}\r\n\r\n return preset(\r\n {\r\n plugins: ['vitest'],\r\n settings: { vitest: { typecheck: true } },\r\n overrides: [\r\n {\r\n files: files ?? GLOB_TESTS,\r\n rules: {\r\n 'vitest/expect-expect': 'error',\r\n 'vitest/no-conditional-expect': 'error',\r\n 'vitest/no-identical-title': 'error',\r\n 'vitest/no-import-node-test': 'error',\r\n 'vitest/no-interpolation-in-snapshots': 'error',\r\n 'vitest/no-mocks-import': 'error',\r\n 'vitest/no-standalone-expect': 'error',\r\n 'vitest/valid-describe-callback': 'error',\r\n 'vitest/valid-expect': 'error',\r\n 'vitest/valid-title': 'error',\r\n 'vitest/consistent-test-it': ['error', { fn: 'it', withinDescribe: 'it' }],\r\n 'vitest/prefer-hooks-in-order': 'error',\r\n 'vitest/prefer-lowercase-title': 'error',\r\n 'vitest/no-disabled-tests': isInEditorEnv() ? 'warn' : 'error',\r\n 'vitest/no-focused-tests': isInEditorEnv() ? 'warn' : 'error',\r\n 'vitest/require-mock-type-parameters': 'off',\r\n 'no-console': 'off',\r\n 'unicorn/no-null': 'off',\r\n 'typescript/ban-ts-comment': 'off',\r\n },\r\n },\r\n ],\r\n },\r\n overrides,\r\n )\r\n}\r\n\r\n// ============================================================================\r\n// Backend / ORM\r\n// ============================================================================\r\n\r\n/** NestJS lint preset — @darraghor/eslint-plugin-nestjs-typed. */\r\nexport function nestjs(overrides?: Partial<OxlintConfig>): OxlintConfig {\r\n return preset(\r\n {\r\n jsPlugins: resolvePlugins([\r\n { name: 'nestjs-typed', specifier: '@darraghor/eslint-plugin-nestjs-typed' },\r\n ]),\r\n rules: {\r\n 'nestjs-typed/injectable-should-be-provided': 'error',\r\n 'nestjs-typed/provided-injected-should-match-factory-parameters': 'error',\r\n 'nestjs-typed/use-injectable-provided-token': 'error',\r\n 'nestjs-typed/api-property-matches-property-optionality': 'error',\r\n 'nestjs-typed/controllers-should-supply-api-tags': 'error',\r\n 'nestjs-typed/api-method-should-specify-api-response': 'error',\r\n 'nestjs-typed/api-property-returning-array-should-set-array': 'error',\r\n 'nestjs-typed/api-property-should-have-api-extra-models': 'error',\r\n 'nestjs-typed/api-operation-summary-description-capitalized': 'error',\r\n 'nestjs-typed/param-decorator-name-matches-route-param': 'error',\r\n 'nestjs-typed/validate-nested-of-array-should-set-each': 'error',\r\n 'nestjs-typed/all-properties-are-whitelisted': 'error',\r\n 'nestjs-typed/no-duplicate-decorators': 'error',\r\n 'nestjs-typed/validation-pipe-should-use-forbid-unknown': 'error',\r\n },\r\n },\r\n overrides,\r\n )\r\n}\r\n\r\n/** Drizzle ORM lint preset — eslint-plugin-drizzle. */\r\nexport function drizzle(overrides?: Partial<OxlintConfig>): OxlintConfig {\r\n return preset(\r\n {\r\n jsPlugins: resolvePlugins(['eslint-plugin-drizzle']),\r\n rules: {\r\n 'drizzle/enforce-delete-with-where': 'error',\r\n 'drizzle/enforce-update-with-where': 'error',\r\n },\r\n },\r\n overrides,\r\n )\r\n}\r\n\r\n// ============================================================================\r\n// Re-exports\r\n// ============================================================================\r\n\r\nexport { defineConfig } from 'oxlint'\r\nexport {\r\n GLOB_SRC,\r\n GLOB_JS,\r\n GLOB_TS,\r\n GLOB_JSX,\r\n GLOB_TESTS,\r\n GLOB_JSON,\r\n GLOB_MARKDOWN,\r\n} from './utils'"],"mappings":";;;;;;;;;AAQA,MAAM,MAAM,QAAQ;AAEpB,SAAS,OAAgB;CACvB,OAAO,CAAC,EACN,IAAI,SACJ,IAAI,6BACJ,IAAI,eACJ,IAAI,mBACJ,IAAI;AAER;AAEA,SAAS,2BAAoC;CAC3C,OACE,CAAC,EAAE,IAAI,iBAAiB,IAAI,0BAC5B,IAAI,uBAAuB,EAAE,WAAW,aAAa,MAAM;AAE/D;;;;;AAMA,SAAgB,gBAAyB;CACvC,IAAI,KAAK,GAAG,OAAO;CACnB,IAAI,yBAAyB,GAAG,OAAO;CACvC,OAAO,CAAC,EACN,IAAI,iBACJ,IAAI,iBACJ,IAAI,oBACJ,IAAI,UACJ,IAAI;AAER;;AAOA,MAAa,WAAW;;AAGxB,MAAa,UAAU;;A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GACL,8CAA8C;GAC9C,kEAAkE;GAClE,8CAA8C;GAC9C,0DAA0D;GAC1D,mDAAmD;GACnD,uDAAuD;GACvD,8DAA8D;GAC9D,0DAA0D;GAC1D,8DAA8D;GAC9D,yDAAyD;GACzD,yDAAyD;GACzD,+CAA+C;GAC/C,wCAAwC;GACxC,0DAA0D;EAC5D;CACF,GACA,SACF;AACF;;AAGA,SAAgB,QAAQ,WAAiD;CACvE,OAAO,OACL;EACE,WAAW,eAAe,CAAC,uBAAuB,CAAC;EACnD,OAAO;GACL,qCAAqC;GACrC,qCAAqC;EACvC;CACF,GACA,SACF;AACF"}
package/package.json ADDED
@@ -0,0 +1,81 @@
1
+ {
2
+ "name": "@hooshid/ox-config",
3
+ "version": "0.1.0",
4
+ "description": "Shared Oxlint + Oxfmt presets — one install for lint and format.",
5
+ "license": "MIT",
6
+ "author": "hooshid",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/hooshid/ox-config.git"
10
+ },
11
+ "homepage": "https://github.com/hooshid/ox-config#readme",
12
+ "bugs": {
13
+ "url": "https://github.com/hooshid/ox-config/issues"
14
+ },
15
+ "keywords": [
16
+ "oxlint",
17
+ "oxfmt",
18
+ "lint",
19
+ "format",
20
+ "preset",
21
+ "config"
22
+ ],
23
+ "files": [
24
+ "dist"
25
+ ],
26
+ "type": "module",
27
+ "exports": {
28
+ "./format": {
29
+ "types": "./dist/format.d.mts",
30
+ "import": "./dist/format.mjs"
31
+ },
32
+ "./lint": {
33
+ "types": "./dist/lint.d.mts",
34
+ "import": "./dist/lint.mjs"
35
+ },
36
+ "./package.json": "./package.json"
37
+ },
38
+ "publishConfig": {
39
+ "access": "public"
40
+ },
41
+ "scripts": {
42
+ "build": "tsdown",
43
+ "dev": "tsdown --watch",
44
+ "lint": "oxlint .",
45
+ "lint:fix": "oxlint . --fix",
46
+ "format": "oxfmt .",
47
+ "format:check": "oxfmt --check .",
48
+ "typecheck": "tsc --noEmit",
49
+ "changeset": "changeset",
50
+ "changeset:version": "changeset version",
51
+ "changeset:publish": "changeset publish",
52
+ "changeset:release": "pnpm build && changeset publish",
53
+ "prepublishOnly": "pnpm build"
54
+ },
55
+ "dependencies": {
56
+ "@darraghor/eslint-plugin-nestjs-typed": "^7.5.6",
57
+ "@tanstack/eslint-plugin-router": "^1.162.0",
58
+ "defu": "^6.1.7",
59
+ "eslint-plugin-better-tailwindcss": "^4.7.0",
60
+ "eslint-plugin-depend": "^1.5.0",
61
+ "eslint-plugin-drizzle": "^0.2.3",
62
+ "eslint-plugin-react-refresh": "^0.5.7",
63
+ "oxlint-tsgolint": "^0.23.0"
64
+ },
65
+ "devDependencies": {
66
+ "@changesets/cli": "^2.31.1",
67
+ "@types/node": "^22.20.4",
68
+ "oxfmt": "^0.71.0",
69
+ "oxlint": "^1.86.0",
70
+ "publint": "^0.3.24",
71
+ "tsdown": "^0.23.0",
72
+ "typescript": "^5.9.3"
73
+ },
74
+ "peerDependencies": {
75
+ "oxfmt": ">=0.44.0",
76
+ "oxlint": ">=1.59.0"
77
+ },
78
+ "engines": {
79
+ "node": ">=20"
80
+ }
81
+ }