@wickedknock/formah
v1.0.3
Published
Instantly format JS/TS files with the world's top 5 style standards — no config files needed
Downloads
349
Maintainers
Readme
formah
Instantly format any JS or TS file to match popular style guides — no config files, no setup.
Install
npm install -g @wickedknock/formahSee it in action
Before:
const fetchUser = async(userId,options)=>{
const res = await fetch('/api/users/'+userId,{method:'GET',headers:{'Content-Type':'application/json'}})
if(!res.ok){throw new Error('Request failed with status '+res.status)}
const data=await res.json()
return {id:data.id,name:data.name,email:data.email,role:data.role||'user'}
}Run:
formah api.jsAfter — Airbnb:
const fetchUser = async (userId, options) => {
const res = await fetch(`/api/users/${userId}`, {
method: 'GET',
headers: { 'Content-Type': 'application/json' },
});
if (!res.ok) {
throw new Error(`Request failed with status ${res.status}`);
}
const data = await res.json();
return {
id: data.id,
name: data.name,
email: data.email,
role: data.role || 'user',
};
};The file is saved in-place. No config files, no extra steps.
Supported styles
Choose one every time you run formah:
| Style | Quotes | Semicolons | Trailing Commas | Indent | |---|---|---|---|---| | Airbnb | single | yes | all | 2 spaces | | Standard JS | single | no | none | 2 spaces | | Google | single | yes | es5 | 2 spaces | | XO | single | yes | all | tabs |
Supported file types
.js .jsx .mjs .cjs .ts .tsx
License
MIT © wickedknock
