Skip to content

Commit

Permalink
[build] eslint와 prettier 관련 설정
Browse files Browse the repository at this point in the history
  • Loading branch information
darkdulgi committed Jul 23, 2024
1 parent a29e834 commit 7f2515b
Show file tree
Hide file tree
Showing 7 changed files with 125 additions and 176 deletions.
29 changes: 15 additions & 14 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,26 @@ module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:react/jsx-runtime',
'plugin:react-hooks/recommended',
'plugin:prettier/recommended'
"eslint:recommended",
"plugin:react/recommended",
"plugin:react/jsx-runtime",
"plugin:react-hooks/recommended",
"prettier",
],
ignorePatterns: ['dist', '.eslintrc.cjs', '**/*.config.js'],
parserOptions: { ecmaVersion: 'latest', sourceType: 'module' },
settings: { react: { version: '18.2' } },
plugins: ['react-refresh'],
ignorePatterns: ["dist", ".eslintrc.cjs", "**/*.config.js"],
parserOptions: { ecmaVersion: "latest", sourceType: "module" },
settings: { react: { version: "18.2" } },
plugins: ["react-refresh", "@stylistic/jsx"],
rules: {
'react/jsx-no-target-blank': 'off',
'react-refresh/only-export-components': [
'warn',
"react/jsx-no-target-blank": "off",
"react-refresh/only-export-components": [
"warn",
{ allowConstantExport: true },
],
"react/react-in-jsx-scope": "off",
"react/prop-types": "off",
"react/no-unknown-property": "off",
"prettier/prettier": ["error", { "endOfLine": "auto" }]
"prettier/prettier": "off", // eslint-plugin-prettier 플러그인을 사용하지 않으므로 관련 에러를 off
"brace-style": ["error", "1tbs", { allowSingleLine: true }],
},
}
};
8 changes: 8 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"jsxSingleQuote": false,
"singleQuote": false,
"trailingComma": "all",
"semi": true,
"tabWidth": 2,
"useTabs": false
}
184 changes: 95 additions & 89 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"dev": "vite",
"build": "vite build",
"lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0",
"format": "prettier --write 'src/**/*.{js,jsx,ts,tsx,json,css}'",
"preview": "vite preview",
"lint-fix": "eslint . --ext js,jsx --fix"
},
Expand All @@ -16,13 +17,14 @@
"zustand": "^4.5.4"
},
"devDependencies": {
"@stylistic/eslint-plugin-js": "^2.3.0",
"@stylistic/eslint-plugin-jsx": "^2.3.0",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@vitejs/plugin-react": "^4.3.1",
"autoprefixer": "^10.4.19",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-react": "^7.34.3",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-react-refresh": "^0.4.7",
Expand Down
42 changes: 0 additions & 42 deletions src/App.css

This file was deleted.

Loading

0 comments on commit 7f2515b

Please sign in to comment.