Skip to content

Commit

Permalink
chore(deps): update dependency prettier to v3 (#87)
Browse files Browse the repository at this point in the history
* chore(deps): update dependency prettier to v3

* fix

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Yosuke Ota <[email protected]>
  • Loading branch information
renovate[bot] and ota-meshi authored Jan 12, 2024
1 parent 523ccf4 commit e0b6e8b
Show file tree
Hide file tree
Showing 20 changed files with 49 additions and 49 deletions.
8 changes: 4 additions & 4 deletions explorer/src/components/AstExplorer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -132,20 +132,20 @@ a { color: red; }
start: locData.sourceLoc.start,
end: locData.sourceLoc.end || locData.sourceLoc.start,
},
{ columnOffset: 1 }
{ columnOffset: 1 },
);
}
}
function findLoc(astJson, locName) {
let locData = astJson.locations.find((l) =>
locInPoint(l[locName], position)
locInPoint(l[locName], position),
);
let nextLocData;
while (
locData &&
(nextLocData = locData.locations.find((l) =>
locInPoint(l[locName], position)
locInPoint(l[locName], position),
))
) {
locData = nextLocData;
Expand Down Expand Up @@ -297,7 +297,7 @@ function processValue(options, ctx, value) {
key !== "source" &&
key !== "parent" &&
key !== "document" &&
key !== "type"
key !== "type",
);
if (typeEntry) entries.unshift(typeEntry);
entries.push(...locEntries);
Expand Down
4 changes: 2 additions & 2 deletions explorer/src/components/MonacoEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<script>
const monacoScript = Array.from(
window.document.head.querySelectorAll("script")
window.document.head.querySelectorAll("script"),
).find((script) => script.src && script.src.includes("monaco"));
window.require.config({
paths: {
Expand Down Expand Up @@ -66,7 +66,7 @@ export default {
renderWhitespace: "boundary",
scrollBeyondLastLine: false,
},
vm.options
vm.options,
);
vm.editor = monaco.editor.create(vm.$el, options);
Expand Down
2 changes: 1 addition & 1 deletion explorer/src/components/scripts/state/deserialize.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export function deserializeState(serializedString) {
try {
const compressedString = window.atob(serializedString);
const uint8Arr = pako.inflate(
Uint8Array.from(compressedString, (c) => c.charCodeAt(0))
Uint8Array.from(compressedString, (c) => c.charCodeAt(0)),
);

const jsonText = new TextDecoder().decode(uint8Arr);
Expand Down
2 changes: 1 addition & 1 deletion explorer/src/components/scripts/state/serialize.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export function serializeState(state) {
`The compress rate of serialized string: ${(
(100 * base64.length) /
jsonString.length
).toFixed(1)}% (${jsonString.length}B → ${base64.length}B)`
).toFixed(1)}% (${jsonString.length}B → ${base64.length}B)`,
);

return base64;
Expand Down
2 changes: 1 addition & 1 deletion lib/html/document.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class Document extends PostCssDocument {
return super.toString(
stringifier || {
stringify: require("../stringify"),
}
},
);
}

Expand Down
6 changes: 3 additions & 3 deletions lib/html/extract-styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ function iterateCode(source, { onStyleTag, onStyleAttribute, svelte, astro }) {
},
{
Tokenizer: svelte ? JsxLikeTokenizer : astro ? AstroTokenizer : undefined,
}
},
);

parser.parseComplete(source);
Expand Down Expand Up @@ -125,7 +125,7 @@ function extractStyles(source, opts) {
const standard =
opts.from &&
/\.(?:\w*html?|xht|xslt?|jsp|aspx?|ejs|php\d*|twig|liquid|m(?:ark)?d(?:ow)?n|mk?d)$/i.test(
opts.from
opts.from,
);
const svelte = opts.from && /\.svelte$/i.test(opts.from);
const astro = opts.from && /\.astro$/i.test(opts.from);
Expand All @@ -149,7 +149,7 @@ function extractStyles(source, opts) {
style.syntax = buildTemplateSyntax(
resolveSyntax("css", {
defaultSyntax: svelte ? cssSafeSyntax : undefined,
})
}),
);
style.lang = "custom-template";
} else {
Expand Down
6 changes: 3 additions & 3 deletions lib/html/parse-styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class LocalFixer {
this.fixLocation(error.input);
error.message = error.message.replace(
/:\d+:\d+:/,
`:${error.line}:${error.column}:`
`:${error.line}:${error.column}:`,
);
}
return error;
Expand All @@ -107,8 +107,8 @@ class LocalFixer {
{
map: false,
},
style.opts
)
style.opts,
),
);
} catch (error) {
this.error(error);
Expand Down
2 changes: 1 addition & 1 deletion lib/syntax/build-syntax-resolver.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ module.exports = function buildSyntaxResolver(config) {
}
if (definedLangs.has(lang)) {
throw new Error(
`Cannot resolve module "${syntax}". It's likely that the module isn't installed correctly. Try reinstalling by running the \`npm install ${syntax}@latest --save-dev\``
`Cannot resolve module "${syntax}". It's likely that the module isn't installed correctly. Try reinstalling by running the \`npm install ${syntax}@latest --save-dev\``,
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/template/syntax.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ module.exports = function buildTemplateSyntax(baseSyntax) {
return templateParse(
css,
opts,
baseSyntax.parse === postcssParse ? TemplateParser : TemplateSafeParser
baseSyntax.parse === postcssParse ? TemplateParser : TemplateSafeParser,
);
},
stringify(...args) {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"eslint-plugin-n": "^16.6.2",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-node-dependencies": "^0.11.0",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-regexp": "^1.4.1",
"eslint-plugin-vue": "^9.0.0",
"eslint-plugin-yml": "^1.0.0",
Expand All @@ -84,7 +84,7 @@
"postcss-less": "^6.0.0",
"postcss-scss": "^4.0.1",
"postcss-styl": "^0.12.0",
"prettier": "^2.4.1",
"prettier": "^3.0.0",
"stylelint": "^14.4.0",
"stylelint-config-standard": "^28.0.0",
"sugarss": "^4.0.1"
Expand Down
6 changes: 3 additions & 3 deletions test/error.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe("error tests", () => {
expect(() =>
parser.parse(html, {
from: "markdown.md",
})
}),
).to.throw("TEST");
});

Expand All @@ -40,7 +40,7 @@ describe("error tests", () => {
expect(() =>
parser.parse(html, {
from: "markdown.md",
})
}),
).to.throw("Unknown word");
});
it("define syntax option", () => {
Expand All @@ -56,7 +56,7 @@ describe("error tests", () => {
expect(() =>
parser.parse(html, {
from: "markdown.md",
})
}),
).to.throw('Cannot resolve module "postcss-foo"');
});
});
20 changes: 10 additions & 10 deletions test/html.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ describe("html tests", () => {
"b {}",
"</style>",
"</html>",
].join("\n")
].join("\n"),
);
});
});
Expand Down Expand Up @@ -110,7 +110,7 @@ describe("html tests", () => {
"}",
"</style>",
"</html>",
].join("\n")
].join("\n"),
);
});
});
Expand All @@ -124,7 +124,7 @@ describe("html tests", () => {
root.last,
postcss.rule({
selector: "b",
})
}),
);
},
};
Expand Down Expand Up @@ -168,7 +168,7 @@ describe("html tests", () => {
"}",
"</style>",
"</html>",
].join("\n")
].join("\n"),
);
});
});
Expand All @@ -182,7 +182,7 @@ describe("html tests", () => {
root.first,
postcss.rule({
selector: "b",
})
}),
);
},
};
Expand Down Expand Up @@ -224,7 +224,7 @@ describe("html tests", () => {
"}b {}",
"</style>",
"</html>",
].join("\n")
].join("\n"),
);
});
});
Expand Down Expand Up @@ -265,7 +265,7 @@ describe("html tests", () => {
"}",
"</style>",
"</html>",
].join("\n")
].join("\n"),
);
});
});
Expand Down Expand Up @@ -308,7 +308,7 @@ describe("html tests", () => {
"}b {}",
"</style>",
"</html>",
].join("\n")
].join("\n"),
);
});
});
Expand All @@ -334,7 +334,7 @@ describe("html tests", () => {
.then((result) => {
expect(result.root.source).to.haveOwnProperty("lang", "html");
expect(result.content).to.equal(
["<html>", "<style>", "b {}</style>", "</html>"].join("\n")
["<html>", "<style>", "b {}</style>", "</html>"].join("\n"),
);
});
});
Expand Down Expand Up @@ -368,7 +368,7 @@ describe("html tests", () => {
//
"<style>b {}</style>",
"<style>b {}</style>",
].join("\n")
].join("\n"),
);
});
});
Expand Down
4 changes: 2 additions & 2 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ describe("API", () => {
].join("\n"),
{
from: "SyntaxError.html",
}
},
);
})
.to.throw(/SyntaxError.html:2:8: Unclosed block\b/)
Expand All @@ -93,7 +93,7 @@ describe("API", () => {
].join("\n"),
{
from: "SyntaxError.html",
}
},
);
})
.to.throw(/SyntaxError.html:2:8: Unknown word\b/)
Expand Down
2 changes: 1 addition & 1 deletion test/integration/stylelint-config-recommended-vue.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const STYLELINT = `.${path.sep}node_modules${path.sep}.bin${path.sep}stylelint`;

const FIXTURE_ROOT = path.resolve(
__dirname,
"../../test-fixtures/integration/stylelint-config-recommended-vue"
"../../test-fixtures/integration/stylelint-config-recommended-vue",
);

describe("Integration with stylelint-config-recommended-vue", () => {
Expand Down
6 changes: 3 additions & 3 deletions test/integration/stylelint.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ chai.use(jestSnapshotPlugin());

const FIXTURE_ROOT = path.resolve(
__dirname,
"../../test-fixtures/integration/stylelint"
"../../test-fixtures/integration/stylelint",
);

describe("Integration with stylelint", () => {
Expand All @@ -29,7 +29,7 @@ describe("Integration with stylelint", () => {
.then((result) => {
const actual = result.results[0].warnings;
chai.expect(actual).toMatchSnapshot();
})
}),
);
});
describe(`stylelint --fix with html`, () => {
Expand All @@ -45,7 +45,7 @@ describe("Integration with stylelint", () => {
.then((result) => {
const actual = result.output;
chai.expect(actual).toMatchSnapshot();
})
}),
);
});
}
Expand Down
10 changes: 5 additions & 5 deletions test/interpolation.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ describe("template interpolation", () => {
].join("\n"),
{
from: "quickapp.ux",
}
},
);

expect(document.nodes).to.have.lengthOf(1);
Expand All @@ -36,7 +36,7 @@ describe("template interpolation", () => {
].join("\n"),
{
from: "quickapp.ux",
}
},
);

expect(document.nodes).to.have.lengthOf(1);
Expand All @@ -62,7 +62,7 @@ describe("template interpolation", () => {
].join("\n"),
{
from: "quickapp.ux",
}
},
);

expect(document.nodes).to.have.lengthOf(2);
Expand Down Expand Up @@ -92,7 +92,7 @@ describe("template interpolation", () => {
].join("\n"),
{
from: "vue-sfc.vue",
}
},
);

expect(document.nodes).to.have.lengthOf(2);
Expand All @@ -117,7 +117,7 @@ describe("template interpolation", () => {
['<a style="display: { dynamicProperties }">', "</a>"].join("\n"),
{
from: "app.svelte",
}
},
);
expect(document.nodes).to.have.lengthOf(1);
expect(document.first.source).to.have.property("lang", "custom-template");
Expand Down
2 changes: 1 addition & 1 deletion test/root.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe("Root node tests", () => {
" .c",
" color red",
"",
].join("\n")
].join("\n"),
);
});
});
2 changes: 1 addition & 1 deletion test/safe-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe("postcss-safe-parser", () => {
].join("\n"),
{
from: "quickapp.ux",
}
},
);

expect(document.nodes).to.have.lengthOf(1);
Expand Down
Loading

0 comments on commit e0b6e8b

Please sign in to comment.