Skip to content

Commit c7b5b09

Browse files
authored
Merge pull request #2367 from ruiiiijiiiiang/feature/update-eslint-version
updated eslint version (8.56.0 > 9.15.0)
2 parents c7885d4 + dfe89bb commit c7b5b09

File tree

3 files changed

+25
-4
lines changed

3 files changed

+25
-4
lines changed

lib/docs/filters/eslint/clean_html.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ def call
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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@ def get_type
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

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ module Docs
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 @@ class Eslint < UrlScraper
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>

0 commit comments

Comments
 (0)