본문으로 건너뛰기

Linting & Formatting

ESLint

yarn create @eslint/config@latest

Prettier

yarn add -D eslint-config-prettier
eslint.config.mjs
import eslintConfigPrettier from "eslint-config-prettier";

export default [
// ...
eslintConfigPrettier,
];

Typescript

yarn add -D typescript-eslint
eslint.config.mjs
import eslint from "@eslint/js";
import tseslint from "typescript-eslint";

export default [
// ...
eslint.configs.recommended,
...tseslint.configs.recommended,
];

Prettier

yarn add -D prettier
prettier.config.mjs
export default {
printWidth: 120,
singleQuote: false,
trailingComma: "all",
useTabs: true,
};
.prettierignore
### macOS ###
# General
.DS_Store

### JavaScript ###
# Dependencies
node_modules
pnpm-lock.yaml
package-lock.json
yarn.lock

# Build
dist
build
prettier --write .

TailwindCSS

yarn add -D prettier-plugin-tailwindcss
prettier.config.mjs
export default {
plugins: [
"prettier-plugin-tailwindcss", // 다른 플러그인과 호환성을 위해 마지막에 추가
],
tailwindFunctions: ["clsx"],
};