Skip to content

Instantly share code, notes, and snippets.

View xfournet's full-sized avatar

Xavier Fournet xfournet

  • YOOI
  • Lyon, France
View GitHub Profile
@xfournet
xfournet / config.ts
Last active January 16, 2025 08:57
airbnb compat with ESLint 9
import { fixupConfigRules } from '@eslint/compat';
import { FlatCompat } from '@eslint/eslintrc';
import stylistic from '@stylistic/eslint-plugin';
import path from 'path';
import { fileURLToPath } from 'url';
const filename = fileURLToPath(import.meta.url);
const dirname = path.dirname(filename);
const compat = new FlatCompat({
baseDirectory: dirname,
@xfournet
xfournet / pluginHttp2Proxy.ts
Last active February 7, 2025 22:15
Vite support for HTTP2 and proxy
import proxy from 'http2-proxy';
import type { Plugin, ProxyOptions } from 'vite';
export const pluginHttp2Proxy = (): Plugin => {
let routes: Record<string, string | ProxyOptions>;
return {
name: 'vite-plugin-http2-proxy',
config: (config) => {
const { server } = config;
routes = server?.proxy ?? {};