Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (typeof padding === "number") {
_backwardCompatibleIndexValue = padding;
throwIfTesting(`${errorPrefix} This is un-document way:
report(node, new RuleError("message", index);
Please use { index }:
report(node, new RuleError("message", {
index: paddingLineColumn
});
`);
}
// when running from textlint-tester, assert
if (padding.line === undefined && padding.column !== undefined) {
// FIXME: Backward compatible <= textlint.5.5
throwIfTesting(`${errorPrefix} Have to use a sets with "line" and "column".
See FAQ: https://github.com/textlint/textlint/blob/master/docs/faq/line-column-or-index.md
report(node, new RuleError("message", {
line: paddingLineNumber,
column: paddingLineColumn
});
OR use "index" property insteadof only "column".
report(node, new RuleError("message", {
index: paddingLineColumn
});
`);
}
// When either one of {column, line} or {index} is not used, throw error
addProcessor(Processor: TextlintPluginProcessorConstructor) {
throwIfTesting(
"Use setupPlugins insteadof addProcessor method.`addProcessor` will be removed in the future." +
"For more details, See https://github.com/textlint/textlint/issues/293"
);
this.textlintKernelDescriptor = this.textlintKernelDescriptor.shallowMerge({
plugins: [
{
pluginId: "`${Processor.name}@deprecated`",
plugin: { Processor }
}
].concat(this.defaultPlugins)
});
}