@imranbarbhuiya/oxc-config 0.1.7 → 0.1.10
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/cli/index.d.ts +1 -1
- package/dist/cli/index.js +78 -66
- package/dist/cli/index.js.map +1 -1
- package/dist/common.js +4 -19
- package/dist/common.js.map +1 -1
- package/dist/config.js.map +1 -1
- package/dist/nest.js +1 -1
- package/dist/nest.js.map +1 -1
- package/dist/node.js +0 -7
- package/dist/node.js.map +1 -1
- package/dist/plugins/nest.d.ts +6 -0
- package/dist/plugins/nest.js +57 -0
- package/dist/plugins/nest.js.map +1 -0
- package/dist/plugins/restricted-syntax.d.ts +6 -0
- package/dist/plugins/restricted-syntax.js +62 -0
- package/dist/plugins/restricted-syntax.js.map +1 -0
- package/dist/typescript.js +9 -14
- package/dist/typescript.js.map +1 -1
- package/package.json +2 -6
- package/dist/nest-plugin.d.ts +0 -2
- package/dist/nest-plugin.js +0 -3
package/dist/cli/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {}
|
package/dist/cli/index.js
CHANGED
|
@@ -408,83 +408,95 @@ if (!(preset in PRESETS)) {
|
|
|
408
408
|
p.log.info(`Available presets: ${Object.keys(PRESETS).join(", ")}`);
|
|
409
409
|
process.exit(1);
|
|
410
410
|
}
|
|
411
|
-
if (includeTailwind === void 0)
|
|
412
|
-
|
|
413
|
-
else
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
p.
|
|
420
|
-
|
|
411
|
+
if (includeTailwind === void 0) {
|
|
412
|
+
if (preset === "node" || preset === "library" || preset === "nest") includeTailwind = false;
|
|
413
|
+
else if (skipPrompts) includeTailwind = hasTailwind(dependencies);
|
|
414
|
+
else {
|
|
415
|
+
const result = await p.confirm({
|
|
416
|
+
message: "Include Tailwind CSS support?",
|
|
417
|
+
initialValue: hasTailwind(dependencies)
|
|
418
|
+
});
|
|
419
|
+
if (p.isCancel(result)) {
|
|
420
|
+
p.cancel("Operation cancelled.");
|
|
421
|
+
process.exit(0);
|
|
422
|
+
}
|
|
423
|
+
includeTailwind = result;
|
|
421
424
|
}
|
|
422
|
-
includeTailwind = result;
|
|
423
425
|
}
|
|
424
|
-
if (includeI18n === void 0)
|
|
425
|
-
|
|
426
|
-
else
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
p.
|
|
433
|
-
|
|
426
|
+
if (includeI18n === void 0) {
|
|
427
|
+
if (preset !== "nextjs") includeI18n = false;
|
|
428
|
+
else if (skipPrompts) includeI18n = hasNextIntl(dependencies);
|
|
429
|
+
else {
|
|
430
|
+
const result = await p.confirm({
|
|
431
|
+
message: "Include next-intl i18n rules?",
|
|
432
|
+
initialValue: hasNextIntl(dependencies)
|
|
433
|
+
});
|
|
434
|
+
if (p.isCancel(result)) {
|
|
435
|
+
p.cancel("Operation cancelled.");
|
|
436
|
+
process.exit(0);
|
|
437
|
+
}
|
|
438
|
+
includeI18n = result;
|
|
434
439
|
}
|
|
435
|
-
includeI18n = result;
|
|
436
440
|
}
|
|
437
|
-
if (includeNativeTailwind === void 0)
|
|
438
|
-
|
|
439
|
-
else
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
p.
|
|
446
|
-
|
|
441
|
+
if (includeNativeTailwind === void 0) {
|
|
442
|
+
if (preset !== "native" || !includeTailwind) includeNativeTailwind = false;
|
|
443
|
+
else if (skipPrompts) includeNativeTailwind = true;
|
|
444
|
+
else {
|
|
445
|
+
const result = await p.confirm({
|
|
446
|
+
message: "Include React Native Tailwind className rules?",
|
|
447
|
+
initialValue: true
|
|
448
|
+
});
|
|
449
|
+
if (p.isCancel(result)) {
|
|
450
|
+
p.cancel("Operation cancelled.");
|
|
451
|
+
process.exit(0);
|
|
452
|
+
}
|
|
453
|
+
includeNativeTailwind = result;
|
|
447
454
|
}
|
|
448
|
-
includeNativeTailwind = result;
|
|
449
455
|
}
|
|
450
|
-
if (includeCentralIcons === void 0)
|
|
451
|
-
|
|
452
|
-
else
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
p.
|
|
459
|
-
|
|
456
|
+
if (includeCentralIcons === void 0) {
|
|
457
|
+
if (preset !== "native" && preset !== "react" && preset !== "nextjs") includeCentralIcons = false;
|
|
458
|
+
else if (skipPrompts) includeCentralIcons = hasCentralIcons(dependencies);
|
|
459
|
+
else {
|
|
460
|
+
const result = await p.confirm({
|
|
461
|
+
message: "Include central-icons barrel-import rules?",
|
|
462
|
+
initialValue: hasCentralIcons(dependencies)
|
|
463
|
+
});
|
|
464
|
+
if (p.isCancel(result)) {
|
|
465
|
+
p.cancel("Operation cancelled.");
|
|
466
|
+
process.exit(0);
|
|
467
|
+
}
|
|
468
|
+
includeCentralIcons = result;
|
|
460
469
|
}
|
|
461
|
-
includeCentralIcons = result;
|
|
462
470
|
}
|
|
463
|
-
if (includeQuery === void 0)
|
|
464
|
-
|
|
465
|
-
else
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
p.
|
|
472
|
-
|
|
471
|
+
if (includeQuery === void 0) {
|
|
472
|
+
if (preset !== "native" && preset !== "react" && preset !== "nextjs") includeQuery = false;
|
|
473
|
+
else if (skipPrompts) includeQuery = hasTanstackQuery(dependencies);
|
|
474
|
+
else {
|
|
475
|
+
const result = await p.confirm({
|
|
476
|
+
message: "Include TanStack Query rules?",
|
|
477
|
+
initialValue: hasTanstackQuery(dependencies)
|
|
478
|
+
});
|
|
479
|
+
if (p.isCancel(result)) {
|
|
480
|
+
p.cancel("Operation cancelled.");
|
|
481
|
+
process.exit(0);
|
|
482
|
+
}
|
|
483
|
+
includeQuery = result;
|
|
473
484
|
}
|
|
474
|
-
includeQuery = result;
|
|
475
485
|
}
|
|
476
|
-
if (includeApiError === void 0)
|
|
477
|
-
|
|
478
|
-
else
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
p.
|
|
485
|
-
|
|
486
|
+
if (includeApiError === void 0) {
|
|
487
|
+
if (preset !== "native" && preset !== "react" && preset !== "nextjs") includeApiError = false;
|
|
488
|
+
else if (skipPrompts) includeApiError = hasTanstackQuery(dependencies);
|
|
489
|
+
else {
|
|
490
|
+
const result = await p.confirm({
|
|
491
|
+
message: "Include ApiError rules for queryFn/mutationFn?",
|
|
492
|
+
initialValue: hasTanstackQuery(dependencies)
|
|
493
|
+
});
|
|
494
|
+
if (p.isCancel(result)) {
|
|
495
|
+
p.cancel("Operation cancelled.");
|
|
496
|
+
process.exit(0);
|
|
497
|
+
}
|
|
498
|
+
includeApiError = result;
|
|
486
499
|
}
|
|
487
|
-
includeApiError = result;
|
|
488
500
|
}
|
|
489
501
|
p.log.step(`Setting up Oxlint and Oxfmt with preset: ${preset}`);
|
|
490
502
|
if (includeTailwind) p.log.info("Including Tailwind CSS support");
|
package/dist/cli/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../src/cli/index.ts"],"sourcesContent":["#!/usr/bin/env node\nimport fs from 'node:fs/promises';\nimport path from 'node:path';\nimport process from 'node:process';\nimport { parseArgs } from 'node:util';\n\nimport * as p from '@clack/prompts';\nimport { addDevDependency, detectPackageManager } from 'nypm';\n\ninterface PresetConfig {\n\tconfigs: string[];\n\tdescription: string;\n}\n\ninterface ExtraConfigs {\n\tapiError: boolean;\n\tcentralIcons: boolean;\n\ti18n: boolean;\n\tnativeTailwind: boolean;\n\tquery: boolean;\n}\n\nconst PACKAGE_NAME = '@imranbarbhuiya/oxc-config';\n\nconst PRESETS: Record<string, PresetConfig> = {\n\tnextjs: {\n\t\tconfigs: ['common', 'node', 'typescript', 'module', 'react', 'next', 'edge'],\n\t\tdescription: 'Next.js application with React, TypeScript, and edge runtime support',\n\t},\n\treact: {\n\t\tconfigs: ['common', 'node', 'typescript', 'module', 'react'],\n\t\tdescription: 'React application with TypeScript',\n\t},\n\tnode: {\n\t\tconfigs: ['common', 'node', 'typescript', 'module'],\n\t\tdescription: 'Node.js application with TypeScript',\n\t},\n\tnative: {\n\t\tconfigs: ['common', 'node', 'typescript', 'module', 'react', 'native'],\n\t\tdescription: 'React Native application with TypeScript',\n\t},\n\tlibrary: {\n\t\tconfigs: ['common', 'node', 'typescript', 'module', 'tsdoc'],\n\t\tdescription: 'TypeScript library with TSDoc support',\n\t},\n\tnest: {\n\t\tconfigs: ['common', 'node', 'typescript', 'module', 'nest'],\n\t\tdescription: 'NestJS application with TypeScript',\n\t},\n};\n\nconst DEFAULT_IGNORES: Record<string, string[]> = {\n\tnextjs: ['.github/**', '.yarn/**', '.next/**', 'node_modules/**', 'next-env.d.ts'],\n\treact: ['.github/**', '.yarn/**', 'node_modules/**', 'dist/**', 'build/**'],\n\tnode: ['.github/**', '.yarn/**', 'node_modules/**', 'dist/**'],\n\tnative: ['.github/**', '.yarn/**', 'node_modules/**', '.expo/**', 'android/**', 'ios/**'],\n\tlibrary: ['.github/**', '.yarn/**', 'node_modules/**', 'dist/**'],\n\tnest: ['.github/**', '.yarn/**', 'node_modules/**', 'dist/**'],\n};\n\nconst PACKAGE_PRESET_MAP: Record<string, string> = {\n\tnext: 'nextjs',\n\t'react-native': 'native',\n\treact: 'react',\n\t'@nestjs/core': 'nest',\n};\n\nconst DETECTION_PRIORITY = ['next', 'react-native', 'react', '@nestjs/core'];\n\nconst { values: options } = parseArgs({\n\toptions: {\n\t\tpreset: { type: 'string', short: 'p' },\n\t\ttailwind: { type: 'boolean', short: 't', default: false },\n\t\t'no-tailwind': { type: 'boolean', default: false },\n\t\ti18n: { type: 'boolean', default: false },\n\t\t'no-i18n': { type: 'boolean', default: false },\n\t\t'native-tailwind': { type: 'boolean', default: false },\n\t\t'no-native-tailwind': { type: 'boolean', default: false },\n\t\t'central-icons': { type: 'boolean', default: false },\n\t\t'no-central-icons': { type: 'boolean', default: false },\n\t\t'api-error': { type: 'boolean', default: false },\n\t\t'no-api-error': { type: 'boolean', default: false },\n\t\tquery: { type: 'boolean', default: false },\n\t\t'no-query': { type: 'boolean', default: false },\n\t\tyes: { type: 'boolean', short: 'y', default: false },\n\t\tcwd: { type: 'string' },\n\t\thelp: { type: 'boolean', short: 'h', default: false },\n\t},\n\tstrict: true,\n\tallowPositionals: false,\n});\n\nfunction printHelp(): void {\n\tconsole.log(`\n@imranbarbhuiya/oxc-config - Setup Oxlint and Oxfmt\n\nUsage:\n npx @imranbarbhuiya/oxc-config [options]\n\nOptions:\n -p, --preset <name> Preset to use (nextjs, react, node, native, library, nest)\n -t, --tailwind Include Tailwind CSS support\n --no-tailwind Exclude Tailwind CSS support\n --i18n Include next-intl i18n rules (Next.js)\n --no-i18n Exclude next-intl i18n rules\n --native-tailwind Include React Native Tailwind className rules\n --no-native-tailwind Exclude React Native Tailwind className rules\n --central-icons Include central-icons barrel-import rules\n --no-central-icons Exclude central-icons barrel-import rules\n --api-error Include ApiError rules for queryFn/mutationFn\n --no-api-error Exclude ApiError rules\n --query Include TanStack Query rules\n --no-query Exclude TanStack Query rules\n -y, --yes Skip prompts and use defaults\n --cwd <path> Working directory (defaults to current directory)\n -h, --help Show this help message\n\nExamples:\n npx @imranbarbhuiya/oxc-config\n npx @imranbarbhuiya/oxc-config --preset nextjs --tailwind\n npx @imranbarbhuiya/oxc-config -p react -y\n`);\n}\n\nfunction generateOxlintConfig(preset: string, includeTailwind: boolean, extras: ExtraConfigs): string {\n\tconst configs = [...PRESETS[preset].configs];\n\n\tif (includeTailwind) configs.push('tailwind');\n\tif (extras.i18n) configs.push('i18n');\n\tif (extras.nativeTailwind) configs.push('nativeTailwind');\n\tif (extras.centralIcons) configs.push('centralIcons');\n\tif (extras.apiError) configs.push('apiError');\n\n\tconst imports = configs.map((name) => {\n\t\tconst fragment = name === 'nativeTailwind' ? 'native-tailwind' : name;\n\t\treturn `import ${name} from '${PACKAGE_NAME}/${fragment}';`;\n\t});\n\n\tconst ignores = DEFAULT_IGNORES[preset].map((ignore) => `'${ignore}'`).join(', ');\n\tconst queryBlock = extras.query\n\t\t? `\n\tjsPlugins: [{ name: 'query', specifier: '@tanstack/eslint-plugin-query' }],\n\trules: {\n\t\t'query/exhaustive-deps': 'error',\n\t\t'query/no-rest-destructuring': 'error',\n\t\t'query/stable-query-client': 'error',\n\t},`\n\t\t: '';\n\n\tconst env =\n\t\tpreset === 'nextjs' || preset === 'react' || preset === 'native'\n\t\t\t? `{\n\t\tnode: true,\n\t\tbrowser: true,\n\t\tserviceworker: true,\n\t}`\n\t\t\t: `{\n\t\tnode: true,\n\t}`;\n\n\treturn `import { defineConfig } from 'oxlint';\n\n${imports.join('\\n')}\n\nexport default defineConfig({\n\textends: [${configs.join(', ')}],\n\tignorePatterns: [${ignores}],\n\tenv: ${env},\n\toptions: {\n\t\ttypeAware: true,\n\t},${queryBlock}\n});\n`;\n}\n\nfunction generateOxfmtConfig(): string {\n\treturn `import { defineConfig } from 'oxfmt';\n\nimport config from '${PACKAGE_NAME}/oxfmt';\n\nexport default defineConfig({\n\t...config,\n});\n`;\n}\n\nasync function fileExists(filePath: string): Promise<boolean> {\n\ttry {\n\t\tawait fs.access(filePath);\n\t\treturn true;\n\t} catch {\n\t\treturn false;\n\t}\n}\n\nasync function getDependencies(cwd: string): Promise<Record<string, string>> {\n\tconst packageJsonPath = path.join(cwd, 'package.json');\n\tif (!(await fileExists(packageJsonPath))) return {};\n\n\tconst content = await fs.readFile(packageJsonPath, 'utf8');\n\tconst packageJson = JSON.parse(content) as Record<string, unknown>;\n\n\treturn {\n\t\t...(packageJson.dependencies as Record<string, string> | undefined),\n\t\t...(packageJson.devDependencies as Record<string, string> | undefined),\n\t};\n}\n\nfunction detectPresetFromDependencies(dependencies: Record<string, string>): string | undefined {\n\tfor (const name of DETECTION_PRIORITY) if (dependencies[name]) return PACKAGE_PRESET_MAP[name];\n\treturn undefined;\n}\n\nfunction hasNextIntl(dependencies: Record<string, string>): boolean {\n\treturn Boolean(dependencies['next-intl']);\n}\n\nfunction hasCentralIcons(dependencies: Record<string, string>): boolean {\n\treturn Object.keys(dependencies).some(\n\t\t(name) => name.startsWith('@central-icons-react/') || name.startsWith('@central-icons-react-native/'),\n\t);\n}\n\nfunction hasTanstackQuery(dependencies: Record<string, string>): boolean {\n\treturn Boolean(dependencies['@tanstack/react-query']);\n}\n\nfunction hasTailwind(dependencies: Record<string, string>): boolean {\n\treturn Boolean(dependencies.tailwindcss || dependencies.nativewind);\n}\n\nasync function updateScripts(packageJsonPath: string): Promise<void> {\n\tif (!(await fileExists(packageJsonPath))) {\n\t\tp.log.error('No package.json found. Run this command in a project with package.json.');\n\t\tprocess.exit(1);\n\t}\n\n\tconst content = await fs.readFile(packageJsonPath, 'utf8');\n\tconst packageJson = JSON.parse(content) as Record<string, unknown>;\n\tconst scripts = (packageJson.scripts as Record<string, string> | undefined) ?? {};\n\n\tscripts.lint = 'oxlint --fix .';\n\tscripts['lint:check'] = 'oxlint .';\n\tscripts.format = 'oxfmt';\n\tscripts['format:check'] = 'oxfmt --check';\n\tpackageJson.scripts = scripts;\n\n\tawait fs.writeFile(packageJsonPath, JSON.stringify(packageJson, null, '\\t') + '\\n');\n}\n\nasync function installDependencies(cwd: string, includeQuery: boolean): Promise<string> {\n\tconst pm = await detectPackageManager(cwd);\n\tconst pmName = pm?.name ?? 'npm';\n\tconst dependencies = [PACKAGE_NAME, 'oxlint', 'oxlint-tsgolint', 'oxfmt'];\n\n\tif (includeQuery) dependencies.push('@tanstack/eslint-plugin-query');\n\n\tp.log.info(`Detected package manager: ${pmName}`);\n\tconst spinner = p.spinner();\n\tspinner.start('Installing dependencies');\n\n\tfor (const dependency of dependencies) {\n\t\tspinner.message(`Installing ${dependency}`);\n\t\tawait addDevDependency(dependency, { cwd, silent: true });\n\t}\n\n\tspinner.stop('Dependencies installed');\n\treturn pmName;\n}\n\nasync function confirmOverwrite(filePath: string, skipPrompts: boolean): Promise<void> {\n\tif (!(await fileExists(filePath)) || skipPrompts) return;\n\n\tconst result = await p.confirm({\n\t\tmessage: `${path.basename(filePath)} already exists. Overwrite?`,\n\t\tinitialValue: false,\n\t});\n\n\tif (p.isCancel(result)) {\n\t\tp.cancel('Operation cancelled.');\n\t\tprocess.exit(0);\n\t}\n\n\tif (!result) {\n\t\tp.cancel('Aborted.');\n\t\tprocess.exit(0);\n\t}\n}\n\nif (options.help) {\n\tprintHelp();\n\tprocess.exit(0);\n}\n\np.intro('@imranbarbhuiya/oxc-config setup');\n\nconst cwd = options.cwd ? path.resolve(options.cwd) : process.cwd();\nconst skipPrompts = options.yes;\nconst dependencies = await getDependencies(cwd);\n\nlet preset = options.preset;\nlet includeTailwind = options['no-tailwind'] ? false : options.tailwind ? true : undefined;\nlet includeI18n = options['no-i18n'] ? false : options.i18n ? true : undefined;\nlet includeNativeTailwind = options['no-native-tailwind'] ? false : options['native-tailwind'] ? true : undefined;\nlet includeCentralIcons = options['no-central-icons'] ? false : options['central-icons'] ? true : undefined;\nlet includeApiError = options['no-api-error'] ? false : options['api-error'] ? true : undefined;\nlet includeQuery = options['no-query'] ? false : options.query ? true : undefined;\n\nif (!preset) {\n\tconst detectedPreset = detectPresetFromDependencies(dependencies);\n\tif (skipPrompts) preset = detectedPreset ?? 'node';\n\telse {\n\t\tconst presetOptions = Object.entries(PRESETS).map(([value, config]) => ({\n\t\t\tvalue,\n\t\t\tlabel: value,\n\t\t\thint: config.description,\n\t\t}));\n\n\t\tif (detectedPreset) {\n\t\t\tconst detected = presetOptions.find((option) => option.value === detectedPreset);\n\t\t\tif (detected) {\n\t\t\t\tdetected.hint = `Detected: ${detected.hint}`;\n\t\t\t\tpresetOptions.splice(\n\t\t\t\t\t0,\n\t\t\t\t\tpresetOptions.length,\n\t\t\t\t\tdetected,\n\t\t\t\t\t...presetOptions.filter(({ value }) => value !== detectedPreset),\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tconst selected = await p.select({\n\t\t\tmessage: 'Select a preset',\n\t\t\toptions: presetOptions,\n\t\t});\n\n\t\tif (p.isCancel(selected)) {\n\t\t\tp.cancel('Operation cancelled.');\n\t\t\tprocess.exit(0);\n\t\t}\n\n\t\tpreset = selected;\n\t}\n}\n\nif (!(preset in PRESETS)) {\n\tp.log.error(`Unknown preset: ${preset}`);\n\tp.log.info(`Available presets: ${Object.keys(PRESETS).join(', ')}`);\n\tprocess.exit(1);\n}\n\nif (includeTailwind === undefined) {\n\tif (preset === 'node' || preset === 'library' || preset === 'nest') includeTailwind = false;\n\telse if (skipPrompts) includeTailwind = hasTailwind(dependencies);\n\telse {\n\t\tconst result = await p.confirm({\n\t\t\tmessage: 'Include Tailwind CSS support?',\n\t\t\tinitialValue: hasTailwind(dependencies),\n\t\t});\n\t\tif (p.isCancel(result)) {\n\t\t\tp.cancel('Operation cancelled.');\n\t\t\tprocess.exit(0);\n\t\t}\n\t\tincludeTailwind = result;\n\t}\n}\n\nif (includeI18n === undefined) {\n\tif (preset !== 'nextjs') includeI18n = false;\n\telse if (skipPrompts) includeI18n = hasNextIntl(dependencies);\n\telse {\n\t\tconst result = await p.confirm({\n\t\t\tmessage: 'Include next-intl i18n rules?',\n\t\t\tinitialValue: hasNextIntl(dependencies),\n\t\t});\n\t\tif (p.isCancel(result)) {\n\t\t\tp.cancel('Operation cancelled.');\n\t\t\tprocess.exit(0);\n\t\t}\n\t\tincludeI18n = result;\n\t}\n}\n\nif (includeNativeTailwind === undefined) {\n\tif (preset !== 'native' || !includeTailwind) includeNativeTailwind = false;\n\telse if (skipPrompts) includeNativeTailwind = true;\n\telse {\n\t\tconst result = await p.confirm({\n\t\t\tmessage: 'Include React Native Tailwind className rules?',\n\t\t\tinitialValue: true,\n\t\t});\n\t\tif (p.isCancel(result)) {\n\t\t\tp.cancel('Operation cancelled.');\n\t\t\tprocess.exit(0);\n\t\t}\n\t\tincludeNativeTailwind = result;\n\t}\n}\n\nif (includeCentralIcons === undefined) {\n\tif (preset !== 'native' && preset !== 'react' && preset !== 'nextjs') includeCentralIcons = false;\n\telse if (skipPrompts) includeCentralIcons = hasCentralIcons(dependencies);\n\telse {\n\t\tconst result = await p.confirm({\n\t\t\tmessage: 'Include central-icons barrel-import rules?',\n\t\t\tinitialValue: hasCentralIcons(dependencies),\n\t\t});\n\t\tif (p.isCancel(result)) {\n\t\t\tp.cancel('Operation cancelled.');\n\t\t\tprocess.exit(0);\n\t\t}\n\t\tincludeCentralIcons = result;\n\t}\n}\n\nif (includeQuery === undefined) {\n\tif (preset !== 'native' && preset !== 'react' && preset !== 'nextjs') includeQuery = false;\n\telse if (skipPrompts) includeQuery = hasTanstackQuery(dependencies);\n\telse {\n\t\tconst result = await p.confirm({\n\t\t\tmessage: 'Include TanStack Query rules?',\n\t\t\tinitialValue: hasTanstackQuery(dependencies),\n\t\t});\n\t\tif (p.isCancel(result)) {\n\t\t\tp.cancel('Operation cancelled.');\n\t\t\tprocess.exit(0);\n\t\t}\n\t\tincludeQuery = result;\n\t}\n}\n\nif (includeApiError === undefined) {\n\tif (preset !== 'native' && preset !== 'react' && preset !== 'nextjs') includeApiError = false;\n\telse if (skipPrompts) includeApiError = hasTanstackQuery(dependencies);\n\telse {\n\t\tconst result = await p.confirm({\n\t\t\tmessage: 'Include ApiError rules for queryFn/mutationFn?',\n\t\t\tinitialValue: hasTanstackQuery(dependencies),\n\t\t});\n\t\tif (p.isCancel(result)) {\n\t\t\tp.cancel('Operation cancelled.');\n\t\t\tprocess.exit(0);\n\t\t}\n\t\tincludeApiError = result;\n\t}\n}\n\np.log.step(`Setting up Oxlint and Oxfmt with preset: ${preset}`);\nif (includeTailwind) p.log.info('Including Tailwind CSS support');\nif (includeI18n) p.log.info('Including next-intl i18n rules');\nif (includeNativeTailwind) p.log.info('Including React Native Tailwind className rules');\nif (includeCentralIcons) p.log.info('Including central-icons barrel-import rules');\nif (includeQuery) p.log.info('Including TanStack Query rules');\nif (includeApiError) p.log.info('Including ApiError rules for queryFn/mutationFn');\n\nconst oxlintConfigPath = path.join(cwd, 'oxlint.config.ts');\nconst oxfmtConfigPath = path.join(cwd, 'oxfmt.config.ts');\nconst packageJsonPath = path.join(cwd, 'package.json');\n\nawait confirmOverwrite(oxlintConfigPath, skipPrompts);\nawait confirmOverwrite(oxfmtConfigPath, skipPrompts);\nawait fs.writeFile(\n\toxlintConfigPath,\n\tgenerateOxlintConfig(preset, includeTailwind, {\n\t\ti18n: includeI18n,\n\t\tnativeTailwind: includeNativeTailwind,\n\t\tcentralIcons: includeCentralIcons,\n\t\tquery: includeQuery,\n\t\tapiError: includeApiError,\n\t}),\n);\nawait fs.writeFile(oxfmtConfigPath, generateOxfmtConfig());\np.log.success('Created oxlint.config.ts and oxfmt.config.ts');\n\nawait updateScripts(packageJsonPath);\np.log.success('Updated package.json scripts');\n\nconst pmName = await installDependencies(cwd, includeQuery);\nconst runPrefix = pmName === 'npm' ? 'npm run' : pmName;\np.outro(`Setup complete! Run \\`${runPrefix} lint && ${runPrefix} format\\``);\n\nprocess.exit(0);\n"],"mappings":";;;;;;;;;AAsBA,MAAM,eAAe;AAErB,MAAM,UAAwC;CAC7C,QAAQ;EACP,SAAS;GAAC;GAAU;GAAQ;GAAc;GAAU;GAAS;GAAQ;EAAM;EAC3E,aAAa;CACd;CACA,OAAO;EACN,SAAS;GAAC;GAAU;GAAQ;GAAc;GAAU;EAAO;EAC3D,aAAa;CACd;CACA,MAAM;EACL,SAAS;GAAC;GAAU;GAAQ;GAAc;EAAQ;EAClD,aAAa;CACd;CACA,QAAQ;EACP,SAAS;GAAC;GAAU;GAAQ;GAAc;GAAU;GAAS;EAAQ;EACrE,aAAa;CACd;CACA,SAAS;EACR,SAAS;GAAC;GAAU;GAAQ;GAAc;GAAU;EAAO;EAC3D,aAAa;CACd;CACA,MAAM;EACL,SAAS;GAAC;GAAU;GAAQ;GAAc;GAAU;EAAM;EAC1D,aAAa;CACd;AACD;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nimport path from 'node:path';\nimport process from 'node:process';\nimport { parseArgs } from 'node:util';\n\nimport * as p from '@clack/prompts';\nimport { addDevDependency, detectPackageManager } from 'nypm';\n\ninterface PresetConfig {\n\tconfigs: string[];\n\tdescription: string;\n}\n\ninterface ExtraConfigs {\n\tapiError: boolean;\n\tcentralIcons: boolean;\n\ti18n: boolean;\n\tnativeTailwind: boolean;\n\tquery: boolean;\n}\n\nconst PACKAGE_NAME = '@imranbarbhuiya/oxc-config';\n\nconst PRESETS: Record<string, PresetConfig> = {\n\tnextjs: {\n\t\tconfigs: ['common', 'node', 'typescript', 'module', 'react', 'next', 'edge'],\n\t\tdescription: 'Next.js application with React, TypeScript, and edge runtime support',\n\t},\n\treact: {\n\t\tconfigs: ['common', 'node', 'typescript', 'module', 'react'],\n\t\tdescription: 'React application with TypeScript',\n\t},\n\tnode: {\n\t\tconfigs: ['common', 'node', 'typescript', 'module'],\n\t\tdescription: 'Node.js application with TypeScript',\n\t},\n\tnative: {\n\t\tconfigs: ['common', 'node', 'typescript', 'module', 'react', 'native'],\n\t\tdescription: 'React Native application with TypeScript',\n\t},\n\tlibrary: {\n\t\tconfigs: ['common', 'node', 'typescript', 'module', 'tsdoc'],\n\t\tdescription: 'TypeScript library with TSDoc support',\n\t},\n\tnest: {\n\t\tconfigs: ['common', 'node', 'typescript', 'module', 'nest'],\n\t\tdescription: 'NestJS application with TypeScript',\n\t},\n};\n\nconst DEFAULT_IGNORES: Record<string, string[]> = {\n\tnextjs: ['.github/**', '.yarn/**', '.next/**', 'node_modules/**', 'next-env.d.ts'],\n\treact: ['.github/**', '.yarn/**', 'node_modules/**', 'dist/**', 'build/**'],\n\tnode: ['.github/**', '.yarn/**', 'node_modules/**', 'dist/**'],\n\tnative: ['.github/**', '.yarn/**', 'node_modules/**', '.expo/**', 'android/**', 'ios/**'],\n\tlibrary: ['.github/**', '.yarn/**', 'node_modules/**', 'dist/**'],\n\tnest: ['.github/**', '.yarn/**', 'node_modules/**', 'dist/**'],\n};\n\nconst PACKAGE_PRESET_MAP: Record<string, string> = {\n\tnext: 'nextjs',\n\t'react-native': 'native',\n\treact: 'react',\n\t'@nestjs/core': 'nest',\n};\n\nconst DETECTION_PRIORITY = ['next', 'react-native', 'react', '@nestjs/core'];\n\nconst { values: options } = parseArgs({\n\toptions: {\n\t\tpreset: { type: 'string', short: 'p' },\n\t\ttailwind: { type: 'boolean', short: 't', default: false },\n\t\t'no-tailwind': { type: 'boolean', default: false },\n\t\ti18n: { type: 'boolean', default: false },\n\t\t'no-i18n': { type: 'boolean', default: false },\n\t\t'native-tailwind': { type: 'boolean', default: false },\n\t\t'no-native-tailwind': { type: 'boolean', default: false },\n\t\t'central-icons': { type: 'boolean', default: false },\n\t\t'no-central-icons': { type: 'boolean', default: false },\n\t\t'api-error': { type: 'boolean', default: false },\n\t\t'no-api-error': { type: 'boolean', default: false },\n\t\tquery: { type: 'boolean', default: false },\n\t\t'no-query': { type: 'boolean', default: false },\n\t\tyes: { type: 'boolean', short: 'y', default: false },\n\t\tcwd: { type: 'string' },\n\t\thelp: { type: 'boolean', short: 'h', default: false },\n\t},\n\tstrict: true,\n\tallowPositionals: false,\n});\n\nfunction printHelp(): void {\n\tconsole.log(`\n@imranbarbhuiya/oxc-config - Setup Oxlint and Oxfmt\n\nUsage:\n npx @imranbarbhuiya/oxc-config [options]\n\nOptions:\n -p, --preset <name> Preset to use (nextjs, react, node, native, library, nest)\n -t, --tailwind Include Tailwind CSS support\n --no-tailwind Exclude Tailwind CSS support\n --i18n Include next-intl i18n rules (Next.js)\n --no-i18n Exclude next-intl i18n rules\n --native-tailwind Include React Native Tailwind className rules\n --no-native-tailwind Exclude React Native Tailwind className rules\n --central-icons Include central-icons barrel-import rules\n --no-central-icons Exclude central-icons barrel-import rules\n --api-error Include ApiError rules for queryFn/mutationFn\n --no-api-error Exclude ApiError rules\n --query Include TanStack Query rules\n --no-query Exclude TanStack Query rules\n -y, --yes Skip prompts and use defaults\n --cwd <path> Working directory (defaults to current directory)\n -h, --help Show this help message\n\nExamples:\n npx @imranbarbhuiya/oxc-config\n npx @imranbarbhuiya/oxc-config --preset nextjs --tailwind\n npx @imranbarbhuiya/oxc-config -p react -y\n`);\n}\n\nfunction generateOxlintConfig(preset: string, includeTailwind: boolean, extras: ExtraConfigs): string {\n\tconst configs = [...PRESETS[preset].configs];\n\n\tif (includeTailwind) configs.push('tailwind');\n\tif (extras.i18n) configs.push('i18n');\n\tif (extras.nativeTailwind) configs.push('nativeTailwind');\n\tif (extras.centralIcons) configs.push('centralIcons');\n\tif (extras.apiError) configs.push('apiError');\n\n\tconst imports = configs.map((name) => {\n\t\tconst fragment = name === 'nativeTailwind' ? 'native-tailwind' : name;\n\t\treturn `import ${name} from '${PACKAGE_NAME}/${fragment}';`;\n\t});\n\n\tconst ignores = DEFAULT_IGNORES[preset].map((ignore) => `'${ignore}'`).join(', ');\n\tconst queryBlock = extras.query\n\t\t? `\n\tjsPlugins: [{ name: 'query', specifier: '@tanstack/eslint-plugin-query' }],\n\trules: {\n\t\t'query/exhaustive-deps': 'error',\n\t\t'query/no-rest-destructuring': 'error',\n\t\t'query/stable-query-client': 'error',\n\t},`\n\t\t: '';\n\n\tconst env =\n\t\tpreset === 'nextjs' || preset === 'react' || preset === 'native'\n\t\t\t? `{\n\t\tnode: true,\n\t\tbrowser: true,\n\t\tserviceworker: true,\n\t}`\n\t\t\t: `{\n\t\tnode: true,\n\t}`;\n\n\treturn `import { defineConfig } from 'oxlint';\n\n${imports.join('\\n')}\n\nexport default defineConfig({\n\textends: [${configs.join(', ')}],\n\tignorePatterns: [${ignores}],\n\tenv: ${env},\n\toptions: {\n\t\ttypeAware: true,\n\t},${queryBlock}\n});\n`;\n}\n\nfunction generateOxfmtConfig(): string {\n\treturn `import { defineConfig } from 'oxfmt';\n\nimport config from '${PACKAGE_NAME}/oxfmt';\n\nexport default defineConfig({\n\t...config,\n});\n`;\n}\n\nasync function fileExists(filePath: string): Promise<boolean> {\n\ttry {\n\t\tawait fs.access(filePath);\n\t\treturn true;\n\t} catch {\n\t\treturn false;\n\t}\n}\n\nasync function getDependencies(cwd: string): Promise<Record<string, string>> {\n\tconst packageJsonPath = path.join(cwd, 'package.json');\n\tif (!(await fileExists(packageJsonPath))) return {};\n\n\tconst content = await fs.readFile(packageJsonPath, 'utf8');\n\tconst packageJson = JSON.parse(content) as Record<string, unknown>;\n\n\treturn {\n\t\t...(packageJson.dependencies as Record<string, string> | undefined),\n\t\t...(packageJson.devDependencies as Record<string, string> | undefined),\n\t};\n}\n\nfunction detectPresetFromDependencies(dependencies: Record<string, string>): string | undefined {\n\tfor (const name of DETECTION_PRIORITY) if (dependencies[name]) return PACKAGE_PRESET_MAP[name];\n\treturn undefined;\n}\n\nfunction hasNextIntl(dependencies: Record<string, string>): boolean {\n\treturn Boolean(dependencies['next-intl']);\n}\n\nfunction hasCentralIcons(dependencies: Record<string, string>): boolean {\n\treturn Object.keys(dependencies).some(\n\t\t(name) => name.startsWith('@central-icons-react/') || name.startsWith('@central-icons-react-native/'),\n\t);\n}\n\nfunction hasTanstackQuery(dependencies: Record<string, string>): boolean {\n\treturn Boolean(dependencies['@tanstack/react-query']);\n}\n\nfunction hasTailwind(dependencies: Record<string, string>): boolean {\n\treturn Boolean(dependencies.tailwindcss || dependencies.nativewind);\n}\n\nasync function updateScripts(packageJsonPath: string): Promise<void> {\n\tif (!(await fileExists(packageJsonPath))) {\n\t\tp.log.error('No package.json found. Run this command in a project with package.json.');\n\t\tprocess.exit(1);\n\t}\n\n\tconst content = await fs.readFile(packageJsonPath, 'utf8');\n\tconst packageJson = JSON.parse(content) as Record<string, unknown>;\n\tconst scripts = (packageJson.scripts as Record<string, string> | undefined) ?? {};\n\n\tscripts.lint = 'oxlint --fix .';\n\tscripts['lint:check'] = 'oxlint .';\n\tscripts.format = 'oxfmt';\n\tscripts['format:check'] = 'oxfmt --check';\n\tpackageJson.scripts = scripts;\n\n\tawait fs.writeFile(packageJsonPath, JSON.stringify(packageJson, null, '\\t') + '\\n');\n}\n\nasync function installDependencies(cwd: string, includeQuery: boolean): Promise<string> {\n\tconst pm = await detectPackageManager(cwd);\n\tconst pmName = pm?.name ?? 'npm';\n\tconst dependencies = [PACKAGE_NAME, 'oxlint', 'oxlint-tsgolint', 'oxfmt'];\n\n\tif (includeQuery) dependencies.push('@tanstack/eslint-plugin-query');\n\n\tp.log.info(`Detected package manager: ${pmName}`);\n\tconst spinner = p.spinner();\n\tspinner.start('Installing dependencies');\n\n\tfor (const dependency of dependencies) {\n\t\tspinner.message(`Installing ${dependency}`);\n\t\tawait addDevDependency(dependency, { cwd, silent: true });\n\t}\n\n\tspinner.stop('Dependencies installed');\n\treturn pmName;\n}\n\nasync function confirmOverwrite(filePath: string, skipPrompts: boolean): Promise<void> {\n\tif (!(await fileExists(filePath)) || skipPrompts) return;\n\n\tconst result = await p.confirm({\n\t\tmessage: `${path.basename(filePath)} already exists. Overwrite?`,\n\t\tinitialValue: false,\n\t});\n\n\tif (p.isCancel(result)) {\n\t\tp.cancel('Operation cancelled.');\n\t\tprocess.exit(0);\n\t}\n\n\tif (!result) {\n\t\tp.cancel('Aborted.');\n\t\tprocess.exit(0);\n\t}\n}\n\nif (options.help) {\n\tprintHelp();\n\tprocess.exit(0);\n}\n\np.intro('@imranbarbhuiya/oxc-config setup');\n\nconst cwd = options.cwd ? path.resolve(options.cwd) : process.cwd();\nconst skipPrompts = options.yes;\nconst dependencies = await getDependencies(cwd);\n\nlet preset = options.preset;\nlet includeTailwind = options['no-tailwind'] ? false : options.tailwind ? true : undefined;\nlet includeI18n = options['no-i18n'] ? false : options.i18n ? true : undefined;\nlet includeNativeTailwind = options['no-native-tailwind'] ? false : options['native-tailwind'] ? true : undefined;\nlet includeCentralIcons = options['no-central-icons'] ? false : options['central-icons'] ? true : undefined;\nlet includeApiError = options['no-api-error'] ? false : options['api-error'] ? true : undefined;\nlet includeQuery = options['no-query'] ? false : options.query ? true : undefined;\n\nif (!preset) {\n\tconst detectedPreset = detectPresetFromDependencies(dependencies);\n\tif (skipPrompts) preset = detectedPreset ?? 'node';\n\telse {\n\t\tconst presetOptions = Object.entries(PRESETS).map(([value, config]) => ({\n\t\t\tvalue,\n\t\t\tlabel: value,\n\t\t\thint: config.description,\n\t\t}));\n\n\t\tif (detectedPreset) {\n\t\t\tconst detected = presetOptions.find((option) => option.value === detectedPreset);\n\t\t\tif (detected) {\n\t\t\t\tdetected.hint = `Detected: ${detected.hint}`;\n\t\t\t\tpresetOptions.splice(\n\t\t\t\t\t0,\n\t\t\t\t\tpresetOptions.length,\n\t\t\t\t\tdetected,\n\t\t\t\t\t...presetOptions.filter(({ value }) => value !== detectedPreset),\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tconst selected = await p.select({\n\t\t\tmessage: 'Select a preset',\n\t\t\toptions: presetOptions,\n\t\t});\n\n\t\tif (p.isCancel(selected)) {\n\t\t\tp.cancel('Operation cancelled.');\n\t\t\tprocess.exit(0);\n\t\t}\n\n\t\tpreset = selected;\n\t}\n}\n\nif (!(preset in PRESETS)) {\n\tp.log.error(`Unknown preset: ${preset}`);\n\tp.log.info(`Available presets: ${Object.keys(PRESETS).join(', ')}`);\n\tprocess.exit(1);\n}\n\nif (includeTailwind === undefined) {\n\tif (preset === 'node' || preset === 'library' || preset === 'nest') includeTailwind = false;\n\telse if (skipPrompts) includeTailwind = hasTailwind(dependencies);\n\telse {\n\t\tconst result = await p.confirm({\n\t\t\tmessage: 'Include Tailwind CSS support?',\n\t\t\tinitialValue: hasTailwind(dependencies),\n\t\t});\n\t\tif (p.isCancel(result)) {\n\t\t\tp.cancel('Operation cancelled.');\n\t\t\tprocess.exit(0);\n\t\t}\n\t\tincludeTailwind = result;\n\t}\n}\n\nif (includeI18n === undefined) {\n\tif (preset !== 'nextjs') includeI18n = false;\n\telse if (skipPrompts) includeI18n = hasNextIntl(dependencies);\n\telse {\n\t\tconst result = await p.confirm({\n\t\t\tmessage: 'Include next-intl i18n rules?',\n\t\t\tinitialValue: hasNextIntl(dependencies),\n\t\t});\n\t\tif (p.isCancel(result)) {\n\t\t\tp.cancel('Operation cancelled.');\n\t\t\tprocess.exit(0);\n\t\t}\n\t\tincludeI18n = result;\n\t}\n}\n\nif (includeNativeTailwind === undefined) {\n\tif (preset !== 'native' || !includeTailwind) includeNativeTailwind = false;\n\telse if (skipPrompts) includeNativeTailwind = true;\n\telse {\n\t\tconst result = await p.confirm({\n\t\t\tmessage: 'Include React Native Tailwind className rules?',\n\t\t\tinitialValue: true,\n\t\t});\n\t\tif (p.isCancel(result)) {\n\t\t\tp.cancel('Operation cancelled.');\n\t\t\tprocess.exit(0);\n\t\t}\n\t\tincludeNativeTailwind = result;\n\t}\n}\n\nif (includeCentralIcons === undefined) {\n\tif (preset !== 'native' && preset !== 'react' && preset !== 'nextjs') includeCentralIcons = false;\n\telse if (skipPrompts) includeCentralIcons = hasCentralIcons(dependencies);\n\telse {\n\t\tconst result = await p.confirm({\n\t\t\tmessage: 'Include central-icons barrel-import rules?',\n\t\t\tinitialValue: hasCentralIcons(dependencies),\n\t\t});\n\t\tif (p.isCancel(result)) {\n\t\t\tp.cancel('Operation cancelled.');\n\t\t\tprocess.exit(0);\n\t\t}\n\t\tincludeCentralIcons = result;\n\t}\n}\n\nif (includeQuery === undefined) {\n\tif (preset !== 'native' && preset !== 'react' && preset !== 'nextjs') includeQuery = false;\n\telse if (skipPrompts) includeQuery = hasTanstackQuery(dependencies);\n\telse {\n\t\tconst result = await p.confirm({\n\t\t\tmessage: 'Include TanStack Query rules?',\n\t\t\tinitialValue: hasTanstackQuery(dependencies),\n\t\t});\n\t\tif (p.isCancel(result)) {\n\t\t\tp.cancel('Operation cancelled.');\n\t\t\tprocess.exit(0);\n\t\t}\n\t\tincludeQuery = result;\n\t}\n}\n\nif (includeApiError === undefined) {\n\tif (preset !== 'native' && preset !== 'react' && preset !== 'nextjs') includeApiError = false;\n\telse if (skipPrompts) includeApiError = hasTanstackQuery(dependencies);\n\telse {\n\t\tconst result = await p.confirm({\n\t\t\tmessage: 'Include ApiError rules for queryFn/mutationFn?',\n\t\t\tinitialValue: hasTanstackQuery(dependencies),\n\t\t});\n\t\tif (p.isCancel(result)) {\n\t\t\tp.cancel('Operation cancelled.');\n\t\t\tprocess.exit(0);\n\t\t}\n\t\tincludeApiError = result;\n\t}\n}\n\np.log.step(`Setting up Oxlint and Oxfmt with preset: ${preset}`);\nif (includeTailwind) p.log.info('Including Tailwind CSS support');\nif (includeI18n) p.log.info('Including next-intl i18n rules');\nif (includeNativeTailwind) p.log.info('Including React Native Tailwind className rules');\nif (includeCentralIcons) p.log.info('Including central-icons barrel-import rules');\nif (includeQuery) p.log.info('Including TanStack Query rules');\nif (includeApiError) p.log.info('Including ApiError rules for queryFn/mutationFn');\n\nconst oxlintConfigPath = path.join(cwd, 'oxlint.config.ts');\nconst oxfmtConfigPath = path.join(cwd, 'oxfmt.config.ts');\nconst packageJsonPath = path.join(cwd, 'package.json');\n\nawait confirmOverwrite(oxlintConfigPath, skipPrompts);\nawait confirmOverwrite(oxfmtConfigPath, skipPrompts);\nawait fs.writeFile(\n\toxlintConfigPath,\n\tgenerateOxlintConfig(preset, includeTailwind, {\n\t\ti18n: includeI18n,\n\t\tnativeTailwind: includeNativeTailwind,\n\t\tcentralIcons: includeCentralIcons,\n\t\tquery: includeQuery,\n\t\tapiError: includeApiError,\n\t}),\n);\nawait fs.writeFile(oxfmtConfigPath, generateOxfmtConfig());\np.log.success('Created oxlint.config.ts and oxfmt.config.ts');\n\nawait updateScripts(packageJsonPath);\np.log.success('Updated package.json scripts');\n\nconst pmName = await installDependencies(cwd, includeQuery);\nconst runPrefix = pmName === 'npm' ? 'npm run' : pmName;\np.outro(`Setup complete! Run \\`${runPrefix} lint && ${runPrefix} format\\``);\n\nprocess.exit(0);\n"],"mappings":";;;;;;;;;AAsBA,MAAM,eAAe;AAErB,MAAM,UAAwC;CAC7C,QAAQ;EACP,SAAS;GAAC;GAAU;GAAQ;GAAc;GAAU;GAAS;GAAQ;EAAM;EAC3E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M;CACN,gBAAgB;CAChB,cAAc;CACd,OAAO;CACP,UAAU;AACX,CAAC,CACF;AACA,MAAM,GAAG,UAAU,iBAAiB,oBAAoB,CAAC;AACzD,EAAE,IAAI,QAAQ,8CAA8C;AAE5D,MAAM,cAAc,eAAe;AACnC,EAAE,IAAI,QAAQ,8BAA8B;AAE5C,MAAM,SAAS,MAAM,oBAAoB,KAAK,YAAY;AAC1D,MAAM,YAAY,WAAW,QAAQ,YAAY;AACjD,EAAE,MAAM,yBAAyB,UAAU,WAAW,UAAU,UAAU;AAE1E,QAAQ,KAAK,CAAC"}
|
package/dist/common.js
CHANGED
|
@@ -1,22 +1,17 @@
|
|
|
1
|
-
import { nativePlugins, packagePlugin } from "./config.js";
|
|
1
|
+
import { localPlugin, nativePlugins, packagePlugin } from "./config.js";
|
|
2
2
|
import { defineConfig } from "oxlint";
|
|
3
3
|
|
|
4
4
|
//#region src/common.ts
|
|
5
5
|
const config = defineConfig({
|
|
6
6
|
plugins: nativePlugins,
|
|
7
|
-
jsPlugins: [
|
|
8
|
-
packagePlugin("eslint-js", "oxlint-plugin-eslint"),
|
|
9
|
-
packagePlugin("import-js", "eslint-plugin-import-x"),
|
|
10
|
-
packagePlugin("unicorn-js", "eslint-plugin-unicorn")
|
|
11
|
-
],
|
|
7
|
+
jsPlugins: [localPlugin("mahir-restricted-syntax", "./plugins/restricted-syntax.js"), packagePlugin("import-js", "eslint-plugin-import-x")],
|
|
12
8
|
categories: { correctness: "off" },
|
|
13
9
|
options: { reportUnusedDisableDirectives: "warn" },
|
|
14
10
|
rules: {
|
|
15
11
|
"array-callback-return": 2,
|
|
16
|
-
"
|
|
12
|
+
"arrow-body-style": [2, "as-needed"],
|
|
17
13
|
"block-scoped-var": 2,
|
|
18
14
|
"consistent-return": 2,
|
|
19
|
-
"eslint-js/consistent-this": [2, "self"],
|
|
20
15
|
"constructor-super": 2,
|
|
21
16
|
curly: [2, "multi-or-nest"],
|
|
22
17
|
"default-case": 2,
|
|
@@ -49,7 +44,6 @@ const config = defineConfig({
|
|
|
49
44
|
}],
|
|
50
45
|
"import/no-mutable-exports": 2,
|
|
51
46
|
"import/no-self-import": 2,
|
|
52
|
-
"import-js/no-useless-path-segments": 2,
|
|
53
47
|
"import/no-webpack-loader-syntax": 2,
|
|
54
48
|
"import-js/order": 0,
|
|
55
49
|
"no-alert": 2,
|
|
@@ -65,7 +59,6 @@ const config = defineConfig({
|
|
|
65
59
|
"no-control-regex": 2,
|
|
66
60
|
"no-debugger": 2,
|
|
67
61
|
"no-delete-var": 2,
|
|
68
|
-
"eslint-js/no-dupe-args": 2,
|
|
69
62
|
"no-dupe-class-members": 2,
|
|
70
63
|
"no-dupe-else-if": 2,
|
|
71
64
|
"no-dupe-keys": 2,
|
|
@@ -101,8 +94,6 @@ const config = defineConfig({
|
|
|
101
94
|
"no-new-wrappers": 2,
|
|
102
95
|
"no-nonoctal-decimal-escape": 2,
|
|
103
96
|
"no-obj-calls": 2,
|
|
104
|
-
"eslint-js/no-octal": 2,
|
|
105
|
-
"eslint-js/no-octal-escape": 2,
|
|
106
97
|
"no-promise-executor-return": 2,
|
|
107
98
|
"no-proto": 2,
|
|
108
99
|
"no-prototype-builtins": 2,
|
|
@@ -123,7 +114,6 @@ const config = defineConfig({
|
|
|
123
114
|
"no-this-before-super": 2,
|
|
124
115
|
"no-throw-literal": 2,
|
|
125
116
|
"no-undef": 2,
|
|
126
|
-
"eslint-js/no-undef-init": 2,
|
|
127
117
|
"no-unexpected-multiline": 2,
|
|
128
118
|
"no-unmodified-loop-condition": 2,
|
|
129
119
|
"no-unneeded-ternary": 2,
|
|
@@ -174,7 +164,6 @@ const config = defineConfig({
|
|
|
174
164
|
radix: 2,
|
|
175
165
|
"require-yield": 2,
|
|
176
166
|
"sort-vars": 2,
|
|
177
|
-
"eslint-js/strict": [2, "never"],
|
|
178
167
|
"symbol-description": 2,
|
|
179
168
|
"unicode-bom": [2, "never"],
|
|
180
169
|
"unicorn/catch-error-name": [2, { name: "error" }],
|
|
@@ -184,13 +173,11 @@ const config = defineConfig({
|
|
|
184
173
|
"unicorn/escape-case": 2,
|
|
185
174
|
"unicorn/new-for-builtins": 2,
|
|
186
175
|
"unicorn/no-abusive-eslint-disable": 2,
|
|
187
|
-
"unicorn
|
|
176
|
+
"unicorn/no-array-for-each": 1,
|
|
188
177
|
"unicorn/no-array-method-this-argument": 2,
|
|
189
178
|
"unicorn/no-await-in-promise-methods": 2,
|
|
190
179
|
"unicorn/no-document-cookie": 2,
|
|
191
180
|
"unicorn/no-empty-file": 2,
|
|
192
|
-
"unicorn-js/no-for-loop": 2,
|
|
193
|
-
"unicorn-js/prefer-unicode-code-point-escapes": 2,
|
|
194
181
|
"unicorn/no-instanceof-array": 2,
|
|
195
182
|
"unicorn/no-invalid-remove-event-listener": 2,
|
|
196
183
|
"unicorn/no-lonely-if": 2,
|
|
@@ -205,7 +192,6 @@ const config = defineConfig({
|
|
|
205
192
|
"unicorn/no-typeof-undefined": 2,
|
|
206
193
|
"unicorn/no-unnecessary-await": 2,
|
|
207
194
|
"unicorn/no-unreadable-iife": 2,
|
|
208
|
-
"unicorn-js/no-unused-properties": 2,
|
|
209
195
|
"unicorn/no-useless-fallback-in-spread": 2,
|
|
210
196
|
"unicorn/no-useless-length-check": 2,
|
|
211
197
|
"unicorn/no-useless-promise-resolve-reject": 2,
|
|
@@ -250,7 +236,6 @@ const config = defineConfig({
|
|
|
250
236
|
"unicorn/require-array-join-separator": 2,
|
|
251
237
|
"unicorn/require-number-to-fixed-digits-argument": 2,
|
|
252
238
|
"unicorn/require-post-message-target-origin": 2,
|
|
253
|
-
"unicorn-js/template-indent": 2,
|
|
254
239
|
"unicorn/text-encoding-identifier-case": 2,
|
|
255
240
|
"unicorn/throw-new-error": 2,
|
|
256
241
|
"use-isnan": 2,
|
package/dist/common.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","names":[],"sources":["../src/common.ts"],"sourcesContent":["import { defineConfig } from 'oxlint';\n\nimport { nativePlugins, packagePlugin } from './config.js';\n\nimport type { OxlintConfig } from 'oxlint';\n\nconst rules: NonNullable<OxlintConfig['rules']> = {\n\t'array-callback-return': 2,\n\t'eslint-js/arrow-body-style': [2, 'as-needed'],\n\t'block-scoped-var': 2,\n\t'consistent-return': 2,\n\t'eslint-js/consistent-this': [2, 'self'],\n\t'constructor-super': 2,\n\tcurly: [2, 'multi-or-nest'],\n\t'default-case': 2,\n\t'default-case-last': 2,\n\t'default-param-last': 2,\n\t'dot-notation': 2,\n\teqeqeq: 2,\n\t'for-direction': 2,\n\t'func-name-matching': 2,\n\t'func-names': [2, 'as-needed'],\n\t'func-style': [\n\t\t2,\n\t\t'declaration',\n\t\t{\n\t\t\tallowArrowFunctions: true,\n\t\t},\n\t],\n\t'getter-return': 2,\n\t'grouped-accessor-pairs': [2, 'getBeforeSet'],\n\t'guard-for-in': 2,\n\t'import/export': 2,\n\t'import/first': 2,\n\t'import/newline-after-import': 2,\n\t'import/no-absolute-path': 2,\n\t'import/no-amd': 2,\n\t'import/no-duplicates': 2,\n\t'import/no-dynamic-require': 2,\n\t'import-js/no-extraneous-dependencies': [\n\t\t2,\n\t\t{\n\t\t\tdevDependencies: true,\n\t\t\toptionalDependencies: true,\n\t\t\tpeerDependencies: true,\n\t\t},\n\t],\n\t'import/no-mutable-exports': 2,\n\t'import/no-self-import': 2,\n\t'import-js/no-useless-path-segments': 2,\n\t'import/no-webpack-loader-syntax': 2,\n\t'import-js/order': 0,\n\t'no-alert': 2,\n\t'no-array-constructor': 2,\n\t'no-async-promise-executor': 2,\n\t'no-caller': 2,\n\t'no-case-declarations': 2,\n\t'no-class-assign': 2,\n\t'no-compare-neg-zero': 2,\n\t'no-cond-assign': 2,\n\t'no-const-assign': 2,\n\t'no-constructor-return': 2,\n\t'no-control-regex': 2,\n\t'no-debugger': 2,\n\t'no-delete-var': 2,\n\t'eslint-js/no-dupe-args': 2,\n\t'no-dupe-class-members': 2,\n\t'no-dupe-else-if': 2,\n\t'no-dupe-keys': 2,\n\t'no-duplicate-case': 2,\n\t'no-empty-character-class': 2,\n\t'no-empty-pattern': 2,\n\t'no-eval': 2,\n\t'no-ex-assign': 2,\n\t'no-extend-native': 2,\n\t'no-extra-bind': 2,\n\t'no-extra-boolean-cast': 2,\n\t'no-extra-label': 2,\n\t'no-fallthrough': 2,\n\t'no-func-assign': 2,\n\t'no-global-assign': 2,\n\t'no-implicit-coercion': 2,\n\t'no-implicit-globals': 2,\n\t'no-implied-eval': 2,\n\t'no-import-assign': 2,\n\t'no-inner-declarations': 2,\n\t'no-invalid-regexp': 2,\n\t'no-irregular-whitespace': 2,\n\t'no-iterator': 2,\n\t'no-label-var': 2,\n\t'no-labels': 2,\n\t'no-lone-blocks': 2,\n\t'no-lonely-if': 2,\n\t'no-loss-of-precision': 2,\n\t'no-misleading-character-class': 2,\n\t'no-multi-assign': 2,\n\t'no-multi-str': 2,\n\t'no-new-func': 2,\n\t'no-new-wrappers': 2,\n\t'no-nonoctal-decimal-escape': 2,\n\t'no-obj-calls': 2,\n\t'eslint-js/no-octal': 2,\n\t'eslint-js/no-octal-escape': 2,\n\t'no-promise-executor-return': 2,\n\t'no-proto': 2,\n\t'no-prototype-builtins': 2,\n\t'no-redeclare': [\n\t\t2,\n\t\t{\n\t\t\tbuiltinGlobals: true,\n\t\t},\n\t],\n\t'no-regex-spaces': 2,\n\t'no-return-assign': 2,\n\t'no-script-url': 2,\n\t'no-self-assign': 2,\n\t'no-self-compare': 2,\n\t'no-sequences': 2,\n\t'no-setter-return': 2,\n\t'no-shadow': [\n\t\t2,\n\t\t{\n\t\t\tbuiltinGlobals: false,\n\t\t\thoist: 'all',\n\t\t},\n\t],\n\t'no-shadow-restricted-names': 2,\n\t'no-template-curly-in-string': 2,\n\t'no-this-before-super': 2,\n\t'no-throw-literal': 2,\n\t'no-undef': 2,\n\t'eslint-js/no-undef-init': 2,\n\t'no-unexpected-multiline': 2,\n\t'no-unmodified-loop-condition': 2,\n\t'no-unneeded-ternary': 2,\n\t'no-unreachable-loop': 2,\n\t'no-unsafe-finally': 2,\n\t'no-unsafe-negation': 2,\n\t'no-unsafe-optional-chaining': 2,\n\t'no-unused-expressions': 2,\n\t'no-unused-labels': 2,\n\t'no-unused-vars': 2,\n\t'no-use-before-define': [\n\t\t2,\n\t\t{\n\t\t\tclasses: true,\n\t\t\tfunctions: false,\n\t\t\tvariables: true,\n\t\t},\n\t],\n\t'no-useless-backreference': 2,\n\t'no-useless-call': 2,\n\t'no-useless-catch': 2,\n\t'no-useless-computed-key': 2,\n\t'no-useless-concat': 2,\n\t'no-useless-constructor': 2,\n\t'no-useless-escape': 2,\n\t'no-useless-rename': [\n\t\t2,\n\t\t{\n\t\t\tignoreDestructuring: false,\n\t\t\tignoreExport: false,\n\t\t\tignoreImport: false,\n\t\t},\n\t],\n\t'no-useless-return': 2,\n\t'no-var': 2,\n\t'no-with': 2,\n\t'object-shorthand': [2, 'always'],\n\t'one-var': [2, 'never'],\n\t'operator-assignment': [2, 'always'],\n\t'prefer-arrow-callback': 2,\n\t'prefer-const': 2,\n\t'prefer-exponentiation-operator': 2,\n\t'prefer-numeric-literals': 2,\n\t'prefer-object-has-own': 2,\n\t'prefer-object-spread': 2,\n\t'prefer-promise-reject-errors': 2,\n\t'prefer-regex-literals': [\n\t\t2,\n\t\t{\n\t\t\tdisallowRedundantWrapping: true,\n\t\t},\n\t],\n\t'prefer-rest-params': 2,\n\t'prefer-spread': 2,\n\t'promise/param-names': 2,\n\t'promise/prefer-await-to-callbacks': 1,\n\t'promise/prefer-await-to-then': 2,\n\t'promise/valid-params': 2,\n\tradix: 2,\n\t'require-yield': 2,\n\t'sort-vars': 2,\n\t'eslint-js/strict': [2, 'never'],\n\t'symbol-description': 2,\n\t'unicode-bom': [2, 'never'],\n\t'unicorn/catch-error-name': [\n\t\t2,\n\t\t{\n\t\t\tname: 'error',\n\t\t},\n\t],\n\t'unicorn/consistent-function-scoping': 2,\n\t'unicorn/empty-brace-spaces': 2,\n\t'unicorn/error-message': 2,\n\t'unicorn/escape-case': 2,\n\t'unicorn/new-for-builtins': 2,\n\t'unicorn/no-abusive-eslint-disable': 2,\n\t'unicorn-js/no-for-each': 1,\n\t'unicorn/no-array-method-this-argument': 2,\n\t'unicorn/no-await-in-promise-methods': 2,\n\t'unicorn/no-document-cookie': 2,\n\t'unicorn/no-empty-file': 2,\n\t'unicorn-js/no-for-loop': 2,\n\t'unicorn-js/prefer-unicode-code-point-escapes': 2,\n\t'unicorn/no-instanceof-array': 2,\n\t'unicorn/no-invalid-remove-event-listener': 2,\n\t'unicorn/no-lonely-if': 2,\n\t'unicorn/no-negated-condition': 2,\n\t'unicorn/no-new-array': 2,\n\t'unicorn/no-new-buffer': 2,\n\t'unicorn/no-object-as-default-parameter': 2,\n\t'unicorn/no-single-promise-in-promise-methods': 2,\n\t'unicorn/no-static-only-class': 2,\n\t'unicorn/no-thenable': 2,\n\t'unicorn/no-this-assignment': 2,\n\t'unicorn/no-typeof-undefined': 2,\n\t'unicorn/no-unnecessary-await': 2,\n\t'unicorn/no-unreadable-iife': 2,\n\t'unicorn-js/no-unused-properties': 2,\n\t'unicorn/no-useless-fallback-in-spread': 2,\n\t'unicorn/no-useless-length-check': 2,\n\t'unicorn/no-useless-promise-resolve-reject': 2,\n\t'unicorn/no-useless-spread': 2,\n\t'unicorn/no-useless-switch-case': 2,\n\t'unicorn/no-zero-fractions': 2,\n\t'unicorn/numeric-separators-style': [\n\t\t2,\n\t\t{\n\t\t\tbinary: {\n\t\t\t\tonlyIfContainsSeparator: true,\n\t\t\t},\n\t\t\thexadecimal: {\n\t\t\t\tonlyIfContainsSeparator: true,\n\t\t\t},\n\t\t\tnumber: {\n\t\t\t\tgroupLength: 3,\n\t\t\t\tminimumDigits: 0,\n\t\t\t},\n\t\t\toctal: {\n\t\t\t\tonlyIfContainsSeparator: true,\n\t\t\t},\n\t\t},\n\t],\n\t'unicorn/prefer-array-find': 2,\n\t'unicorn/prefer-array-flat': 2,\n\t'unicorn/prefer-array-flat-map': 2,\n\t'unicorn/prefer-array-index-of': 2,\n\t'unicorn/prefer-array-some': 2,\n\t'unicorn/prefer-code-point': 2,\n\t'unicorn/prefer-date-now': 2,\n\t'unicorn/prefer-default-parameters': 2,\n\t'unicorn/prefer-export-from': 2,\n\t'unicorn/prefer-includes': 2,\n\t'unicorn/prefer-math-trunc': 2,\n\t'unicorn/prefer-modern-math-apis': 2,\n\t'unicorn/prefer-native-coercion-functions': 2,\n\t'unicorn/prefer-number-properties': 2,\n\t'unicorn/prefer-object-from-entries': 2,\n\t'unicorn/prefer-optional-catch-binding': 2,\n\t'unicorn/prefer-query-selector': 2,\n\t'unicorn/prefer-reflect-apply': 2,\n\t'unicorn/prefer-regexp-test': 2,\n\t'unicorn/prefer-set-size': 2,\n\t'unicorn/prefer-string-replace-all': 2,\n\t'unicorn/prefer-string-slice': 2,\n\t'unicorn/prefer-string-starts-ends-with': 2,\n\t'unicorn/prefer-string-trim-start-end': 2,\n\t'unicorn/prefer-type-error': 2,\n\t'unicorn/relative-url-style': [2, 'never'],\n\t'unicorn/require-array-join-separator': 2,\n\t'unicorn/require-number-to-fixed-digits-argument': 2,\n\t'unicorn/require-post-message-target-origin': 2,\n\t'unicorn-js/template-indent': 2,\n\t'unicorn/text-encoding-identifier-case': 2,\n\t'unicorn/throw-new-error': 2,\n\t'use-isnan': 2,\n\t'valid-typeof': [\n\t\t2,\n\t\t{\n\t\t\trequireStringLiterals: true,\n\t\t},\n\t],\n\t'vars-on-top': 2,\n\tyoda: [2, 'never'],\n};\n\nconst config = defineConfig({\n\tplugins: nativePlugins,\n\tjsPlugins: [\n\t\tpackagePlugin('eslint-js', 'oxlint-plugin-eslint'),\n\t\tpackagePlugin('import-js', 'eslint-plugin-import-x'),\n\t\tpackagePlugin('unicorn-js', 'eslint-plugin-unicorn'),\n\t],\n\tcategories: {\n\t\tcorrectness: 'off',\n\t},\n\toptions: {\n\t\treportUnusedDisableDirectives: 'warn',\n\t},\n\trules,\n});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C7B,mCAAmC;EACnC,4CAA4C;EAC5C,oCAAoC;EACpC,sCAAsC;EACtC,yCAAyC;EACzC,iCAAiC;EACjC,gCAAgC;EAChC,8BAA8B;EAC9B,2BAA2B;EAC3B,qCAAqC;EACrC,+BAA+B;EAC/B,0CAA0C;EAC1C,wCAAwC;EACxC,6BAA6B;EAC7B,8BAA8B,CAAC,GAAG,OAAO;EACzC,wCAAwC;EACxC,mDAAmD;EACnD,8CAA8C;EAC9C,8BAA8B;EAC9B,yCAAyC;EACzC,2BAA2B;EAC3B,aAAa;EACb,gBAAgB,CACf,GACA,EACC,uBAAuB,KACxB,CACD;EACA,eAAe;EACf,MAAM,CAAC,GAAG,OAAO;CAgBb;AACL,CAAC"}
|
|
1
|
+
{"version":3,"file":"common.js","names":[],"sources":["../src/common.ts"],"sourcesContent":["import { defineConfig } from 'oxlint';\n\nimport { localPlugin, nativePlugins, packagePlugin } from './config.js';\n\nimport type { OxlintConfig } from 'oxlint';\n\nconst rules: NonNullable<OxlintConfig['rules']> = {\n\t'array-callback-return': 2,\n\t'arrow-body-style': [2, 'as-needed'],\n\t'block-scoped-var': 2,\n\t'consistent-return': 2,\n\t'constructor-super': 2,\n\tcurly: [2, 'multi-or-nest'],\n\t'default-case': 2,\n\t'default-case-last': 2,\n\t'default-param-last': 2,\n\t'dot-notation': 2,\n\teqeqeq: 2,\n\t'for-direction': 2,\n\t'func-name-matching': 2,\n\t'func-names': [2, 'as-needed'],\n\t'func-style': [\n\t\t2,\n\t\t'declaration',\n\t\t{\n\t\t\tallowArrowFunctions: true,\n\t\t},\n\t],\n\t'getter-return': 2,\n\t'grouped-accessor-pairs': [2, 'getBeforeSet'],\n\t'guard-for-in': 2,\n\t'import/export': 2,\n\t'import/first': 2,\n\t'import/newline-after-import': 2,\n\t'import/no-absolute-path': 2,\n\t'import/no-amd': 2,\n\t'import/no-duplicates': 2,\n\t'import/no-dynamic-require': 2,\n\t'import-js/no-extraneous-dependencies': [\n\t\t2,\n\t\t{\n\t\t\tdevDependencies: true,\n\t\t\toptionalDependencies: true,\n\t\t\tpeerDependencies: true,\n\t\t},\n\t],\n\t'import/no-mutable-exports': 2,\n\t'import/no-self-import': 2,\n\t'import/no-webpack-loader-syntax': 2,\n\t'import-js/order': 0,\n\t'no-alert': 2,\n\t'no-array-constructor': 2,\n\t'no-async-promise-executor': 2,\n\t'no-caller': 2,\n\t'no-case-declarations': 2,\n\t'no-class-assign': 2,\n\t'no-compare-neg-zero': 2,\n\t'no-cond-assign': 2,\n\t'no-const-assign': 2,\n\t'no-constructor-return': 2,\n\t'no-control-regex': 2,\n\t'no-debugger': 2,\n\t'no-delete-var': 2,\n\t'no-dupe-class-members': 2,\n\t'no-dupe-else-if': 2,\n\t'no-dupe-keys': 2,\n\t'no-duplicate-case': 2,\n\t'no-empty-character-class': 2,\n\t'no-empty-pattern': 2,\n\t'no-eval': 2,\n\t'no-ex-assign': 2,\n\t'no-extend-native': 2,\n\t'no-extra-bind': 2,\n\t'no-extra-boolean-cast': 2,\n\t'no-extra-label': 2,\n\t'no-fallthrough': 2,\n\t'no-func-assign': 2,\n\t'no-global-assign': 2,\n\t'no-implicit-coercion': 2,\n\t'no-implicit-globals': 2,\n\t'no-implied-eval': 2,\n\t'no-import-assign': 2,\n\t'no-inner-declarations': 2,\n\t'no-invalid-regexp': 2,\n\t'no-irregular-whitespace': 2,\n\t'no-iterator': 2,\n\t'no-label-var': 2,\n\t'no-labels': 2,\n\t'no-lone-blocks': 2,\n\t'no-lonely-if': 2,\n\t'no-loss-of-precision': 2,\n\t'no-misleading-character-class': 2,\n\t'no-multi-assign': 2,\n\t'no-multi-str': 2,\n\t'no-new-func': 2,\n\t'no-new-wrappers': 2,\n\t'no-nonoctal-decimal-escape': 2,\n\t'no-obj-calls': 2,\n\t'no-promise-executor-return': 2,\n\t'no-proto': 2,\n\t'no-prototype-builtins': 2,\n\t'no-redeclare': [\n\t\t2,\n\t\t{\n\t\t\tbuiltinGlobals: true,\n\t\t},\n\t],\n\t'no-regex-spaces': 2,\n\t'no-return-assign': 2,\n\t'no-script-url': 2,\n\t'no-self-assign': 2,\n\t'no-self-compare': 2,\n\t'no-sequences': 2,\n\t'no-setter-return': 2,\n\t'no-shadow': [\n\t\t2,\n\t\t{\n\t\t\tbuiltinGlobals: false,\n\t\t\thoist: 'all',\n\t\t},\n\t],\n\t'no-shadow-restricted-names': 2,\n\t'no-template-curly-in-string': 2,\n\t'no-this-before-super': 2,\n\t'no-throw-literal': 2,\n\t'no-undef': 2,\n\t'no-unexpected-multiline': 2,\n\t'no-unmodified-loop-condition': 2,\n\t'no-unneeded-ternary': 2,\n\t'no-unreachable-loop': 2,\n\t'no-unsafe-finally': 2,\n\t'no-unsafe-negation': 2,\n\t'no-unsafe-optional-chaining': 2,\n\t'no-unused-expressions': 2,\n\t'no-unused-labels': 2,\n\t'no-unused-vars': 2,\n\t'no-use-before-define': [\n\t\t2,\n\t\t{\n\t\t\tclasses: true,\n\t\t\tfunctions: false,\n\t\t\tvariables: true,\n\t\t},\n\t],\n\t'no-useless-backreference': 2,\n\t'no-useless-call': 2,\n\t'no-useless-catch': 2,\n\t'no-useless-computed-key': 2,\n\t'no-useless-concat': 2,\n\t'no-useless-constructor': 2,\n\t'no-useless-escape': 2,\n\t'no-useless-rename': [\n\t\t2,\n\t\t{\n\t\t\tignoreDestructuring: false,\n\t\t\tignoreExport: false,\n\t\t\tignoreImport: false,\n\t\t},\n\t],\n\t'no-useless-return': 2,\n\t'no-var': 2,\n\t'no-with': 2,\n\t'object-shorthand': [2, 'always'],\n\t'one-var': [2, 'never'],\n\t'operator-assignment': [2, 'always'],\n\t'prefer-arrow-callback': 2,\n\t'prefer-const': 2,\n\t'prefer-exponentiation-operator': 2,\n\t'prefer-numeric-literals': 2,\n\t'prefer-object-has-own': 2,\n\t'prefer-object-spread': 2,\n\t'prefer-promise-reject-errors': 2,\n\t'prefer-regex-literals': [\n\t\t2,\n\t\t{\n\t\t\tdisallowRedundantWrapping: true,\n\t\t},\n\t],\n\t'prefer-rest-params': 2,\n\t'prefer-spread': 2,\n\t'promise/param-names': 2,\n\t'promise/prefer-await-to-callbacks': 1,\n\t'promise/prefer-await-to-then': 2,\n\t'promise/valid-params': 2,\n\tradix: 2,\n\t'require-yield': 2,\n\t'sort-vars': 2,\n\t'symbol-description': 2,\n\t'unicode-bom': [2, 'never'],\n\t'unicorn/catch-error-name': [\n\t\t2,\n\t\t{\n\t\t\tname: 'error',\n\t\t},\n\t],\n\t'unicorn/consistent-function-scoping': 2,\n\t'unicorn/empty-brace-spaces': 2,\n\t'unicorn/error-message': 2,\n\t'unicorn/escape-case': 2,\n\t'unicorn/new-for-builtins': 2,\n\t'unicorn/no-abusive-eslint-disable': 2,\n\t'unicorn/no-array-for-each': 1,\n\t'unicorn/no-array-method-this-argument': 2,\n\t'unicorn/no-await-in-promise-methods': 2,\n\t'unicorn/no-document-cookie': 2,\n\t'unicorn/no-empty-file': 2,\n\t'unicorn/no-instanceof-array': 2,\n\t'unicorn/no-invalid-remove-event-listener': 2,\n\t'unicorn/no-lonely-if': 2,\n\t'unicorn/no-negated-condition': 2,\n\t'unicorn/no-new-array': 2,\n\t'unicorn/no-new-buffer': 2,\n\t'unicorn/no-object-as-default-parameter': 2,\n\t'unicorn/no-single-promise-in-promise-methods': 2,\n\t'unicorn/no-static-only-class': 2,\n\t'unicorn/no-thenable': 2,\n\t'unicorn/no-this-assignment': 2,\n\t'unicorn/no-typeof-undefined': 2,\n\t'unicorn/no-unnecessary-await': 2,\n\t'unicorn/no-unreadable-iife': 2,\n\t'unicorn/no-useless-fallback-in-spread': 2,\n\t'unicorn/no-useless-length-check': 2,\n\t'unicorn/no-useless-promise-resolve-reject': 2,\n\t'unicorn/no-useless-spread': 2,\n\t'unicorn/no-useless-switch-case': 2,\n\t'unicorn/no-zero-fractions': 2,\n\t'unicorn/numeric-separators-style': [\n\t\t2,\n\t\t{\n\t\t\tbinary: {\n\t\t\t\tonlyIfContainsSeparator: true,\n\t\t\t},\n\t\t\thexadecimal: {\n\t\t\t\tonlyIfContainsSeparator: true,\n\t\t\t},\n\t\t\tnumber: {\n\t\t\t\tgroupLength: 3,\n\t\t\t\tminimumDigits: 0,\n\t\t\t},\n\t\t\toctal: {\n\t\t\t\tonlyIfContainsSeparator: true,\n\t\t\t},\n\t\t},\n\t],\n\t'unicorn/prefer-array-find': 2,\n\t'unicorn/prefer-array-flat': 2,\n\t'unicorn/prefer-array-flat-map': 2,\n\t'unicorn/prefer-array-index-of': 2,\n\t'unicorn/prefer-array-some': 2,\n\t'unicorn/prefer-code-point': 2,\n\t'unicorn/prefer-date-now': 2,\n\t'unicorn/prefer-default-parameters': 2,\n\t'unicorn/prefer-export-from': 2,\n\t'unicorn/prefer-includes': 2,\n\t'unicorn/prefer-math-trunc': 2,\n\t'unicorn/prefer-modern-math-apis': 2,\n\t'unicorn/prefer-native-coercion-functions': 2,\n\t'unicorn/prefer-number-properties': 2,\n\t'unicorn/prefer-object-from-entries': 2,\n\t'unicorn/prefer-optional-catch-binding': 2,\n\t'unicorn/prefer-query-selector': 2,\n\t'unicorn/prefer-reflect-apply': 2,\n\t'unicorn/prefer-regexp-test': 2,\n\t'unicorn/prefer-set-size': 2,\n\t'unicorn/prefer-string-replace-all': 2,\n\t'unicorn/prefer-string-slice': 2,\n\t'unicorn/prefer-string-starts-ends-with': 2,\n\t'unicorn/prefer-string-trim-start-end': 2,\n\t'unicorn/prefer-type-error': 2,\n\t'unicorn/relative-url-style': [2, 'never'],\n\t'unicorn/require-array-join-separator': 2,\n\t'unicorn/require-number-to-fixed-digits-argument': 2,\n\t'unicorn/require-post-message-target-origin': 2,\n\t'unicorn/text-encoding-identifier-case': 2,\n\t'unicorn/throw-new-error': 2,\n\t'use-isnan': 2,\n\t'valid-typeof': [\n\t\t2,\n\t\t{\n\t\t\trequireStringLiterals: true,\n\t\t},\n\t],\n\t'vars-on-top': 2,\n\tyoda: [2, 'never'],\n};\n\nconst config = defineConfig({\n\tplugins: nativePlugins,\n\tjsPlugins: [\n\t\tlocalPlugin('mahir-restricted-syntax', './plugins/restricted-syntax.js'),\n\t\tpackagePlugin('import-js', 'eslint-plugin-import-x'),\n\t],\n\tcategories: {\n\t\tcorrectness: 'off',\n\t},\n\toptions: {\n\t\treportUnusedDisableDirectives: 'warn',\n\t},\n\trules,\n});\n\nexport default config;\n"],"mappings":";;;;AA8RA,MAAM,SAAS,aAAa;CAC3B,SAAS;CACT,WAAW,CACV,YAAY,2BAA2B,gCAAgC,GACvE,cAAc,aAAa,wBAAwB,CACpD;CACA,YAAY,EACX,aAAa,MACd;CACA,SAAS,EACR,+BAA+B,OAChC;CACA;EAnSA,yBAAyB;EACzB,oBAAoB,CAAC,GAAG,WAAW;EACnC,oBAAoB;EACpB,qBAAqB;EACrB,qBAAqB;EACrB,OAAO,CAAC,GAAG,eAAe;EAC1B,gBAAgB;EAChB,qBAAqB;EACrB,sBAAsB;EACtB,gBAAgB;EAChB,QAAQ;EACR,iBAAiB;EACjB,sBAAsB;EACtB,cAAc,CAAC,GAAG,WAAW;EAC7B,cAAc;GACb;GACA;GACA,EACC,qBAAqB,KACtB;EACD;EACA,iBAAiB;EACjB,0BAA0B,CAAC,GAAG,cAAc;EAC5C,gBAAgB;EAChB,iBAAiB;EACjB,gBAAgB;EAChB,+BAA+B;EAC/B,2BAA2B;EAC3B,iBAAiB;EACjB,wBAAwB;EACxB,6BAA6B;EAC7B,wCAAwC,CACvC,GACA;GACC,iBAAiB;GACjB,sBAAsB;GACtB,kBAAkB;EACnB,CACD;EACA,6BAA6B;EAC7B,yBAAyB;EACzB,mCAAmC;EACnC,mBAAmB;EACnB,YAAY;EACZ,wBAAwB;EACxB,6BAA6B;EAC7B,aAAa;EACb,wBAAwB;EACxB,mBAAmB;EACnB,uBAAuB;EACvB,kBAAkB;EAClB,mBAAmB;EACnB,yBAAyB;EACzB,oBAAoB;EACpB,eAAe;EACf,iBAAiB;EACjB,yBAAyB;EACzB,mBAAmB;EACnB,gBAAgB;EAChB,qBAAqB;E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4CAA4C;EAC5C,oCAAoC;EACpC,sCAAsC;EACtC,yCAAyC;EACzC,iCAAiC;EACjC,gCAAgC;EAChC,8BAA8B;EAC9B,2BAA2B;EAC3B,qCAAqC;EACrC,+BAA+B;EAC/B,0CAA0C;EAC1C,wCAAwC;EACxC,6BAA6B;EAC7B,8BAA8B,CAAC,GAAG,OAAO;EACzC,wCAAwC;EACxC,mDAAmD;EACnD,8CAA8C;EAC9C,yCAAyC;EACzC,2BAA2B;EAC3B,aAAa;EACb,gBAAgB,CACf,GACA,EACC,uBAAuB,KACxB,CACD;EACA,eAAe;EACf,MAAM,CAAC,GAAG,OAAO;CAeb;AACL,CAAC"}
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","names":[],"sources":["../src/config.ts"],"sourcesContent":["import { fileURLToPath, URL } from 'node:url';\n\nimport type { ExternalPluginEntry, OxlintConfig } from 'oxlint';\n\nexport const nativePlugins: NonNullable<OxlintConfig['plugins']> = [\n\t'eslint',\n\t'typescript',\n\t'unicorn',\n\t'oxc',\n\t'import',\n\t'jsdoc',\n\t'react',\n\t'nextjs',\n\t'promise',\n\t'node',\n];\n\nexport function packagePlugin(name: string, specifier: string): ExternalPluginEntry {\n\treturn { name, specifier: fileURLToPath(import.meta.resolve(specifier)) };\n}\n\nexport function localPlugin(name: string, path: string): ExternalPluginEntry {\n\treturn { name, specifier: fileURLToPath(new URL(path, import.meta.url)) };\n}\n"],"mappings":";;;AAIA,MAAa,gBAAsD;CAClE;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;AAEA,SAAgB,cAAc,MAAc,WAAwC;CACnF,OAAO;EAAE;EAAM,WAAW,cAAc,
|
|
1
|
+
{"version":3,"file":"config.js","names":[],"sources":["../src/config.ts"],"sourcesContent":["import { fileURLToPath, URL } from 'node:url';\n\nimport type { ExternalPluginEntry, OxlintConfig } from 'oxlint';\n\nexport const nativePlugins: NonNullable<OxlintConfig['plugins']> = [\n\t'eslint',\n\t'typescript',\n\t'unicorn',\n\t'oxc',\n\t'import',\n\t'jsdoc',\n\t'react',\n\t'nextjs',\n\t'promise',\n\t'node',\n];\n\nexport function packagePlugin(name: string, specifier: string): ExternalPluginEntry {\n\treturn { name, specifier: fileURLToPath(import.meta.resolve(specifier)) };\n}\n\nexport function localPlugin(name: string, path: string): ExternalPluginEntry {\n\treturn { name, specifier: fileURLToPath(new URL(path, import.meta.url)) };\n}\n"],"mappings":";;;AAIA,MAAa,gBAAsD;CAClE;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;AAEA,SAAgB,cAAc,MAAc,WAAwC;CACnF,OAAO;EAAE;EAAM,WAAW,cAAc,YAAY,QAAQ,SAAS,CAAC;CAAE;AACzE;AAEA,SAAgB,YAAY,MAAc,MAAmC;CAC5E,OAAO;EAAE;EAAM,WAAW,cAAc,IAAI,IAAI,MAAM,YAAY,GAAG,CAAC;CAAE;AACzE"}
|
package/dist/nest.js
CHANGED
|
@@ -4,7 +4,7 @@ import { defineConfig } from "oxlint";
|
|
|
4
4
|
//#region src/nest.ts
|
|
5
5
|
const config = defineConfig({
|
|
6
6
|
plugins: nativePlugins,
|
|
7
|
-
jsPlugins: [localPlugin("nestjs-typed", "./nest
|
|
7
|
+
jsPlugins: [localPlugin("nestjs-typed", "./plugins/nest.js")],
|
|
8
8
|
rules: { "nestjs-typed/sort-module-metadata-arrays": 2 }
|
|
9
9
|
});
|
|
10
10
|
|
package/dist/nest.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nest.js","names":[],"sources":["../src/nest.ts"],"sourcesContent":["import { defineConfig } from 'oxlint';\n\nimport { localPlugin, nativePlugins } from './config.js';\n\nimport type { OxlintConfig } from 'oxlint';\n\nconst rules: NonNullable<OxlintConfig['rules']> = {\n\t'nestjs-typed/sort-module-metadata-arrays': 2,\n};\n\nconst config = defineConfig({\n\tplugins: nativePlugins,\n\tjsPlugins: [localPlugin('nestjs-typed', './nest
|
|
1
|
+
{"version":3,"file":"nest.js","names":[],"sources":["../src/nest.ts"],"sourcesContent":["import { defineConfig } from 'oxlint';\n\nimport { localPlugin, nativePlugins } from './config.js';\n\nimport type { OxlintConfig } from 'oxlint';\n\nconst rules: NonNullable<OxlintConfig['rules']> = {\n\t'nestjs-typed/sort-module-metadata-arrays': 2,\n};\n\nconst config = defineConfig({\n\tplugins: nativePlugins,\n\tjsPlugins: [localPlugin('nestjs-typed', './plugins/nest.js')],\n\trules,\n});\n\nexport default config;\n"],"mappings":";;;;AAUA,MAAM,SAAS,aAAa;CAC3B,SAAS;CACT,WAAW,CAAC,YAAY,gBAAgB,mBAAmB,CAAC;CAC5D,SANA,4CAA4C,EAMxC;AACL,CAAC"}
|
package/dist/node.js
CHANGED
|
@@ -19,13 +19,6 @@ const config = defineConfig({
|
|
|
19
19
|
ignores: ["existsSync"]
|
|
20
20
|
}],
|
|
21
21
|
"node-js/no-unpublished-bin": 2,
|
|
22
|
-
"node-js/prefer-global/buffer": [2, "never"],
|
|
23
|
-
"node-js/prefer-global/console": [2, "always"],
|
|
24
|
-
"node-js/prefer-global/process": [2, "never"],
|
|
25
|
-
"node-js/prefer-global/text-decoder": [2, "never"],
|
|
26
|
-
"node-js/prefer-global/text-encoder": [2, "never"],
|
|
27
|
-
"node-js/prefer-global/url": [2, "never"],
|
|
28
|
-
"node-js/prefer-global/url-search-params": [2, "never"],
|
|
29
22
|
"node-js/process-exit-as-throw": 2,
|
|
30
23
|
"node-js/hashbang": [2, { convertPath: { "src/**/*.js": ["^src/(.+?)\\.js$", "dist/$1.js"] } }],
|
|
31
24
|
"no-restricted-globals": [
|
package/dist/node.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.js","names":[],"sources":["../src/node.ts"],"sourcesContent":["import { defineConfig } from 'oxlint';\n\nimport { nativePlugins, packagePlugin } from './config.js';\n\nimport type { OxlintConfig } from 'oxlint';\n\nconst rules: NonNullable<OxlintConfig['rules']> = {\n\t'node/callback-return': 2,\n\t'node/handle-callback-err': 2,\n\t'node-js/no-callback-literal': 2,\n\t'node-js/no-deprecated-api': 2,\n\t'node/no-exports-assign': 2,\n\t'node/no-new-require': 2,\n\t'node/no-path-concat': 2,\n\t'node/no-sync': [\n\t\t2,\n\t\t{\n\t\t\tallowAtRootLevel: true,\n\t\t\tignores: ['existsSync'],\n\t\t},\n\t],\n\t'node-js/no-unpublished-bin': 2,\n\t'node-js/
|
|
1
|
+
{"version":3,"file":"node.js","names":[],"sources":["../src/node.ts"],"sourcesContent":["import { defineConfig } from 'oxlint';\n\nimport { nativePlugins, packagePlugin } from './config.js';\n\nimport type { OxlintConfig } from 'oxlint';\n\nconst rules: NonNullable<OxlintConfig['rules']> = {\n\t'node/callback-return': 2,\n\t'node/handle-callback-err': 2,\n\t'node-js/no-callback-literal': 2,\n\t'node-js/no-deprecated-api': 2,\n\t'node/no-exports-assign': 2,\n\t'node/no-new-require': 2,\n\t'node/no-path-concat': 2,\n\t'node/no-sync': [\n\t\t2,\n\t\t{\n\t\t\tallowAtRootLevel: true,\n\t\t\tignores: ['existsSync'],\n\t\t},\n\t],\n\t'node-js/no-unpublished-bin': 2,\n\t'node-js/process-exit-as-throw': 2,\n\t'node-js/hashbang': [\n\t\t2,\n\t\t{\n\t\t\tconvertPath: {\n\t\t\t\t'src/**/*.js': ['^src/(.+?)\\\\.js$', 'dist/$1.js'],\n\t\t\t},\n\t\t},\n\t],\n\t'no-restricted-globals': [\n\t\t2,\n\t\t{ name: 'Buffer', message: 'Import Buffer from `node:buffer` instead' },\n\t\t{ name: 'process', message: 'Import process from `node:process` instead' },\n\t\t{ name: 'setTimeout', message: 'Import setTimeout from `node:timers` instead' },\n\t\t{ name: 'setInterval', message: 'Import setInterval from `node:timers` instead' },\n\t\t{ name: 'setImmediate', message: 'Import setImmediate from `node:timers` instead' },\n\t\t{ name: 'clearTimeout', message: 'Import clearTimeout from `node:timers` instead' },\n\t\t{ name: 'clearInterval', message: 'Import clearInterval from `node:timers` instead' },\n\t\t{ name: 'clearImmediate', message: 'Import clearImmediate from `node:timers` instead' },\n\t],\n\t'unicorn/prefer-node-protocol': 2,\n\t'unicorn/require-post-message-target-origin': 0,\n};\n\nconst config = defineConfig({\n\tplugins: nativePlugins,\n\tjsPlugins: [packagePlugin('node-js', 'eslint-plugin-n')],\n\tenv: {\n\t\tnode: true,\n\t},\n\trules,\n});\n\nexport default config;\n"],"mappings":";;;;AA8CA,MAAM,SAAS,aAAa;CAC3B,SAAS;CACT,WAAW,CAAC,cAAc,WAAW,iBAAiB,CAAC;CACvD,KAAK,EACJ,MAAM,KACP;CACA;EA7CA,wBAAwB;EACxB,4BAA4B;EAC5B,+BAA+B;EAC/B,6BAA6B;EAC7B,0BAA0B;EAC1B,uBAAuB;EACvB,uBAAuB;EACvB,gBAAgB,CACf,GACA;GACC,kBAAkB;GAClB,SAAS,CAAC,YAAY;EACvB,CACD;EACA,8BAA8B;EAC9B,iCAAiC;EACjC,oBAAoB,CACnB,GACA,EACC,aAAa,EACZ,eAAe,CAAC,oBAAoB,YAAY,EACjD,EACD,CACD;EACA,yBAAyB;GACxB;GACA;IAAE,MAAM;IAAU,SAAS;GAA2C;GACtE;IAAE,MAAM;IAAW,SAAS;GAA6C;GACzE;IAAE,MAAM;IAAc,SAAS;GAA+C;GAC9E;IAAE,MAAM;IAAe,SAAS;GAAgD;GAChF;IAAE,MAAM;IAAgB,SAAS;GAAiD;GAClF;IAAE,MAAM;IAAgB,SAAS;GAAiD;GAClF;IAAE,MAAM;IAAiB,SAAS;GAAkD;GACpF;IAAE,MAAM;IAAkB,SAAS;GAAmD;EACvF;EACA,gCAAgC;EAChC,8CAA8C;CAS1C;AACL,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
//#region src/plugins/nest.ts
|
|
2
|
+
const DEFAULT_LOCALE = "en-US";
|
|
3
|
+
function isSortable(node) {
|
|
4
|
+
return node?.type === "Identifier" || node?.type === "CallExpression";
|
|
5
|
+
}
|
|
6
|
+
function nodeName(node) {
|
|
7
|
+
if (node.type === "Identifier") return node.name;
|
|
8
|
+
if (node.type === "CallExpression" && node.callee.type === "MemberExpression" && node.callee.object.type === "Identifier") return node.callee.object.name;
|
|
9
|
+
return "";
|
|
10
|
+
}
|
|
11
|
+
function isFactoryProviderInjectArray(node) {
|
|
12
|
+
if (node.parent.type !== "Property") return false;
|
|
13
|
+
const property = node.parent;
|
|
14
|
+
if (property.key.type !== "Identifier" || property.key.name !== "inject") return false;
|
|
15
|
+
if (property.parent.type !== "ObjectExpression") return false;
|
|
16
|
+
return property.parent.properties.some((item) => item.type === "Property" && item.key.type === "Identifier" && item.key.name === "useFactory");
|
|
17
|
+
}
|
|
18
|
+
const plugin = {
|
|
19
|
+
meta: {
|
|
20
|
+
name: "eslint-plugin-mahir-nest",
|
|
21
|
+
version: "1.0.0"
|
|
22
|
+
},
|
|
23
|
+
rules: { "sort-module-metadata-arrays": {
|
|
24
|
+
meta: {
|
|
25
|
+
type: "suggestion",
|
|
26
|
+
docs: { description: "Ensure Module metadata arrays are sorted alphabetically" },
|
|
27
|
+
fixable: "code",
|
|
28
|
+
schema: [{
|
|
29
|
+
type: "object",
|
|
30
|
+
additionalProperties: false,
|
|
31
|
+
properties: { locale: { type: "string" } }
|
|
32
|
+
}],
|
|
33
|
+
messages: { moduleMetadataArraysAreSorted: "`Module` metadata arrays should be sorted in ASC alphabetical order" }
|
|
34
|
+
},
|
|
35
|
+
defaultOptions: [{ locale: DEFAULT_LOCALE }],
|
|
36
|
+
create(context) {
|
|
37
|
+
const locale = context.options.at(0)?.locale ?? DEFAULT_LOCALE;
|
|
38
|
+
const sourceCode = context.sourceCode;
|
|
39
|
+
return { "ClassDeclaration > Decorator[expression.callee.name=\"Module\"] Property > ArrayExpression"(node) {
|
|
40
|
+
if (isFactoryProviderInjectArray(node)) return;
|
|
41
|
+
const sortable = node.elements.filter(isSortable);
|
|
42
|
+
const sorted = sortable.toSorted((left, right) => nodeName(left).localeCompare(nodeName(right), locale));
|
|
43
|
+
if (sortable.every((element, index) => element === sorted[index])) return;
|
|
44
|
+
const texts = sorted.map((element) => sourceCode.getText(element));
|
|
45
|
+
context.report({
|
|
46
|
+
node,
|
|
47
|
+
messageId: "moduleMetadataArraysAreSorted",
|
|
48
|
+
fix: (fixer) => sortable.map((element, index) => fixer.replaceText(element, texts[index] ?? ""))
|
|
49
|
+
});
|
|
50
|
+
} };
|
|
51
|
+
}
|
|
52
|
+
} }
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
//#endregion
|
|
56
|
+
export { plugin as default };
|
|
57
|
+
//# sourceMappingURL=nest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nest.js","names":[],"sources":["../../src/plugins/nest.ts"],"sourcesContent":["import type { TSESLint, TSESTree } from '@typescript-eslint/utils';\n\nconst DEFAULT_LOCALE = 'en-US';\n\ntype Options = [\n\t{\n\t\tlocale?: string;\n\t},\n];\n\nfunction isSortable(\n\tnode: TSESTree.Expression | TSESTree.SpreadElement | null,\n): node is TSESTree.CallExpression | TSESTree.Identifier {\n\treturn node?.type === 'Identifier' || node?.type === 'CallExpression';\n}\n\nfunction nodeName(node: TSESTree.Node) {\n\tif (node.type === 'Identifier') return node.name;\n\tif (\n\t\tnode.type === 'CallExpression' &&\n\t\tnode.callee.type === 'MemberExpression' &&\n\t\tnode.callee.object.type === 'Identifier'\n\t)\n\t\treturn node.callee.object.name;\n\treturn '';\n}\n\nfunction isFactoryProviderInjectArray(node: TSESTree.ArrayExpression) {\n\tif (node.parent.type !== 'Property') return false;\n\tconst property = node.parent;\n\tif (property.key.type !== 'Identifier' || property.key.name !== 'inject') return false;\n\tif (property.parent.type !== 'ObjectExpression') return false;\n\treturn property.parent.properties.some(\n\t\t(item) => item.type === 'Property' && item.key.type === 'Identifier' && item.key.name === 'useFactory',\n\t);\n}\n\nconst sortModuleMetadataArrays: TSESLint.RuleModule<'moduleMetadataArraysAreSorted', Options> = {\n\tmeta: {\n\t\ttype: 'suggestion',\n\t\tdocs: {\n\t\t\tdescription: 'Ensure Module metadata arrays are sorted alphabetically',\n\t\t},\n\t\tfixable: 'code',\n\t\tschema: [\n\t\t\t{\n\t\t\t\ttype: 'object',\n\t\t\t\tadditionalProperties: false,\n\t\t\t\tproperties: {\n\t\t\t\t\tlocale: { type: 'string' },\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t\tmessages: {\n\t\t\tmoduleMetadataArraysAreSorted: '`Module` metadata arrays should be sorted in ASC alphabetical order',\n\t\t},\n\t},\n\tdefaultOptions: [{ locale: DEFAULT_LOCALE }],\n\tcreate(context) {\n\t\tconst locale = context.options.at(0)?.locale ?? DEFAULT_LOCALE;\n\t\tconst sourceCode = context.sourceCode;\n\t\treturn {\n\t\t\t'ClassDeclaration > Decorator[expression.callee.name=\"Module\"] Property > ArrayExpression'(\n\t\t\t\tnode: TSESTree.ArrayExpression,\n\t\t\t) {\n\t\t\t\tif (isFactoryProviderInjectArray(node)) return;\n\t\t\t\tconst sortable = node.elements.filter(isSortable);\n\t\t\t\tconst sorted = sortable.toSorted((left, right) => nodeName(left).localeCompare(nodeName(right), locale));\n\t\t\t\tif (sortable.every((element, index) => element === sorted[index])) return;\n\t\t\t\tconst texts = sorted.map((element) => sourceCode.getText(element));\n\t\t\t\tcontext.report({\n\t\t\t\t\tnode,\n\t\t\t\t\tmessageId: 'moduleMetadataArraysAreSorted',\n\t\t\t\t\tfix: (fixer) => sortable.map((element, index) => fixer.replaceText(element, texts[index] ?? '')),\n\t\t\t\t});\n\t\t\t},\n\t\t};\n\t},\n};\n\nconst plugin: TSESLint.FlatConfig.Plugin = {\n\tmeta: {\n\t\tname: 'eslint-plugin-mahir-nest',\n\t\tversion: '1.0.0',\n\t},\n\trules: {\n\t\t'sort-module-metadata-arrays': sortModuleMetadataArrays,\n\t},\n};\n\nexport default plugin;\n"],"mappings":";AAEA,MAAM,iBAAiB;AAQvB,SAAS,WACR,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S,OAAO,SAAS,UAAU,YAAY,OAAO,MAAM,GAAG;IACnE,MAAM,QAAQ,OAAO,KAAK,YAAY,WAAW,QAAQ,OAAO,CAAC;IACjE,QAAQ,OAAO;KACd;KACA,WAAW;KACX,MAAM,UAAU,SAAS,KAAK,SAAS,UAAU,MAAM,YAAY,SAAS,MAAM,UAAU,EAAE,CAAC;IAChG,CAAC;GACF,EACD;EACD;CASuD,EACvD;AACD"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
//#region src/plugins/restricted-syntax.ts
|
|
2
|
+
function restrictionSelector(restriction) {
|
|
3
|
+
return typeof restriction === "string" ? restriction : restriction.selector;
|
|
4
|
+
}
|
|
5
|
+
function restrictionMessage(restriction) {
|
|
6
|
+
if (typeof restriction === "string") return `Using '${restriction}' is not allowed.`;
|
|
7
|
+
return restriction.message ?? `Using '${restriction.selector}' is not allowed.`;
|
|
8
|
+
}
|
|
9
|
+
const plugin = {
|
|
10
|
+
meta: {
|
|
11
|
+
name: "eslint-plugin-mahir-restricted-syntax",
|
|
12
|
+
version: "1.0.0"
|
|
13
|
+
},
|
|
14
|
+
rules: { "no-restricted-syntax": {
|
|
15
|
+
meta: {
|
|
16
|
+
type: "suggestion",
|
|
17
|
+
docs: { description: "Disallow specified syntax via ESLint selectors" },
|
|
18
|
+
schema: {
|
|
19
|
+
type: "array",
|
|
20
|
+
items: { oneOf: [{
|
|
21
|
+
type: "string",
|
|
22
|
+
minLength: 1
|
|
23
|
+
}, {
|
|
24
|
+
type: "object",
|
|
25
|
+
additionalProperties: false,
|
|
26
|
+
required: ["selector"],
|
|
27
|
+
properties: {
|
|
28
|
+
selector: {
|
|
29
|
+
type: "string",
|
|
30
|
+
minLength: 1
|
|
31
|
+
},
|
|
32
|
+
message: {
|
|
33
|
+
type: "string",
|
|
34
|
+
minLength: 1
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}] }
|
|
38
|
+
},
|
|
39
|
+
messages: { restricted: "{{message}}" }
|
|
40
|
+
},
|
|
41
|
+
defaultOptions: [],
|
|
42
|
+
create(context) {
|
|
43
|
+
const visitors = {};
|
|
44
|
+
for (const restriction of context.options) {
|
|
45
|
+
const selector = restrictionSelector(restriction);
|
|
46
|
+
const message = restrictionMessage(restriction);
|
|
47
|
+
visitors[selector] = (node) => {
|
|
48
|
+
context.report({
|
|
49
|
+
node,
|
|
50
|
+
messageId: "restricted",
|
|
51
|
+
data: { message }
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
return visitors;
|
|
56
|
+
}
|
|
57
|
+
} }
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
//#endregion
|
|
61
|
+
export { plugin as default };
|
|
62
|
+
//# sourceMappingURL=restricted-syntax.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"restricted-syntax.js","names":[],"sources":["../../src/plugins/restricted-syntax.ts"],"sourcesContent":["import type { TSESLint, TSESTree } from '@typescript-eslint/utils';\n\ntype Restriction =\n\t| string\n\t| {\n\t\t\tmessage?: string;\n\t\t\tselector: string;\n\t };\n\ntype Options = Restriction[];\n\nfunction restrictionSelector(restriction: Restriction) {\n\treturn typeof restriction === 'string' ? restriction : restriction.selector;\n}\n\nfunction restrictionMessage(restriction: Restriction) {\n\tif (typeof restriction === 'string') return `Using '${restriction}' is not allowed.`;\n\treturn restriction.message ?? `Using '${restriction.selector}' is not allowed.`;\n}\n\nconst noRestrictedSyntax: TSESLint.RuleModule<'restricted', Options> = {\n\tmeta: {\n\t\ttype: 'suggestion',\n\t\tdocs: {\n\t\t\tdescription: 'Disallow specified syntax via ESLint selectors',\n\t\t},\n\t\tschema: {\n\t\t\ttype: 'array',\n\t\t\titems: {\n\t\t\t\toneOf: [\n\t\t\t\t\t{ type: 'string', minLength: 1 },\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: 'object',\n\t\t\t\t\t\tadditionalProperties: false,\n\t\t\t\t\t\trequired: ['selector'],\n\t\t\t\t\t\tproperties: {\n\t\t\t\t\t\t\tselector: { type: 'string', minLength: 1 },\n\t\t\t\t\t\t\tmessage: { type: 'string', minLength: 1 },\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\t\tmessages: {\n\t\t\trestricted: '{{message}}',\n\t\t},\n\t},\n\tdefaultOptions: [],\n\tcreate(context) {\n\t\tconst visitors: TSESLint.RuleListener = {};\n\t\tfor (const restriction of context.options) {\n\t\t\tconst selector = restrictionSelector(restriction);\n\t\t\tconst message = restrictionMessage(restriction);\n\t\t\tvisitors[selector] = (node: TSESTree.Node) => {\n\t\t\t\tcontext.report({\n\t\t\t\t\tnode,\n\t\t\t\t\tmessageId: 'restricted',\n\t\t\t\t\tdata: { message },\n\t\t\t\t});\n\t\t\t};\n\t\t}\n\t\treturn visitors;\n\t},\n};\n\nconst plugin: TSESLint.FlatConfig.Plugin = {\n\tmeta: {\n\t\tname: 'eslint-plugin-mahir-restricted-syntax',\n\t\tversion: '1.0.0',\n\t},\n\trules: {\n\t\t'no-restricted-syntax': noRestrictedSyntax,\n\t},\n};\n\nexport default plugin;\n"],"mappings":";AAWA,SAAS,oBAAoB,aAA0B;CACtD,OAAO,OAAO,gBAAgB,WAAW,cAAc,YAAY;AACpE;AAEA,SAAS,mBAAmB,aAA0B;CACrD,IAAI,OAAO,gBAAgB,UAAU,OAAO,UAAU,YAAY;CAClE,OAAO,YAAY,WAAW,UAAU,YAAY,SAAS;AAC9D;AA+CA,MAAM,SAAqC;CAC1C,MAAM;EACL,MAAM;EACN,SAAS;CACV;CACA,OAAO,EACN,wBAAwB;EAlDzB,MAAM;GACL,MAAM;GACN,MAAM,EACL,aAAa,iDACd;GACA,QAAQ;IACP,MAAM;IACN,OAAO,EACN,OAAO,CACN;KAAE,MAAM;KAAU,WAAW;IAAE,GAC/B;KACC,MAAM;KACN,sBAAsB;KACtB,UAAU,CAAC,UAAU;KACrB,YAAY;MACX,UAAU;OAAE,MAAM;OAAU,WAAW;MAAE;MACzC,SAAS;OAAE,MAAM;OAAU,WAAW;MAAE;KACzC;IACD,CACD,EACD;GACD;GACA,UAAU,EACT,YAAY,cACb;EACD;EACA,gBAAgB,CAAC;EACjB,OAAO,SAAS;GACf,MAAM,WAAkC,CAAC;GACzC,KAAK,MAAM,eAAe,QAAQ,SAAS;IAC1C,MAAM,WAAW,oBAAoB,WAAW;IAChD,MAAM,UAAU,mBAAmB,WAAW;IAC9C,SAAS,aAAa,SAAwB;KAC7C,QAAQ,OAAO;MACd;MACA,WAAW;MACX,MAAM,EAAE,QAAQ;KACjB,CAAC;IACF;GACD;GACA,OAAO;EACR;CAS0C,EAC1C;AACD"}
|
package/dist/typescript.js
CHANGED
|
@@ -4,7 +4,7 @@ import { defineConfig } from "oxlint";
|
|
|
4
4
|
//#region src/typescript.ts
|
|
5
5
|
const config = defineConfig({
|
|
6
6
|
plugins: nativePlugins,
|
|
7
|
-
jsPlugins: [packagePlugin("sonarjs", "eslint-plugin-sonarjs")
|
|
7
|
+
jsPlugins: [packagePlugin("sonarjs", "eslint-plugin-sonarjs")],
|
|
8
8
|
rules: {
|
|
9
9
|
"typescript/adjacent-overload-signatures": 2,
|
|
10
10
|
"typescript/array-type": [2, { default: "array" }],
|
|
@@ -23,18 +23,18 @@ const config = defineConfig({
|
|
|
23
23
|
}],
|
|
24
24
|
"typescript/consistent-type-definitions": 2,
|
|
25
25
|
"typescript/consistent-type-exports": [2, { fixMixedExportsWithInlineTypeSpecifier: true }],
|
|
26
|
-
"
|
|
26
|
+
"default-param-last": 2,
|
|
27
27
|
"typescript/dot-notation": [2, {
|
|
28
28
|
allowKeywords: true,
|
|
29
29
|
allowPattern: "(^[A-Z])|(^[a-z]+(_[a-z]+)+$)",
|
|
30
30
|
allowPrivateClassPropertyAccess: true
|
|
31
31
|
}],
|
|
32
|
-
"typescript
|
|
33
|
-
"typescript
|
|
32
|
+
"typescript/method-signature-style": [2, "property"],
|
|
33
|
+
"typescript/no-array-constructor": 2,
|
|
34
34
|
"typescript/no-array-delete": 0,
|
|
35
35
|
"typescript/no-base-to-string": [1, { ignoredTypeNames: ["RegExp"] }],
|
|
36
36
|
"typescript/no-confusing-non-null-assertion": 2,
|
|
37
|
-
"
|
|
37
|
+
"no-dupe-class-members": 2,
|
|
38
38
|
"typescript/no-duplicate-enum-values": 2,
|
|
39
39
|
"typescript/no-duplicate-type-constituents": 2,
|
|
40
40
|
"typescript/no-dynamic-delete": 1,
|
|
@@ -54,7 +54,6 @@ const config = defineConfig({
|
|
|
54
54
|
ignoreParameters: true,
|
|
55
55
|
ignoreProperties: true
|
|
56
56
|
}],
|
|
57
|
-
"typescript-js/no-invalid-this": 2,
|
|
58
57
|
"typescript/no-invalid-void-type": [2, {
|
|
59
58
|
allowAsThisParameter: true,
|
|
60
59
|
allowInGenericTypeArguments: true
|
|
@@ -68,7 +67,7 @@ const config = defineConfig({
|
|
|
68
67
|
"typescript/no-namespace": 0,
|
|
69
68
|
"typescript/no-non-null-asserted-nullish-coalescing": 2,
|
|
70
69
|
"typescript/no-non-null-asserted-optional-chain": 2,
|
|
71
|
-
"
|
|
70
|
+
"no-redeclare": [2, { builtinGlobals: true }],
|
|
72
71
|
"typescript/no-redundant-type-constituents": 0,
|
|
73
72
|
"typescript/no-require-imports": 2,
|
|
74
73
|
"typescript/no-this-alias": [2, {
|
|
@@ -88,17 +87,16 @@ const config = defineConfig({
|
|
|
88
87
|
"typescript/no-unsafe-member-access": 0,
|
|
89
88
|
"typescript/no-unsafe-return": 0,
|
|
90
89
|
"typescript/no-unsafe-unary-minus": 0,
|
|
91
|
-
"
|
|
90
|
+
"no-unused-expressions": 2,
|
|
92
91
|
"typescript/no-unused-vars": 0,
|
|
93
|
-
"
|
|
92
|
+
"no-use-before-define": [2, {
|
|
94
93
|
classes: true,
|
|
95
94
|
functions: false,
|
|
96
95
|
variables: true
|
|
97
96
|
}],
|
|
98
|
-
"
|
|
97
|
+
"no-useless-constructor": 2,
|
|
99
98
|
"typescript/only-throw-error": 2,
|
|
100
99
|
"typescript/prefer-as-const": 0,
|
|
101
|
-
"typescript-js/prefer-as-const": 0,
|
|
102
100
|
"typescript/prefer-for-of": 2,
|
|
103
101
|
"typescript/prefer-function-type": 2,
|
|
104
102
|
"typescript/prefer-includes": 2,
|
|
@@ -125,13 +123,10 @@ const config = defineConfig({
|
|
|
125
123
|
"consistent-return": 0,
|
|
126
124
|
"default-case": 0,
|
|
127
125
|
"default-case-last": 0,
|
|
128
|
-
"default-param-last": 0,
|
|
129
126
|
"dot-notation": 0,
|
|
130
127
|
"import/no-dynamic-require": 0,
|
|
131
128
|
"no-shadow": 0,
|
|
132
129
|
"no-undef": 0,
|
|
133
|
-
"no-use-before-define": 0,
|
|
134
|
-
"no-useless-constructor": 0,
|
|
135
130
|
"sonarjs/no-all-duplicated-branches": 2,
|
|
136
131
|
"sonarjs/no-collapsible-if": 2,
|
|
137
132
|
"sonarjs/no-collection-size-mischeck": 2,
|
package/dist/typescript.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typescript.js","names":[],"sources":["../src/typescript.ts"],"sourcesContent":["import { defineConfig } from 'oxlint';\n\nimport { nativePlugins, packagePlugin } from './config.js';\n\nimport type { OxlintConfig } from 'oxlint';\n\nconst rules: NonNullable<OxlintConfig['rules']> = {\n\t'typescript/adjacent-overload-signatures': 2,\n\t'typescript/array-type': [\n\t\t2,\n\t\t{\n\t\t\tdefault: 'array',\n\t\t},\n\t],\n\t'typescript/await-thenable': 2,\n\t'typescript/ban-ts-comment': [\n\t\t2,\n\t\t{\n\t\t\t'ts-check': true,\n\t\t\t'ts-expect-error': 'allow-with-description',\n\t\t\t'ts-ignore': false,\n\t\t\t'ts-nocheck': false,\n\t\t},\n\t],\n\t'typescript/ban-tslint-comment': 2,\n\t'typescript/class-literal-property-style': [2, 'fields'],\n\t'typescript/consistent-type-assertions': [\n\t\t2,\n\t\t{\n\t\t\tassertionStyle: 'as',\n\t\t\tobjectLiteralTypeAssertions: 'allow',\n\t\t},\n\t],\n\t'typescript/consistent-type-definitions': 2,\n\t'typescript/consistent-type-exports': [\n\t\t2,\n\t\t{\n\t\t\tfixMixedExportsWithInlineTypeSpecifier: true,\n\t\t},\n\t],\n\t'
|
|
1
|
+
{"version":3,"file":"typescript.js","names":[],"sources":["../src/typescript.ts"],"sourcesContent":["import { defineConfig } from 'oxlint';\n\nimport { nativePlugins, packagePlugin } from './config.js';\n\nimport type { OxlintConfig } from 'oxlint';\n\nconst rules: NonNullable<OxlintConfig['rules']> = {\n\t'typescript/adjacent-overload-signatures': 2,\n\t'typescript/array-type': [\n\t\t2,\n\t\t{\n\t\t\tdefault: 'array',\n\t\t},\n\t],\n\t'typescript/await-thenable': 2,\n\t'typescript/ban-ts-comment': [\n\t\t2,\n\t\t{\n\t\t\t'ts-check': true,\n\t\t\t'ts-expect-error': 'allow-with-description',\n\t\t\t'ts-ignore': false,\n\t\t\t'ts-nocheck': false,\n\t\t},\n\t],\n\t'typescript/ban-tslint-comment': 2,\n\t'typescript/class-literal-property-style': [2, 'fields'],\n\t'typescript/consistent-type-assertions': [\n\t\t2,\n\t\t{\n\t\t\tassertionStyle: 'as',\n\t\t\tobjectLiteralTypeAssertions: 'allow',\n\t\t},\n\t],\n\t'typescript/consistent-type-definitions': 2,\n\t'typescript/consistent-type-exports': [\n\t\t2,\n\t\t{\n\t\t\tfixMixedExportsWithInlineTypeSpecifier: true,\n\t\t},\n\t],\n\t'default-param-last': 2,\n\t'typescript/dot-notation': [\n\t\t2,\n\t\t{\n\t\t\tallowKeywords: true,\n\t\t\tallowPattern: '(^[A-Z])|(^[a-z]+(_[a-z]+)+$)',\n\t\t\tallowPrivateClassPropertyAccess: true,\n\t\t},\n\t],\n\t'typescript/method-signature-style': [2, 'property'],\n\t'typescript/no-array-constructor': 2,\n\t'typescript/no-array-delete': 0,\n\t'typescript/no-base-to-string': [\n\t\t1,\n\t\t{\n\t\t\tignoredTypeNames: ['RegExp'],\n\t\t},\n\t],\n\t'typescript/no-confusing-non-null-assertion': 2,\n\t'no-dupe-class-members': 2,\n\t'typescript/no-duplicate-enum-values': 2,\n\t'typescript/no-duplicate-type-constituents': 2,\n\t'typescript/no-dynamic-delete': 1,\n\t'typescript/no-empty-object-type': [\n\t\t2,\n\t\t{\n\t\t\tallowInterfaces: 'with-single-extends',\n\t\t\tallowObjectTypes: 'always',\n\t\t},\n\t],\n\t'typescript/no-explicit-any': 0,\n\t'typescript/no-extra-non-null-assertion': 2,\n\t'typescript/no-floating-promises': [\n\t\t2,\n\t\t{\n\t\t\tignoreIIFE: true,\n\t\t\tignoreVoid: true,\n\t\t},\n\t],\n\t'typescript/no-for-in-array': 2,\n\t'typescript/no-implied-eval': 2,\n\t'typescript/no-inferrable-types': [\n\t\t2,\n\t\t{\n\t\t\tignoreParameters: true,\n\t\t\tignoreProperties: true,\n\t\t},\n\t],\n\t'typescript/no-invalid-void-type': [\n\t\t2,\n\t\t{\n\t\t\tallowAsThisParameter: true,\n\t\t\tallowInGenericTypeArguments: true,\n\t\t},\n\t],\n\t'typescript/no-meaningless-void-operator': [\n\t\t2,\n\t\t{\n\t\t\tcheckNever: true,\n\t\t},\n\t],\n\t'typescript/no-misused-new': 2,\n\t'typescript/no-misused-promises': [\n\t\t2,\n\t\t{\n\t\t\tchecksConditionals: true,\n\t\t\tchecksVoidReturn: false,\n\t\t},\n\t],\n\t'typescript/no-namespace': 0,\n\t'typescript/no-non-null-asserted-nullish-coalescing': 2,\n\t'typescript/no-non-null-asserted-optional-chain': 2,\n\t'no-redeclare': [\n\t\t2,\n\t\t{\n\t\t\tbuiltinGlobals: true,\n\t\t},\n\t],\n\t'typescript/no-redundant-type-constituents': 0,\n\t'typescript/no-require-imports': 2,\n\t'typescript/no-this-alias': [\n\t\t2,\n\t\t{\n\t\t\tallowDestructuring: true,\n\t\t\tallowedNames: ['self'],\n\t\t},\n\t],\n\t'typescript/no-unnecessary-boolean-literal-compare': 2,\n\t'typescript/no-unnecessary-condition': 1,\n\t'typescript/no-unnecessary-qualifier': 2,\n\t'typescript/no-unnecessary-type-assertion': 2,\n\t'typescript/no-unnecessary-type-constraint': 2,\n\t'typescript/no-unsafe-argument': 0,\n\t'typescript/no-unsafe-assignment': 0,\n\t'typescript/no-unsafe-call': 0,\n\t'typescript/no-unsafe-enum-comparison': 0,\n\t'typescript/no-unsafe-function-type': 0,\n\t'typescript/no-unsafe-member-access': 0,\n\t'typescript/no-unsafe-return': 0,\n\t'typescript/no-unsafe-unary-minus': 0,\n\t'no-unused-expressions': 2,\n\t'typescript/no-unused-vars': 0,\n\t'no-use-before-define': [\n\t\t2,\n\t\t{\n\t\t\tclasses: true,\n\t\t\tfunctions: false,\n\t\t\tvariables: true,\n\t\t},\n\t],\n\t'no-useless-constructor': 2,\n\t'typescript/only-throw-error': 2,\n\t'typescript/prefer-as-const': 0,\n\t'typescript/prefer-for-of': 2,\n\t'typescript/prefer-function-type': 2,\n\t'typescript/prefer-includes': 2,\n\t'typescript/prefer-literal-enum-member': 2,\n\t'typescript/prefer-namespace-keyword': 2,\n\t'typescript/prefer-optional-chain': 2,\n\t'typescript/prefer-readonly': [\n\t\t2,\n\t\t{\n\t\t\tonlyInlineLambdas: true,\n\t\t},\n\t],\n\t'typescript/prefer-reduce-type-parameter': 2,\n\t'typescript/prefer-regexp-exec': 2,\n\t'typescript/prefer-return-this-type': 2,\n\t'typescript/prefer-string-starts-ends-with': 2,\n\t'typescript/require-array-sort-compare': [\n\t\t2,\n\t\t{\n\t\t\tignoreStringArrays: false,\n\t\t},\n\t],\n\t'typescript/require-await': 0,\n\t'typescript/restrict-plus-operands': 2,\n\t'typescript/restrict-template-expressions': 0,\n\t'typescript/return-await': [2, 'in-try-catch'],\n\t'typescript/triple-slash-reference': [\n\t\t2,\n\t\t{\n\t\t\tlib: 'never',\n\t\t\tpath: 'never',\n\t\t\ttypes: 'never',\n\t\t},\n\t],\n\t'typescript/unbound-method': 0,\n\t'typescript/unified-signatures': 2,\n\t'consistent-return': 0,\n\t'default-case': 0,\n\t'default-case-last': 0,\n\t'dot-notation': 0,\n\t'import/no-dynamic-require': 0,\n\t'no-shadow': 0,\n\t'no-undef': 0,\n\t'sonarjs/no-all-duplicated-branches': 2,\n\t'sonarjs/no-collapsible-if': 2,\n\t'sonarjs/no-collection-size-mischeck': 2,\n\t'sonarjs/no-duplicated-branches': 2,\n\t'sonarjs/no-element-overwrite': 2,\n\t'sonarjs/no-empty-collection': 2,\n\t'sonarjs/no-extra-arguments': 2,\n\t'sonarjs/no-gratuitous-expressions': 2,\n\t'sonarjs/no-identical-conditions': 2,\n\t'sonarjs/no-identical-expressions': 2,\n\t'sonarjs/no-identical-functions': 2,\n\t'sonarjs/no-ignored-return': 2,\n\t'sonarjs/no-inverted-boolean-check': 2,\n\t'sonarjs/no-nested-switch': 2,\n\t'sonarjs/no-redundant-boolean': 2,\n\t'sonarjs/no-redundant-jump': 2,\n\t'sonarjs/no-same-line-conditional': 2,\n\t'sonarjs/no-unused-collection': 2,\n\t'sonarjs/no-use-of-empty-return-value': 2,\n\t'sonarjs/non-existent-operator': 2,\n\t'sonarjs/prefer-immediate-return': 2,\n\t'sonarjs/prefer-object-literal': 2,\n\t'sonarjs/prefer-single-boolean-return': 2,\n\t'sonarjs/prefer-while': 2,\n};\nconst config = defineConfig({\n\tplugins: nativePlugins,\n\tjsPlugins: [packagePlugin('sonarjs', 'eslint-plugin-sonarjs')],\n\trules,\n});\n\nexport default config;\n"],"mappings":";;;;AA6NA,MAAM,SAAS,aAAa;CAC3B,SAAS;CACT,WAAW,CAAC,cAAc,WAAW,uBAAuB,CAAC;CAC7D;EAzNA,2CAA2C;EAC3C,yBAAyB,CACxB,GACA,EACC,SAAS,QACV,CACD;EACA,6BAA6B;EAC7B,6BAA6B,CAC5B,GACA;GACC,YAAY;GACZ,mBAAmB;GACnB,aAAa;GACb,cAAc;EACf,CACD;EACA,iCAAiC;EACjC,2CAA2C,CAAC,GAAG,QAAQ;EACvD,yCAAyC,CACxC,GACA;GACC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;EAC7B,wBAAwB,CACvB,GACA;GACC,SAAS;GACT,WAAW;GACX,WAAW;EACZ,CACD;EACA,0BAA0B;EAC1B,+BAA+B;EAC/B,8BAA8B;EAC9B,4BAA4B;EAC5B,mCAAmC;EACnC,8BAA8B;EAC9B,yCAAyC;EACzC,uCAAuC;EACvC,oCAAoC;EACpC,8BAA8B,CAC7B,GACA,EACC,mBAAmB,KACpB,CACD;EACA,2CAA2C;EAC3C,iCAAiC;EACjC,sCAAsC;EACtC,6CAA6C;EAC7C,yCAAyC,CACxC,GACA,EACC,oBAAoB,MACrB,CACD;EACA,4BAA4B;EAC5B,qCAAqC;EACrC,4CAA4C;EAC5C,2BAA2B,CAAC,GAAG,cAAc;EAC7C,qCAAqC,CACpC,GACA;GACC,KAAK;GACL,MAAM;GACN,OAAO;EACR,CACD;EACA,6BAA6B;EAC7B,iCAAiC;EACjC,qBAAqB;EACrB,gBAAgB;EAChB,qBAAqB;EACrB,gBAAgB;EAChB,6BAA6B;EAC7B,aAAa;EACb,YAAY;EACZ,sCAAsC;EACtC,6BAA6B;EAC7B,uCAAuC;EACvC,kCAAkC;EAClC,gCAAgC;EAChC,+BAA+B;EAC/B,8BAA8B;EAC9B,qCAAqC;EACrC,mCAAmC;EACnC,oCAAoC;EACpC,kCAAkC;EAClC,6BAA6B;EAC7B,qCAAqC;EACrC,4BAA4B;EAC5B,gCAAgC;EAChC,6BAA6B;EAC7B,oCAAoC;EACpC,gCAAgC;EAChC,wCAAwC;EACxC,iCAAiC;EACjC,mCAAmC;EACnC,iCAAiC;EACjC,wCAAwC;EACxC,wBAAwB;CAKpB;AACL,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@imranbarbhuiya/oxc-config",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.10",
|
|
4
4
|
"description": "Shared Oxlint and Oxfmt configs for JavaScript and TypeScript projects",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"config",
|
|
@@ -194,8 +194,6 @@
|
|
|
194
194
|
},
|
|
195
195
|
"dependencies": {
|
|
196
196
|
"@clack/prompts": "^1.7.0",
|
|
197
|
-
"@darraghor/eslint-plugin-nestjs-typed": "^7.2.5",
|
|
198
|
-
"@typescript-eslint/eslint-plugin": "^8.63.0",
|
|
199
197
|
"eslint-plugin-better-tailwindcss": "^4.6.1",
|
|
200
198
|
"eslint-plugin-import-x": "^4.17.1",
|
|
201
199
|
"eslint-plugin-jsdoc": "^63.0.12",
|
|
@@ -203,9 +201,7 @@
|
|
|
203
201
|
"eslint-plugin-react": "^7.37.5",
|
|
204
202
|
"eslint-plugin-sonarjs": "^4.1.0",
|
|
205
203
|
"eslint-plugin-tsdoc": "^0.5.2",
|
|
206
|
-
"
|
|
207
|
-
"nypm": "^0.6.8",
|
|
208
|
-
"oxlint-plugin-eslint": "^1.80.0"
|
|
204
|
+
"nypm": "^0.6.8"
|
|
209
205
|
},
|
|
210
206
|
"devDependencies": {
|
|
211
207
|
"@types/bun": "^1.4.0",
|
package/dist/nest-plugin.d.ts
DELETED
package/dist/nest-plugin.js
DELETED