大量的代码格式化
Some checks failed
Docker Build & Deploy / Build Docker Image (push) Failing after 1m10s
Docker Build & Deploy / Deploy to Production (push) Has been skipped
Docker Build & Deploy / Cleanup Dangling Images (push) Successful in 1s
Docker Build & Deploy / WeChat Notification (push) Successful in 1s
Some checks failed
Docker Build & Deploy / Build Docker Image (push) Failing after 1m10s
Docker Build & Deploy / Deploy to Production (push) Has been skipped
Docker Build & Deploy / Cleanup Dangling Images (push) Successful in 1s
Docker Build & Deploy / WeChat Notification (push) Successful in 1s
This commit is contained in:
@@ -1,52 +1,82 @@
|
||||
import js from '@eslint/js'
|
||||
import js from '@eslint/js'
|
||||
import globals from 'globals'
|
||||
import pluginVue from 'eslint-plugin-vue'
|
||||
import skipFormatting from '@vue/eslint-config-prettier/skip-formatting'
|
||||
|
||||
export default [
|
||||
{
|
||||
ignores: ['**/dist/**', '**/dist-ssr/**', '**/coverage/**', '**/node_modules/**', '.nuxt/**'],
|
||||
ignores: ['**/dist/**', '**/dist-ssr/**', '**/coverage/**', '**/node_modules/**', '.nuxt/**']
|
||||
},
|
||||
// Load Vue recommended rules first (sets up parser etc.)
|
||||
...pluginVue.configs['flat/recommended'],
|
||||
|
||||
// General Configuration for all JS/Vue files
|
||||
{
|
||||
files: ['**/*.{js,mjs,jsx}'],
|
||||
files: ['**/*.{js,mjs,jsx,vue}'],
|
||||
languageOptions: {
|
||||
globals: {
|
||||
...globals.browser,
|
||||
},
|
||||
parserOptions: {
|
||||
ecmaVersion: 'latest',
|
||||
sourceType: 'module',
|
||||
...globals.browser
|
||||
},
|
||||
ecmaVersion: 'latest',
|
||||
sourceType: 'module'
|
||||
},
|
||||
rules: {
|
||||
// Import standard JS recommended rules
|
||||
...js.configs.recommended.rules,
|
||||
'indent': ['error', 2],
|
||||
|
||||
// --- Logic & Best Practices ---
|
||||
'no-unused-vars': ['warn', {
|
||||
argsIgnorePattern: '^_',
|
||||
varsIgnorePattern: '^_',
|
||||
caughtErrorsIgnorePattern: '^_'
|
||||
}],
|
||||
'no-undef': 'error',
|
||||
'no-console': ['warn', { allow: ['warn', 'error', 'info'] }],
|
||||
'no-debugger': 'warn',
|
||||
'eqeqeq': ['error', 'always', { null: 'ignore' }],
|
||||
'curly': ['error', 'all'],
|
||||
'prefer-const': 'warn',
|
||||
'no-var': 'error',
|
||||
|
||||
// --- Formatting & Style (User requested warnings) ---
|
||||
'indent': ['error', 2, { SwitchCase: 1 }],
|
||||
'quotes': ['error', 'single', { avoidEscape: true }],
|
||||
'semi': ['error', 'never'],
|
||||
'no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
|
||||
'comma-dangle': ['error', 'never'],
|
||||
'no-trailing-spaces': 'error',
|
||||
'no-multiple-empty-lines': ['error', { max: 1 }],
|
||||
'space-before-function-paren': ['error', 'always'],
|
||||
},
|
||||
'object-curly-spacing': ['error', 'always'],
|
||||
'array-bracket-spacing': ['error', 'never']
|
||||
}
|
||||
},
|
||||
...pluginVue.configs['flat/recommended'],
|
||||
|
||||
// Vue Specific Overrides
|
||||
{
|
||||
files: ['**/*.vue'],
|
||||
rules: {
|
||||
'vue/multi-word-component-names': 'off',
|
||||
'vue/no-v-html': 'warn',
|
||||
|
||||
// Turn off standard indent for Vue files to avoid conflicts with vue/html-indent
|
||||
// or script indentation issues. Vue plugin handles this better.
|
||||
'indent': 'off',
|
||||
},
|
||||
// Ensure Vue's own indentation rules are active (they are in 'recommended' but let's be explicit if needed)
|
||||
'vue/html-indent': ['error', 2],
|
||||
'vue/script-indent': ['error', 2, {
|
||||
baseIndent: 0,
|
||||
switchCase: 1,
|
||||
ignores: []
|
||||
}]
|
||||
}
|
||||
},
|
||||
skipFormatting,
|
||||
|
||||
// Service Worker specific globals
|
||||
{
|
||||
files: ['**/service-worker.js', '**/src/registerServiceWorker.js'],
|
||||
languageOptions: {
|
||||
globals: {
|
||||
...globals.serviceworker,
|
||||
...globals.browser,
|
||||
},
|
||||
},
|
||||
},
|
||||
...globals.serviceworker
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user