@imranbarbhuiya/oxc-config 0.1.0 → 0.1.3
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/README.md +2 -2
- package/dist/cli/index.js +2 -6
- package/dist/cli/index.js.map +1 -1
- package/dist/common.d.ts +3 -0
- package/dist/common.js +1 -0
- package/dist/common.js.map +1 -1
- package/dist/oxfmt.js +1 -1
- package/dist/oxfmt.js.map +1 -1
- package/package.json +96 -20
package/README.md
CHANGED
|
@@ -113,13 +113,13 @@ Add scripts to `package.json`:
|
|
|
113
113
|
- `edge` contains edge-runtime rules
|
|
114
114
|
- `jsdoc` contains JSDoc rules
|
|
115
115
|
- `tsdoc` contains TSDoc rules and includes JSDoc
|
|
116
|
-
- `tailwind` contains Tailwind CSS rules
|
|
116
|
+
- `tailwind` contains Tailwind CSS rules
|
|
117
117
|
- `i18n` contains next-intl rules
|
|
118
118
|
- `native-tailwind` contains React Native Tailwind class-name rules
|
|
119
119
|
- `central-icons` prevents barrel imports from `@central-icons-react*` packages
|
|
120
120
|
- `api-error` requires allowed error classes in TanStack Query functions
|
|
121
121
|
|
|
122
|
-
Fragments can be combined through `defineConfig({ extends: [...] })`.
|
|
122
|
+
Fragments can be combined through `defineConfig({ extends: [...] })`. The Tailwind plugin ships with this package. Install a third-party plugin only when you add it yourself, such as TanStack Query.
|
|
123
123
|
|
|
124
124
|
TanStack Query can be added directly:
|
|
125
125
|
|
package/dist/cli/index.js
CHANGED
|
@@ -260,9 +260,6 @@ export default defineConfig({
|
|
|
260
260
|
extends: [${configs.join(", ")}],
|
|
261
261
|
ignorePatterns: [${ignores}],
|
|
262
262
|
env: ${env},
|
|
263
|
-
categories: {
|
|
264
|
-
correctness: 'off',
|
|
265
|
-
},
|
|
266
263
|
options: {
|
|
267
264
|
typeAware: true,
|
|
268
265
|
},${queryBlock}
|
|
@@ -327,7 +324,7 @@ async function updateScripts(packageJsonPath) {
|
|
|
327
324
|
packageJson.scripts = scripts;
|
|
328
325
|
await fs.writeFile(packageJsonPath, JSON.stringify(packageJson, null, " ") + "\n");
|
|
329
326
|
}
|
|
330
|
-
async function installDependencies(cwd,
|
|
327
|
+
async function installDependencies(cwd, includeQuery) {
|
|
331
328
|
const pmName = (await detectPackageManager(cwd))?.name ?? "npm";
|
|
332
329
|
const dependencies = [
|
|
333
330
|
PACKAGE_NAME,
|
|
@@ -335,7 +332,6 @@ async function installDependencies(cwd, includeTailwind, includeQuery) {
|
|
|
335
332
|
"oxlint-tsgolint",
|
|
336
333
|
"oxfmt"
|
|
337
334
|
];
|
|
338
|
-
if (includeTailwind) dependencies.push("eslint-plugin-better-tailwindcss");
|
|
339
335
|
if (includeQuery) dependencies.push("@tanstack/eslint-plugin-query");
|
|
340
336
|
p.log.info(`Detected package manager: ${pmName}`);
|
|
341
337
|
const spinner = p.spinner();
|
|
@@ -513,7 +509,7 @@ await fs.writeFile(oxfmtConfigPath, generateOxfmtConfig());
|
|
|
513
509
|
p.log.success("Created oxlint.config.ts and oxfmt.config.ts");
|
|
514
510
|
await updateScripts(packageJsonPath);
|
|
515
511
|
p.log.success("Updated package.json scripts");
|
|
516
|
-
const pmName = await installDependencies(cwd,
|
|
512
|
+
const pmName = await installDependencies(cwd, includeQuery);
|
|
517
513
|
const runPrefix = pmName === "npm" ? "npm run" : pmName;
|
|
518
514
|
p.outro(`Setup complete! Run \`${runPrefix} lint && ${runPrefix} format\``);
|
|
519
515
|
process.exit(0);
|
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\tcategories: {\n\t\tcorrectness: 'off',\n\t},\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, includeTailwind: boolean, 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 (includeTailwind) dependencies.push('eslint-plugin-better-tailwindcss');\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, includeTailwind, 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;EAC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,iBAAiB,oBAAoB,CAAC;AACzD,EAAE,IAAI,QAAQ,8CAA8C;AAE5D,MAAM,cAAc,eAAe;AACnC,EAAE,IAAI,QAAQ,8BAA8B;AAE5C,MAAM,SAAS,MAAM,oBAAoB,KAAK,iBAAiB,YAAY;AAC3E,MAAM,YAAY,WAAW,QAAQ,YAAY;AACjD,EAAE,MAAM,yBAAyB,UAAU,WAAW,UAAU,UAAU;AAE1E,QAAQ,KAAK,CAAC"}
|
|
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;AAEA,MAAM,kBAA4C;CACjD,QAAQ;EAAC;EAAc;EAAY;EAAY;EAAmB;CAAe;CACjF,OAAO;EAAC;EAAc;EAAY;EAAmB;EAAW;CAAU;CAC1E,MAAM;EAAC;EAAc;EAAY;EAAmB;CAAS;CAC7D,QAAQ;EAAC;EAAc;EAAY;EAAmB;EAAY;EAAc;CAAQ;CACxF,SAAS;EAAC;EAAc;EAAY;EAAmB;CAAS;CAChE,MAAM;EAAC;EAAc;EAAY;EAAmB;CAAS;AAC9D;AAEA,MAAM,qBAA6C;CAClD,MAAM;CACN,gBAAgB;CAChB,OAAO;CACP,gBAAgB;AACjB;AAEA,MAAM,qBAAqB;CAAC;CAAQ;CAAgB;CAA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C;AAC7D,IAAI,iBAAiB,EAAE,IAAI,KAAK,iDAAiD;AAEjF,MAAM,mBAAmB,KAAK,KAAK,KAAK,kBAAkB;AAC1D,MAAM,kBAAkB,KAAK,KAAK,KAAK,iBAAiB;AACxD,MAAM,kBAAkB,KAAK,KAAK,KAAK,cAAc;AAErD,MAAM,iBAAiB,kBAAkB,WAAW;AACpD,MAAM,iBAAiB,iBAAiB,WAAW;AACnD,MAAM,GAAG,UACR,kBACA,qBAAqB,QAAQ,iBAAiB;CAC7C,MAAM;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.d.ts
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
declare const config: {
|
|
3
3
|
plugins: ("eslint" | "react" | "unicorn" | "typescript" | "oxc" | "import" | "jsdoc" | "jest" | "vitest" | "jsx-a11y" | "nextjs" | "react-perf" | "promise" | "node" | "vue")[];
|
|
4
4
|
jsPlugins: import("oxlint").ExternalPluginEntry[];
|
|
5
|
+
categories: {
|
|
6
|
+
correctness: "off";
|
|
7
|
+
};
|
|
5
8
|
options: {
|
|
6
9
|
reportUnusedDisableDirectives: "warn";
|
|
7
10
|
};
|
package/dist/common.js
CHANGED
|
@@ -9,6 +9,7 @@ const config = defineConfig({
|
|
|
9
9
|
packagePlugin("import-js", "eslint-plugin-import-x"),
|
|
10
10
|
packagePlugin("unicorn-js", "eslint-plugin-unicorn")
|
|
11
11
|
],
|
|
12
|
+
categories: { correctness: "off" },
|
|
12
13
|
options: { reportUnusedDisableDirectives: "warn" },
|
|
13
14
|
rules: {
|
|
14
15
|
"array-callback-return": 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': [\n\t\t2,\n\t\t{\n\t\t\talphabetize: {\n\t\t\t\tcaseInsensitive: true,\n\t\t\t\torder: 'asc',\n\t\t\t},\n\t\t\tgroups: ['builtin', 'index', 'external', 'internal', 'sibling', 'parent', 'type'],\n\t\t\t'newlines-between': 'always',\n\t\t},\n\t],\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-named-capture-group': 1,\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\toptions: {\n\t\treportUnusedDisableDirectives: 'warn',\n\t},\n\trules,\n});\n\nexport default config;\n"],"mappings":";;;;AAoTA,MAAM,SAAS,aAAa;CAC3B,SAAS;CACT,WAAW;EACV,cAAc,aAAa,sBAAsB;EACjD,cAAc,aAAa,wBAAwB;EACnD,cAAc,cAAc,uBAAuB;CACpD;CACA,SAAS,EACR,+BAA+B,OAChC;CACA;EAvTA,yBAAyB;EACzB,8BAA8B,CAAC,GAAG,WAAW;EAC7C,oBAAoB;EACpB,qBAAqB;EACrB,6BAA6B,CAAC,GAAG,MAAM;EACvC,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,sCAAsC;EACtC,mCAAmC;EACnC,mBAAmB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BAAuB;EACvB,8BAA8B;EAC9B,+BAA+B;EAC/B,gCAAgC;EAChC,8BAA8B;EAC9B,mCAAmC;EACnC,yCAAyC;EACzC,mCAAmC;EACnC,6CAA6C;EAC7C,6BAA6B;EAC7B,kCAAkC;EAClC,6BAA6B;EAC7B,oCAAoC,CACnC,GACA;GACC,QAAQ,EACP,yBAAyB,KAC1B;GACA,aAAa,EACZ,yBAAyB,KAC1B;GACA,QAAQ;IACP,aAAa;IACb,eAAe;GAChB;GACA,OAAO,EACN,yBAAyB,KAC1B;EACD,CACD;EACA,6BAA6B;EAC7B,6BAA6B;EAC7B,iCAAiC;EACjC,iCAAiC;EACjC,6BAA6B;EAC7B,6BAA6B;EAC7B,2BAA2B;EAC3B,qCAAqC;EACrC,8BAA8B;EAC9B,2BAA2B;EAC3B,6BAA6B;EAC7B,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;CAab;AACL,CAAC"}
|
|
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': [\n\t\t2,\n\t\t{\n\t\t\talphabetize: {\n\t\t\t\tcaseInsensitive: true,\n\t\t\t\torder: 'asc',\n\t\t\t},\n\t\t\tgroups: ['builtin', 'index', 'external', 'internal', 'sibling', 'parent', 'type'],\n\t\t\t'newlines-between': 'always',\n\t\t},\n\t],\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-named-capture-group': 1,\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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A,6BAA6B;EAC7B,6BAA6B;EAC7B,iCAAiC;EACjC,iCAAiC;EACjC,6BAA6B;EAC7B,6BAA6B;EAC7B,2BAA2B;EAC3B,qCAAqC;EACrC,8BAA8B;EAC9B,2BAA2B;EAC3B,6BAA6B;EAC7B,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"}
|
package/dist/oxfmt.js
CHANGED
package/dist/oxfmt.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oxfmt.js","names":[],"sources":["../src/oxfmt.ts"],"sourcesContent":["import { defineConfig } from 'oxfmt';\n\nexport default defineConfig({\n\tprintWidth: 120,\n\tuseTabs: true,\n\tsingleQuote: true,\n\tquoteProps: 'as-needed',\n\ttrailingComma: 'all',\n\tendOfLine: 'lf',\n\tignorePatterns: ['tests/fixtures
|
|
1
|
+
{"version":3,"file":"oxfmt.js","names":[],"sources":["../src/oxfmt.ts"],"sourcesContent":["import { defineConfig } from 'oxfmt';\n\nexport default defineConfig({\n\tprintWidth: 120,\n\tuseTabs: true,\n\tsingleQuote: true,\n\tquoteProps: 'as-needed',\n\ttrailingComma: 'all',\n\tendOfLine: 'lf',\n\tignorePatterns: ['tests/fixtures/**'],\n});\n"],"mappings":";;;AAEA,oBAAe,aAAa;CAC3B,YAAY;CACZ,SAAS;CACT,aAAa;CACb,YAAY;CACZ,eAAe;CACf,WAAW;CACX,gBAAgB,CAAC,mBAAmB;AACrC,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.3",
|
|
4
4
|
"description": "Shared Oxlint and Oxfmt configs for JavaScript and TypeScript projects",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"config",
|
|
@@ -27,81 +27,157 @@
|
|
|
27
27
|
"oxc-config": "dist/cli/index.js"
|
|
28
28
|
},
|
|
29
29
|
"files": [
|
|
30
|
-
"dist
|
|
30
|
+
"dist"
|
|
31
31
|
],
|
|
32
32
|
"type": "module",
|
|
33
33
|
"exports": {
|
|
34
34
|
"./api-error": {
|
|
35
35
|
"types": "./dist/api-error.d.ts",
|
|
36
|
-
"import": "./dist/api-error.js"
|
|
36
|
+
"import": "./dist/api-error.js",
|
|
37
|
+
"default": "./dist/api-error.js"
|
|
37
38
|
},
|
|
38
39
|
"./central-icons": {
|
|
39
40
|
"types": "./dist/central-icons.d.ts",
|
|
40
|
-
"import": "./dist/central-icons.js"
|
|
41
|
+
"import": "./dist/central-icons.js",
|
|
42
|
+
"default": "./dist/central-icons.js"
|
|
41
43
|
},
|
|
42
44
|
"./common": {
|
|
43
45
|
"types": "./dist/common.d.ts",
|
|
44
|
-
"import": "./dist/common.js"
|
|
46
|
+
"import": "./dist/common.js",
|
|
47
|
+
"default": "./dist/common.js"
|
|
45
48
|
},
|
|
46
49
|
"./edge": {
|
|
47
50
|
"types": "./dist/edge.d.ts",
|
|
48
|
-
"import": "./dist/edge.js"
|
|
51
|
+
"import": "./dist/edge.js",
|
|
52
|
+
"default": "./dist/edge.js"
|
|
49
53
|
},
|
|
50
54
|
"./i18n": {
|
|
51
55
|
"types": "./dist/i18n.d.ts",
|
|
52
|
-
"import": "./dist/i18n.js"
|
|
56
|
+
"import": "./dist/i18n.js",
|
|
57
|
+
"default": "./dist/i18n.js"
|
|
53
58
|
},
|
|
54
59
|
"./jsdoc": {
|
|
55
60
|
"types": "./dist/jsdoc.d.ts",
|
|
56
|
-
"import": "./dist/jsdoc.js"
|
|
61
|
+
"import": "./dist/jsdoc.js",
|
|
62
|
+
"default": "./dist/jsdoc.js"
|
|
57
63
|
},
|
|
58
64
|
"./jsx": {
|
|
59
65
|
"types": "./dist/jsx.d.ts",
|
|
60
|
-
"import": "./dist/jsx.js"
|
|
66
|
+
"import": "./dist/jsx.js",
|
|
67
|
+
"default": "./dist/jsx.js"
|
|
61
68
|
},
|
|
62
69
|
"./module": {
|
|
63
70
|
"types": "./dist/module.d.ts",
|
|
64
|
-
"import": "./dist/module.js"
|
|
71
|
+
"import": "./dist/module.js",
|
|
72
|
+
"default": "./dist/module.js"
|
|
65
73
|
},
|
|
66
74
|
"./native": {
|
|
67
75
|
"types": "./dist/native.d.ts",
|
|
68
|
-
"import": "./dist/native.js"
|
|
76
|
+
"import": "./dist/native.js",
|
|
77
|
+
"default": "./dist/native.js"
|
|
69
78
|
},
|
|
70
79
|
"./native-tailwind": {
|
|
71
80
|
"types": "./dist/native-tailwind.d.ts",
|
|
72
|
-
"import": "./dist/native-tailwind.js"
|
|
81
|
+
"import": "./dist/native-tailwind.js",
|
|
82
|
+
"default": "./dist/native-tailwind.js"
|
|
73
83
|
},
|
|
74
84
|
"./nest": {
|
|
75
85
|
"types": "./dist/nest.d.ts",
|
|
76
|
-
"import": "./dist/nest.js"
|
|
86
|
+
"import": "./dist/nest.js",
|
|
87
|
+
"default": "./dist/nest.js"
|
|
77
88
|
},
|
|
78
89
|
"./next": {
|
|
79
90
|
"types": "./dist/next.d.ts",
|
|
80
|
-
"import": "./dist/next.js"
|
|
91
|
+
"import": "./dist/next.js",
|
|
92
|
+
"default": "./dist/next.js"
|
|
81
93
|
},
|
|
82
94
|
"./node": {
|
|
83
95
|
"types": "./dist/node.d.ts",
|
|
84
|
-
"import": "./dist/node.js"
|
|
96
|
+
"import": "./dist/node.js",
|
|
97
|
+
"default": "./dist/node.js"
|
|
85
98
|
},
|
|
86
99
|
"./react": {
|
|
87
100
|
"types": "./dist/react.d.ts",
|
|
88
|
-
"import": "./dist/react.js"
|
|
101
|
+
"import": "./dist/react.js",
|
|
102
|
+
"default": "./dist/react.js"
|
|
89
103
|
},
|
|
90
104
|
"./tsdoc": {
|
|
91
105
|
"types": "./dist/tsdoc.d.ts",
|
|
92
|
-
"import": "./dist/tsdoc.js"
|
|
106
|
+
"import": "./dist/tsdoc.js",
|
|
107
|
+
"default": "./dist/tsdoc.js"
|
|
93
108
|
},
|
|
94
109
|
"./typescript": {
|
|
95
110
|
"types": "./dist/typescript.d.ts",
|
|
96
|
-
"import": "./dist/typescript.js"
|
|
111
|
+
"import": "./dist/typescript.js",
|
|
112
|
+
"default": "./dist/typescript.js"
|
|
97
113
|
},
|
|
98
114
|
"./tailwind": {
|
|
99
115
|
"types": "./dist/tailwind.d.ts",
|
|
100
|
-
"import": "./dist/tailwind.js"
|
|
116
|
+
"import": "./dist/tailwind.js",
|
|
117
|
+
"default": "./dist/tailwind.js"
|
|
101
118
|
},
|
|
102
119
|
"./oxfmt": {
|
|
103
120
|
"types": "./dist/oxfmt.d.ts",
|
|
104
|
-
"import": "./dist/oxfmt.js"
|
|
121
|
+
"import": "./dist/oxfmt.js",
|
|
122
|
+
"default": "./dist/oxfmt.js"
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
"typesVersions": {
|
|
126
|
+
"*": {
|
|
127
|
+
"api-error": [
|
|
128
|
+
"./dist/api-error.d.ts"
|
|
129
|
+
],
|
|
130
|
+
"central-icons": [
|
|
131
|
+
"./dist/central-icons.d.ts"
|
|
132
|
+
],
|
|
133
|
+
"common": [
|
|
134
|
+
"./dist/common.d.ts"
|
|
135
|
+
],
|
|
136
|
+
"edge": [
|
|
137
|
+
"./dist/edge.d.ts"
|
|
138
|
+
],
|
|
139
|
+
"i18n": [
|
|
140
|
+
"./dist/i18n.d.ts"
|
|
141
|
+
],
|
|
142
|
+
"jsdoc": [
|
|
143
|
+
"./dist/jsdoc.d.ts"
|
|
144
|
+
],
|
|
145
|
+
"jsx": [
|
|
146
|
+
"./dist/jsx.d.ts"
|
|
147
|
+
],
|
|
148
|
+
"module": [
|
|
149
|
+
"./dist/module.d.ts"
|
|
150
|
+
],
|
|
151
|
+
"native": [
|
|
152
|
+
"./dist/native.d.ts"
|
|
153
|
+
],
|
|
154
|
+
"native-tailwind": [
|
|
155
|
+
"./dist/native-tailwind.d.ts"
|
|
156
|
+
],
|
|
157
|
+
"nest": [
|
|
158
|
+
"./dist/nest.d.ts"
|
|
159
|
+
],
|
|
160
|
+
"next": [
|
|
161
|
+
"./dist/next.d.ts"
|
|
162
|
+
],
|
|
163
|
+
"node": [
|
|
164
|
+
"./dist/node.d.ts"
|
|
165
|
+
],
|
|
166
|
+
"react": [
|
|
167
|
+
"./dist/react.d.ts"
|
|
168
|
+
],
|
|
169
|
+
"tsdoc": [
|
|
170
|
+
"./dist/tsdoc.d.ts"
|
|
171
|
+
],
|
|
172
|
+
"typescript": [
|
|
173
|
+
"./dist/typescript.d.ts"
|
|
174
|
+
],
|
|
175
|
+
"tailwind": [
|
|
176
|
+
"./dist/tailwind.d.ts"
|
|
177
|
+
],
|
|
178
|
+
"oxfmt": [
|
|
179
|
+
"./dist/oxfmt.d.ts"
|
|
180
|
+
]
|
|
105
181
|
}
|
|
106
182
|
},
|
|
107
183
|
"publishConfig": {
|