Ben Lin
2025-03-05 abbc201b41a1a25a19ccf7cff8df633dadcf5d88
internal/eslint-config/src/strict.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,57 @@
export default {
  extends: ['@vben'],
  plugins: ['simple-import-sort'],
  rules: {
    'simple-import-sort/imports': 'error',
    'simple-import-sort/exports': 'error',
    '@typescript-eslint/ban-ts-comment': [
      'error',
      {
        'ts-expect-error': 'allow-with-description',
        'ts-ignore': 'allow-with-description',
        'ts-nocheck': 'allow-with-description',
        'ts-check': false,
      },
    ],
    /**
     * ã€å¼ºåˆ¶ã€‘关键字前后有一个空格
     * @link https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/keyword-spacing.md
     */
    'keyword-spacing': 'off',
    '@typescript-eslint/keyword-spacing': [
      'error',
      {
        before: true,
        after: true,
        overrides: {
          return: { after: true },
          throw: { after: true },
          case: { after: true },
        },
      },
    ],
    /**
     * ç¦æ­¢å‡ºçŽ°ç©ºå‡½æ•°ï¼Œæ™®é€šå‡½æ•°ï¼ˆéž async/await/generator)、箭头函数、类上的方法除外
     * @link https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-empty-function.md
     */
    'no-empty-function': 'off',
    '@typescript-eslint/no-empty-function': [
      'error',
      {
        allow: ['arrowFunctions', 'functions', 'methods'],
      },
    ],
    /**
     * ä¼˜å…ˆä½¿ç”¨ interface è€Œä¸æ˜¯ type å®šä¹‰å¯¹è±¡ç±»åž‹
     * @link https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/consistent-type-definitions.md
     */
    '@typescript-eslint/consistent-type-definitions': ['warn', 'interface'],
    'vue/attributes-order': 'error',
    'vue/require-default-prop': 'error',
  },
};