eslint.config.mjs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  3. * Exceptions. See /LICENSE for license information.
  4. * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  5. */
  6. /*
  7. * ESLint configuration.
  8. *
  9. * See https://eslint.style and https://typescript-eslint.io for additional
  10. * linting options.
  11. */
  12. // @ts-check
  13. import js from '@eslint/js';
  14. import tseslint from 'typescript-eslint';
  15. import stylistic from '@stylistic/eslint-plugin';
  16. export default tseslint.config(
  17. {
  18. ignores: ['dist', 'out', 'esbuild.js'],
  19. },
  20. js.configs.recommended,
  21. ...tseslint.configs.recommended,
  22. ...tseslint.configs.stylistic,
  23. {
  24. plugins: {
  25. '@stylistic': stylistic,
  26. },
  27. rules: {
  28. curly: 'warn',
  29. '@stylistic/semi': ['warn', 'always'],
  30. '@typescript-eslint/no-empty-function': 'off',
  31. '@typescript-eslint/naming-convention': [
  32. 'warn',
  33. {
  34. selector: 'import',
  35. format: ['camelCase', 'PascalCase'],
  36. },
  37. ],
  38. '@typescript-eslint/no-unused-vars': [
  39. 'error',
  40. {
  41. argsIgnorePattern: '^_',
  42. },
  43. ],
  44. },
  45. }
  46. );