1
0

eslint.config.mjs 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. import createConfig from '@antfu/eslint-config'
  2. import sonarjs from 'eslint-plugin-sonarjs'
  3. export default createConfig(
  4. {
  5. stylistic: true,
  6. ignores: ['**/version.json', 'tsconfig.json', 'tsconfig.node.json'],
  7. },
  8. sonarjs.configs.recommended,
  9. {
  10. name: '@nginx-ui/eslint-config',
  11. rules: {
  12. 'no-console': 'warn',
  13. 'no-alert': 'warn',
  14. 'ts/no-explicit-any': 'warn',
  15. 'vue/no-unused-refs': 'warn',
  16. 'vue/prop-name-casing': 'warn',
  17. 'node/prefer-global/process': 'off',
  18. 'unused-imports/no-unused-vars': 'warn',
  19. // https://eslint.org/docs/latest/rules/dot-notation
  20. 'style/dot-notation': 'off',
  21. // https://eslint.org/docs/latest/rules/arrow-parens
  22. 'style/arrow-parens': ['error', 'as-needed'],
  23. // https://eslint.org/docs/latest/rules/prefer-template
  24. 'prefer-template': 'error',
  25. // https://eslint.style/rules/js/arrow-spacing
  26. 'style/arrow-spacing': ['error', { before: true, after: true }],
  27. // https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/prefer-default-export.md
  28. 'import/prefer-default-export': 'off',
  29. // https://eslint.vuejs.org/rules/require-typed-ref
  30. 'vue/require-typed-ref': 'warn',
  31. // https://eslint.vuejs.org/rules/require-prop-types
  32. 'vue/require-prop-types': 'warn',
  33. // https://eslint.vuejs.org/rules/no-ref-as-operand.html
  34. 'vue/no-ref-as-operand': 'error',
  35. // -- Sonarlint
  36. 'sonarjs/no-duplicate-string': 'off',
  37. 'sonarjs/no-nested-template-literals': 'off',
  38. 'sonarjs/pseudo-random': 'warn',
  39. 'sonarjs/no-nested-functions': 'off',
  40. },
  41. },
  42. )