jewpms/eslint.config.mjs
user bd28727507 refactor: 升级 Bootstrap 到 v5 并替换 BootstrapVue 为 BootstrapVueNext
- 将 Bootstrap 从 v4 升级到 v5,并移除 BootstrapVue,替换为 BootstrapVueNext
- 更新相关组件和依赖,调整代码以适应新版本的 Bootstrap 和 BootstrapVueNext
- 移除不再需要的兼容性配置,优化代码结构
2025-03-25 21:30:10 +08:00

73 lines
2.2 KiB
JavaScript

// @ts-check
import globals from 'globals';
import prettier from 'eslint-plugin-prettier/recommended';
import tseslint from 'typescript-eslint';
import js from '@eslint/js';
import vue from 'eslint-plugin-vue';
// jhipster-needle-eslint-add-import - JHipster will add additional import here
export default tseslint.config(
{
languageOptions: {
globals: {
...globals.node,
},
},
},
{ ignores: ['src/main/docker/'] },
{ ignores: ['target/classes/static/', 'target/'] },
js.configs.recommended,
...tseslint.configs.recommended.map(config =>
config.name === 'typescript-eslint/base' ? config : { ...config, files: ['**/*.ts', '**/*.tsx', '**/*.mts', '**/*.cts'] },
),
{
files: ['**/*.{js,cjs,mjs}'],
rules: {
'no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
},
},
...vue.configs['flat/recommended'],
{
files: ['**/*.vue'],
languageOptions: {
parserOptions: { parser: '@typescript-eslint/parser' },
globals: { ...globals.browser },
},
},
{
files: ['src/main/webapp/**/*.vue', 'src/main/webapp/**/*.ts'],
languageOptions: {
globals: { ...globals.browser },
},
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'vue/multi-word-component-names': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/consistent-type-imports': 'error',
'vue/no-v-text-v-html-on-component': [
'error',
{
allow: ['router-link', 'BAlert', 'BBadge', 'BButton', 'BLink'],
},
],
'vue/no-reserved-component-names': 'off',
'vue/attributes-order': 'off',
},
},
{
files: ['src/main/webapp/**/*.spec.ts'],
rules: {
'@typescript-eslint/no-empty-function': 'off',
},
},
// jhipster-needle-eslint-add-config - JHipster will add additional config here
prettier,
);