react
→ typescript
git init
git remote add origin https://github.com/blendy9702/til-react-ts.git
: 깃 주소는 늘 다름.
{
"singleQuote": false,
"semi": true,
"useTabs": false,
"tabWidth": 2,
"trailingComma": "all",
"printWidth": 80,
"arrowParens": "avoid",
"endOfLine": "auto"
}
import js from "@eslint/js";
import globals from "globals";
import reactHooks from "eslint-plugin-react-hooks";
import reactRefresh from "eslint-plugin-react-refresh";
import tseslint from "typescript-eslint";
import prettier from "eslint-plugin-prettier";
import react from "eslint-plugin-react";
export default tseslint.config(
{ ignores: ["dist"] },
{
extends: [js.configs.recommended, ...tseslint.configs.recommended],
//검사할 파일 종류
files: ["**/*.{ts,tsx,js,jsx}"],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
},
plugins: {
"react-hooks": reactHooks,
"react-refresh": reactRefresh,
prettier, // Prettier 플러그인
react,
},
rules: {
...reactHooks.configs.recommended.rules,
"react-refresh/only-export-components": [
"warn",
{ allowConstantExport: true },
],
"prettier/prettier": "warn", // Prettier 규칙 (포매팅 오류를 에러로 표시)
"react/react-in-jsx-scope": "off", // React import 생략 가능
},
settings: {
react: {
version: "detect", // React 버전을 자동 감지
},
},
},
);