create-airbnb-x-config 3.0.1 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/constants/common/common.mjs +1 -0
- package/dist/constants/common/index.mjs +1 -0
- package/dist/helpers/createEslintConfigFile.mjs +1 -1
- package/dist/helpers/getArgs/getArgs.mjs +1 -0
- package/dist/helpers/getArgs/index.mjs +1 -0
- package/dist/helpers/getCommands/getCommands.mjs +1 -0
- package/dist/helpers/getCommands/index.mjs +1 -0
- package/dist/helpers/getConfigUrl/getConfigUrl.mjs +1 -0
- package/dist/helpers/getConfigUrl/index.mjs +1 -0
- package/dist/helpers/getPackageManager.mjs +1 -1
- package/dist/helpers/getProgramOptions/getProgramOptions.mjs +1 -0
- package/dist/helpers/getProgramOptions/index.mjs +1 -0
- package/dist/helpers/installPackages.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/package.mjs +1 -1
- package/dist/utils/functions/index.mjs +2 -0
- package/dist/utils/index.mjs +1 -2
- package/dist/utils/strings/index.mjs +1 -0
- package/dist/utils/strings/paths.mjs +1 -0
- package/package.json +4 -4
- package/dist/constants/index.mjs +0 -1
- package/dist/helpers/getArgs.mjs +0 -1
- package/dist/helpers/getCommands.mjs +0 -1
- package/dist/helpers/getConfigUrl.mjs +0 -1
- package/dist/helpers/getProgramOptions.mjs +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e={EXTENDED:`extended`,LEGACY:`legacy`},t={JAVASCRIPT:`javascript`,TYPESCRIPT:`typescript`},n={NONE:`none`,PRETTIER:`prettier`},r={REACT:`react`,REACT_ROUTER:`react-router`,REMIX:`remix`,NEXT:`next`,NODE:`node`},i={NONE:`none`,IMPORT:`import`,REACT:`react`,TYPESCRIPT:`typescript`},a={BASE:`base`,REACT:`react`,REACT_HOOKS:`react-hooks`},o={NPM:`npm`,YARN:`yarn`,PNPM:`pnpm`,BUN:`bun`},s={TRUE:`true`,FALSE:`false`},c={config:e.EXTENDED,language:t.TYPESCRIPT,formatter:n.PRETTIER,strictConfig:!1,legacyReactHooks:!0,createEslintFile:!0,skipInstall:!1},l={DEFAULT:`default`,STRICT:`strict`},u=`eslint.config.mjs`,d=`https://github.com/eslint-config/airbnb-extended/tree/master/apps/build-templates/templates`,f=`https://raw.githubusercontent.com/eslint-config/airbnb-extended/refs/heads/master/apps/build-templates/templates`;export{f as baseGithubRawUrl,d as baseGithubUrl,e as configs,c as defaults,u as eslintConfigName,n as formatters,t as languages,a as legacyConfigs,o as packageManagers,r as runtimes,i as strictConfigs,s as stringBooleans,l as subFolders};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./common.mjs";export{};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{baseGithubRawUrl as e,eslintConfigName as t}from"../constants/index.mjs";import n
|
|
1
|
+
import{baseGithubRawUrl as e,eslintConfigName as t}from"../constants/common/common.mjs";import"../constants/common/index.mjs";import{getConfigUrl as n}from"./getConfigUrl/getConfigUrl.mjs";import"./getConfigUrl/index.mjs";import{rootPath as r}from"../utils/strings/paths.mjs";import"../utils/index.mjs";import i from"node:fs/promises";import a from"node-fetch";const o=async o=>{try{let s=n(o);if(!s)return;let{path:c}=s,l=await(await a(`${e}/${c}`)).text();await i.writeFile(`${r}/${t}`,l,{encoding:`utf8`})}catch(e){console.error(e)}};export{o as createESLintConfigFile};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{configs as e,formatters as t,languages as n,legacyConfigs as r,packageManagers as i,runtimes as a,stringBooleans as o}from"../../constants/common/common.mjs";import"../../constants/common/index.mjs";import{getPackageManager as s}from"../getPackageManager.mjs";import{getProgramOptions as c}from"../getProgramOptions/getProgramOptions.mjs";import"../getProgramOptions/index.mjs";const l=t=>{let{config:n}=t;return n===e.EXTENDED?e.EXTENDED:n===e.LEGACY?e.LEGACY:null},u=e=>{let{language:t}=e;return t===n.JAVASCRIPT?n.JAVASCRIPT:t===n.TYPESCRIPT?n.TYPESCRIPT:null},d=e=>{let{formatter:n}=e;return n===t.NONE?t.NONE:n===t.PRETTIER?t.PRETTIER:null},f=e=>{let{runtime:t}=e;return t&&[a.REACT,a.REACT_ROUTER,a.REMIX].includes(t)?a.REACT:t===a.NEXT?a.NEXT:t===a.NODE?a.NODE:null},p=e=>{let{strictConfig:t}=e;return t?.length?t:null},m=e=>{let{legacyConfig:t}=e;return t===r.BASE?r.BASE:t===r.REACT?r.REACT:t===r.REACT_HOOKS?r.REACT_HOOKS:null},h=async e=>{let{packageManager:t}=e;return t===i.NPM?i.NPM:t===i.YARN?i.YARN:t===i.PNPM?i.PNPM:t===i.BUN?i.BUN:s()},g=e=>{let{createEslintFile:t}=e;return t?t===o.TRUE:null},_=e=>{let{skipInstall:t}=e;return t?t===o.TRUE:null},v=async()=>{let e=c();return{config:l(e),language:u(e),formatter:d(e),runtime:f(e),strictConfig:p(e),legacyConfig:m(e),packageManager:await h(e),createEslintFile:g(e),skipInstall:_(e)}};export{v as getArgs};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./getArgs.mjs";export{};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{formatters as e,packageManagers as t}from"../../constants/common/common.mjs";import"../../constants/common/index.mjs";const n=n=>{let{formatter:r,packageManager:i}=n,a=[i,{[t.NPM]:`install`,[t.YARN]:`add`,[t.PNPM]:`install`,[t.BUN]:`add`}[i],`-D`,`eslint@^9`,`@eslint/compat`,`@eslint/js@^9`,`eslint-config-airbnb-extended`];return r===e.PRETTIER&&a.push(`prettier`,`eslint-plugin-prettier`,`eslint-config-prettier`),a};export{n as getCommands};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./getCommands.mjs";export{};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{baseGithubUrl as e,configs as t,eslintConfigName as n,formatters as r,languages as i,subFolders as a}from"../../constants/common/common.mjs";import"../../constants/common/index.mjs";import o from"picocolors";const s=s=>{let{config:c,language:l,formatter:u,strictConfig:d,runtime:f,legacyConfig:p}=s,m=c===t.LEGACY,h=u===r.PRETTIER?`prettier`:null,g=l===i.TYPESCRIPT?`ts`:`js`,_=c===t.EXTENDED?null:p,v=(()=>{if(!d||d.length===0)return[a.DEFAULT];let e=[...d].sort((e,t)=>e.localeCompare(t)).join(`-`);return[a.STRICT,e]})(),y=[...m?[t.LEGACY,_]:[f],h,g,...v,n].filter(Boolean).join(`/`);return{path:y,url:o.blue(`${e}/${y}`)}};export{s as getConfigUrl};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./getConfigUrl.mjs";export{};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{packageManagers as e}from"../constants/index.mjs";import{detect as t}from"package-manager-detector/detect";
|
|
1
|
+
import{packageManagers as e}from"../constants/common/common.mjs";import"../constants/common/index.mjs";import{detect as t}from"package-manager-detector/detect";const n=async()=>{let n=await t();if(!n)return e.NPM;let{name:r}=n;return r===e.PNPM?e.PNPM:r===e.YARN?e.YARN:r===e.BUN?e.BUN:e.NPM};export{n as getPackageManager};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{configs as e,eslintConfigName as t,formatters as n,languages as r,legacyConfigs as i,packageManagers as a,runtimes as o,strictConfigs as s,stringBooleans as c}from"../../constants/common/common.mjs";import"../../constants/common/index.mjs";import{name as l,version as u}from"../../package.mjs";import{Command as d,Option as f}from"commander";const p=()=>{let p=new d().name(l).version(u,`-v, --version`,`Output the current version of create-airbnb-x-config.`).helpOption(`-h, --help`,`Display this help message.`).addOption(new f(`--config <config>`,`Explicitly tell the CLI to use selected config.`).choices(Object.values(e))).addOption(new f(`--lang, --language <lang>`,`Generate configuration for a selected language project.`).choices(Object.values(r))).addOption(new f(`--formatter <formatter>`,`Include selected formatter for specific linting rules.`).choices(Object.values(n))).addOption(new f(`--runtime <runtime>`,`Include selected runtime for specific linting rules.`).choices(Object.values(o)).conflicts([`legacy-config`])).addOption(new f(`--strict, --strict-config <config...>`,`Include the selected strict ESLint config.`).choices(Object.values(s)).argParser((e,t)=>[...new Set([...t||[],e])]).conflicts([`legacy-config`])).addOption(new f(`--legacy, --legacy-config <config>`,`Include the selected legacy ESLint config.`).choices(Object.values(i)).conflicts([`runtime`,`strict-config`])).addOption(new f(`--pm, --package-manager <pm>`,`Explicitly tell the CLI to use selected package manager.`).choices(Object.values(a))).addOption(new f(`--create-eslint-file [bool]`,`Explicitly tell the CLI to create ${t} file.`).choices(Object.values(c))).addOption(new f(`--skip-install [bool]`,`Explicitly tell the CLI to skip installing packages.`).choices(Object.values(c))).parse().opts();return{...p,...p.strictConfig===void 0?null:{strictConfig:p.strictConfig.includes(s.NONE)?[s.NONE]:p.strictConfig.reduce((e,t)=>{let{language:n,runtime:i}=p,a=t===s.IMPORT,c=i&&[o.REACT,o.NEXT].includes(i)&&t===s.REACT,l=n===r.TYPESCRIPT&&t===s.TYPESCRIPT;return(a||c||l)&&e.push(t),e},[])},...p.createEslintFile===void 0?null:{createEslintFile:p.createEslintFile===!0?c.TRUE:p.createEslintFile},...p.skipInstall===void 0?null:{skipInstall:p.skipInstall===!0?c.TRUE:p.skipInstall}}};export{p as getProgramOptions};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./getProgramOptions.mjs";export{};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e
|
|
1
|
+
import{getCommands as e}from"./getCommands/getCommands.mjs";import"./getCommands/index.mjs";import t from"cross-spawn";const n=async n=>{let[r,...i]=e(n);return new Promise((e,n)=>{t(r,i,{stdio:`inherit`,env:{...process.env,ADBLOCK:`1`,NODE_ENV:`development`,DISABLE_OPENCOLLECTIVE:`1`}}).on(`close`,t=>{if(t!==0){n(Error(`${r} ${i.join(` `)}`,{cause:`package-failed`}));return}e()})})};export{n as installPackages};
|
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{configs as e,defaults as t,eslintConfigName as n,formatters as r,languages as i,legacyConfigs as a,runtimes as o,strictConfigs as s}from"./constants/index.mjs";import c
|
|
2
|
+
import{configs as e,defaults as t,eslintConfigName as n,formatters as r,languages as i,legacyConfigs as a,runtimes as o,strictConfigs as s}from"./constants/common/common.mjs";import"./constants/common/index.mjs";import{getConfigUrl as c}from"./helpers/getConfigUrl/getConfigUrl.mjs";import"./helpers/getConfigUrl/index.mjs";import{exit as l,handleSigTerm as u,onCancel as d,onPromptState as f}from"./utils/functions/index.mjs";import"./utils/index.mjs";import{createESLintConfigFile as p}from"./helpers/createEslintConfigFile.mjs";import{getArgs as m}from"./helpers/getArgs/getArgs.mjs";import"./helpers/getArgs/index.mjs";import{getCommands as h}from"./helpers/getCommands/getCommands.mjs";import"./helpers/getCommands/index.mjs";import{installPackages as g}from"./helpers/installPackages.mjs";import _ from"picocolors";import v from"prompts";process.on(`SIGINT`,u),process.on(`SIGTERM`,u);const y=async()=>{let l=await m();if(l.config===null){let{configBoolean:n}=await v({type:`toggle`,name:`configBoolean`,message:`Config?`,initial:t.config===e.EXTENDED,active:`Extended`,inactive:`Legacy`,onState:f},{onCancel:d}),r=n?e.EXTENDED:e.LEGACY;l={...l,config:r,...r===e.EXTENDED?{legacyConfig:null}:{runtime:null}}}if(l.language===null){let{languageBoolean:e}=await v({type:`toggle`,name:`languageBoolean`,message:`Are you using ${_.blue(`typescript`)}?`,initial:t.language===i.TYPESCRIPT,active:`Yes`,inactive:`No`,onState:f},{onCancel:d}),n=e?i.TYPESCRIPT:i.JAVASCRIPT;l={...l,language:n}}if(l.formatter===r.NONE)l={...l,formatter:null};else if(l.formatter===null){let{formatterBoolean:e}=await v({type:`toggle`,name:`formatterBoolean`,message:`Are you using ${_.cyan(`prettier`)}?`,initial:t.formatter===r.PRETTIER,active:`Yes`,inactive:`No`,onState:f},{onCancel:d}),n=e?r.PRETTIER:null;l={...l,formatter:n}}if(l.config===e.EXTENDED){if(!l.runtime){let{runtime:e}=await v({type:`select`,name:`runtime`,message:`Are you using?`,choices:[{title:`React/React Router/Remix`,description:_.cyanBright(`You are using React.js library or Remix ( React Router 7 ) framework`),value:o.REACT},{title:`Next`,description:_.blackBright(`You are using Next.js framework`),value:o.NEXT},{title:`Node`,description:_.greenBright(`You are using Node or any other frameworks of it`),value:o.NODE}],onState:f},{onCancel:d});l={...l,runtime:e}}if(l.strictConfig?.includes(s.NONE))l={...l,strictConfig:null};else if(!l.strictConfig){let{hasStrictConfig:e}=await v({type:`toggle`,name:`hasStrictConfig`,message:`Do you want to add ${_.cyan(`strict`)} configs?`,initial:t.strictConfig,active:`Yes`,inactive:`No`,onState:f},{onCancel:d});if(e){let{strictConfig:e}=await v({type:`multiselect`,name:`strictConfig`,message:`Select Strict Configs:`,min:1,choices:[{title:`Import`,description:_.yellowBright(`Strict Import config`),value:s.IMPORT},...l.runtime&&[o.REACT,o.NEXT].includes(l.runtime)?[{title:`React`,description:_.cyanBright(`Strict React config`),value:s.REACT}]:[],...l.language===i.TYPESCRIPT?[{title:`TypeScript`,description:_.blueBright(`Strict TypeScript config`),value:s.TYPESCRIPT}]:[]],onState:f},{onCancel:d});l={...l,strictConfig:e}}else l={...l,strictConfig:null}}}if(l.config===e.LEGACY){if(!l.legacyConfig){let{legacyConfig:e}=await v({type:`select`,name:`legacyConfig`,message:`Are you using?`,choices:[{title:`Base Config`,description:_.greenBright(`eslint-config-airbnb-base`),value:a.BASE},{title:`React Config`,description:_.cyanBright(`eslint-config-airbnb`),value:a.REACT}],onState:f},{onCancel:d});l={...l,legacyConfig:e}}if(l.legacyConfig===a.REACT){let{reactHooks:e}=await v({type:`toggle`,name:`reactHooks`,message:`Are you using hooks?`,initial:t.legacyReactHooks,active:`Yes`,inactive:`No`,onState:f},{onCancel:d}),n=e?a.REACT_HOOKS:l.legacyConfig;l={...l,legacyConfig:n}}}if(l.createEslintFile===null){let{createEslintFile:e}=await v({type:`toggle`,name:`createEslintFile`,message:`Should I create an ${_.blue(n)} file for you?`,initial:t.createEslintFile,active:`Yes`,inactive:`No`,onState:f},{onCancel:d});l={...l,createEslintFile:e}}if(l.skipInstall===null){let{skipInstall:e}=await v({type:`toggle`,name:`skipInstall`,message:`Do you want to skip the package installation?`,initial:t.skipInstall,active:`Yes`,inactive:`No`,onState:f},{onCancel:d});l={...l,skipInstall:e}}let u=l,y=h(u).join(` `);console.log(),l.createEslintFile&&await p(u),l.skipInstall?(console.log(`${_.yellowBright(`No Worries`)}, you can install the packages yourself using your ${_.blue(`favourite`)} package manager (${u.packageManager}, maybe? 🤔)`),console.log(),console.log(_.cyan(`Command:`)),console.log(_.blue(y))):(console.log(`${_.blue(`Installing`)} packages using ${_.cyanBright(u.packageManager)}, please wait...`),await g(u),console.log(),console.log(_.yellowBright(`Installation Completed`)),console.log(),console.log(_.cyan(`Executed Command:`)),console.log(_.blue(y))),console.log(),console.log(_.cyan(l.createEslintFile?`Created Config:`:`Config:`)),console.log(c(u)?.url),console.log()};try{await y()}catch(e){e instanceof Error?l(e):console.error(e)}export{};
|
package/dist/package.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=`create-airbnb-x-config`,t=`3.0
|
|
1
|
+
var e=`create-airbnb-x-config`,t=`3.1.0`;export{e as name,t as version};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import e from"picocolors";const t=()=>process.exit(0),n=e=>{e.aborted&&(process.stdout.write(`\x1B[?25h`),process.stdout.write(`
|
|
2
|
+
`),process.exit(1))},r=()=>{console.error(`👋 Exiting, bye bye.`),process.exit(1)},i=t=>{console.log(`Aborting installation.`),t.cause===`package-failed`?console.log(`${e.red(t.message)} has failed.`):console.log(`${e.red(`Unexpected error. Please report it as a bug:`)}\n`,t),process.exit(1)};export{i as exit,t as handleSigTerm,r as onCancel,n as onPromptState};
|
package/dist/utils/index.mjs
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
`),process.exit(1))},a=()=>{console.error(`👋 Exiting, bye bye.`),process.exit(1)},o=t=>{console.log(`Aborting installation.`),t.cause===`package-failed`?console.log(`${e.red(t.message)} has failed.`):console.log(`${e.red(`Unexpected error. Please report it as a bug:`)}\n`,t),process.exit(1)};export{o as exit,r as handleSigTerm,a as onCancel,i as onPromptState,n as rootPath};
|
|
1
|
+
import"./functions/index.mjs";import"./strings/paths.mjs";import"./strings/index.mjs";export{};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./paths.mjs";export{};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"node:path";const t=e.resolve(`.`);export{t as rootPath};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-airbnb-x-config",
|
|
3
|
-
"version": "3.0
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"description": "Airbnb Extended Config CLI",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"create-airbnb-x-config": "./dist/index.mjs"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"commander": "^14.0.
|
|
37
|
+
"commander": "^14.0.3",
|
|
38
38
|
"cross-spawn": "^7.0.6",
|
|
39
39
|
"node-fetch": "^3.3.2",
|
|
40
40
|
"package-manager-detector": "^1.6.0",
|
|
@@ -44,9 +44,9 @@
|
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@types/cross-spawn": "^6.0.6",
|
|
46
46
|
"@types/prompts": "^2.4.9",
|
|
47
|
-
"tsdown": "^0.
|
|
47
|
+
"tsdown": "^0.21.7",
|
|
48
48
|
"tsx": "^4.21.0",
|
|
49
|
-
"@airbnb-extended/typescript-config": "3.
|
|
49
|
+
"@airbnb-extended/typescript-config": "3.1.0"
|
|
50
50
|
},
|
|
51
51
|
"engines": {
|
|
52
52
|
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
package/dist/constants/index.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e={EXTENDED:`extended`,LEGACY:`legacy`},t={JAVASCRIPT:`javascript`,TYPESCRIPT:`typescript`},n={PRETTIER:`prettier`},r={REACT:`react`,REACT_ROUTER:`react-router`,REMIX:`remix`,NEXT:`next`,NODE:`node`},i={IMPORT:`import`,REACT:`react`,TYPESCRIPT:`typescript`},a={BASE:`base`,REACT:`react`,REACT_HOOKS:`react-hooks`},o={NPM:`npm`,YARN:`yarn`,PNPM:`pnpm`,BUN:`bun`},s={TRUE:`true`,FALSE:`false`},c={config:e.EXTENDED,language:t.TYPESCRIPT,formatter:n.PRETTIER,strictConfig:!1,legacyReactHooks:!0,createEslintFile:!0,skipInstall:!1},l={DEFAULT:`default`,STRICT:`strict`},u=`eslint.config.mjs`,d=`https://github.com/eslint-config/airbnb-extended/tree/master/apps/build-templates/templates`,f=`https://raw.githubusercontent.com/eslint-config/airbnb-extended/refs/heads/master/apps/build-templates/templates`;export{f as baseGithubRawUrl,d as baseGithubUrl,e as configs,c as defaults,u as eslintConfigName,n as formatters,t as languages,a as legacyConfigs,o as packageManagers,r as runtimes,i as strictConfigs,s as stringBooleans,l as subFolders};
|
package/dist/helpers/getArgs.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{configs as e,formatters as t,languages as n,legacyConfigs as r,packageManagers as i,runtimes as a,stringBooleans as o}from"../constants/index.mjs";import s from"./getPackageManager.mjs";import c from"./getProgramOptions.mjs";const l=t=>{let{config:n}=t;return n===e.EXTENDED?e.EXTENDED:n===e.LEGACY?e.LEGACY:null},u=e=>{let{language:t}=e;return t===n.JAVASCRIPT?n.JAVASCRIPT:t===n.TYPESCRIPT?n.TYPESCRIPT:null},d=e=>{let{formatter:n}=e;return n===t.PRETTIER?t.PRETTIER:null},f=e=>{let{runtime:t}=e;return t&&[a.REACT,a.REACT_ROUTER,a.REMIX].includes(t)?a.REACT:t===a.NEXT?a.NEXT:t===a.NODE?a.NODE:null},p=e=>{let{strictConfig:t}=e;return t?.length?t:null},m=e=>{let{legacyConfig:t}=e;return t===r.BASE?r.BASE:t===r.REACT?r.REACT:t===r.REACT_HOOKS?r.REACT_HOOKS:null},h=async e=>{let{packageManager:t}=e;return t===i.NPM?i.NPM:t===i.YARN?i.YARN:t===i.PNPM?i.PNPM:t===i.BUN?i.BUN:s()},g=e=>{let{createEslintFile:t}=e;return t?t===o.TRUE:null},_=e=>{let{skipInstall:t}=e;return t?t===o.TRUE:null};var v=async()=>{let e=c();return{config:l(e),language:u(e),formatter:d(e),runtime:f(e),strictConfig:p(e),legacyConfig:m(e),packageManager:await h(e),createEslintFile:g(e),skipInstall:_(e)}};export{v as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{formatters as e,packageManagers as t}from"../constants/index.mjs";var n=n=>{let{formatter:r,packageManager:i}=n,a=[i,{[t.NPM]:`install`,[t.YARN]:`add`,[t.PNPM]:`install`,[t.BUN]:`add`}[i],`-D`,`eslint`,`@eslint/compat`,`@eslint/js`,`eslint-config-airbnb-extended`];return r===e.PRETTIER&&a.push(`prettier`,`eslint-plugin-prettier`,`eslint-config-prettier`),a};export{n as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{baseGithubUrl as e,configs as t,eslintConfigName as n,formatters as r,languages as i,subFolders as a}from"../constants/index.mjs";import o from"picocolors";var s=s=>{let{config:c,language:l,formatter:u,strictConfig:d,runtime:f,legacyConfig:p}=s,m=c===t.LEGACY,h=u===r.PRETTIER?`prettier`:null,g=l===i.TYPESCRIPT?`ts`:`js`,_=c===t.EXTENDED?null:p,v=(()=>{if(!d||d.length===0)return[a.DEFAULT];let e=[...d].sort((e,t)=>e.localeCompare(t)).join(`-`);return[a.STRICT,e]})(),y=[...m?[t.LEGACY,_]:[f],h,g,...v,n].filter(Boolean).join(`/`);return{path:y,url:o.blue(`${e}/${y}`)}};export{s as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{configs as e,eslintConfigName as t,formatters as n,languages as r,legacyConfigs as i,packageManagers as a,runtimes as o,strictConfigs as s,stringBooleans as c}from"../constants/index.mjs";import{name as l,version as u}from"../package.mjs";import{Command as d,Option as f}from"commander";var p=()=>{let p=new d().name(l).version(u,`-v, --version`,`Output the current version of create-airbnb-x-config.`).helpOption(`-h, --help`,`Display this help message.`).addOption(new f(`--config <config>`,`Explicitly tell the CLI to use selected config.`).choices(Object.values(e))).addOption(new f(`--lang, --language <lang>`,`Generate configuration for a selected language project.`).choices(Object.values(r))).addOption(new f(`--formatter <formatter>`,`Include selected formatter for specific linting rules.`).choices(Object.values(n))).addOption(new f(`--runtime <runtime>`,`Include selected runtime for specific linting rules.`).choices(Object.values(o)).conflicts([`legacy-config`])).addOption(new f(`--strict, --strict-config <config...>`,`Include the selected strict ESLint config.`).choices(Object.values(s)).argParser((e,t)=>[...new Set([...t||[],e])]).conflicts([`legacy-config`])).addOption(new f(`--legacy, --legacy-config <config>`,`Include the selected legacy ESLint config.`).choices(Object.values(i)).conflicts([`runtime`,`strict-config`])).addOption(new f(`--pm, --package-manager <pm>`,`Explicitly tell the CLI to use selected package manager.`).choices(Object.values(a))).addOption(new f(`--create-eslint-file [bool]`,`Explicitly tell the CLI to create ${t} file.`).choices(Object.values(c))).addOption(new f(`--skip-install [bool]`,`Explicitly tell the CLI to skip installing packages.`).choices(Object.values(c))).parse().opts();return{...p,...p.strictConfig===void 0?null:{strictConfig:p.strictConfig.reduce((e,t)=>{let{language:n,runtime:i}=p,a=t===s.IMPORT,c=i&&[o.REACT,o.NEXT].includes(i)&&t===s.REACT,l=n===r.TYPESCRIPT&&t===s.TYPESCRIPT;return(a||c||l)&&e.push(t),e},[])},...p.createEslintFile===void 0?null:{createEslintFile:p.createEslintFile===!0?c.TRUE:p.createEslintFile},...p.skipInstall===void 0?null:{skipInstall:p.skipInstall===!0?c.TRUE:p.skipInstall}}};export{p as default};
|