Skip to content

Commit

Permalink
style(projects): update prettier config
Browse files Browse the repository at this point in the history
  • Loading branch information
Soybean committed Apr 1, 2022
1 parent ca2dfa6 commit df56abe
Show file tree
Hide file tree
Showing 128 changed files with 2,260 additions and 2,060 deletions.
10 changes: 5 additions & 5 deletions .env-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ type ServiceEnv = Record<
const serviceEnvConfig: ServiceEnv = {
dev: {
url: 'http://localhost:8080',
proxy: '/api',
proxy: '/api'
},
test: {
url: 'http://localhost:8080',
proxy: '/api',
proxy: '/api'
},
prod: {
url: 'http://localhost:8080',
proxy: '/api',
},
proxy: '/api'
}
};

/**
Expand All @@ -32,7 +32,7 @@ const serviceEnvConfig: ServiceEnv = {
export function getEnvConfig(env: ImportMetaEnv) {
const { VITE_ENV_TYPE = 'dev' } = env;
const envConfig = {
http: serviceEnvConfig[VITE_ENV_TYPE],
http: serviceEnvConfig[VITE_ENV_TYPE]
};
return envConfig;
}
92 changes: 46 additions & 46 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@ module.exports = {
env: {
browser: true,
es2021: true,
'vue/setup-compiler-macros': true,
'vue/setup-compiler-macros': true
},
globals: {
PROJECT_BUILD_TIME: 'readonly',
AMap: 'readonly',
BMap: 'readonly',
TMap: 'readonly',
TMap: 'readonly'
},
parser: 'vue-eslint-parser',
parserOptions: {
ecmaVersion: 12,
parser: '@typescript-eslint/parser',
sourceType: 'module',
sourceType: 'module'
},
plugins: ['vue', '@typescript-eslint'],
extends: [
Expand All @@ -24,7 +24,7 @@ module.exports = {
'plugin:prettier/recommended',
'@vue/eslint-config-typescript/recommended',
'@vue/eslint-config-prettier',
'@vue/typescript/recommended',
'@vue/typescript/recommended'
],
rules: {
'import/extensions': 'off',
Expand All @@ -38,22 +38,22 @@ module.exports = {
{
pattern: 'vue',
group: 'external',
position: 'before',
position: 'before'
},
{
pattern: 'vue-router',
group: 'external',
position: 'before',
position: 'before'
},
{
pattern: 'vuex',
group: 'external',
position: 'before',
position: 'before'
},
{
pattern: 'pinia',
group: 'external',
position: 'before',
position: 'before'
},
// ui framework, such as "naive-ui"
// {
Expand All @@ -64,92 +64,92 @@ module.exports = {
{
pattern: '@/config',
group: 'internal',
position: 'before',
position: 'before'
},
{
pattern: '@/settings',
group: 'internal',
position: 'before',
position: 'before'
},
{
pattern: '@/enum',
group: 'internal',
position: 'before',
position: 'before'
},
{
pattern: '@/plugins',
group: 'internal',
position: 'before',
position: 'before'
},
{
pattern: '@/layouts',
group: 'internal',
position: 'before',
position: 'before'
},
{
pattern: '@/views',
group: 'internal',
position: 'before',
position: 'before'
},
{
pattern: '@/components',
group: 'internal',
position: 'before',
position: 'before'
},
{
pattern: '@/router',
group: 'internal',
position: 'before',
position: 'before'
},
{
pattern: '@/store',
group: 'internal',
position: 'before',
position: 'before'
},
{
pattern: '@/composables',
group: 'internal',
position: 'before',
position: 'before'
},
{
pattern: '@/hooks',
group: 'internal',
position: 'before',
position: 'before'
},
{
pattern: '@/service',
group: 'internal',
position: 'before',
position: 'before'
},
{
pattern: '@/utils',
group: 'internal',
position: 'before',
position: 'before'
},
{
pattern: '@/assets',
group: 'internal',
position: 'before',
position: 'before'
},
{
pattern: '@/**',
group: 'internal',
position: 'before',
position: 'before'
},
{
pattern: '@/interface',
group: 'internal',
position: 'before',
},
position: 'before'
}
],
pathGroupsExcludedImportTypes: [
'vue',
'vue-router',
'vuex',
'pinia',
'pinia'
// 'naive-ui'
],
},
]
}
],
'import/no-unresolved': 'off',
'import/prefer-default-export': 'off',
Expand All @@ -158,8 +158,8 @@ module.exports = {
'error',
{
props: true,
ignorePropertyModificationsFor: ['state', 'acc', 'e'],
},
ignorePropertyModificationsFor: ['state', 'acc', 'e']
}
],
'no-plusplus': 'off',
'no-shadow': 'off',
Expand All @@ -168,44 +168,44 @@ module.exports = {
'vue/multi-word-component-names': [
'error',
{
ignores: ['index'],
},
ignores: ['index']
}
],

'@typescript-eslint/ban-types': [
'error',
{
types: {
'{}': {
message: 'Use object instead',
fixWith: 'object',
},
},
},
fixWith: 'object'
}
}
}
],
'@typescript-eslint/no-empty-interface': [
'error',
{
allowSingleExtends: true,
},
allowSingleExtends: true
}
],
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-shadow': 'error',
'@typescript-eslint/no-unused-vars': ['warn', { ignoreRestSiblings: true, varsIgnorePattern: '^_' }],
'@typescript-eslint/no-use-before-define': ['error', { classes: true, functions: false, typedefs: false }],
'@typescript-eslint/no-use-before-define': ['error', { classes: true, functions: false, typedefs: false }]
},
overrides: [
{
files: ['*.vue'],
rules: {
'no-undef': 'off',
},
'no-undef': 'off'
}
},
{
files: ['*.html'],
rules: {
'vue/comment-directive': 'off',
},
},
],
'vue/comment-directive': 'off'
}
}
]
};
4 changes: 2 additions & 2 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = { // https://prettier.io/docs/en/options.html
arrowParens: 'always',
arrowParens: 'avoid',
bracketSameLine: false,
bracketSpacing: true,
embeddedLanguageFormatting: 'auto',
Expand All @@ -13,7 +13,7 @@ module.exports = { // https://prettier.io/docs/en/options.html
semi: true,
singleQuote: true,
tabWidth: 2,
trailingComma: 'es5',
trailingComma: 'none',
useTabs: false,
vueIndentScriptAndStyle: false,
overrides: [
Expand Down
4 changes: 3 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@
"composables": "hook",
"directive": "tools",
"directives": "tools",
"business": "core"
"business": "core",
"request": "api",
"adapter": "middleware"
}
}
2 changes: 1 addition & 1 deletion build/config/define.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ import dayjs from 'dayjs';
const PROJECT_BUILD_TIME = JSON.stringify(dayjs().format('YYYY-MM-DD HH:mm:ss'));

export const viteDefine = {
PROJECT_BUILD_TIME,
PROJECT_BUILD_TIME
};
2 changes: 1 addition & 1 deletion build/config/path.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ export function resolvePath(rootPath: string, basePath: string) {

return {
root,
src,
src
};
}
4 changes: 2 additions & 2 deletions build/config/proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ export function createViteProxy(viteEnv: ImportMetaEnv) {
[http.proxy]: {
target: http.url,
changeOrigin: true,
rewrite: (path) => path.replace(new RegExp(`^${http.proxy}`), ''),
},
rewrite: path => path.replace(new RegExp(`^${http.proxy}`), '')
}
};

return proxy;
Expand Down
8 changes: 4 additions & 4 deletions build/plugins/auto-import.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ export default (srcPath: string) => {
Icons({
compiler: 'vue3',
customCollections: {
custom: FileSystemIconLoader(`${srcPath}/assets/svg`),
custom: FileSystemIconLoader(`${srcPath}/assets/svg`)
},
scale: 1,
defaultClass: 'inline-block',
defaultClass: 'inline-block'
}),
Components({
dts: true,
resolvers: [IconsResolver({ customCollections: ['custom'], componentPrefix: 'icon' })],
}),
resolvers: [IconsResolver({ customCollections: ['custom'], componentPrefix: 'icon' })]
})
];
};
6 changes: 3 additions & 3 deletions build/plugins/html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ export default (config: ConfigEnv): PluginOption[] => {
inject: {
data: {
appName: viteEnv.VITE_APP_NAME,
appTitle: viteEnv.VITE_APP_TITLE,
},
},
appTitle: viteEnv.VITE_APP_TITLE
}
}
});
};
2 changes: 1 addition & 1 deletion build/plugins/mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ export default viteMockServe({
injectCode: `
import { setupMockServer } from '../mock';
setupMockServer();
`,
`
});
2 changes: 1 addition & 1 deletion build/plugins/visualizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ import { visualizer } from 'rollup-plugin-visualizer';

export default visualizer({
gzipSize: true,
brotliSize: true,
brotliSize: true
});
Loading

1 comment on commit df56abe

@vercel
Copy link

@vercel vercel bot commented on df56abe Apr 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.