History

Merge pull request #2367 from ruiiiijiiiiang/feature/update-eslint-version

updated eslint version (8.56.0 > 9.15.0)

Simon Legner committed 1 year ago

Commit c7b5b092 parents c7885d4 dfe89bb3 files · +25 −4Browse files

Unified · Split

3 files
  1. lib/docs/filters/eslint/clean_html.rb +1 −0
  2. lib/docs/filters/eslint/entries.rb +6 −1
  3. lib/docs/scrapers/eslint.rb +18 −3
lib/docs/filters/eslint/clean_html.rb+1−0
@@ -5,6 +5,7 @@ module Docs · 4 unmodified lines
55 @doc = at_css('#main') if at_css('#main')
66 @doc = at_css('.docs-main__content') if at_css('.docs-main__content')
77
8+ css('.docs-toc').remove
89 css('.eslint-ad').remove
910 css('.glyphicon').remove
1011 css('hr', 'colgroup', 'td:empty').remove
lib/docs/filters/eslint/entries.rb+6−1
@@ -10,7 +10,12 @@ module Docs · 9 unmodified lines
1010 if subpath.start_with?('rules')
1111 return 'Rules'
1212 else
13− at_css('nav.docs-index [aria-current="true"]').ancestors('li')[-1].at_css('a').content
13+ type = at_css('nav.docs-index [aria-current="true"]').ancestors('li')[-1].at_css('a').content
14+ # This specific entry is mispelled with a lowercase 'i'
15+ if type.start_with?('integrate')
16+ type = type.sub('integrate', 'Integrate')
17+ end
18+ return type
1419 end
1520 end
1621 end
lib/docs/scrapers/eslint.rb+18−3
@@ -2,9 +2,9 @@ module Docs · 1 unmodified line
22 class Eslint < UrlScraper
33 self.name = 'ESLint'
44 self.type = 'simple'
5− self.release = '8.56.0'
5+ self.release = '9.15.0'
66 self.base_url = 'https://eslint.org/docs/latest/'
7− self.root_path = 'user-guide/getting-started'
7+ self.root_path = '/'
88 self.links = {
99 home: 'https://eslint.org/',
1010 code: 'https://github.com/eslint/eslint'
@@ -14,7 +14,22 @@ module Docs · 3 unmodified lines
1414
1515 options[:skip_patterns] = [/maintain/, /migrating/, /migrate/, /\Aversions/, /rule-deprecation/]
1616 options[:skip] = %w(about about/ versions)
17− options[:replace_paths] = { 'user-guide' => 'user-guide/' }
17+ # A number of paths have a trailing slash, causing them to be suffixed by "index" during the NormalizePathsFilter
18+ options[:replace_paths] = {
19+ 'configure/' => 'configure',
20+ 'contribute/' => 'contribute',
21+ 'contribute/architecture/' => 'contribute/architecture',
22+ 'extend/' => 'extend',
23+ 'flags/' => 'flags',
24+ 'integrate/' => 'integrate',
25+ 'rules/' => 'rules',
26+ 'use/' => 'use',
27+ 'use/formatters/' => 'use/formatters',
28+ 'use/configure/' => 'use/configure',
29+ 'use/configure/rules/' => 'use/configure/rules',
30+ 'use/core-concepts/' => 'use/core-concepts',
31+ 'use/troubleshooting/' => 'use/troubleshooting',
32+ }
1833
1934 options[:attribution] = <<-HTML
2035 &copy; OpenJS Foundation and other contributors<br>