eslint.config.mjs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. import ljharb from '@ljharb/eslint-config/flat';
  2. export default [
  3. ...ljharb,
  4. {
  5. ignores: [
  6. 'test/resolver/malformed_package_json/package.json',
  7. 'test/list-exports/**',
  8. ],
  9. },
  10. {
  11. rules: {
  12. 'array-bracket-newline': 'off',
  13. complexity: 'off',
  14. 'consistent-return': 'off',
  15. curly: 'off',
  16. 'dot-notation': ['error', { allowKeywords: true }],
  17. 'func-name-matching': 'off',
  18. 'func-style': 'off',
  19. 'global-require': 'warn',
  20. 'id-length': ['error', { min: 1, max: 40 }],
  21. 'max-depth': 'off',
  22. 'max-lines-per-function': 'off',
  23. 'max-lines': 'off',
  24. 'max-nested-callbacks': 'off',
  25. 'max-params': 'off',
  26. 'max-statements-per-line': ['error', { max: 2 }],
  27. 'max-statements': 'off',
  28. 'multiline-comment-style': 'off',
  29. 'no-magic-numbers': 'off',
  30. 'no-shadow': 'off',
  31. 'no-use-before-define': 'off',
  32. 'sort-keys': 'off',
  33. strict: 'off',
  34. },
  35. },
  36. {
  37. files: ['**/*.js'],
  38. rules: {
  39. indent: ['error', 4],
  40. },
  41. },
  42. {
  43. files: ['bin/**'],
  44. rules: {
  45. 'no-process-exit': 'off',
  46. },
  47. },
  48. {
  49. files: ['example/**'],
  50. rules: {
  51. 'no-console': 'off',
  52. },
  53. },
  54. {
  55. files: ['test/resolver/nested_symlinks/mylib/*.js'],
  56. rules: {
  57. 'no-throw-literal': 'off',
  58. },
  59. },
  60. {
  61. files: ['test/**'],
  62. languageOptions: {
  63. ecmaVersion: 5,
  64. parserOptions: {
  65. allowReserved: false,
  66. },
  67. },
  68. rules: {
  69. 'dot-notation': ['error', { allowPattern: 'throws' }],
  70. 'max-lines': 'off',
  71. 'max-lines-per-function': 'off',
  72. 'no-unused-vars': ['error', {
  73. vars: 'all',
  74. args: 'none',
  75. caughtErrors: 'none',
  76. }],
  77. },
  78. },
  79. ];