Skip to content

Commit

Permalink
style: format code with Prettier and StandardJS
Browse files Browse the repository at this point in the history
This commit fixes the style issues introduced in 4d3d1de according to the output
from Prettier and StandardJS.

Details: None
  • Loading branch information
deepsource-autofix[bot] authored Nov 14, 2023
1 parent 4d3d1de commit 8acf41d
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 50 deletions.
12 changes: 6 additions & 6 deletions src/i18n/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,21 @@ i18n
// },
resources: {
en: {
translation: translationInEn,
translation: translationInEn
},
zh: {
translation: translationInZh,
},
translation: translationInZh
}
},
lng: 'zh',
fallbackLng: 'en', // 默认语言
debug: process.env.NODE_ENV !== 'production', // 开启调试模式
interpolation: {
escapeValue: false, // 不转义特殊字符
escapeValue: false // 不转义特殊字符
},
detection: {
order: ['localStorage', 'navigator'],
},
order: ['localStorage', 'navigator']
}
})

export default i18n
2 changes: 1 addition & 1 deletion src/locales/en/translation.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const en = {
demo: 'Demo',
lang: 'En',
home: 'Home',
home: 'Home'
}

export default en
2 changes: 1 addition & 1 deletion src/locales/zh/translation.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const zh = {
demo: '演示',
lang: 'ZH',
home: '首页',
home: '首页'
}

export default zh
84 changes: 42 additions & 42 deletions webpack/webpack.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ switch (process.env.BUILD_GOAL) {

const config = {
entry: {
app: `${paths.src}/index.tsx`,
app: `${paths.src}/index.tsx`
},
output: {
path: paths.build,
Expand All @@ -46,7 +46,7 @@ const config = {
// library: '',
// libraryTarget: 'umd',
// chunkLoadingGlobal: '',
clean: true,
clean: true
// contentBase: path.join(__dirname, "public"), // 配置额外的静态文件内容的访问路径
},
resolve: {
Expand All @@ -61,13 +61,13 @@ const config = {
'@pages': path.resolve('./src/pages'),
'@routers': path.resolve('./src/routers'),
'@utils': path.resolve('./src/utils'),
'@theme': path.resolve('./src/theme'),
'@theme': path.resolve('./src/theme')
},
symlinks: false,
symlinks: false
},
plugins: [
new Dotenv({
path: path.resolve(__dirname, '..', dotEnv),
path: path.resolve(__dirname, '..', dotEnv)
}),
new HtmlWebpackPlugin({
title: isDev ? 'Pro React Dev' : 'Pro React',
Expand All @@ -91,8 +91,8 @@ const config = {
minifyCSS: true,
minifyJS: true,
minifyURLs: true,
useShortDoctype: true,
},
useShortDoctype: true
}
}),
new AntdDayjsWebpackPlugin(),
new CaseSensitivePathsPlugin(),
Expand All @@ -101,29 +101,29 @@ const config = {
include: /src/,
failOnError: true,
allowAsyncCycles: false,
cwd: process.cwd(),
cwd: process.cwd()
}),
new NodePolyfillPlugin(),
new WebpackBar(),
new ForkTsCheckerWebpackPlugin({
async: false,
async: false
}),
new ESLintWebpackPlugin({
// 指定检查文件的根目录
context: path.resolve(__dirname, '../src'),
exclude: 'node_modules', // 默认值
cache: true, // 开启缓存
// 缓存目录
cacheLocation: path.resolve(__dirname, '../node_modules/.cache/.eslintcache'),
}),
cacheLocation: path.resolve(__dirname, '../node_modules/.cache/.eslintcache')
})
],
module: {
// 将缺失的导出提示成错误而不是警告
strictExportPresence: true,
rules: [
{
test: /\.css$/,
use: ['style-loader', 'css-loader', 'postcss-loader'],
use: ['style-loader', 'css-loader', 'postcss-loader']
},
{
test: /\.less$/i,
Expand All @@ -140,10 +140,10 @@ const config = {
localIdentName: isDev ? '[path][name]__[local]--[hash:base64:5]' : '[local]--[hash:base64:5]',
localIdentContext: paths.src,
namedExport: false,
exportLocalsConvention: 'camelCase',
exportLocalsConvention: 'camelCase'
},
importLoaders: 2,
},
importLoaders: 2
}
},
{
loader: require.resolve('postcss-loader'),
Expand All @@ -157,18 +157,18 @@ const config = {
'postcss-preset-env',
{
autoprefixer: {
flexbox: 'no-2009',
flexbox: 'no-2009'
},
stage: 3,
},
stage: 3
}
],
'postcss-normalize',
],
'postcss-normalize'
]
},
sourceMap: true,
},
},
],
sourceMap: true
}
}
]
},
{
test: /\.(js|jsx|ts|tsx)$/,
Expand All @@ -178,48 +178,48 @@ const config = {
loader: 'esbuild-loader',
options: {
// loader: 'tsx',
target: 'es2015',
},
target: 'es2015'
}
},
{
loader: 'babel-loader?cacheDirectory',
options: {
presets: ['@babel/preset-env', '@babel/preset-react'],
plugins: ['@babel/plugin-proposal-object-rest-spread', '@babel/plugin-transform-runtime'],
},
},
],
plugins: ['@babel/plugin-proposal-object-rest-spread', '@babel/plugin-transform-runtime']
}
}
]
},
{
test: /\.(png|jpe?g|gif|webp|eot|ttf|woff|woff2|mp4)$/i,
type: 'asset',
parser: {
// Conditions for converting to base64
dataUrlCondition: {
maxSize: 25 * 1024, // 25kb
},
maxSize: 25 * 1024 // 25kb
}
},
generator: {
filename: 'images/[contenthash][ext][query]',
},
filename: 'images/[contenthash][ext][query]'
}
},
{
test: /\.svg(\?v=\d+\.\d+\.\d+)?$/,
use: [
{
loader: 'babel-loader',
loader: 'babel-loader'
},
{
loader: '@svgr/webpack',
options: {
babel: false,
icon: true,
},
},
],
},
],
},
icon: true
}
}
]
}
]
}
}

if (USE_ANALYZE) {
Expand Down

0 comments on commit 8acf41d

Please sign in to comment.