TODO or DIEEEEEEE!!!!!!!!!!!!!
This plugin turns these TODO comments:
// TODO::expires(2021-01-01): do something
// TODO::expire(2021-01-01): do something
Into such code:
if (Date.now() > 1_704_067_200_000) {
throw new Error("TODO expired: do something");
}
$ npm install -D unplugin-todo-or-die
$ yarn add -D unplugin-todo-or-die
$ pnpm add -D unplugin-todo-or-die
Vite
// vite.config.ts
import TodoOrDie from "unplugin-todo-or-die/vite";
export default defineConfig({
plugins: [
TodoOrDie({
/* options */
}),
],
});
Rollup
// rollup.config.js
import TodoOrDie from "unplugin-todo-or-die/rollup";
export default {
plugins: [
TodoOrDie({
/* options */
}),
// other plugins
],
};
Webpack
// webpack.config.js
module.exports = {
/* ... */
plugins: [
require("unplugin-todo-or-die/webpack")({
/* options */
}),
],
};
Nuxt
// nuxt.config.ts
export default defineNuxtConfig({
modules: ["unplugin-todo-or-die/nuxt"],
});
Vue CLI
// vue.config.js
module.exports = {
configureWebpack: {
plugins: [
require("unplugin-todo-or-die/webpack")({
/* options */
}),
],
},
};
Quasar
// quasar.conf.js [Vite]
module.exports = {
vitePlugins: [
[
"unplugin-todo-or-die/vite",
{
/* options */
},
],
],
};
// quasar.conf.js [Webpack]
const TodoOrDiePlugin = require("unplugin-todo-or-die/webpack");
module.exports = {
build: {
chainWebpack(chain) {
chain.plugin("unplugin-todo-or-die").use(
TodoOrDiePlugin({
/* options */
}),
);
},
},
};
esbuild
// esbuild.config.js
import { build } from "esbuild";
build({
/* ... */
plugins: [
require("unplugin-todo-or-die/esbuild")({
/* options */
}),
],
});
Astro
// astro.config.mjs
import TodoOrDie from "unplugin-todo-or-die/astro";
export default defineConfig({
integrations: [
TodoOrDie({
/* options */
}),
],
});
Original version (ruby): https://github.com/searls/todo_or_die