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.6 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
  1. // @ts-check
  2. import reactHooks from 'eslint-plugin-react-hooks';
  3. import eslint from '@eslint/js';
  4. import jest from 'eslint-plugin-jest';
  5. import eslintPluginUnicorn from 'eslint-plugin-unicorn';
  6. import unusedImports from 'eslint-plugin-unused-imports';
  7. import globals from 'globals';
  8. import tseslint from 'typescript-eslint';
  9. export default [
  10. ...tseslint.config(eslint.configs.recommended, ...tseslint.configs.recommended),
  11. {
  12. ...jest.configs['flat/recommended'],
  13. rules: {
  14. ...jest.configs['flat/recommended'].rules,
  15. ...jest.configs['flat/style'].rules,
  16. 'jest/consistent-test-it': 'error',
  17. 'jest/expect-expect': 'error',
  18. 'jest/no-test-return-statement': 'error',
  19. 'jest/prefer-called-with': 'error',
  20. 'jest/prefer-expect-resolves': 'error',
  21. 'jest/prefer-hooks-in-order': 'error',
  22. 'jest/prefer-hooks-on-top': 'error',
  23. 'jest/prefer-jest-mocked': 'error',
  24. 'jest/prefer-spy-on': 'error',
  25. 'jest/require-to-throw-message': 'error',
  26. 'jest/require-top-level-describe': 'error',
  27. },
  28. },
  29. {
  30. ignores: ['dist/**/*', 'site/.docusaurus/**/*', 'site/build/**/*'],
  31. },
  32. {
  33. languageOptions: {
  34. ecmaVersion: 2022,
  35. sourceType: 'module',
  36. globals: globals.node,
  37. },
  38. plugins: {
  39. 'react-hooks': reactHooks,
  40. 'unused-imports': unusedImports,
  41. unicorn: eslintPluginUnicorn,
  42. },
  43. rules: {
  44. '@typescript-eslint/no-unsafe-function-type': 0,
  45. '@typescript-eslint/ban-ts-comment': 0,
  46. '@typescript-eslint/ban-types': 0,
  47. '@typescript-eslint/consistent-type-imports': 'error',
  48. '@typescript-eslint/no-explicit-any': 0,
  49. '@typescript-eslint/no-unused-vars': [
  50. 'error',
  51. {
  52. vars: 'all',
  53. varsIgnorePattern: '^_',
  54. args: 'none',
  55. ignoreRestSiblings: false,
  56. },
  57. ],
  58. '@typescript-eslint/no-use-before-define': 'error',
  59. '@typescript-eslint/no-var-requires': 0,
  60. curly: 'error',
  61. 'no-case-declarations': 0,
  62. 'no-control-regex': 0,
  63. 'no-empty': 0,
  64. 'no-unused-expressions': 'error',
  65. 'no-useless-escape': 0,
  66. 'object-shorthand': 'error',
  67. 'prefer-const': 'error',
  68. 'unicorn/no-lonely-if': 'error',
  69. 'unicorn/no-negated-condition': 'error',
  70. 'unicorn/prefer-number-properties': 'error',
  71. 'unused-imports/no-unused-imports': 'error',
  72. },
  73. },
  74. {
  75. files: ['examples/**', 'site/**'],
  76. rules: {
  77. '@typescript-eslint/no-namespace': 0,
  78. '@typescript-eslint/no-var-requires': 0,
  79. '@typescript-eslint/no-unused-vars': 0,
  80. '@typescript-eslint/no-require-imports': 0,
  81. },
  82. },
  83. ];
Tip!

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

Comments

Loading...