.eslintrc.js 905 B

1234567891011121314151617181920212223242526272829
  1. /* eslint-disable no-undef */
  2. module.exports = {
  3. env: {
  4. node: true,
  5. es6: true
  6. },
  7. parser: '@typescript-eslint/parser',
  8. parserOptions: {
  9. ecmaVersion: 2020,
  10. project: ['./tsconfig.json'],
  11. tsconfigRootDir: __dirname,
  12. projectFolderIgnoreList: ['**/node_modules/**', './dist/**', './db/*', './logs/*'],
  13. createDefaultProgram: true
  14. },
  15. plugins: ['@typescript-eslint'],
  16. extends: [
  17. 'eslint:recommended',
  18. 'plugin:@typescript-eslint/recommended'
  19. ],
  20. rules: {
  21. 'no-var': 'error',
  22. 'no-extra-semi': 'off',
  23. 'quotes': [1, 'single'], // 必须使用单引号
  24. 'semi': [2, 'always'], //语句强制分号结尾
  25. '@typescript-eslint/adjacent-overload-signatures': 'error', // 强制函数重载是连续的
  26. '@typescript-eslint/no-empty-function': 'off', // 允许空函数
  27. '@typescript-eslint/no-extra-semi': ['error'], // 多余分号去掉
  28. }
  29. };