refactor: update component names to PascalCase and improve structure
- Changed component names from kebab-case to PascalCase in various files for consistency. - Updated `<router-view>` and `<transition>` to `<RouterView>` and `<Transition>` respectively in App.vue and base-layout.vue. - Refactored AppNaiveUIProvider.vue to use PascalCase for Naive UI providers. - Adjusted language and theme switch buttons to use PascalCase for icon components. - Updated button components in demo pages to use PascalCase for Naive UI buttons. - Modified ESLint rules in route message files to use perfectionist/sort-objects for better key sorting. - Enhanced Vite plugin files to export loadPlugin functions for better plugin management. - Improved plugin loading logic to handle errors and warnings more effectively.
This commit is contained in:
@@ -10,6 +10,7 @@ import {
|
||||
import pluginImport from 'eslint-plugin-import';
|
||||
import pluginJsonc from 'eslint-plugin-jsonc';
|
||||
import pluginOxlint from 'eslint-plugin-oxlint';
|
||||
import pluginPerfectionist from 'eslint-plugin-perfectionist';
|
||||
import pluginPlaywright from 'eslint-plugin-playwright';
|
||||
import pluginVue from 'eslint-plugin-vue';
|
||||
import { globalIgnores } from 'eslint/config';
|
||||
@@ -24,7 +25,14 @@ export default defineConfigWithVueTs(
|
||||
files: ['**/*.{ts,mts,tsx,vue}'],
|
||||
},
|
||||
|
||||
globalIgnores(['worker-configuration.d.ts', '**/dist/**', '**/dist-ssr/**', '**/coverage/**']),
|
||||
globalIgnores([
|
||||
'worker-configuration.d.ts',
|
||||
'**/dist/**',
|
||||
'**/dist-ssr/**',
|
||||
'**/coverage/**',
|
||||
'**/public/**',
|
||||
'**/-----TEMP-----/**',
|
||||
]),
|
||||
|
||||
pluginVue.configs['flat/essential'],
|
||||
vueTsConfigs.recommended,
|
||||
@@ -45,6 +53,13 @@ export default defineConfigWithVueTs(
|
||||
{
|
||||
rules: {
|
||||
'@intlify/vue-i18n/no-raw-text': 'off',
|
||||
'@intlify/vue-i18n/no-unused-keys': [
|
||||
'error',
|
||||
{
|
||||
src: './src',
|
||||
extensions: ['.js', '.ts', '.tsx', '.vue'],
|
||||
},
|
||||
],
|
||||
},
|
||||
settings: {
|
||||
'vue-i18n': {
|
||||
@@ -54,9 +69,7 @@ export default defineConfigWithVueTs(
|
||||
},
|
||||
},
|
||||
{
|
||||
plugins: {
|
||||
import: pluginImport,
|
||||
},
|
||||
plugins: { import: pluginImport },
|
||||
rules: {
|
||||
'import/first': 'error',
|
||||
'import/no-duplicates': 'error',
|
||||
@@ -70,6 +83,8 @@ export default defineConfigWithVueTs(
|
||||
},
|
||||
},
|
||||
|
||||
{ plugins: { perfectionist: pluginPerfectionist } },
|
||||
|
||||
{
|
||||
/**
|
||||
* 启用 sort-keys 规则以强制对象键按字母顺序排序
|
||||
@@ -102,7 +117,11 @@ export default defineConfigWithVueTs(
|
||||
'vue/attributes-order': 'error',
|
||||
'vue/multi-word-component-names': 'off',
|
||||
'vue/padding-line-between-blocks': ['error', 'always'],
|
||||
|
||||
'vue/component-name-in-template-casing': [
|
||||
'error',
|
||||
'PascalCase',
|
||||
{ registeredComponentsOnly: false, ignores: [] },
|
||||
],
|
||||
// '@stylistic/padding-line-between-statements': [
|
||||
// 'error',
|
||||
// { blankLine: 'always', prev: '*', next: ['const', 'let', 'var'] },
|
||||
|
||||
Reference in New Issue
Block a user