.eslintrc.js 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. // eslint-disable-next-line @typescript-eslint/no-var-requires
  2. const path = require('path');
  3. module.exports = {
  4. root: true,
  5. parser: 'vue-eslint-parser',
  6. parserOptions: {
  7. // Parser that checks the content of the <script> tag
  8. parser: '@typescript-eslint/parser',
  9. sourceType: 'module',
  10. ecmaVersion: 2020,
  11. ecmaFeatures: {
  12. jsx: true,
  13. },
  14. },
  15. env: {
  16. 'browser': true,
  17. 'node': true,
  18. 'vue/setup-compiler-macros': true,
  19. },
  20. plugins: ['@typescript-eslint'],
  21. extends: [
  22. // Airbnb JavaScript Style Guide https://github.com/airbnb/javascript
  23. 'airbnb-base',
  24. 'plugin:@typescript-eslint/recommended',
  25. 'plugin:import/recommended',
  26. 'plugin:import/typescript',
  27. 'plugin:vue/vue3-recommended',
  28. 'plugin:prettier/recommended',
  29. ],
  30. settings: {
  31. 'import/resolver': {
  32. typescript: {
  33. project: path.resolve(__dirname, './tsconfig.json'),
  34. },
  35. },
  36. },
  37. rules: {
  38. 'vue/no-v-html':0,
  39. 'prettier/prettier': 1,
  40. // Vue: Recommended rules to be closed or modify
  41. 'vue/require-default-prop': 0,
  42. 'vue/singleline-html-element-content-newline': 0,
  43. 'vue/max-attributes-per-line': 0,
  44. // Vue: Add extra rules
  45. 'vue/custom-event-name-casing': [2, 'camelCase'],
  46. 'vue/no-v-text': 1,
  47. 'vue/padding-line-between-blocks': 1,
  48. 'vue/require-direct-export': 1,
  49. 'vue/multi-word-component-names': 0,
  50. // Allow @ts-ignore comment
  51. '@typescript-eslint/ban-ts-comment': 0,
  52. '@typescript-eslint/no-unused-vars': 1,
  53. '@typescript-eslint/no-empty-function': 1,
  54. '@typescript-eslint/no-explicit-any': 0,
  55. 'import/extensions': [
  56. 2,
  57. 'ignorePackages',
  58. {
  59. js: 'never',
  60. jsx: 'never',
  61. ts: 'never',
  62. tsx: 'never',
  63. },
  64. ],
  65. 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
  66. 'no-param-reassign': 0,
  67. 'prefer-regex-literals': 0,
  68. 'import/no-extraneous-dependencies': 0,
  69. "no-use-before-define": 0,
  70. "import/prefer-default-export": 0,
  71. "class-methods-use-this": 0,
  72. "no-unused-expressions": 0,
  73. "no-bitwise": 0,
  74. "no-console": 0,
  75. "@typescript-eslint/no-non-null-assertion": 0
  76. },
  77. };