.eslintrc.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. 'use strict';
  2. module.exports = {
  3. extends: ['ash-nazg/sauron-node'],
  4. parserOptions: {
  5. sourceType: 'module'
  6. },
  7. env: {
  8. node: true,
  9. browser: true
  10. },
  11. overrides: [
  12. {
  13. files: '*.md',
  14. processor: 'markdown/markdown'
  15. },
  16. {
  17. files: '**/*.md/*.js',
  18. globals: {
  19. require: true,
  20. StackBlur: true,
  21. width: true,
  22. height: true,
  23. top_x: true,
  24. top_y: true,
  25. radius: true,
  26. imageData: true,
  27. sourceImage: true,
  28. targetCanvas: true,
  29. blurAlphaChannel: true
  30. },
  31. rules: {
  32. 'import/unambiguous': 0,
  33. 'import/no-commonjs': 0,
  34. 'node/no-missing-import': 0,
  35. 'import/no-unresolved': ['error', {
  36. ignore: ['stackblur-canvas']
  37. }],
  38. 'node/no-missing-require': ['error', {
  39. allowModules: ['stackblur-canvas']
  40. }],
  41. 'no-shadow': 0,
  42. 'no-unused-vars': ['error', {varsIgnorePattern: 'StackBlur'}]
  43. }
  44. }, {
  45. files: 'rollup.config.js',
  46. env: {
  47. node: true
  48. }
  49. }, {
  50. files: '.*.js',
  51. extends: ['plugin:node/recommended-script'],
  52. rules: {
  53. 'import/unambiguous': 0,
  54. 'import/no-commonjs': 0
  55. }
  56. }
  57. ],
  58. rules: {
  59. 'jsdoc/require-returns': ['error', {exemptedBy: ['see']}],
  60. // Handled by Babel
  61. 'node/no-unsupported-features/es-syntax': 0,
  62. // Would be good, but as not supported in older Node and browsers,
  63. // would need polyfill for `Number.isNaN`
  64. 'unicorn/prefer-number-properties': 0,
  65. 'unicorn/prefer-math-trunc': 0
  66. }
  67. };