securityos/node_modules/eslint-plugin-unicorn/rules/fix/replace-string-raw.js

15 lines
287 B
JavaScript
Raw Permalink Normal View History

2024-09-06 15:32:35 +00:00
'use strict';
// Replace `StringLiteral` or `TemplateLiteral` node with raw text
const replaceStringRaw = (fixer, node, raw) =>
fixer.replaceTextRange(
// Ignore quotes and backticks
[
node.range[0] + 1,
node.range[1] - 1,
],
raw,
);
module.exports = replaceStringRaw;