.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / @typescript-eslint / experimental-utils / dist / eslint-utils / RuleCreator.js
1 "use strict";
2 Object.defineProperty(exports, "__esModule", { value: true });
3 exports.RuleCreator = void 0;
4 const applyDefault_1 = require("./applyDefault");
5 function RuleCreator(urlCreator) {
6     // This function will get much easier to call when this is merged https://github.com/Microsoft/TypeScript/pull/26349
7     // TODO - when the above PR lands; add type checking for the context.report `data` property
8     return function createRule({ name, meta, defaultOptions, create, }) {
9         return {
10             meta: Object.assign(Object.assign({}, meta), { docs: Object.assign(Object.assign({}, meta.docs), { url: urlCreator(name) }) }),
11             create(context) {
12                 const optionsWithDefault = applyDefault_1.applyDefault(defaultOptions, context.options);
13                 return create(context, optionsWithDefault);
14             },
15         };
16     };
17 }
18 exports.RuleCreator = RuleCreator;
19 //# sourceMappingURL=RuleCreator.js.map