eslint.config.mjs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. import globals from 'globals';
  2. import jsdoc from './dist/index.js';
  3. // import canonical from 'eslint-config-canonical';
  4. // import canonicalJsdoc from 'eslint-config-canonical/jsdoc.js';
  5. const common = {
  6. linterOptions: {
  7. reportUnusedDisableDirectives: 0
  8. },
  9. plugins: {
  10. jsdoc
  11. }
  12. };
  13. export default [
  14. // canonical,
  15. // canonicalJsdoc,
  16. {
  17. ...common,
  18. files: ['.ncurc.js'],
  19. languageOptions: {
  20. parserOptions: {
  21. ecmaFeatures: {
  22. impliedStrict: false
  23. },
  24. },
  25. sourceType: 'script'
  26. },
  27. rules: {
  28. 'import/no-commonjs': 0,
  29. strict: [
  30. 'error',
  31. 'global'
  32. ]
  33. }
  34. },
  35. {
  36. ...common,
  37. files: ['test/**/*.js'],
  38. rules: {
  39. 'no-restricted-syntax': 0,
  40. 'unicorn/prevent-abbreviations': 0
  41. }
  42. },
  43. {
  44. ...common,
  45. ignores: ['dist/**/*.js', '.ignore/**/*.js'],
  46. languageOptions: {
  47. globals: globals.node
  48. },
  49. settings: {
  50. jsdoc: {
  51. mode: 'typescript'
  52. }
  53. },
  54. rules: {
  55. 'array-element-newline': 0,
  56. 'filenames/match-regex': 0,
  57. 'import/extensions': 0,
  58. 'import/no-useless-path-segments': 0,
  59. 'prefer-named-capture-group': 0,
  60. 'unicorn/no-array-reduce': 0,
  61. 'unicorn/no-unsafe-regex': 0,
  62. 'unicorn/prefer-array-some': 0,
  63. 'unicorn/prevent-abbreviations': 0,
  64. 'unicorn/import-index': 0,
  65. 'linebreak-style': 0,
  66. 'no-inline-comments': 0,
  67. 'no-extra-parens': 0
  68. }
  69. }
  70. ];