数据可视化大屏
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

.eslintrc.js 4.0KB

1 rok temu
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. const prettierConfig = require('./.prettierrc.js');
  2. module.exports = {
  3. root: true,
  4. parserOptions: { ecmaVersion: 2021 },
  5. overrides: [
  6. {
  7. files: ['*.ts'],
  8. parser: '@typescript-eslint/parser',
  9. parserOptions: {
  10. tsconfigRootDir: __dirname,
  11. project: ['tsconfig.json'],
  12. createDefaultProgram: true
  13. },
  14. plugins: ['@typescript-eslint', 'jsdoc', 'import', 'deprecation'],
  15. extends: [
  16. 'plugin:@angular-eslint/recommended',
  17. 'plugin:@angular-eslint/template/process-inline-templates',
  18. 'plugin:prettier/recommended'
  19. ],
  20. rules: {
  21. 'prettier/prettier': ['error', prettierConfig],
  22. 'jsdoc/newline-after-description': 1,
  23. '@angular-eslint/component-class-suffix': [
  24. 'error',
  25. {
  26. suffixes: ['Directive', 'Component', 'Base', 'Widget']
  27. }
  28. ],
  29. '@angular-eslint/directive-class-suffix': [
  30. 'error',
  31. {
  32. suffixes: ['Directive', 'Component', 'Base', 'Widget']
  33. }
  34. ],
  35. '@angular-eslint/component-selector': [
  36. 'off',
  37. {
  38. type: ['element', 'attribute'],
  39. prefix: ['app', 'test'],
  40. style: 'kebab-case'
  41. }
  42. ],
  43. '@angular-eslint/directive-selector': [
  44. 'off',
  45. {
  46. type: 'attribute',
  47. prefix: ['app']
  48. }
  49. ],
  50. '@angular-eslint/no-attribute-decorator': 'error',
  51. '@angular-eslint/no-conflicting-lifecycle': 'off',
  52. '@angular-eslint/no-forward-ref': 'off',
  53. '@angular-eslint/no-host-metadata-property': 'off',
  54. '@angular-eslint/no-lifecycle-call': 'off',
  55. '@angular-eslint/no-pipe-impure': 'error',
  56. '@angular-eslint/prefer-output-readonly': 'error',
  57. '@angular-eslint/use-component-selector': 'off',
  58. '@angular-eslint/use-component-view-encapsulation': 'off',
  59. '@angular-eslint/no-input-rename': 'off',
  60. '@angular-eslint/no-output-native': 'off',
  61. '@typescript-eslint/array-type': [
  62. 'error',
  63. {
  64. default: 'array-simple'
  65. }
  66. ],
  67. '@typescript-eslint/ban-types': [
  68. 'off',
  69. {
  70. types: {
  71. String: {
  72. message: 'Use string instead.'
  73. },
  74. Number: {
  75. message: 'Use number instead.'
  76. },
  77. Boolean: {
  78. message: 'Use boolean instead.'
  79. },
  80. Function: {
  81. message: 'Use specific callable interface instead.'
  82. }
  83. }
  84. }
  85. ],
  86. 'import/no-duplicates': 'error',
  87. 'import/no-unused-modules': 'error',
  88. 'import/no-unassigned-import': 'error',
  89. 'import/order': [
  90. 'error',
  91. {
  92. alphabetize: { order: 'asc', caseInsensitive: false },
  93. 'newlines-between': 'always',
  94. groups: ['external', 'internal', ['parent', 'sibling', 'index']],
  95. pathGroups: [],
  96. pathGroupsExcludedImportTypes: []
  97. }
  98. ],
  99. '@typescript-eslint/no-this-alias': 'error',
  100. '@typescript-eslint/member-ordering': 'off',
  101. 'no-irregular-whitespace': 'error',
  102. 'no-multiple-empty-lines': 'error',
  103. 'no-sparse-arrays': 'error',
  104. 'prefer-object-spread': 'error',
  105. 'prefer-template': 'error',
  106. 'prefer-const': 'off',
  107. 'max-len': 'off',
  108. 'deprecation/deprecation': 'warn',
  109. 'jsdoc/newline-after-description': 'off'
  110. }
  111. },
  112. {
  113. files: ['*.html'],
  114. extends: ['plugin:@angular-eslint/template/recommended'],
  115. rules: {
  116. "@angular-eslint/template/prefer-self-closing-tags": "error"
  117. }
  118. },
  119. {
  120. files: ['*.html'],
  121. excludedFiles: ['*inline-template-*.component.html'],
  122. extends: ['plugin:prettier/recommended'],
  123. rules: {
  124. 'prettier/prettier': ['error', { parser: 'angular' }],
  125. '@angular-eslint/template/eqeqeq': 'off'
  126. }
  127. }
  128. ]
  129. };