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

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

Comments

Loading...