Skip to content

Instantly share code, notes, and snippets.

View tuanductran's full-sized avatar

Tuan Duc Tran tuanductran

View GitHub Profile
@tuanductran
tuanductran / eslint.config.mjs
Created October 22, 2024 07:38
Antfu Eslint basic.
import antfu from '@antfu/eslint-config'
export default antfu(
{
formatters: true,
},
)
@tuanductran
tuanductran / slugify.ts
Created October 22, 2024 07:33
How to create a slug with just a snippet of TypeScript code
export function slugify(str: string): string {
let formattedSlug = str.toLowerCase();
const accentMapping: { [key: string]: string } = {
á: "a",
à: "a",
ă: "a",
ắ: "a",
ằ: "a",
ẵ: "a",
@tuanductran
tuanductran / .eslintrc.js
Created October 24, 2022 21:06 — forked from nkbt/.eslintrc.js
Strict ESLint config for React, ES6 (based on Airbnb Code style)
{
"env": {
"browser": true,
"node": true,
"es6": true
},
"plugins": ["react"],
"ecmaFeatures": {