Skip to content

refactor(core): 重构配置服务中的配置获取逻辑 #2421

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from

Conversation

sysfox
Copy link
Contributor

@sysfox sysfox commented May 2, 2025

Description

Linked Issues

#2407

Additional context

@sysfox
Copy link
Contributor Author

sysfox commented May 2, 2025

Caution

根目录下的package.json 中的@sxzz/eslint-configeslint版本已回滚至5bf9397之前的版本号
将这两个依赖更新到最新版本会导致大量错误甚至于所有PR的Test-Run Lint流程都会失败以及无法commit

@sysfox
Copy link
Contributor Author

sysfox commented May 2, 2025

All CI/CD Test Passed

@nyaruta
Copy link
Contributor

nyaruta commented May 2, 2025

Caution

根目录下的package.json 中的@sxzz/eslint-configeslint版本已回滚至c26e9ef之前的版本号 将这两个依赖更新到最新版本会导致大量错误甚至于所有PR的Test-Run Lint流程都会失败以及无法commit

配置文件顺序问题

@nyaruta
Copy link
Contributor

nyaruta commented May 2, 2025

写成这样

import { sxzz } from '@sxzz/eslint-config'

export default sxzz(
  {
    prettier: true,
    markdown: true,
    vue: false, // auto detection
    unocss: false, // auto detection
  },
  [
    {
      ignores: [
        'assets/types/type.declare.ts',

        'node_modules',
        'dist',
        'out',
        'packages/*/node_modules',
        'packages/*/dist',
        'packages/*/out',
        'packages/*/lib',
        'packages/*/build',
        'packages/*/coverage',
        'packages/*/test',
        'packages/*/tests',
        'packages/*/esm',
        'packages/*/types',
        'test/**/*.db.ts',
      ],
      languageOptions: {
        parserOptions: {
          emitDecoratorMetadata: true,
          experimentalDecorators: true,
        },
      },
      rules: {
        eqeqeq: 'off',

        'no-void': 0,
        '@typescript-eslint/consistent-type-assertions': 0,
        'no-restricted-syntax': 0,
        'unicorn/filename-case': 0,
        'unicorn/prefer-math-trunc': 0,

        'unused-imports/no-unused-imports': 'error',

        'unused-imports/no-unused-vars': [
          'error',
          {
            vars: 'all',
            varsIgnorePattern: '^_',
            args: 'after-used',
            argsIgnorePattern: '^_',
            ignoreRestSiblings: true,
          },
        ],

        // for node server runtime
        'require-await': 0,
        '@typescript-eslint/no-unsafe-function-type': 0,
        'unicorn/no-array-callback-reference': 0,

        'node/prefer-global/process': 0,
        'node/prefer-global/buffer': 'off',
        'no-duplicate-imports': 'off',
        'unicorn/explicit-length-check': 0,
        'unicorn/prefer-top-level-await': 0,
        // readable push syntax
        'unicorn/no-array-push-push': 0,
        '@typescript-eslint/no-require-imports': 0,
        'perfectionist/sort-imports': 0,
      },
    },
    {
      files: ['packages/api-client/**/*.ts'],
      rules: { 'unused-imports/no-unused-vars': 0 },
    },

    {
      files: [
        'apps/core/src/migration/**/*.ts',
        'apps/core/src/modules/serverless/pack/**/*.ts',
        'apps/core/test/**/*.ts',
      ],
      rules: {
        'import/no-default-export': 'off',
      },
    },
  ],
)

测试能过

- 将 @sxzz/eslint-config 从 4.6.0 升级到 6.2.0
- 更新 eslint 从 9.17.0 到 9.25.1
- 下降 typescript 从 5.8.3 到 5.7.3
- 调整 ESLint 配置参数的位置
@sysfox
Copy link
Contributor Author

sysfox commented May 2, 2025

@nyaruta 问题解决,感谢

@Innei
Copy link
Member

Innei commented May 5, 2025

Resolve conflict and merge into 86fdb9e

@Innei Innei closed this May 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants