Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

eslint.config.mjs 4.0 KB

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
  1. // @ts-check
  2. import reactHooks from 'eslint-plugin-react-hooks';
  3. import reactRefresh from 'eslint-plugin-react-refresh';
  4. import eslint from '@eslint/js';
  5. import jest from 'eslint-plugin-jest';
  6. import eslintPluginUnicorn from 'eslint-plugin-unicorn';
  7. import unusedImports from 'eslint-plugin-unused-imports';
  8. import globals from 'globals';
  9. import tseslint from 'typescript-eslint';
  10. export default [
  11. ...tseslint.config(eslint.configs.recommended, ...tseslint.configs.recommendedTypeChecked),
  12. {
  13. ...jest.configs['flat/recommended'],
  14. rules: {
  15. ...jest.configs['flat/recommended'].rules,
  16. ...jest.configs['flat/style'].rules,
  17. 'jest/consistent-test-it': 'error',
  18. 'jest/expect-expect': 'error',
  19. 'jest/no-test-return-statement': 'error',
  20. 'jest/prefer-called-with': 'error',
  21. 'jest/prefer-expect-resolves': 'error',
  22. 'jest/prefer-hooks-in-order': 'error',
  23. 'jest/prefer-hooks-on-top': 'error',
  24. 'jest/prefer-jest-mocked': 'error',
  25. 'jest/prefer-spy-on': 'error',
  26. 'jest/require-to-throw-message': 'error',
  27. 'jest/require-top-level-describe': 'error',
  28. },
  29. },
  30. {
  31. ignores: [
  32. 'dist/**/*',
  33. 'site/.docusaurus/**/*',
  34. 'site/build/**/*',
  35. '**/venv/**/*',
  36. 'examples/redteam-medical-agent/src/**/*',
  37. ],
  38. },
  39. {
  40. languageOptions: {
  41. ecmaVersion: 2022,
  42. globals: globals.node,
  43. sourceType: 'module',
  44. parserOptions: {
  45. projectService: true,
  46. tsconfigRootDir: import.meta.dirname,
  47. },
  48. },
  49. plugins: {
  50. 'react-hooks': reactHooks,
  51. 'react-refresh': reactRefresh,
  52. 'unused-imports': unusedImports,
  53. unicorn: eslintPluginUnicorn,
  54. },
  55. rules: {
  56. '@typescript-eslint/ban-ts-comment': 0,
  57. '@typescript-eslint/ban-types': 0,
  58. '@typescript-eslint/consistent-type-imports': 'error',
  59. '@typescript-eslint/no-explicit-any': 0,
  60. '@typescript-eslint/no-unsafe-function-type': 0,
  61. '@typescript-eslint/no-unused-vars': [
  62. 'error',
  63. {
  64. args: 'none',
  65. ignoreRestSiblings: false,
  66. vars: 'all',
  67. varsIgnorePattern: '^_',
  68. },
  69. ],
  70. '@typescript-eslint/no-use-before-define': 'error',
  71. '@typescript-eslint/no-var-requires': 0,
  72. curly: 'error',
  73. 'no-case-declarations': 0,
  74. 'no-control-regex': 0,
  75. 'no-empty': 0,
  76. 'no-unused-expressions': 'error',
  77. 'no-useless-escape': 0,
  78. 'object-shorthand': 'error',
  79. 'prefer-const': 'error',
  80. 'react-refresh/only-export-components': 'warn',
  81. 'unicorn/no-lonely-if': 'error',
  82. 'unicorn/no-negated-condition': 'error',
  83. 'unicorn/prefer-number-properties': 'error',
  84. 'unused-imports/no-unused-imports': 'error',
  85. // 250508(Will): Latent Type-info Errors;
  86. // These need to be addressed in separate PRs.
  87. '@typescript-eslint/await-thenable': 0,
  88. '@typescript-eslint/no-base-to-string': 0,
  89. '@typescript-eslint/no-duplicate-type-constituents': 0,
  90. '@typescript-eslint/no-floating-promises': 0,
  91. '@typescript-eslint/no-implied-eval': 0,
  92. '@typescript-eslint/no-misused-promises': 0,
  93. '@typescript-eslint/no-redundant-type-constituents': 0,
  94. '@typescript-eslint/no-unnecessary-type-assertion': 0,
  95. '@typescript-eslint/no-unsafe-argument': 0,
  96. '@typescript-eslint/no-unsafe-assignment': 0,
  97. '@typescript-eslint/no-unsafe-call': 0,
  98. '@typescript-eslint/no-unsafe-member-access': 0,
  99. '@typescript-eslint/no-unsafe-return': 0,
  100. '@typescript-eslint/only-throw-error': 0,
  101. '@typescript-eslint/prefer-promise-reject-errors': 0,
  102. '@typescript-eslint/require-await': 0,
  103. '@typescript-eslint/restrict-plus-operands': 0,
  104. '@typescript-eslint/restrict-template-expressions': 0,
  105. '@typescript-eslint/unbound-method': 0,
  106. },
  107. },
  108. {
  109. files: ['examples/**', 'site/**'],
  110. rules: {
  111. '@typescript-eslint/no-namespace': 0,
  112. '@typescript-eslint/no-require-imports': 0,
  113. '@typescript-eslint/no-unused-vars': 0,
  114. '@typescript-eslint/no-var-requires': 0,
  115. },
  116. },
  117. ];
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...