Files
test-repo/scripts/tools/eslint-plugin-prettier-internal-rules/no-doc-builder-concat.js
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

35 lines
699 B
JavaScript
Raw Normal View History

2021-01-04 10:04:30 +08:00
"use strict";
const selector = [
"CallExpression",
">",
"Identifier.callee",
'[name="concat"]',
].join("");
const messageId = "no-doc-builder-concat";
module.exports = {
meta: {
type: "suggestion",
docs: {
url:
2021-01-24 01:14:13 +08:00
"https://github.com/prettier/prettier/blob/main/scripts/eslint-plugin-prettier-internal-rules/no-doc-builder-concat.js",
2021-01-04 10:04:30 +08:00
},
messages: {
[messageId]: "Use array directly instead of `concat([])`",
},
fixable: "code",
},
create(context) {
return {
[selector](node) {
context.report({
node,
messageId,
fix: (fixer) => fixer.replaceText(node, ""),
});
},
};
},
};