Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"lint:tsc": "tsc --noEmit",
"prepare": "husky install",
"prepublishOnly": "pnpm lint && pnpm test",
"test": "pnpm clean && pnpm build && pnpm vitest"
"test": "pnpm clean && pnpm build && pnpm vitest --run"
},
"lint-staged": {
"**": [
Expand Down
7 changes: 3 additions & 4 deletions src/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const cacheGcInterval = process.env["PRETTIER_PLUGIN_ELM_CACHE_GC_INTERVAL"]
? Number.parseInt(process.env["PRETTIER_PLUGIN_ELM_CACHE_GC_INTERVAL"], 10)
: 1000 * 60;

/* istanbul ignore next */
/* v8 ignore next 3 */
const noop = () => {
//
};
Expand Down Expand Up @@ -53,7 +53,7 @@ const collectGarbageIfNeeded = () => {
// fs.statSync may fail if another GC process has just deleted it;
// this is not critical

/* istanbul ignore next */
/* v8 ignore next 3 */
if (process.env["NODE_ENV"] === "test") {
throw error;
}
Expand Down Expand Up @@ -118,7 +118,7 @@ export const getCachedValue = <Args extends any[], Result>(
// a failure to save record into cache or clean garbage
// should not affect the result of the function

/* istanbul ignore next */
/* v8 ignore next 3 */
if (process.env["NODE_ENV"] === "test") {
throw error;
}
Expand All @@ -128,7 +128,6 @@ export const getCachedValue = <Args extends any[], Result>(
// eslint-disable-next-line unicorn/error-message -- populating message in a for loop below
const errorToThrow = new Error() as Error & Record<string, unknown>;
for (const errorProperty in record.error) {
/* istanbul ignore else */
if (Object.prototype.hasOwnProperty.call(record.error, errorProperty)) {
errorToThrow[errorProperty] = record.error["property"];
}
Expand Down
1 change: 0 additions & 1 deletion src/main.test.mts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ for (const sourceFileName of files) {
plugins: [require.resolve(path.resolve(__dirname, ".."))],
});
} catch (error) {
console.log("err", error);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant line from #60

actualResult = sourceText;
}

Expand Down
2 changes: 1 addition & 1 deletion src/printer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const print = (path: AstPath<ElmNode>): Doc => {
return node.body;
}

/* istanbul ignore next */
/* v8 ignore next 15 */
default: {
if (process.env["NODE_ENV"] === "test") {
throw new Error(
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"compilerOptions": {
"noEmit": false,
"outDir": "dist",
"rootDir": "src"
"rootDir": "src",
"sourceMap": true
},
"include": ["src/**/*"]
}