mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-07 14:12:43 +00:00
Hide conflicting lint rules
This commit is contained in:
@@ -47,9 +47,9 @@ export default [{
|
|||||||
"semi" : ["warn", "always"],
|
"semi" : ["warn", "always"],
|
||||||
|
|
||||||
/** Whitespace **/
|
/** Whitespace **/
|
||||||
"array-bracket-spacing" : ["warn", "never"],
|
//"array-bracket-spacing" : ["warn", "never"],
|
||||||
"arrow-spacing" : ["warn", { before: false, after: false }],
|
"arrow-spacing" : ["warn", { before: false, after: false }],
|
||||||
"comma-spacing" : ["warn", { before: false, after: true }],
|
//"comma-spacing" : ["warn", { before: false, after: true }],
|
||||||
"indent" : ["warn", "tab", { MemberExpression: "off" }],
|
"indent" : ["warn", "tab", { MemberExpression: "off" }],
|
||||||
"linebreak-style" : "off",
|
"linebreak-style" : "off",
|
||||||
"no-trailing-spaces" : "warn",
|
"no-trailing-spaces" : "warn",
|
||||||
|
|||||||
@@ -73,6 +73,7 @@ export default {
|
|||||||
pos.comma !== maxComma ||
|
pos.comma !== maxComma ||
|
||||||
pos.closing !== maxClosing
|
pos.closing !== maxClosing
|
||||||
) {
|
) {
|
||||||
|
console.log(context);
|
||||||
context.report({
|
context.report({
|
||||||
node: pos.node,
|
node: pos.node,
|
||||||
message: "useState pair is not aligned with others in its block.",
|
message: "useState pair is not aligned with others in its block.",
|
||||||
@@ -86,8 +87,6 @@ export default {
|
|||||||
const paddedLeft = left.padEnd(maxComma - 1);
|
const paddedLeft = left.padEnd(maxComma - 1);
|
||||||
const paddedRight = right.padEnd(maxClosing - maxComma - 2);
|
const paddedRight = right.padEnd(maxClosing - maxComma - 2);
|
||||||
const aligned = `[${paddedLeft}, ${paddedRight}] = useState(${value})`;
|
const aligned = `[${paddedLeft}, ${paddedRight}] = useState(${value})`;
|
||||||
console.log("Pre: " + text);
|
|
||||||
console.log("Post: " + aligned);
|
|
||||||
return [
|
return [
|
||||||
fixer.replaceText(pos.node, aligned),
|
fixer.replaceText(pos.node, aligned),
|
||||||
fixer.insertTextBefore(pos.node.parent, ""),
|
fixer.insertTextBefore(pos.node.parent, ""),
|
||||||
|
|||||||
Reference in New Issue
Block a user