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 2.8 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
  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.recommended),
  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: ['dist/**/*', 'site/.docusaurus/**/*', 'site/build/**/*', '**/venv/**/*'],
  32. },
  33. {
  34. languageOptions: {
  35. ecmaVersion: 2022,
  36. globals: globals.node,
  37. sourceType: 'module',
  38. },
  39. plugins: {
  40. 'react-hooks': reactHooks,
  41. 'react-refresh': reactRefresh,
  42. 'unused-imports': unusedImports,
  43. unicorn: eslintPluginUnicorn,
  44. },
  45. rules: {
  46. '@typescript-eslint/ban-ts-comment': 0,
  47. '@typescript-eslint/ban-types': 0,
  48. '@typescript-eslint/consistent-type-imports': 'error',
  49. '@typescript-eslint/no-explicit-any': 0,
  50. '@typescript-eslint/no-unsafe-function-type': 0,
  51. '@typescript-eslint/no-unused-vars': [
  52. 'error',
  53. {
  54. args: 'none',
  55. ignoreRestSiblings: false,
  56. vars: 'all',
  57. varsIgnorePattern: '^_',
  58. },
  59. ],
  60. '@typescript-eslint/no-use-before-define': 'error',
  61. '@typescript-eslint/no-var-requires': 0,
  62. curly: 'error',
  63. 'no-case-declarations': 0,
  64. 'no-control-regex': 0,
  65. 'no-empty': 0,
  66. 'no-unused-expressions': 'error',
  67. 'no-useless-escape': 0,
  68. 'object-shorthand': 'error',
  69. 'prefer-const': 'error',
  70. 'react-refresh/only-export-components': 'warn',
  71. 'unicorn/no-lonely-if': 'error',
  72. 'unicorn/no-negated-condition': 'error',
  73. 'unicorn/prefer-number-properties': 'error',
  74. 'unused-imports/no-unused-imports': 'error',
  75. },
  76. },
  77. {
  78. files: ['examples/**', 'site/**'],
  79. rules: {
  80. '@typescript-eslint/no-namespace': 0,
  81. '@typescript-eslint/no-require-imports': 0,
  82. '@typescript-eslint/no-unused-vars': 0,
  83. '@typescript-eslint/no-var-requires': 0,
  84. },
  85. },
  86. ];
Tip!

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

Comments

Loading...