Prechádzať zdrojové kódy

Update ESLint documentation (8.56.0)

Simon Legner 1 rok pred
rodič
commit
2e35633424

+ 4 - 6
lib/docs/filters/eslint/entries.rb

@@ -7,12 +7,10 @@ module Docs
       end
 
       def get_type
-        if subpath.include?('developer-guide')
-          'Developer Guide'
-        elsif subpath.include?('guide')
-          'Guide'
-        elsif subpath.start_with?('rules')
-          'Rules'
+        if subpath.start_with?('rules')
+          return 'Rules'
+        else
+          at_css('nav.docs-index [aria-current="true"]').ancestors('li')[-1].at_css('a').content
         end
       end
     end

+ 3 - 3
lib/docs/scrapers/eslint.rb

@@ -2,7 +2,7 @@ module Docs
   class Eslint < UrlScraper
     self.name = 'ESLint'
     self.type = 'simple'
-    self.release = '8.30.0'
+    self.release = '8.56.0'
     self.base_url = 'https://eslint.org/docs/latest/'
     self.root_path = 'user-guide/getting-started'
     self.links = {
@@ -12,8 +12,8 @@ module Docs
 
     html_filters.push 'eslint/entries', 'eslint/clean_html'
 
-    options[:skip_patterns] = [/maintainer-guide/]
-    options[:skip] = %w(about about/ rules versions)
+    options[:skip_patterns] = [/maintain/, /migrating/, /migrate/, /\Aversions/, /rule-deprecation/]
+    options[:skip] = %w(about about/ versions)
     options[:replace_paths] = { 'user-guide' => 'user-guide/' }
 
     options[:attribution] = <<-HTML