Skip to content

Commit d4034ee

Browse files
updated eslint scraper
1 parent 811b9d1 commit d4034ee

File tree

2 files changed

+24
-4
lines changed

2 files changed

+24
-4
lines changed

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)