@hooshid/ox-config 1.0.0 → 1.0.1
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/lint.d.mts.map +1 -1
- package/dist/lint.mjs +48 -7
- package/dist/lint.mjs.map +1 -1
- package/package.json +1 -1
package/dist/lint.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lint.d.mts","names":[],"sources":["../src/utils.ts","../src/lint.ts"],"mappings":";;;qBAgDa;;qBAGA;;qBAGA;;qBAGA;;qBAGA;;qBAMA;;qBAGA;;;;;;;wBCsCG,KAAK,YAAY,QAAQ,gBAAgB;;;;;
|
|
1
|
+
{"version":3,"file":"lint.d.mts","names":[],"sources":["../src/utils.ts","../src/lint.ts"],"mappings":";;;qBAgDa;;qBAGA;;qBAGA;;qBAGA;;qBAGA;;qBAMA;;qBAGA;;;;;;;wBCsCG,KAAK,YAAY,QAAQ,gBAAgB;;;;;wBA6HzC,UAAU,YAAY,QAAQ,gBAAgB;;wBAa9C,QAAQ,YAAY,QAAQ,gBAAgB;;wBA2C5C,OAAO,YAAY,QAAQ,gBAAgB;;wBAwB3C,KAAK,YAAY,QAAQ,gBAAgB;;wBAazC,QAAQ,YAAY,QAAQ,gBAAgB;;wBAuE5C,MAAM,YAAY,QAAQ,gBAAgB;;wBAW1C,UAAU,YAAY,QAAQ,gBAAgB;;wBAe9C,OAAO,YAAY,QAAQ,gBAAgB;;;;;;;;;;;wBAc3C,eAAe,YAAY,QAAQ,gBAAgB;;;;;;;;;wBAwEnD,cAAc,YAAY,QAAQ,gBAAgB;;wBAkGlD,KAAK,YAAY,QAAQ,gBAAgB;;wBAKzC,MAAM,YAAY,QAAQ,gBAAgB;UAQhD,sBAAsB,QAAQ;;EAEtC;;;wBAIc,OAAO,UAAU,gBAAgB;UAkDvC,wBAAwB,QAAQ;EACxC;EACA;;EAEA;;;wBAIc,SAAS,UAAS,kBAAuB;;;;;wBA6BzC,OAAO,YAAY,QAAQ,gBAAgB;;wBA+B3C,QAAQ,YAAY,QAAQ,gBAAgB"}
|
package/dist/lint.mjs
CHANGED
|
@@ -150,6 +150,8 @@ function base(overrides) {
|
|
|
150
150
|
"typescript/consistent-type-definitions": "off",
|
|
151
151
|
"typescript/consistent-type-imports": "error",
|
|
152
152
|
"no-unused-vars": "off",
|
|
153
|
+
"no-useless-rename": "error",
|
|
154
|
+
"uninvoked-array-callback": "error",
|
|
153
155
|
"typescript/array-type": "error",
|
|
154
156
|
"typescript/consistent-generic-constructors": "error",
|
|
155
157
|
"typescript/consistent-indexed-object-style": "error",
|
|
@@ -157,6 +159,10 @@ function base(overrides) {
|
|
|
157
159
|
"typescript/ban-tslint-comment": "error",
|
|
158
160
|
"typescript/no-empty-interface": "error",
|
|
159
161
|
"typescript/no-inferrable-types": "error",
|
|
162
|
+
"typescript/no-misused-new": "error",
|
|
163
|
+
"typescript/no-unnecessary-parameter-property-assignment": "error",
|
|
164
|
+
"typescript/no-useless-empty-export": "error",
|
|
165
|
+
"typescript/no-deprecated": "warn",
|
|
160
166
|
"typescript/prefer-for-of": "error",
|
|
161
167
|
"typescript/prefer-function-type": "error",
|
|
162
168
|
"typescript/unified-signatures": "error"
|
|
@@ -223,7 +229,6 @@ function unicorn(overrides) {
|
|
|
223
229
|
"unicorn/catch-error-name": "error",
|
|
224
230
|
"unicorn/error-message": "error",
|
|
225
231
|
"unicorn/prefer-optional-catch-binding": "error",
|
|
226
|
-
"unicorn/no-zero-fractions": "error",
|
|
227
232
|
"unicorn/number-literal-case": "error",
|
|
228
233
|
"unicorn/numeric-separators-style": "error",
|
|
229
234
|
"unicorn/prefer-includes": "error",
|
|
@@ -232,9 +237,22 @@ function unicorn(overrides) {
|
|
|
232
237
|
"unicorn/prefer-string-trim-start-end": "error",
|
|
233
238
|
"unicorn/prefer-structured-clone": "error",
|
|
234
239
|
"unicorn/prefer-default-parameters": "error",
|
|
235
|
-
"unicorn/
|
|
240
|
+
"unicorn/prefer-string-starts-ends-with": "error",
|
|
241
|
+
"unicorn/prefer-set-size": "error",
|
|
236
242
|
"unicorn/throw-new-error": "error",
|
|
237
|
-
"unicorn/require-array-join-separator": "error"
|
|
243
|
+
"unicorn/require-array-join-separator": "error",
|
|
244
|
+
"unicorn/no-zero-fractions": "error",
|
|
245
|
+
"unicorn/no-console-spaces": "error",
|
|
246
|
+
"unicorn/no-useless-spread": "error",
|
|
247
|
+
"unicorn/no-useless-fallback-in-spread": "error",
|
|
248
|
+
"unicorn/no-unnecessary-await": "error",
|
|
249
|
+
"unicorn/no-useless-length-check": "error",
|
|
250
|
+
"unicorn/no-single-promise-in-promise-methods": "error",
|
|
251
|
+
"unicorn/no-await-in-promise-methods": "error",
|
|
252
|
+
"unicorn/no-invalid-remove-event-listener": "error",
|
|
253
|
+
"unicorn/no-invalid-fetch-options": "error",
|
|
254
|
+
"unicorn/no-new-array": "error",
|
|
255
|
+
"unicorn/no-empty-file": "warn"
|
|
238
256
|
}
|
|
239
257
|
}, overrides);
|
|
240
258
|
}
|
|
@@ -255,7 +273,10 @@ function depend(overrides) {
|
|
|
255
273
|
}
|
|
256
274
|
/** Node.js lint preset — native node plugin. */
|
|
257
275
|
function node(overrides) {
|
|
258
|
-
return preset({
|
|
276
|
+
return preset({
|
|
277
|
+
plugins: ["node"],
|
|
278
|
+
rules: { "unicorn/prefer-node-protocol": "error" }
|
|
279
|
+
}, overrides);
|
|
259
280
|
}
|
|
260
281
|
/** Promise lint preset — native promise plugin. */
|
|
261
282
|
function promise(overrides) {
|
|
@@ -267,10 +288,11 @@ const reactRules = {
|
|
|
267
288
|
"react/jsx-key": "error",
|
|
268
289
|
"react/jsx-no-duplicate-props": "error",
|
|
269
290
|
"react/jsx-no-undef": "error",
|
|
270
|
-
"react/jsx-uses-vars": "error",
|
|
271
291
|
"react/jsx-no-target-blank": ["error", { allowReferrer: false }],
|
|
272
292
|
"react/jsx-no-comment-textnodes": "error",
|
|
273
293
|
"react/jsx-no-script-url": "error",
|
|
294
|
+
"react/jsx-props-no-spread-multi": "error",
|
|
295
|
+
"react/jsx-no-useless-fragment": "warn",
|
|
274
296
|
"react/jsx-boolean-value": ["error", "never"],
|
|
275
297
|
"react/jsx-curly-brace-presence": ["error", {
|
|
276
298
|
props: "never",
|
|
@@ -288,7 +310,6 @@ const reactRules = {
|
|
|
288
310
|
"react/hook-use-state": "error",
|
|
289
311
|
"react/no-children-prop": "error",
|
|
290
312
|
"react/no-danger-with-children": "error",
|
|
291
|
-
"react/no-deprecated": "error",
|
|
292
313
|
"react/no-direct-mutation-state": "error",
|
|
293
314
|
"react/no-find-dom-node": "error",
|
|
294
315
|
"react/no-is-mounted": "error",
|
|
@@ -298,8 +319,20 @@ const reactRules = {
|
|
|
298
319
|
"react/no-unsafe": "error",
|
|
299
320
|
"react/require-render-return": "error",
|
|
300
321
|
"react/void-dom-elements-no-children": "error",
|
|
322
|
+
"react/no-set-state": "error",
|
|
323
|
+
"react/no-did-mount-set-state": "error",
|
|
324
|
+
"react/no-did-update-set-state": "error",
|
|
325
|
+
"react/no-will-update-set-state": "error",
|
|
326
|
+
"react/no-this-in-sfc": "error",
|
|
327
|
+
"react/forward-ref-uses-ref": "error",
|
|
328
|
+
"react/no-unstable-nested-components": "warn",
|
|
329
|
+
"react/iframe-missing-sandbox": "error",
|
|
330
|
+
"react/set-state-in-render": "error",
|
|
331
|
+
"react/error-boundaries": "error",
|
|
332
|
+
"react/jsx-no-constructed-context-values": "warn",
|
|
333
|
+
"react/no-array-index-key": "warn",
|
|
334
|
+
"react/style-prop-object": "error",
|
|
301
335
|
"react/react-in-jsx-scope": "off",
|
|
302
|
-
"react/jsx-uses-react": "off",
|
|
303
336
|
"react/no-unescaped-entities": "off"
|
|
304
337
|
};
|
|
305
338
|
/** React lint preset — core React + Hooks rules. */
|
|
@@ -489,6 +522,14 @@ function vitest(options) {
|
|
|
489
522
|
"vitest/no-disabled-tests": isInEditorEnv() ? "warn" : "error",
|
|
490
523
|
"vitest/no-focused-tests": isInEditorEnv() ? "warn" : "error",
|
|
491
524
|
"vitest/require-mock-type-parameters": "off",
|
|
525
|
+
"vitest/prefer-called-once": "error",
|
|
526
|
+
"vitest/prefer-called-times": "error",
|
|
527
|
+
"vitest/prefer-expect-type-of": "error",
|
|
528
|
+
"vitest/prefer-to-be-object": "error",
|
|
529
|
+
"vitest/hoisted-apis-on-top": "error",
|
|
530
|
+
"vitest/require-awaited-expect-poll": "error",
|
|
531
|
+
"vitest/no-conditional-tests": "error",
|
|
532
|
+
"vitest/consistent-vitest-vi": "error",
|
|
492
533
|
"no-console": "off",
|
|
493
534
|
"unicorn/no-null": "off",
|
|
494
535
|
"typescript/ban-ts-comment": "off"
|
package/dist/lint.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lint.mjs","names":["defineConfig"],"sources":["../src/utils.ts","../src/lint.ts"],"sourcesContent":["/**\n * Utility functions and constants\n */\n\n// ============================================================================\n// Environment detection\n// ============================================================================\n\nconst env = process.env\n\nfunction isCI(): boolean {\n return !!(\n env['CI'] ||\n env['CONTINUOUS_INTEGRATION'] ||\n env['BUILD_ID'] ||\n env['BUILD_NUMBER'] ||\n env['RUN_ID']\n )\n}\n\nfunction isInGitHooksOrLintStaged(): boolean {\n return (\n !!(env['GIT_PARAMS'] || env['VSCODE_GIT_COMMAND']) ||\n env['npm_lifecycle_script']?.startsWith('lint-staged') === true\n )\n}\n\n/**\n * Detects whether running in an editor environment.\n * Returns false in CI, Git Hooks, or lint-staged.\n */\nexport function isInEditorEnv(): boolean {\n if (isCI()) return false\n if (isInGitHooksOrLintStaged()) return false\n return !!(\n env['VSCODE_PID'] ||\n env['VSCODE_CWD'] ||\n env['JETBRAINS_IDE'] ||\n env['VIM'] ||\n env['NVIM']\n )\n}\n\n// ============================================================================\n// File matching patterns (Globs)\n// ============================================================================\n\n/** All JS/TS source files */\nexport const GLOB_SRC = '**/*.{js,mjs,cjs,jsx,ts,mts,cts,tsx}'\n\n/** JavaScript files only */\nexport const GLOB_JS = '**/*.{js,mjs,cjs,jsx}'\n\n/** TypeScript files only */\nexport const GLOB_TS = '**/*.{ts,mts,cts,tsx}'\n\n/** JSX/TSX files (React-related) */\nexport const GLOB_JSX = '**/*.{jsx,tsx}'\n\n/** Test files */\nexport const GLOB_TESTS: string[] = [\n '**/*.{test,spec}.{js,mjs,cjs,jsx,ts,mts,cts,tsx}',\n '**/__tests__/**/*.{js,mjs,cjs,jsx,ts,mts,cts,tsx}',\n]\n\n/** JSON files */\nexport const GLOB_JSON = '**/*.json'\n\n/** Markdown files */\nexport const GLOB_MARKDOWN = '**/*.md'\n","/**\n * Oxlint lint presets.\n *\n * Every preset is a function that accepts optional overrides, merged via `defu`.\n * User overrides take priority over preset defaults.\n *\n * @example\n * ```ts\n * // oxlint.config.ts\n * import { base, unicorn, react, tailwind, vitest } from '@hooshid/ox-config/lint'\n * import { defineConfig } from 'oxlint'\n *\n * export default defineConfig({\n * extends: [base(), unicorn(), react(), tailwind(), vitest()],\n * })\n * ```\n */\nimport { existsSync, readFileSync } from 'node:fs'\nimport { createRequire } from 'node:module'\nimport path from 'node:path'\n\nimport { defu } from 'defu'\nimport { defineConfig } from 'oxlint'\n\nimport { GLOB_JSX, GLOB_SRC, GLOB_TESTS, GLOB_TS, isInEditorEnv } from './utils'\n\nimport type { ExternalPluginEntry, OxlintConfig } from 'oxlint'\n\nconst require = createRequire(import.meta.url)\n\n// ============================================================================\n// Ignore patterns\n// ============================================================================\n\nconst DEFAULT_IGNORES: string[] = [\n '**/node_modules/**',\n '**/dist/**',\n '**/build/**',\n '**/out/**',\n '**/.next/**',\n '**/.cache/**',\n '**/.turbo/**',\n '**/.output/**',\n '**/.nitro/**',\n '**/.tanstack/**',\n '**/.vinxi/**',\n '**/.git/**',\n '**/.svn/**',\n '**/.hg/**',\n '**/.pnp.*',\n '**/public/**',\n '**/*.d.ts',\n]\n\nfunction loadGitignorePatterns(): string[] {\n const gitignoreFile = path.resolve(process.cwd(), '.gitignore')\n if (!existsSync(gitignoreFile)) return []\n\n return readFileSync(gitignoreFile, 'utf8')\n .split(/\\r?\\n/u)\n .map((line) => line.trim())\n .filter((line) => line && !line.startsWith('#'))\n .map((pattern) => {\n let p = pattern.trimEnd()\n if (p.startsWith('/')) p = p.slice(1)\n if (!p.includes('/') && !p.includes('*')) p = `**/${p}`\n if (p.endsWith('/')) p = `${p}**`\n return p\n })\n}\n\n// ============================================================================\n// Helpers\n// ============================================================================\n\nfunction preset(defaults: OxlintConfig, overrides?: Partial<OxlintConfig>): OxlintConfig {\n return defineConfig(defu(overrides ?? {}, defaults))\n}\n\n/**\n * Resolve a jsPlugin package name to its absolute path.\n * This allows oxlint to load plugins directly without relying on\n * Node module resolution from the consumer's CWD — fixes pnpm strict mode.\n */\nfunction resolvePlugin(name: string): string {\n try {\n return require.resolve(name)\n } catch {\n return name\n }\n}\n\nfunction resolvePlugins(plugins: ExternalPluginEntry[]): ExternalPluginEntry[] {\n return plugins.map((p) => {\n if (typeof p === 'string') return resolvePlugin(p)\n return { ...p, specifier: resolvePlugin(p.specifier) }\n })\n}\n\n// ============================================================================\n// Core\n// ============================================================================\n\n/**\n * Base lint preset — TypeScript + Import plugins, categories, env, ignores.\n * Always include first.\n */\nexport function base(overrides?: Partial<OxlintConfig>): OxlintConfig {\n return preset(\n {\n plugins: ['typescript', 'import'],\n categories: {\n correctness: 'error',\n suspicious: 'error',\n perf: 'error',\n pedantic: 'warn',\n },\n rules: {\n // Shape-only check; necessary in interactive CLI and sequential workflows.\n 'no-await-in-loop': 'off',\n // High-noise; readonly intent better expressed via `const generics` or call-site.\n 'typescript/prefer-readonly-parameter-types': 'off',\n // Turns `if (str)` into ceremony for marginal safety gain.\n 'typescript/strict-boolean-expressions': 'off',\n // File/function size is a reviewer call, not a lint rule.\n 'max-lines': 'off',\n 'max-lines-per-function': 'off',\n // Misfires on `/* @__PURE__ */` and similar bundler annotations.\n 'no-inline-comments': 'off',\n // TODO/FIXME triage belongs in the issue tracker.\n 'no-warning-comments': 'off',\n // Default cap of 10 is too tight for modern React/Next component files.\n 'import/max-dependencies': 'off',\n // Modern React renders apostrophes correctly; legacy noise.\n 'react/no-unescaped-entities': 'off',\n // Misfires on Next.js Server Actions and placeholder async functions.\n 'require-await': 'off',\n },\n env: {\n browser: true,\n node: true,\n es2026: true,\n builtin: true,\n },\n ignorePatterns: [...DEFAULT_IGNORES, ...loadGitignorePatterns()],\n overrides: [\n {\n files: [GLOB_TS],\n rules: {\n // Only list rules that DIFFER from categories defaults\n 'typescript/consistent-type-definitions': 'off',\n 'typescript/consistent-type-imports': 'error',\n 'no-unused-vars': 'off',\n 'typescript/array-type': 'error',\n 'typescript/consistent-generic-constructors': 'error',\n 'typescript/consistent-indexed-object-style': 'error',\n 'typescript/consistent-type-assertions': 'error',\n 'typescript/ban-tslint-comment': 'error',\n 'typescript/no-empty-interface': 'error',\n 'typescript/no-inferrable-types': 'error',\n 'typescript/prefer-for-of': 'error',\n 'typescript/prefer-function-type': 'error',\n 'typescript/unified-signatures': 'error',\n },\n },\n {\n files: [GLOB_SRC],\n rules: {\n // CSS/style side-effect imports are standard in all frontend frameworks\n 'import/no-unassigned-import': 'off',\n 'import/no-relative-parent-imports': 'error',\n 'import/first': 'error',\n 'import/no-duplicates': 'error',\n 'import/consistent-type-specifier-style': 'error',\n 'import/no-mutable-exports': 'error',\n 'import/no-named-default': 'error',\n },\n },\n {\n // Config files commonly import shared roots via `../../config.ts`\n // in monorepos — intended pattern, not a smell.\n files: ['**/*.config.{ts,mts,cts,js,mjs,cjs}'],\n rules: {\n 'import/no-relative-parent-imports': 'off',\n },\n },\n {\n // Test files use mock setup patterns (vi.mock/vi.hoisted before imports),\n // explicit mock signatures, and fixture data that\n // legitimately violate strict style/safety rules.\n files: GLOB_TESTS,\n rules: {\n // Mock setup pattern breaks standard import ordering\n 'import/first': 'off',\n 'import/no-duplicates': 'off',\n 'import/consistent-type-specifier-style': 'off',\n // Mock signatures need explicit values / async without await\n 'unicorn/no-useless-undefined': 'off',\n 'typescript/no-empty-function': 'off',\n // Modernization hints aren't useful in tests\n 'unicorn/prefer-string-replace-all': 'off',\n 'unicorn/no-array-callback-reference': 'off',\n 'unicorn/prefer-spread': 'off',\n // Tests deliberately use non-null assertions, magic numbers, any\n 'typescript/no-non-null-assertion': 'off',\n 'no-magic-numbers': 'off',\n 'typescript/no-explicit-any': 'off',\n 'typescript/no-unsafe-assignment': 'off',\n 'typescript/no-unsafe-call': 'off',\n 'typescript/no-unsafe-member-access': 'off',\n 'typescript/no-unsafe-return': 'off',\n 'typescript/no-unsafe-argument': 'off',\n // Index keys are fine when rendering fixture lists\n 'react/no-array-index-key': 'off',\n },\n },\n ],\n },\n overrides,\n )\n}\n\n/**\n * Type-aware lint preset — enables 59 type-aware rules via tsgolint + type checking.\n * Requires TypeScript 7.0+ and `oxlint-tsgolint` (bundled as dependency).\n */\nexport function typeAware(overrides?: Partial<OxlintConfig>): OxlintConfig {\n return preset(\n {\n options: {\n typeAware: true,\n typeCheck: true,\n },\n },\n overrides,\n )\n}\n\n/** Unicorn lint preset — 100+ code quality rules. */\nexport function unicorn(overrides?: Partial<OxlintConfig>): OxlintConfig {\n return preset(\n {\n plugins: ['unicorn'],\n rules: {\n 'unicorn/no-null': 'off',\n 'unicorn/filename-case': ['error', { case: 'kebabCase' }],\n 'unicorn/catch-error-name': 'error',\n 'unicorn/error-message': 'error',\n 'unicorn/prefer-optional-catch-binding': 'error',\n 'unicorn/no-zero-fractions': 'error',\n 'unicorn/number-literal-case': 'error',\n 'unicorn/numeric-separators-style': 'error',\n 'unicorn/prefer-includes': 'error',\n 'unicorn/prefer-spread': 'error',\n 'unicorn/prefer-ternary': 'error',\n 'unicorn/prefer-string-trim-start-end': 'error',\n 'unicorn/prefer-structured-clone': 'error',\n 'unicorn/prefer-default-parameters': 'error',\n 'unicorn/no-console-spaces': 'error',\n 'unicorn/throw-new-error': 'error',\n 'unicorn/require-array-join-separator': 'error',\n },\n },\n overrides,\n )\n}\n\n/** Dependency optimization — flags packages replaceable with native APIs. */\nexport function depend(overrides?: Partial<OxlintConfig>): OxlintConfig {\n return preset(\n {\n jsPlugins: resolvePlugins(['eslint-plugin-depend']),\n rules: {\n 'depend/ban-dependencies': [\n 'error',\n {\n presets: ['native', 'microutilities', 'preferred'],\n modules: [],\n allowed: ['dotenv'],\n },\n ],\n },\n },\n overrides,\n )\n}\n\n// ============================================================================\n// Runtime environments\n// ============================================================================\n\n/** Node.js lint preset — native node plugin. */\nexport function node(overrides?: Partial<OxlintConfig>): OxlintConfig {\n return preset({ plugins: ['node'] }, overrides)\n}\n\n/** Promise lint preset — native promise plugin. */\nexport function promise(overrides?: Partial<OxlintConfig>): OxlintConfig {\n return preset({ plugins: ['promise'] }, overrides)\n}\n\n// ============================================================================\n// Frontend\n// ============================================================================\n\nconst reactRules = {\n // ─── Hooks (CRITICAL) ─────────────────────────────\n 'react/rules-of-hooks': 'error',\n 'react/exhaustive-deps': 'warn',\n\n // ─── JSX Correctness ──────────────────────────────\n 'react/jsx-key': 'error',\n 'react/jsx-no-duplicate-props': 'error',\n 'react/jsx-no-undef': 'error',\n 'react/jsx-uses-vars': 'error',\n 'react/jsx-no-target-blank': ['error', { allowReferrer: false }],\n 'react/jsx-no-comment-textnodes': 'error',\n 'react/jsx-no-script-url': 'error',\n\n // ─── JSX Style ────────────────────────────────────\n 'react/jsx-boolean-value': ['error', 'never'],\n 'react/jsx-curly-brace-presence': ['error', { props: 'never', children: 'never' }],\n 'react/jsx-fragments': ['error', 'syntax'],\n 'react/jsx-pascal-case': ['error', { allowAllCaps: false, allowNamespace: true }],\n 'react/self-closing-comp': ['error', { component: true, html: true }],\n 'react/hook-use-state': 'error',\n\n // ─── Runtime Safety ───────────────────────────────\n 'react/no-children-prop': 'error',\n 'react/no-danger-with-children': 'error',\n 'react/no-deprecated': 'error',\n 'react/no-direct-mutation-state': 'error',\n 'react/no-find-dom-node': 'error',\n 'react/no-is-mounted': 'error',\n 'react/no-render-return-value': 'error',\n 'react/no-string-refs': 'error',\n 'react/no-unknown-property': 'error',\n 'react/no-unsafe': 'error',\n 'react/require-render-return': 'error',\n 'react/void-dom-elements-no-children': 'error',\n\n // ─── Modern React (17+) ───────────────────────────\n 'react/react-in-jsx-scope': 'off',\n 'react/jsx-uses-react': 'off',\n\n // ─── Noise Reduction ──────────────────────────────\n 'react/no-unescaped-entities': 'off',\n} satisfies NonNullable<OxlintConfig['rules']>\n\n/** React lint preset — core React + Hooks rules. */\nexport function react(overrides?: Partial<OxlintConfig>): OxlintConfig {\n return preset(\n {\n plugins: ['react'],\n rules: reactRules,\n },\n overrides,\n )\n}\n\n/** React + react-refresh preset (for Vite, TanStack Start, etc.). */\nexport function reactVite(overrides?: Partial<OxlintConfig>): OxlintConfig {\n return preset(\n {\n plugins: ['react'],\n jsPlugins: resolvePlugins(['eslint-plugin-react-refresh']),\n rules: {\n ...reactRules,\n 'react-refresh/only-export-components': ['warn', { allowConstantExport: true }],\n },\n },\n overrides,\n )\n}\n\n/** Next.js lint preset — enables native nextjs plugin. */\nexport function nextjs(overrides?: Partial<OxlintConfig>): OxlintConfig {\n return preset({ plugins: ['nextjs'] }, overrides)\n}\n\n/**\n * TanStack Router lint preset.\n *\n * Loads @tanstack/eslint-plugin-router and applies conventions specific\n * to file-based routing setups.\n *\n * Rules provided by the plugin:\n * - `route-param-names` — validates `$param` names match between route path and params\n * - `create-route-property-order` — enforces consistent property order in `createRoute()`\n */\nexport function tanstackRouter(overrides?: Partial<OxlintConfig>): OxlintConfig {\n return preset(\n {\n jsPlugins: resolvePlugins([\n { name: 'tanstack-router', specifier: '@tanstack/eslint-plugin-router' },\n ]),\n rules: {\n // ─── Route Configuration ─────────────────────────\n 'tanstack-router/route-param-names': 'error',\n 'tanstack-router/create-route-property-order': 'error',\n\n // ─── Route File Conventions ──────────────────────\n // Route files should use named exports for route objects\n // (default export reserved for the component or route)\n 'import/no-default-export': 'off', // Router requires default exports\n },\n overrides: [\n {\n // Route files follow specific naming and structure\n files: ['**/routes/**/*.{ts,tsx}'],\n rules: {\n // Routes must not use window directly — use router hooks\n 'no-restricted-globals': [\n 'error',\n {\n name: 'window',\n message: 'Use useRouter() or useNavigate() instead of window in route files.',\n },\n ],\n },\n },\n {\n // ─── Filename Convention (kebab-case) ─────────\n // Applies only to files inside a `routes/` folder.\n files: ['**/routes/**/*.{ts,tsx}'],\n plugins: ['unicorn'],\n rules: {\n 'unicorn/filename-case': [\n 'error',\n {\n case: 'kebabCase',\n ignore: [\n '\\\\$', // dynamic params: $postId.tsx, posts.$postId.tsx\n '^_', // pathless/root: _auth.tsx, __root.tsx\n '\\\\.', // multi-segment: posts.index.tsx, route.lazy.tsx\n ],\n },\n ],\n },\n },\n {\n // Root route file convention\n files: ['**/routes/__root.tsx'],\n rules: {\n // __root.tsx can't use useNavigate (no router context yet)\n 'no-restricted-globals': 'off',\n },\n },\n ],\n },\n overrides,\n )\n}\n\n/**\n * TanStack Start lint preset.\n *\n * Adds rules for server functions, client/server boundaries, and Start\n * conventions. This preset assumes `reactVite()` and `tanstackRouter()`\n * are already in the `extends` array.\n *\n */\nexport function tanstackStart(overrides?: Partial<OxlintConfig>): OxlintConfig {\n return preset(\n {\n rules: {\n // ─── Server Function Safety ──────────────────────\n // Prevent async promise executors (Start loaders must be sync wrapper)\n 'no-async-promise-executor': 'error',\n // Sequential awaits are fine in server functions\n 'no-await-in-loop': 'off',\n\n // ─── Client / Server Boundary ────────────────────\n // Node.js modules must not leak into client bundles\n 'import/no-nodejs-modules': 'error',\n\n // ─── Loader Conventions ──────────────────────────\n // Loaders must consistently return or throw\n 'consistent-return': 'error',\n\n // ─── Common Start Pitfalls ───────────────────────\n // Empty functions are common in placeholder server functions\n 'no-empty-function': 'warn',\n },\n\n overrides: [\n {\n // Server-only files — Node.js APIs allowed\n files: ['**/*.server.{ts,tsx}', '**/server/**/*.{ts,tsx}', '**/server-fns/**/*.{ts,tsx}'],\n rules: {\n 'import/no-nodejs-modules': 'off',\n 'no-console': 'off',\n },\n },\n {\n // Client-only files — Node.js APIs forbidden\n files: ['**/*.client.{ts,tsx}', '**/components/**/*.{ts,tsx}'],\n rules: {\n 'import/no-nodejs-modules': 'error',\n },\n },\n {\n // Route files — server-aware\n files: ['**/routes/**/*.{ts,tsx}'],\n rules: {\n // Routes use loaders, not direct fetch in component\n 'no-restricted-syntax': [\n 'warn',\n {\n selector: 'CallExpression[callee.name=\"fetch\"]',\n message: 'Prefer a loader or server function over direct fetch in route files.',\n },\n ],\n },\n },\n {\n files: ['**/*.server.{ts,tsx}', '**/*.client.{ts,tsx}'],\n plugins: ['unicorn'],\n rules: {\n 'unicorn/filename-case': [\n 'error',\n {\n case: 'kebabCase',\n ignore: [\n '\\\\.', // allow *.server.ts / *.client.ts (has dots)\n ],\n },\n ],\n },\n },\n {\n files: ['**/*.server.{ts,tsx}', '**/server/**/*.{ts,tsx}', '**/server-fns/**/*.{ts,tsx}'],\n rules: {\n 'import/no-nodejs-modules': 'off',\n 'no-console': 'off',\n // ← جدید: جلوگیری از crash توی SSR\n 'no-restricted-globals': [\n 'error',\n {\n name: 'window',\n message:\n 'Not available in server context. Use a server function or guard with typeof window.',\n },\n { name: 'document', message: 'Not available in server context.' },\n { name: 'localStorage', message: 'Not available in server context.' },\n { name: 'sessionStorage', message: 'Not available in server context.' },\n ],\n },\n },\n ],\n },\n overrides,\n )\n}\n\n// ============================================================================\n// Quality\n// ============================================================================\n\n/** Accessibility lint preset — enables native jsx-a11y plugin. */\nexport function a11y(overrides?: Partial<OxlintConfig>): OxlintConfig {\n return preset({ plugins: ['jsx-a11y'] }, overrides)\n}\n\n/** JSDoc lint preset — enables native jsdoc plugin. */\nexport function jsdoc(overrides?: Partial<OxlintConfig>): OxlintConfig {\n return preset({ plugins: ['jsdoc'] }, overrides)\n}\n\n// ============================================================================\n// Testing\n// ============================================================================\n\ninterface VitestOptions extends Partial<OxlintConfig> {\n /** Test file glob patterns. Replaces the default GLOB_TESTS. */\n files?: string[]\n}\n\n/** Vitest lint preset — native vitest plugin with test-file scoping. */\nexport function vitest(options?: VitestOptions): OxlintConfig {\n const { files, ...overrides } = options ?? {}\n\n return preset(\n {\n plugins: ['vitest'],\n settings: { vitest: { typecheck: true } },\n overrides: [\n {\n files: files ?? GLOB_TESTS,\n rules: {\n 'vitest/expect-expect': 'error',\n 'vitest/no-conditional-expect': 'error',\n 'vitest/no-identical-title': 'error',\n 'vitest/no-import-node-test': 'error',\n 'vitest/no-interpolation-in-snapshots': 'error',\n 'vitest/no-mocks-import': 'error',\n 'vitest/no-standalone-expect': 'error',\n 'vitest/valid-describe-callback': 'error',\n 'vitest/valid-expect': 'error',\n 'vitest/valid-title': 'error',\n 'vitest/consistent-test-it': ['error', { fn: 'it', withinDescribe: 'it' }],\n 'vitest/prefer-hooks-in-order': 'error',\n 'vitest/prefer-lowercase-title': 'error',\n 'vitest/no-disabled-tests': isInEditorEnv() ? 'warn' : 'error',\n 'vitest/no-focused-tests': isInEditorEnv() ? 'warn' : 'error',\n 'vitest/require-mock-type-parameters': 'off',\n 'no-console': 'off',\n 'unicorn/no-null': 'off',\n 'typescript/ban-ts-comment': 'off',\n },\n },\n ],\n },\n overrides,\n )\n}\n\n// ============================================================================\n// Tailwind\n// ============================================================================\n\ninterface TailwindOptions extends Partial<OxlintConfig> {\n entryPoint?: string\n rootFontSize?: number\n /** File glob patterns for tailwind rules. @default GLOB_JSX */\n files?: string[]\n}\n\n/** Tailwind CSS lint preset — eslint-plugin-better-tailwindcss. */\nexport function tailwind(options: TailwindOptions = {}): OxlintConfig {\n const { entryPoint = 'src/styles/globals.css', rootFontSize = 16, files, ...overrides } = options\n\n return preset(\n {\n jsPlugins: resolvePlugins(['eslint-plugin-better-tailwindcss']),\n settings: { 'better-tailwindcss': { entryPoint, rootFontSize } },\n overrides: [\n {\n files: files ?? [GLOB_JSX],\n rules: {\n 'better-tailwindcss/enforce-consistent-line-wrapping': ['error', { printWidth: 0 }],\n 'better-tailwindcss/enforce-canonical-classes': 'error',\n },\n },\n ],\n },\n overrides,\n )\n}\n\n// ============================================================================\n// Backend / ORM\n// ============================================================================\n\n/**\n * NestJS lint preset — loads @darraghor/eslint-plugin-nestjs-typed via jsPlugin.\n * Covers DI validation, Swagger consistency, decorator bug prevention (19 AST rules).\n */\nexport function nestjs(overrides?: Partial<OxlintConfig>): OxlintConfig {\n return preset(\n {\n jsPlugins: resolvePlugins([\n { name: 'nestjs-typed', specifier: '@darraghor/eslint-plugin-nestjs-typed' },\n ]),\n rules: {\n // DI\n 'nestjs-typed/injectable-should-be-provided': 'error',\n 'nestjs-typed/provided-injected-should-match-factory-parameters': 'error',\n 'nestjs-typed/use-injectable-provided-token': 'error',\n // Swagger\n 'nestjs-typed/api-property-matches-property-optionality': 'error',\n 'nestjs-typed/controllers-should-supply-api-tags': 'error',\n 'nestjs-typed/api-method-should-specify-api-response': 'error',\n 'nestjs-typed/api-property-returning-array-should-set-array': 'error',\n 'nestjs-typed/api-property-should-have-api-extra-models': 'error',\n 'nestjs-typed/api-operation-summary-description-capitalized': 'error',\n // Bug prevention\n 'nestjs-typed/param-decorator-name-matches-route-param': 'error',\n 'nestjs-typed/validate-nested-of-array-should-set-each': 'error',\n 'nestjs-typed/all-properties-are-whitelisted': 'error',\n 'nestjs-typed/no-duplicate-decorators': 'error',\n 'nestjs-typed/validation-pipe-should-use-forbid-unknown': 'error',\n },\n },\n overrides,\n )\n}\n\n/** Drizzle ORM lint preset — eslint-plugin-drizzle. */\nexport function drizzle(overrides?: Partial<OxlintConfig>): OxlintConfig {\n return preset(\n {\n jsPlugins: resolvePlugins(['eslint-plugin-drizzle']),\n rules: {\n 'drizzle/enforce-delete-with-where': 'error',\n 'drizzle/enforce-update-with-where': 'error',\n },\n },\n overrides,\n )\n}\n\n// ============================================================================\n// Re-exports\n// ============================================================================\n\nexport { defineConfig } from 'oxlint'\nexport { GLOB_SRC, GLOB_JS, GLOB_TS, GLOB_JSX, GLOB_TESTS, GLOB_JSON, GLOB_MARKDOWN } from './utils'\n"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GAAE;GAAY;EAAa,EAAE;EAC/D,WAAW,CACT;GACE,OAAO,SAAS,CAAA,gBAAS;GACzB,OAAO;IACL,uDAAuD,CAAC,SAAS,EAAE,YAAY,EAAE,CAAC;IAClF,gDAAgD;GAClD;EACF,CACF;CACF,GACA,SACF;AACF;;;;;AAUA,SAAgB,OAAO,WAAiD;CACtE,OAAO,OACL;EACE,WAAW,eAAe,CACxB;GAAE,MAAM;GAAgB,WAAW;EAAwC,CAC7E,CAAC;EACD,OAAO;GAEL,8CAA8C;GAC9C,kEAAkE;GAClE,8CAA8C;GAE9C,0DAA0D;GAC1D,mDAAmD;GACnD,uDAAuD;GACvD,8DAA8D;GAC9D,0DAA0D;GAC1D,8DAA8D;GAE9D,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"}
|
|
1
|
+
{"version":3,"file":"lint.mjs","names":["defineConfig"],"sources":["../src/utils.ts","../src/lint.ts"],"sourcesContent":["/**\n * Utility functions and constants\n */\n\n// ============================================================================\n// Environment detection\n// ============================================================================\n\nconst env = process.env\n\nfunction isCI(): boolean {\n return !!(\n env['CI'] ||\n env['CONTINUOUS_INTEGRATION'] ||\n env['BUILD_ID'] ||\n env['BUILD_NUMBER'] ||\n env['RUN_ID']\n )\n}\n\nfunction isInGitHooksOrLintStaged(): boolean {\n return (\n !!(env['GIT_PARAMS'] || env['VSCODE_GIT_COMMAND']) ||\n env['npm_lifecycle_script']?.startsWith('lint-staged') === true\n )\n}\n\n/**\n * Detects whether running in an editor environment.\n * Returns false in CI, Git Hooks, or lint-staged.\n */\nexport function isInEditorEnv(): boolean {\n if (isCI()) return false\n if (isInGitHooksOrLintStaged()) return false\n return !!(\n env['VSCODE_PID'] ||\n env['VSCODE_CWD'] ||\n env['JETBRAINS_IDE'] ||\n env['VIM'] ||\n env['NVIM']\n )\n}\n\n// ============================================================================\n// File matching patterns (Globs)\n// ============================================================================\n\n/** All JS/TS source files */\nexport const GLOB_SRC = '**/*.{js,mjs,cjs,jsx,ts,mts,cts,tsx}'\n\n/** JavaScript files only */\nexport const GLOB_JS = '**/*.{js,mjs,cjs,jsx}'\n\n/** TypeScript files only */\nexport const GLOB_TS = '**/*.{ts,mts,cts,tsx}'\n\n/** JSX/TSX files (React-related) */\nexport const GLOB_JSX = '**/*.{jsx,tsx}'\n\n/** Test files */\nexport const GLOB_TESTS: string[] = [\n '**/*.{test,spec}.{js,mjs,cjs,jsx,ts,mts,cts,tsx}',\n '**/__tests__/**/*.{js,mjs,cjs,jsx,ts,mts,cts,tsx}',\n]\n\n/** JSON files */\nexport const GLOB_JSON = '**/*.json'\n\n/** Markdown files */\nexport const GLOB_MARKDOWN = '**/*.md'\n","/**\n * Oxlint lint presets.\n *\n * Every preset is a function that accepts optional overrides, merged via `defu`.\n * User overrides take priority over preset defaults.\n *\n * @example\n * ```ts\n * // oxlint.config.ts\n * import { base, unicorn, react, tailwind, vitest } from '@hooshid/ox-config/lint'\n * import { defineConfig } from 'oxlint'\n *\n * export default defineConfig({\n * extends: [base(), unicorn(), react(), tailwind(), vitest()],\n * })\n * ```\n */\nimport { existsSync, readFileSync } from 'node:fs'\nimport { createRequire } from 'node:module'\nimport path from 'node:path'\n\nimport { defu } from 'defu'\nimport { defineConfig } from 'oxlint'\n\nimport { GLOB_JSX, GLOB_SRC, GLOB_TESTS, GLOB_TS, isInEditorEnv } from './utils'\n\nimport type { ExternalPluginEntry, OxlintConfig } from 'oxlint'\n\nconst require = createRequire(import.meta.url)\n\n// ============================================================================\n// Ignore patterns\n// ============================================================================\n\nconst DEFAULT_IGNORES: string[] = [\n '**/node_modules/**',\n '**/dist/**',\n '**/build/**',\n '**/out/**',\n '**/.next/**',\n '**/.cache/**',\n '**/.turbo/**',\n '**/.output/**',\n '**/.nitro/**',\n '**/.tanstack/**',\n '**/.vinxi/**',\n '**/.git/**',\n '**/.svn/**',\n '**/.hg/**',\n '**/.pnp.*',\n '**/public/**',\n '**/*.d.ts',\n]\n\nfunction loadGitignorePatterns(): string[] {\n const gitignoreFile = path.resolve(process.cwd(), '.gitignore')\n if (!existsSync(gitignoreFile)) return []\n\n return readFileSync(gitignoreFile, 'utf8')\n .split(/\\r?\\n/u)\n .map((line) => line.trim())\n .filter((line) => line && !line.startsWith('#'))\n .map((pattern) => {\n let p = pattern.trimEnd()\n if (p.startsWith('/')) p = p.slice(1)\n if (!p.includes('/') && !p.includes('*')) p = `**/${p}`\n if (p.endsWith('/')) p = `${p}**`\n return p\n })\n}\n\n// ============================================================================\n// Helpers\n// ============================================================================\n\nfunction preset(defaults: OxlintConfig, overrides?: Partial<OxlintConfig>): OxlintConfig {\n return defineConfig(defu(overrides ?? {}, defaults))\n}\n\n/**\n * Resolve a jsPlugin package name to its absolute path.\n * This allows oxlint to load plugins directly without relying on\n * Node module resolution from the consumer's CWD — fixes pnpm strict mode.\n */\nfunction resolvePlugin(name: string): string {\n try {\n return require.resolve(name)\n } catch {\n return name\n }\n}\n\nfunction resolvePlugins(plugins: ExternalPluginEntry[]): ExternalPluginEntry[] {\n return plugins.map((p) => {\n if (typeof p === 'string') return resolvePlugin(p)\n return { ...p, specifier: resolvePlugin(p.specifier) }\n })\n}\n\n// ============================================================================\n// Core\n// ============================================================================\n\n/**\n * Base lint preset — TypeScript + Import plugins, categories, env, ignores.\n * Always include first.\n */\nexport function base(overrides?: Partial<OxlintConfig>): OxlintConfig {\n return preset(\n {\n plugins: ['typescript', 'import'],\n categories: {\n correctness: 'error',\n suspicious: 'error',\n perf: 'error',\n pedantic: 'warn',\n },\n rules: {\n // Shape-only check; necessary in interactive CLI and sequential workflows.\n 'no-await-in-loop': 'off',\n // High-noise; readonly intent better expressed via `const generics` or call-site.\n 'typescript/prefer-readonly-parameter-types': 'off',\n // Turns `if (str)` into ceremony for marginal safety gain.\n 'typescript/strict-boolean-expressions': 'off',\n // File/function size is a reviewer call, not a lint rule.\n 'max-lines': 'off',\n 'max-lines-per-function': 'off',\n // Misfires on `/* @__PURE__ */` and similar bundler annotations.\n 'no-inline-comments': 'off',\n // TODO/FIXME triage belongs in the issue tracker.\n 'no-warning-comments': 'off',\n // Default cap of 10 is too tight for modern React/Next component files.\n 'import/max-dependencies': 'off',\n // Modern React renders apostrophes correctly; legacy noise.\n 'react/no-unescaped-entities': 'off',\n // Misfires on Next.js Server Actions and placeholder async functions.\n 'require-await': 'off',\n },\n env: {\n browser: true,\n node: true,\n es2026: true,\n builtin: true,\n },\n ignorePatterns: [...DEFAULT_IGNORES, ...loadGitignorePatterns()],\n overrides: [\n {\n files: [GLOB_TS],\n rules: {\n // Only list rules that DIFFER from categories defaults\n 'typescript/consistent-type-definitions': 'off',\n 'typescript/consistent-type-imports': 'error',\n 'no-unused-vars': 'off',\n 'no-useless-rename': 'error',\n 'uninvoked-array-callback': 'error',\n 'typescript/array-type': 'error',\n 'typescript/consistent-generic-constructors': 'error',\n 'typescript/consistent-indexed-object-style': 'error',\n 'typescript/consistent-type-assertions': 'error',\n 'typescript/ban-tslint-comment': 'error',\n 'typescript/no-empty-interface': 'error',\n 'typescript/no-inferrable-types': 'error',\n 'typescript/no-misused-new': 'error',\n 'typescript/no-unnecessary-parameter-property-assignment': 'error',\n 'typescript/no-useless-empty-export': 'error',\n 'typescript/no-deprecated': 'warn',\n 'typescript/prefer-for-of': 'error',\n 'typescript/prefer-function-type': 'error',\n 'typescript/unified-signatures': 'error',\n },\n },\n {\n files: [GLOB_SRC],\n rules: {\n // CSS/style side-effect imports are standard in all frontend frameworks\n 'import/no-unassigned-import': 'off',\n 'import/no-relative-parent-imports': 'error',\n 'import/first': 'error',\n 'import/no-duplicates': 'error',\n 'import/consistent-type-specifier-style': 'error',\n 'import/no-mutable-exports': 'error',\n 'import/no-named-default': 'error',\n },\n },\n {\n // Config files commonly import shared roots via `../../config.ts`\n // in monorepos — intended pattern, not a smell.\n files: ['**/*.config.{ts,mts,cts,js,mjs,cjs}'],\n rules: {\n 'import/no-relative-parent-imports': 'off',\n },\n },\n {\n // Test files use mock setup patterns (vi.mock/vi.hoisted before imports),\n // explicit mock signatures, and fixture data that\n // legitimately violate strict style/safety rules.\n files: GLOB_TESTS,\n rules: {\n // Mock setup pattern breaks standard import ordering\n 'import/first': 'off',\n 'import/no-duplicates': 'off',\n 'import/consistent-type-specifier-style': 'off',\n // Mock signatures need explicit values / async without await\n 'unicorn/no-useless-undefined': 'off',\n 'typescript/no-empty-function': 'off',\n // Modernization hints aren't useful in tests\n 'unicorn/prefer-string-replace-all': 'off',\n 'unicorn/no-array-callback-reference': 'off',\n 'unicorn/prefer-spread': 'off',\n // Tests deliberately use non-null assertions, magic numbers, any\n 'typescript/no-non-null-assertion': 'off',\n 'no-magic-numbers': 'off',\n 'typescript/no-explicit-any': 'off',\n 'typescript/no-unsafe-assignment': 'off',\n 'typescript/no-unsafe-call': 'off',\n 'typescript/no-unsafe-member-access': 'off',\n 'typescript/no-unsafe-return': 'off',\n 'typescript/no-unsafe-argument': 'off',\n // Index keys are fine when rendering fixture lists\n 'react/no-array-index-key': 'off',\n },\n },\n ],\n },\n overrides,\n )\n}\n\n/**\n * Type-aware lint preset — enables 59 type-aware rules via tsgolint + type checking.\n * Requires TypeScript 7.0+ and `oxlint-tsgolint` (bundled as dependency).\n */\nexport function typeAware(overrides?: Partial<OxlintConfig>): OxlintConfig {\n return preset(\n {\n options: {\n typeAware: true,\n typeCheck: true,\n },\n },\n overrides,\n )\n}\n\n/** Unicorn lint preset — 100+ code quality rules. */\nexport function unicorn(overrides?: Partial<OxlintConfig>): OxlintConfig {\n return preset(\n {\n plugins: ['unicorn'],\n rules: {\n 'unicorn/no-null': 'off',\n 'unicorn/filename-case': ['error', { case: 'kebabCase' }],\n 'unicorn/catch-error-name': 'error',\n 'unicorn/error-message': 'error',\n 'unicorn/prefer-optional-catch-binding': 'error',\n 'unicorn/number-literal-case': 'error',\n 'unicorn/numeric-separators-style': 'error',\n 'unicorn/prefer-includes': 'error',\n 'unicorn/prefer-spread': 'error',\n 'unicorn/prefer-ternary': 'error',\n 'unicorn/prefer-string-trim-start-end': 'error',\n 'unicorn/prefer-structured-clone': 'error',\n 'unicorn/prefer-default-parameters': 'error',\n 'unicorn/prefer-string-starts-ends-with': 'error',\n 'unicorn/prefer-set-size': 'error',\n 'unicorn/throw-new-error': 'error',\n 'unicorn/require-array-join-separator': 'error',\n\n // Correctness\n 'unicorn/no-zero-fractions': 'error',\n 'unicorn/no-console-spaces': 'error',\n 'unicorn/no-useless-spread': 'error',\n 'unicorn/no-useless-fallback-in-spread': 'error',\n 'unicorn/no-unnecessary-await': 'error',\n 'unicorn/no-useless-length-check': 'error',\n 'unicorn/no-single-promise-in-promise-methods': 'error',\n 'unicorn/no-await-in-promise-methods': 'error',\n 'unicorn/no-invalid-remove-event-listener': 'error',\n 'unicorn/no-invalid-fetch-options': 'error',\n 'unicorn/no-new-array': 'error',\n 'unicorn/no-empty-file': 'warn',\n },\n },\n overrides,\n )\n}\n\n/** Dependency optimization — flags packages replaceable with native APIs. */\nexport function depend(overrides?: Partial<OxlintConfig>): OxlintConfig {\n return preset(\n {\n jsPlugins: resolvePlugins(['eslint-plugin-depend']),\n rules: {\n 'depend/ban-dependencies': [\n 'error',\n {\n presets: ['native', 'microutilities', 'preferred'],\n modules: [],\n allowed: ['dotenv'],\n },\n ],\n },\n },\n overrides,\n )\n}\n\n// ============================================================================\n// Runtime environments\n// ============================================================================\n\n/** Node.js lint preset — native node plugin. */\nexport function node(overrides?: Partial<OxlintConfig>): OxlintConfig {\n return preset(\n {\n plugins: ['node'],\n rules: {\n 'unicorn/prefer-node-protocol': 'error',\n },\n },\n overrides,\n )\n}\n\n/** Promise lint preset — native promise plugin. */\nexport function promise(overrides?: Partial<OxlintConfig>): OxlintConfig {\n return preset({ plugins: ['promise'] }, overrides)\n}\n\n// ============================================================================\n// Frontend\n// ============================================================================\n\nconst reactRules = {\n // Hooks (CRITICAL)\n 'react/rules-of-hooks': 'error',\n 'react/exhaustive-deps': 'warn',\n\n // JSX Correctness\n 'react/jsx-key': 'error',\n 'react/jsx-no-duplicate-props': 'error',\n 'react/jsx-no-undef': 'error',\n 'react/jsx-no-target-blank': ['error', { allowReferrer: false }],\n 'react/jsx-no-comment-textnodes': 'error',\n 'react/jsx-no-script-url': 'error',\n 'react/jsx-props-no-spread-multi': 'error',\n 'react/jsx-no-useless-fragment': 'warn',\n\n // JSX Style\n 'react/jsx-boolean-value': ['error', 'never'],\n 'react/jsx-curly-brace-presence': ['error', { props: 'never', children: 'never' }],\n 'react/jsx-fragments': ['error', 'syntax'],\n 'react/jsx-pascal-case': ['error', { allowAllCaps: false, allowNamespace: true }],\n 'react/self-closing-comp': ['error', { component: true, html: true }],\n 'react/hook-use-state': 'error',\n\n // Runtime Safety\n 'react/no-children-prop': 'error',\n 'react/no-danger-with-children': 'error',\n 'react/no-direct-mutation-state': 'error',\n 'react/no-find-dom-node': 'error',\n 'react/no-is-mounted': 'error',\n 'react/no-render-return-value': 'error',\n 'react/no-string-refs': 'error',\n 'react/no-unknown-property': 'error',\n 'react/no-unsafe': 'error',\n 'react/require-render-return': 'error',\n 'react/void-dom-elements-no-children': 'error',\n\n // Lifecycle Safety\n 'react/no-set-state': 'error',\n 'react/no-did-mount-set-state': 'error',\n 'react/no-did-update-set-state': 'error',\n 'react/no-will-update-set-state': 'error',\n 'react/no-this-in-sfc': 'error',\n\n // Refs & Boundaries\n 'react/forward-ref-uses-ref': 'error',\n 'react/no-unstable-nested-components': 'warn',\n 'react/iframe-missing-sandbox': 'error',\n 'react/set-state-in-render': 'error',\n 'react/error-boundaries': 'error',\n\n // Performance\n 'react/jsx-no-constructed-context-values': 'warn',\n 'react/no-array-index-key': 'warn',\n 'react/style-prop-object': 'error',\n\n // Modern React (17+)\n 'react/react-in-jsx-scope': 'off',\n\n // Noise Reduction\n 'react/no-unescaped-entities': 'off',\n} satisfies NonNullable<OxlintConfig['rules']>\n\n/** React lint preset — core React + Hooks rules. */\nexport function react(overrides?: Partial<OxlintConfig>): OxlintConfig {\n return preset(\n {\n plugins: ['react'],\n rules: reactRules,\n },\n overrides,\n )\n}\n\n/** React + react-refresh preset (for Vite, TanStack Start, etc.). */\nexport function reactVite(overrides?: Partial<OxlintConfig>): OxlintConfig {\n return preset(\n {\n plugins: ['react'],\n jsPlugins: resolvePlugins(['eslint-plugin-react-refresh']),\n rules: {\n ...reactRules,\n 'react-refresh/only-export-components': ['warn', { allowConstantExport: true }],\n },\n },\n overrides,\n )\n}\n\n/** Next.js lint preset — enables native nextjs plugin. */\nexport function nextjs(overrides?: Partial<OxlintConfig>): OxlintConfig {\n return preset({ plugins: ['nextjs'] }, overrides)\n}\n\n/**\n * TanStack Router lint preset.\n *\n * Loads @tanstack/eslint-plugin-router and applies conventions specific\n * to file-based routing setups.\n *\n * Rules provided by the plugin:\n * - `route-param-names` — validates `$param` names match between route path and params\n * - `create-route-property-order` — enforces consistent property order in `createRoute()`\n */\nexport function tanstackRouter(overrides?: Partial<OxlintConfig>): OxlintConfig {\n return preset(\n {\n jsPlugins: resolvePlugins([\n { name: 'tanstack-router', specifier: '@tanstack/eslint-plugin-router' },\n ]),\n rules: {\n // ─── Route Configuration ─────────────────────────\n 'tanstack-router/route-param-names': 'error',\n 'tanstack-router/create-route-property-order': 'error',\n\n // ─── Route File Conventions ──────────────────────\n // Route files should use named exports for route objects\n // (default export reserved for the component or route)\n 'import/no-default-export': 'off', // Router requires default exports\n },\n overrides: [\n {\n // Route files follow specific naming and structure\n files: ['**/routes/**/*.{ts,tsx}'],\n rules: {\n // Routes must not use window directly — use router hooks\n 'no-restricted-globals': [\n 'error',\n {\n name: 'window',\n message: 'Use useRouter() or useNavigate() instead of window in route files.',\n },\n ],\n },\n },\n {\n // ─── Filename Convention (kebab-case) ─────────\n // Applies only to files inside a `routes/` folder.\n files: ['**/routes/**/*.{ts,tsx}'],\n plugins: ['unicorn'],\n rules: {\n 'unicorn/filename-case': [\n 'error',\n {\n case: 'kebabCase',\n ignore: [\n '\\\\$', // dynamic params: $postId.tsx, posts.$postId.tsx\n '^_', // pathless/root: _auth.tsx, __root.tsx\n '\\\\.', // multi-segment: posts.index.tsx, route.lazy.tsx\n ],\n },\n ],\n },\n },\n {\n // Root route file convention\n files: ['**/routes/__root.tsx'],\n rules: {\n // __root.tsx can't use useNavigate (no router context yet)\n 'no-restricted-globals': 'off',\n },\n },\n ],\n },\n overrides,\n )\n}\n\n/**\n * TanStack Start lint preset.\n *\n * Adds rules for server functions, client/server boundaries, and Start\n * conventions. This preset assumes `reactVite()` and `tanstackRouter()`\n * are already in the `extends` array.\n *\n */\nexport function tanstackStart(overrides?: Partial<OxlintConfig>): OxlintConfig {\n return preset(\n {\n rules: {\n // ─── Server Function Safety ──────────────────────\n // Prevent async promise executors (Start loaders must be sync wrapper)\n 'no-async-promise-executor': 'error',\n // Sequential awaits are fine in server functions\n 'no-await-in-loop': 'off',\n\n // ─── Client / Server Boundary ────────────────────\n // Node.js modules must not leak into client bundles\n 'import/no-nodejs-modules': 'error',\n\n // ─── Loader Conventions ──────────────────────────\n // Loaders must consistently return or throw\n 'consistent-return': 'error',\n\n // ─── Common Start Pitfalls ───────────────────────\n // Empty functions are common in placeholder server functions\n 'no-empty-function': 'warn',\n },\n\n overrides: [\n {\n // Server-only files — Node.js APIs allowed\n files: ['**/*.server.{ts,tsx}', '**/server/**/*.{ts,tsx}', '**/server-fns/**/*.{ts,tsx}'],\n rules: {\n 'import/no-nodejs-modules': 'off',\n 'no-console': 'off',\n },\n },\n {\n // Client-only files — Node.js APIs forbidden\n files: ['**/*.client.{ts,tsx}', '**/components/**/*.{ts,tsx}'],\n rules: {\n 'import/no-nodejs-modules': 'error',\n },\n },\n {\n // Route files — server-aware\n files: ['**/routes/**/*.{ts,tsx}'],\n rules: {\n // Routes use loaders, not direct fetch in component\n 'no-restricted-syntax': [\n 'warn',\n {\n selector: 'CallExpression[callee.name=\"fetch\"]',\n message: 'Prefer a loader or server function over direct fetch in route files.',\n },\n ],\n },\n },\n {\n files: ['**/*.server.{ts,tsx}', '**/*.client.{ts,tsx}'],\n plugins: ['unicorn'],\n rules: {\n 'unicorn/filename-case': [\n 'error',\n {\n case: 'kebabCase',\n ignore: [\n '\\\\.', // allow *.server.ts / *.client.ts (has dots)\n ],\n },\n ],\n },\n },\n {\n files: ['**/*.server.{ts,tsx}', '**/server/**/*.{ts,tsx}', '**/server-fns/**/*.{ts,tsx}'],\n rules: {\n 'import/no-nodejs-modules': 'off',\n 'no-console': 'off',\n // ← جدید: جلوگیری از crash توی SSR\n 'no-restricted-globals': [\n 'error',\n {\n name: 'window',\n message:\n 'Not available in server context. Use a server function or guard with typeof window.',\n },\n { name: 'document', message: 'Not available in server context.' },\n { name: 'localStorage', message: 'Not available in server context.' },\n { name: 'sessionStorage', message: 'Not available in server context.' },\n ],\n },\n },\n ],\n },\n overrides,\n )\n}\n\n// ============================================================================\n// Quality\n// ============================================================================\n\n/** Accessibility lint preset — enables native jsx-a11y plugin. */\nexport function a11y(overrides?: Partial<OxlintConfig>): OxlintConfig {\n return preset({ plugins: ['jsx-a11y'] }, overrides)\n}\n\n/** JSDoc lint preset — enables native jsdoc plugin. */\nexport function jsdoc(overrides?: Partial<OxlintConfig>): OxlintConfig {\n return preset({ plugins: ['jsdoc'] }, overrides)\n}\n\n// ============================================================================\n// Testing\n// ============================================================================\n\ninterface VitestOptions extends Partial<OxlintConfig> {\n /** Test file glob patterns. Replaces the default GLOB_TESTS. */\n files?: string[]\n}\n\n/** Vitest lint preset — native vitest plugin with test-file scoping. */\nexport function vitest(options?: VitestOptions): OxlintConfig {\n const { files, ...overrides } = options ?? {}\n\n return preset(\n {\n plugins: ['vitest'],\n settings: { vitest: { typecheck: true } },\n overrides: [\n {\n files: files ?? GLOB_TESTS,\n rules: {\n 'vitest/expect-expect': 'error',\n 'vitest/no-conditional-expect': 'error',\n 'vitest/no-identical-title': 'error',\n 'vitest/no-import-node-test': 'error',\n 'vitest/no-interpolation-in-snapshots': 'error',\n 'vitest/no-mocks-import': 'error',\n 'vitest/no-standalone-expect': 'error',\n 'vitest/valid-describe-callback': 'error',\n 'vitest/valid-expect': 'error',\n 'vitest/valid-title': 'error',\n 'vitest/consistent-test-it': ['error', { fn: 'it', withinDescribe: 'it' }],\n 'vitest/prefer-hooks-in-order': 'error',\n 'vitest/prefer-lowercase-title': 'error',\n 'vitest/no-disabled-tests': isInEditorEnv() ? 'warn' : 'error',\n 'vitest/no-focused-tests': isInEditorEnv() ? 'warn' : 'error',\n 'vitest/require-mock-type-parameters': 'off',\n 'vitest/prefer-called-once': 'error',\n 'vitest/prefer-called-times': 'error',\n 'vitest/prefer-expect-type-of': 'error',\n 'vitest/prefer-to-be-object': 'error',\n 'vitest/hoisted-apis-on-top': 'error',\n 'vitest/require-awaited-expect-poll': 'error',\n 'vitest/no-conditional-tests': 'error',\n 'vitest/consistent-vitest-vi': 'error',\n 'no-console': 'off',\n 'unicorn/no-null': 'off',\n 'typescript/ban-ts-comment': 'off',\n },\n },\n ],\n },\n overrides,\n )\n}\n\n// ============================================================================\n// Tailwind\n// ============================================================================\n\ninterface TailwindOptions extends Partial<OxlintConfig> {\n entryPoint?: string\n rootFontSize?: number\n /** File glob patterns for tailwind rules. @default GLOB_JSX */\n files?: string[]\n}\n\n/** Tailwind CSS lint preset — eslint-plugin-better-tailwindcss. */\nexport function tailwind(options: TailwindOptions = {}): OxlintConfig {\n const { entryPoint = 'src/styles/globals.css', rootFontSize = 16, files, ...overrides } = options\n\n return preset(\n {\n jsPlugins: resolvePlugins(['eslint-plugin-better-tailwindcss']),\n settings: { 'better-tailwindcss': { entryPoint, rootFontSize } },\n overrides: [\n {\n files: files ?? [GLOB_JSX],\n rules: {\n 'better-tailwindcss/enforce-consistent-line-wrapping': ['error', { printWidth: 0 }],\n 'better-tailwindcss/enforce-canonical-classes': 'error',\n },\n },\n ],\n },\n overrides,\n )\n}\n\n// ============================================================================\n// Backend / ORM\n// ============================================================================\n\n/**\n * NestJS lint preset — loads @darraghor/eslint-plugin-nestjs-typed via jsPlugin.\n * Covers DI validation, Swagger consistency, decorator bug prevention (19 AST rules).\n */\nexport function nestjs(overrides?: Partial<OxlintConfig>): OxlintConfig {\n return preset(\n {\n jsPlugins: resolvePlugins([\n { name: 'nestjs-typed', specifier: '@darraghor/eslint-plugin-nestjs-typed' },\n ]),\n rules: {\n // DI\n 'nestjs-typed/injectable-should-be-provided': 'error',\n 'nestjs-typed/provided-injected-should-match-factory-parameters': 'error',\n 'nestjs-typed/use-injectable-provided-token': 'error',\n // Swagger\n 'nestjs-typed/api-property-matches-property-optionality': 'error',\n 'nestjs-typed/controllers-should-supply-api-tags': 'error',\n 'nestjs-typed/api-method-should-specify-api-response': 'error',\n 'nestjs-typed/api-property-returning-array-should-set-array': 'error',\n 'nestjs-typed/api-property-should-have-api-extra-models': 'error',\n 'nestjs-typed/api-operation-summary-description-capitalized': 'error',\n // Bug prevention\n 'nestjs-typed/param-decorator-name-matches-route-param': 'error',\n 'nestjs-typed/validate-nested-of-array-should-set-each': 'error',\n 'nestjs-typed/all-properties-are-whitelisted': 'error',\n 'nestjs-typed/no-duplicate-decorators': 'error',\n 'nestjs-typed/validation-pipe-should-use-forbid-unknown': 'error',\n },\n },\n overrides,\n )\n}\n\n/** Drizzle ORM lint preset — eslint-plugin-drizzle. */\nexport function drizzle(overrides?: Partial<OxlintConfig>): OxlintConfig {\n return preset(\n {\n jsPlugins: resolvePlugins(['eslint-plugin-drizzle']),\n rules: {\n 'drizzle/enforce-delete-with-where': 'error',\n 'drizzle/enforce-update-with-where': 'error',\n },\n },\n overrides,\n )\n}\n\n// ============================================================================\n// Re-exports\n// ============================================================================\n\nexport { defineConfig } from 'oxlint'\nexport { GLOB_SRC, GLOB_JS, GLOB_TS, GLOB_JSX, GLOB_TESTS, GLOB_JSON, GLOB_MARK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