.eslintrc.cjs 1.9 KB

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