UNPKG

@masknet/eslint-plugin

Version:
21 lines 800 B
const BASE_URL = 'https://dimensiondev.github.io/eslint-plugin/src/rules/'; export function createRule({ name, meta, create, resolveOptions }) { if (meta?.docs) { meta.docs.url ??= new URL(name, BASE_URL).toString(); } return Object.freeze({ name, meta, create(context) { const options = resolveOptions?.(...context.options) ?? context.options[0]; const listener = Object.entries(create(context, options)); return Object.fromEntries(listener.filter((pair) => pair[1])); }, }); } export function ensureParserWithTypeInformation(parserServices) { if (!parserServices?.program) { throw new Error('see https://typescript-eslint.io/docs/linting/type-linting'); } } //# sourceMappingURL=rule.js.map