Skip to content

Commit 1e2f859

Browse files
committed
chore: eslint, prettier 추가
1 parent f3b24c6 commit 1e2f859

File tree

13 files changed

+15111
-11110
lines changed

13 files changed

+15111
-11110
lines changed

.babelrc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"presets": [
3-
"@babel/preset-react",
4-
"@babel/preset-env",
5-
"@babel/preset-typescript"
6-
]
2+
"presets": [
3+
"@babel/preset-react",
4+
"@babel/preset-env",
5+
"@babel/preset-typescript"
6+
]
77
}

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
config

.eslintrc.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"parser": "@typescript-eslint/parser",
3+
"parserOptions": {
4+
"project": "./tsconfig.json"
5+
},
6+
"plugins": ["@typescript-eslint"],
7+
"env": {
8+
"browser": true,
9+
"es6": true,
10+
"node": true
11+
},
12+
"extends": [
13+
"airbnb",
14+
"airbnb-typescript",
15+
"plugin:prettier/recommended",
16+
"plugin:@typescript-eslint/recommended"
17+
],
18+
"rules": {
19+
"react/jsx-filename-extension": [
20+
1,
21+
{ "extensions": [".js", ".jsx", ".ts", ".tsx"] }
22+
],
23+
"react/function-component-definition": [
24+
2,
25+
{ "namedComponents": "arrow-function" }
26+
],
27+
"react/prop-types": 0,
28+
"import/no-unresolved": "off",
29+
"import/no-cycle": "off",
30+
"no-param-reassign": "off"
31+
}
32+
}

.prettierrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"singleQuote": true,
3+
"semi": true,
4+
"tabWidth": 4,
5+
"trailingComma": "all",
6+
"printWidth": 80,
7+
"arrowParens": "avoid",
8+
"endOfLine": "auto"
9+
}

config/webpack.common.js

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,38 @@
1-
const HtmlWebpackPlugin = require("html-webpack-plugin");
2-
const path = require("path");
3-
const webpack = require("webpack");
1+
const HtmlWebpackPlugin = require('html-webpack-plugin');
2+
const path = require('path');
3+
const webpack = require('webpack');
44

55
module.exports = {
6-
entry: "./src/index.tsx",
6+
entry: './src/index.tsx',
77

8-
module: {
9-
rules: [
10-
{
11-
test: /\.tsx?$/,
12-
use: ["babel-loader"],
13-
exclude: /node_modules/,
14-
},
15-
],
16-
},
8+
module: {
9+
rules: [
10+
{
11+
test: /\.tsx?$/,
12+
use: ['babel-loader'],
13+
exclude: /node_modules/,
14+
},
15+
],
16+
},
1717

18-
plugins: [
19-
new HtmlWebpackPlugin({
20-
template: "public/index.html",
21-
}),
22-
new webpack.ProvidePlugin({
23-
React: "react",
24-
}),
25-
],
18+
plugins: [
19+
new HtmlWebpackPlugin({
20+
template: 'public/index.html',
21+
}),
22+
new webpack.ProvidePlugin({
23+
React: 'react',
24+
}),
25+
],
2626

27-
resolve: {
28-
alias: {
29-
"@": path.resolve(__dirname, "../src/"),
27+
resolve: {
28+
alias: {
29+
'@': path.resolve(__dirname, '../src/'),
30+
},
31+
extensions: ['.js', '.jsx', '.ts', '.tsx', '.css', '.json'],
3032
},
31-
extensions: [".js", ".jsx", ".ts", ".tsx", ".css", ".json"],
32-
},
3333

34-
output: {
35-
filename: "bundle.js",
36-
path: path.join(__dirname, "dist"),
37-
},
34+
output: {
35+
filename: 'bundle.js',
36+
path: path.join(__dirname, 'dist'),
37+
},
3838
};

config/webpack.dev.js

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
const { merge } = require("webpack-merge");
2-
const common = require("./webpack.common");
1+
const { merge } = require('webpack-merge');
2+
const common = require('./webpack.common');
33

44
module.exports = merge(common, {
5-
mode: "development",
6-
devtool: "inline-source-map",
7-
devServer: {
8-
open: false,
9-
hot: true,
10-
compress: true,
11-
port: 3000,
12-
historyApiFallback: true,
13-
liveReload: true,
14-
// proxy: {
15-
// "/api": { target: "http://localhost:9000" },
16-
// },
17-
},
18-
module: {
19-
rules: [
20-
{
21-
test: /\.(sa|sc|c)ss$/i,
22-
use: ["style-loader", "css-loader"], // 필요에 따라 sass-loader 추가
23-
},
24-
],
25-
},
5+
mode: 'development',
6+
devtool: 'inline-source-map',
7+
devServer: {
8+
open: false,
9+
hot: true,
10+
compress: true,
11+
port: 3000,
12+
historyApiFallback: true,
13+
liveReload: true,
14+
// proxy: {
15+
// "/api": { target: "http://localhost:9000" },
16+
// },
17+
},
18+
module: {
19+
rules: [
20+
{
21+
test: /\.(sa|sc|c)ss$/i,
22+
use: ['style-loader', 'css-loader'],
23+
},
24+
],
25+
},
2626
});

config/webpack.prod.js

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,36 @@
1-
const { merge } = require("webpack-merge");
2-
const common = require("./webpack.common");
3-
const path = require("path");
4-
const TerserPlugin = require("terser-webpack-plugin");
1+
const { merge } = require('webpack-merge');
2+
const common = require('./webpack.common');
3+
const path = require('path');
4+
const TerserPlugin = require('terser-webpack-plugin');
55

66
module.exports = merge(common, {
7-
mode: "production",
8-
devtool: "cheap-module-source-map",
9-
output: {
10-
filename: "[name].[contenthash].js",
11-
path: path.resolve(__dirname, "../dist"),
12-
publicPath: "./",
13-
clean: true,
14-
},
15-
optimization: {
16-
usedExports: true,
17-
minimize: true,
18-
minimizer: [
19-
new TerserPlugin({
20-
terserOptions: {
21-
compress: {
22-
drop_console: true,
23-
},
7+
mode: 'production',
8+
devtool: 'cheap-module-source-map',
9+
output: {
10+
filename: '[name].[contenthash].js',
11+
path: path.resolve(__dirname, '../dist'),
12+
publicPath: './',
13+
clean: true,
14+
},
15+
optimization: {
16+
usedExports: true,
17+
minimize: true,
18+
minimizer: [
19+
new TerserPlugin({
20+
terserOptions: {
21+
compress: {
22+
drop_console: true,
23+
},
24+
},
25+
}),
26+
],
27+
splitChunks: {
28+
chunks: 'all',
2429
},
25-
}),
26-
],
27-
splitChunks: {
28-
chunks: "all",
2930
},
30-
},
31-
performance: {
32-
hints: false,
33-
maxEntrypointSize: 512000,
34-
maxAssetSize: 512000,
35-
},
31+
performance: {
32+
hints: false,
33+
maxEntrypointSize: 512000,
34+
maxAssetSize: 512000,
35+
},
3636
});

0 commit comments

Comments
 (0)