eslint.rb 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. module Docs
  2. class Eslint < UrlScraper
  3. self.name = 'ESLint'
  4. self.type = 'simple'
  5. self.release = '9.15.0'
  6. self.base_url = 'https://eslint.org/docs/latest/'
  7. self.root_path = '/'
  8. self.links = {
  9. home: 'https://eslint.org/',
  10. code: 'https://github.com/eslint/eslint'
  11. }
  12. html_filters.push 'eslint/entries', 'eslint/clean_html'
  13. options[:skip_patterns] = [/maintain/, /migrating/, /migrate/, /\Aversions/, /rule-deprecation/]
  14. options[:skip] = %w(about about/ versions)
  15. # A number of paths have a trailing slash, causing them to be suffixed by "index" during the NormalizePathsFilter
  16. options[:replace_paths] = {
  17. 'configure/' => 'configure',
  18. 'contribute/' => 'contribute',
  19. 'contribute/architecture/' => 'contribute/architecture',
  20. 'extend/' => 'extend',
  21. 'flags/' => 'flags',
  22. 'integrate/' => 'integrate',
  23. 'rules/' => 'rules',
  24. 'use/' => 'use',
  25. 'use/formatters/' => 'use/formatters',
  26. 'use/configure/' => 'use/configure',
  27. 'use/configure/rules/' => 'use/configure/rules',
  28. 'use/core-concepts/' => 'use/core-concepts',
  29. 'use/troubleshooting/' => 'use/troubleshooting',
  30. }
  31. options[:attribution] = <<-HTML
  32. &copy; OpenJS Foundation and other contributors<br>
  33. Licensed under the MIT License.
  34. HTML
  35. def get_latest_version(opts)
  36. get_npm_version('eslint', opts)
  37. end
  38. end
  39. end