Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated eslint version (8.56.0 > 9.15.0) #2367

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/docs/filters/eslint/clean_html.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ def call
@doc = at_css('#main') if at_css('#main')
@doc = at_css('.docs-main__content') if at_css('.docs-main__content')

css('.docs-toc').remove
css('.eslint-ad').remove
css('.glyphicon').remove
css('hr', 'colgroup', 'td:empty').remove
Expand Down
7 changes: 6 additions & 1 deletion lib/docs/filters/eslint/entries.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ def get_type
if subpath.start_with?('rules')
return 'Rules'
else
at_css('nav.docs-index [aria-current="true"]').ancestors('li')[-1].at_css('a').content
type = at_css('nav.docs-index [aria-current="true"]').ancestors('li')[-1].at_css('a').content
# This specific entry is mispelled with a lowercase 'i'
if type.start_with?('integrate')
type = type.sub('integrate', 'Integrate')
end
return type
end
end
end
Expand Down
21 changes: 18 additions & 3 deletions lib/docs/scrapers/eslint.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ module Docs
class Eslint < UrlScraper
self.name = 'ESLint'
self.type = 'simple'
self.release = '8.56.0'
self.release = '9.15.0'
self.base_url = 'https://eslint.org/docs/latest/'
self.root_path = 'user-guide/getting-started'
self.root_path = '/'
self.links = {
home: 'https://eslint.org/',
code: 'https://github.com/eslint/eslint'
Expand All @@ -14,7 +14,22 @@ class Eslint < UrlScraper

options[:skip_patterns] = [/maintain/, /migrating/, /migrate/, /\Aversions/, /rule-deprecation/]
options[:skip] = %w(about about/ versions)
options[:replace_paths] = { 'user-guide' => 'user-guide/' }
# A number of paths have a trailing slash, causing them to be suffixed by "index" during the NormalizePathsFilter
options[:replace_paths] = {
'configure/' => 'configure',
'contribute/' => 'contribute',
'contribute/architecture/' => 'contribute/architecture',
'extend/' => 'extend',
'flags/' => 'flags',
'integrate/' => 'integrate',
'rules/' => 'rules',
'use/' => 'use',
'use/formatters/' => 'use/formatters',
'use/configure/' => 'use/configure',
'use/configure/rules/' => 'use/configure/rules',
'use/core-concepts/' => 'use/core-concepts',
'use/troubleshooting/' => 'use/troubleshooting',
}

options[:attribution] = <<-HTML
&copy; OpenJS Foundation and other contributors<br>
Expand Down