Linting & Formatting
ESLint
- Yarn
- npm
yarn create @eslint/config@latest
npm init @eslint/config@latest
Prettier
- Yarn
- npm
yarn add -D eslint-config-prettier
npm install -D eslint-config-prettier
eslint.config.mjs
import eslintConfigPrettier from "eslint-config-prettier";
export default [
// ...
eslintConfigPrettier,
];
Typescript
- Yarn
- npm
yarn add -D typescript-eslint
npm install -D typescript-eslint
eslint.config.mjs
import eslint from "@eslint/js";
import tseslint from "typescript-eslint";
export default tseslint.config(eslint.configs.recommended, ...tseslint.configs.recommended);
Prettier
- Yarn
- npm
yarn add -D prettier
npm install -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
- npm
yarn add -D prettier-plugin-tailwindcss
npm install -D prettier-plugin-tailwindcss
prettier.config.mjs
export default {
plugins: [
"prettier-plugin-tailwindcss", // 다른 플러그인과 호환성을 위해 마지막에 추가
],
tailwindFunctions: ["clsx"],
};