mirror of
https://github.com/JamesIves/github-pages-deploy-action.git
synced 2023-12-15 20:03:39 +08:00
1 line
3.8 KiB
Plaintext
1 line
3.8 KiB
Plaintext
{"version":3,"sources":["../src/warnRemovedSettings.js"],"names":["warnSettings","has","obj","property","Object","prototype","hasOwnProperty","call","getMovedSettings","ruleName","warnRemovedSettings","context","movedSettings","settings","jsdoc","setting","hasBeenWarned","report","loc","start","column","line","message","markSettingAsWarned"],"mappings":";;;;;;;AAAA;;;;AAEA,MAAMA,YAAY,GAAG,4BAArB;AAEA;;;;;;;;;;AAUA;;;;;;AAKA,MAAMC,GAAG,GAAG,CAACC,GAAD,EAAMC,QAAN,KAAmB;AAC7B,SAAOC,MAAM,CAACC,SAAP,CAAiBC,cAAjB,CAAgCC,IAAhC,CAAqCL,GAArC,EAA0CC,QAA1C,CAAP;AACD,CAFD;AAIA;;;;;;;AAKA,MAAMK,gBAAgB,GAAIC,QAAD,IAAc;AACrC,UAAQA,QAAR;AACA,SAAK,eAAL;AACE,aAAO,CAAC,sBAAD,CAAP;;AACF,SAAK,iBAAL;AACE,aAAO,CAAC,oBAAD,CAAP;;AACF,SAAK,aAAL;AACE,aAAO,CAAC,qBAAD,EAAwB,uBAAxB,CAAP;;AACF,SAAK,iBAAL;AACE,aAAO,CAAC,4BAAD,CAAP;;AACF,SAAK,gBAAL;AACE,aAAO,CACL,iBADK,EAEL,kBAFK,EAGL,wBAHK,EAIL,mBAJK,EAKL,uBALK,EAML,kBANK,EAOL,YAPK,EASL;AACA,2BAVK,EAWL,YAXK,EAYL,+BAZK,CAAP;AAVF;AA0BA;;;AACA,SAAO,EAAP;AACD,CA7BD;AA+BA;;;;;;AAIe,SAASC,mBAAT,CAA8BC,OAA9B,EAAuCF,QAAvC,EAAiD;AAC9D,QAAMG,aAAa,GAAGJ,gBAAgB,CAACC,QAAD,CAAtC;;AAEA,MAAI,CAACE,OAAO,CAACE,QAAT,IAAqB,CAACF,OAAO,CAACE,QAAR,CAAiBC,KAA3C,EAAkD;AAChD;AACD;;AAL6D;AAAA;AAAA;;AAAA;AAO9D,yBAAsBF,aAAtB,8HAAqC;AAAA,YAA1BG,OAA0B;;AACnC,UACEd,GAAG,CAACU,OAAO,CAACE,QAAR,CAAiBC,KAAlB,EAAyBC,OAAzB,CAAH,IACA,CAACf,YAAY,CAACgB,aAAb,CAA2BL,OAA3B,EAAoCI,OAApC,CAFH,EAGE;AACAJ,QAAAA,OAAO,CAACM,MAAR,CAAe;AACbC,UAAAA,GAAG,EAAE;AACHC,YAAAA,KAAK,EAAE;AACLC,cAAAA,MAAM,EAAE,CADH;AAELC,cAAAA,IAAI,EAAE;AAFD;AADJ,WADQ;AAObC,UAAAA,OAAO,EAAG,oBAAmBP,OAAQ,uBAA5B,GACN,6BAA4BN,QAAS;AAR3B,SAAf;AAUAT,QAAAA,YAAY,CAACuB,mBAAb,CAAiCZ,OAAjC,EAA0CI,OAA1C;AACD;AACF;AAxB6D;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAyB/D","sourcesContent":["import WarnSettings from './WarnSettings';\n\nconst warnSettings = WarnSettings();\n\n/**\n * @typedef {(\n * \"require-jsdoc\"\n * | \"require-returns\"\n * | \"valid-types\"\n * | \"require-example\"\n * | \"check-examples\"\n * )} RulesWithMovedSettings\n */\n\n/**\n * @param {object} obj\n * @param {string} property\n * @returns {boolean}\n */\nconst has = (obj, property) => {\n return Object.prototype.hasOwnProperty.call(obj, property);\n};\n\n/**\n *\n * @param {RulesWithMovedSettings} ruleName\n * @returns {string[]}\n */\nconst getMovedSettings = (ruleName) => {\n switch (ruleName) {\n case 'require-jsdoc':\n return ['exemptEmptyFunctions'];\n case 'require-returns':\n return ['forceRequireReturn'];\n case 'valid-types':\n return ['allowEmptyNamepaths', 'checkSeesForNamepaths'];\n case 'require-example':\n return ['avoidExampleOnConstructors'];\n case 'check-examples':\n return [\n 'captionRequired',\n 'exampleCodeRegex',\n 'rejectExampleCodeRegex',\n 'allowInlineConfig',\n 'noDefaultExampleRules',\n 'matchingFileName',\n 'configFile',\n\n // The old name for `checkEslintrc`\n 'eslintrcForExamples',\n 'baseConfig',\n 'reportUnusedDisableDirectives',\n ];\n }\n\n /* istanbul ignore next */\n return [];\n};\n\n/**\n * @param {object} context\n * @param {RulesWithMovedSettings} ruleName\n */\nexport default function warnRemovedSettings (context, ruleName) {\n const movedSettings = getMovedSettings(ruleName);\n\n if (!context.settings || !context.settings.jsdoc) {\n return;\n }\n\n for (const setting of movedSettings) {\n if (\n has(context.settings.jsdoc, setting) &&\n !warnSettings.hasBeenWarned(context, setting)\n ) {\n context.report({\n loc: {\n start: {\n column: 1,\n line: 1,\n },\n },\n message: `\\`settings.jsdoc.${setting}\\` has been removed, ` +\n `use options in the rule \\`${ruleName}\\` instead.`,\n });\n warnSettings.markSettingAsWarned(context, setting);\n }\n }\n}\n"],"file":"warnRemovedSettings.js"} |