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MAAK,GAAW,OAAO,IAC5B,IAGJ,QACG,QAAQ,UACR,YAAY,2BACZ,QAAO,KACN,kBAAkB,IAStB,QAAQ,MAAM,QAAQ,MAGM,IAAxB,QAAQ,KAAK,QAEf","file":"/npm/lint@0.8.19/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/lint@0.8.19/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","#!/usr/bin/env node\n\nconst program = require(\"commander\");\nconst { prompt } = require(\"inquirer\");\nconst chalk = require(\"chalk\");\nconst simpleGit = require(\"simple-git\");\nvar path = require(\"path\");\nconst fs = require(\"fs\");\nconst { init } = require(\"./utils/initializer\");\n\nconst {\n  getUsernameFromLocalDevice,\n  getTokenFromLocalDevice,\n  printLoginStatus,\n  signup,\n  login,\n  logout\n} = require(\"./utils/user\");\n\nconst {\n  getStagedFiles,\n  getDeletedStagedFiles,\n  fetchPolicyRules,\n  lintingPreCommit,\n  lintStaged,\n  preCommit,\n  prepareCommitMsg,\n  postCommit,\n  createLintStagedConfig,\n  fetchLinters\n} = require(\"./utils/linter\");\n\nconst { install, uninstall } = require(\"./utils/hooks\");\n\nconst {\n  runEslint,\n  createESlintConfig,\n  parseOutPoutForRuleCheckAsTable,\n  installEslint,\n  assignESlintRules,\n  selectFilesForESLint,\n  checkIfLintStagedConfigExist,\n  checkIfEslintIsInstalled,\n  eslintNoConfig\n} = require(\"./utils/linters/eslint\");\n\nconst {\n  installBrakeman\n} = require(\"./utils/linters/brakeman\");\n\nconst {\n  installErbLint\n} = require(\"./utils/linters/erbLint\");\n\n// const {\n//   checkInstalledPackages,\n//   installRubocop\n// } = require(\"./utils/linters/rubocop\");\n\nconst {\n  createPrettierConfig,\n  runPrettierOnStagedFiles,\n  runPrettierOnProject\n} = require(\"./utils/linters/prettier\");\n\n// ********** Version **********\nprogram.version(\"v0.8.19\", \"-v, --version\");\n\nprogram\n  .command(\"init\")\n  .description(\"Initializes current repository\")\n  .action(() => {\n    init();\n  });\n\nprogram\n  .command(\"install:hooks\")\n  .description(\"Install git hooks\")\n  .action(() => {\n    console.log(\"Installing git hooks...\");\n    install();\n  });\n\n// program\n//   .command(\"uninstall:hooks\")\n//   .description(\"Uninstall git hooks\")\n//   .action(() => {\n//     console.log(\"Uninstalling git hooks...\");\n//     uninstall();\n//   });\n\n// ********** Linters **********\n\nprogram\n  .command(\"install:eslint\")\n  .description(\"Install ESLint\")\n  .action(() => {\n    installEslint();\n  });\n\nprogram\n  .command(\"install:erblint\")\n  .description(\"Install ERB Lint\")\n  .action(() => {\n    installErbLint();\n  });\n\nprogram\n  .command(\"install:brakeman\")\n  .description(\"Install Brakeman\")\n  .action(() => {\n    installBrakeman();\n  });\n\nprogram\n  .command(\"install:rubocop\")\n  .description(\"Install Rubocop\")\n  .action(() => {\n    console.log(\"Installing Rubocop...\");\n    installRubocop();\n  });\n\nprogram\n  .command(\"install:stylelint\")\n  .description(\"Install StyleLint\")\n  .action(() => {\n    console.log(\"Installing StyleLint...\");\n    installRubocop();\n  });\n\nprogram\n  .command(\"lint:staged\")\n  .description(\"Lint Staged files\")\n  .option(\n    \"-f, --format [desiredFormat]\",\n    \"Set the errors report format in console\"\n  )\n  .action(desiredFormat => {\n    lintingPreCommit(desiredFormat.format);\n  });\n\n// Git hooks\n\nprogram\n  .command(\"pre-commit\")\n  .description(\"Simulates pre-commit git hook actions.\")\n  .option(\"-k, --keep\", \"Skip temporary files deletion.\")\n  .option(\"-t, --time\", \"Show execution time.\")\n  .option(\"-T, --truncate\", \"Shorten the output to display only the first 10 offenses.\")\n  .action(cmd => {\n    preCommit(cmd.keep, cmd.time, cmd.truncate);\n  });\n\nprogram\n  .command(\"prepare-commit-msg\")\n  .description(\"Triggers 'prepare-commit-msg' hook actions.\")\n  .action(() => prepareCommitMsg());\n\nprogram\n  .command(\"post-commit\")\n  .description(\"Triggers 'post-commit' hook actions.\")\n  .action(() => postCommit());\n\nprogram\n  .command(\"prettify <extenstion>\")\n  .description(\"Run Prettier on project.\")\n  .action(extenstion => runPrettierOnProject(extenstion));\n\n// ********** User **********\n\nprogram\n  .command(\"login\")\n  .description(\"Sign in on local device.\")\n  .action(() => {\n    const username = getUsernameFromLocalDevice();\n    const token = getTokenFromLocalDevice();\n    if (username && token) {\n      console.log(\"Already logged in as \" + chalk.green(username) + \".\");\n    } else {\n      prompt([\n        {\n          type: \"input\",\n          name: \"username\",\n          message: \"Enter your username or email...\"\n        },\n        {\n          type: \"password\",\n          name: \"password\",\n          mask: \"*\",\n          message: \"Enter your password...\",\n          hidden: true\n        }\n      ]).then(credentials => {\n        login(credentials);\n      });\n    }\n  });\n\nprogram\n  .command(\"logout\")\n  .description(\"Sign out from local device.\")\n  .action(() => {\n    const username = getUsernameFromLocalDevice();\n    const token = getTokenFromLocalDevice();\n    if (!username && !token) {\n      console.log(\"Not logged in.\");\n    } else {\n      prompt([\n        {\n          type: \"confirm\",\n          name: \"confirm\",\n          message: \"Are you sure you want to log out from Omnilint?\"\n        }\n      ]).then(answers => {\n        if (answers.confirm) {\n          logout();\n        }\n      });\n    }\n  });\n\nprogram\n  .command(\"signup\")\n  .description(\"Creates an account\")\n  .action(() => {\n    const username = getUsernameFromLocalDevice();\n    const token = getTokenFromLocalDevice();\n    if (username && token) {\n      console.log(\"Already logged in as \" + chalk.green(username) + \".\");\n      process.exit(0);\n    } else {\n      prompt([\n        {\n          type: \"input\",\n          name: \"username\",\n          message: \"Enter an username...\"\n        },\n        {\n          type: \"input\",\n          name: \"email\",\n          message: \"Enter an email...\"\n        },\n        {\n          type: \"password\",\n          name: \"password\",\n          mask: \"*\",\n          message: \"Enter your password...\",\n          hidden: true\n        }\n      ]).then(answers => signup(answers));\n    }\n  });\n\nprogram\n  .command(\"whoami\")\n  .description(\"Get current user status\")\n  .action(() => {\n    printLoginStatus();\n  });\n\n// program\n//   .command(\"list\")\n//   .alias(\"ls\")\n//   .description(\"Lists repositories\")\n//   .action(() => getRepositories());\n\nprogram.parse(process.argv);\n\n// Show help if no args\nif (program.args.length === 0) {\n  // program.help();\n  lintingPreCommit();\n}\n"]}