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
5 @doc = at_css('#main') if at_css('#main')5 @doc = at_css('#main') if at_css('#main')
6 @doc = at_css('.docs-main__content') if at_css('.docs-main__content')6 @doc = at_css('.docs-main__content') if at_css('.docs-main__content')
7 7
8 css('.docs-toc').remove
8 css('.eslint-ad').remove9 css('.eslint-ad').remove
9 css('.glyphicon').remove10 css('.glyphicon').remove
10 css('hr', 'colgroup', 'td:empty').remove11 css('hr', 'colgroup', 'td:empty').remove
lib/docs/filters/eslint/entries.rb+6−1
@@ -10,7 +10,12 @@ module Docs · 9 unmodified lines
10 if subpath.start_with?('rules')10 if subpath.start_with?('rules')
11 return 'Rules'11 return 'Rules'
12 else12 else
13 at_css('nav.docs-index [aria-current="true"]').ancestors('li')[-1].at_css('a').content13 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
14 end19 end
15 end20 end
16 end21 end
lib/docs/scrapers/eslint.rb+18−3
@@ -2,9 +2,9 @@ module Docs · 1 unmodified line
2 class Eslint < UrlScraper2 class Eslint < UrlScraper
3 self.name = 'ESLint'3 self.name = 'ESLint'
4 self.type = 'simple'4 self.type = 'simple'
5 self.release = '8.56.0'5 self.release = '9.15.0'
6 self.base_url = 'https://eslint.org/docs/latest/'6 self.base_url = 'https://eslint.org/docs/latest/'
7 self.root_path = 'user-guide/getting-started'7 self.root_path = '/'
8 self.links = {8 self.links = {
9 home: 'https://eslint.org/',9 home: 'https://eslint.org/',
10 code: 'https://github.com/eslint/eslint'10 code: 'https://github.com/eslint/eslint'
@@ -14,7 +14,22 @@ module Docs · 3 unmodified lines
14 14
15 options[:skip_patterns] = [/maintain/, /migrating/, /migrate/, /\Aversions/, /rule-deprecation/]15 options[:skip_patterns] = [/maintain/, /migrating/, /migrate/, /\Aversions/, /rule-deprecation/]
16 options[:skip] = %w(about about/ versions)16 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 }
18 33
19 options[:attribution] = <<-HTML34 options[:attribution] = <<-HTML
20 &copy; OpenJS Foundation and other contributors<br>35 &copy; OpenJS Foundation and other contributors<br>