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

Minor lint tweaks #2568

Merged
merged 1 commit into from
Sep 12, 2019
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
6 changes: 3 additions & 3 deletions build.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const renderer = new marked.Renderer()
renderer.heading = anchorMarkdownHeadings
const markedOptions = {
langPrefix: 'language-',
renderer: renderer
renderer
}

// This function imports a given language file and uses the default language set
Expand Down Expand Up @@ -133,7 +133,7 @@ function buildLocale (source, locale, opts) {
})
}))
.use(markdown(markedOptions))
.use(githubLinks({ locale: locale, site: i18nJSON(locale) }))
.use(githubLinks({ locale, site: i18nJSON(locale) }))
.use(prism())
// Set pretty permalinks, we don't want .html suffixes everywhere.
.use(permalinks({
Expand Down Expand Up @@ -190,7 +190,7 @@ function buildLocale (source, locale, opts) {
function withPreserveLocale (preserveLocale) {
return (files, m, next) => {
if (preserveLocale) {
var path = m.path('locale/en')
const path = m.path('locale/en')
m.read(path, (err, newfiles) => {
if (err) {
console.error(err)
Expand Down
4 changes: 1 addition & 3 deletions scripts/helpers/slashes.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict'

module.exports = function (str) {
return str.replace(/\\/g, '/')
}
module.exports = (str) => str.replace(/\\/g, '/')
4 changes: 2 additions & 2 deletions scripts/plugins/filter-stylus-partials.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
'use strict'

const Path = require('path')
const path = require('path')

module.exports = function filterStylusPartials () {
return (files, metalsmith, done) => {
Object.keys(files).forEach((filename) => {
const isPartial = (/^_.*\.styl(us)?/).test(Path.basename(filename))
const isPartial = (/^_.*\.styl(us)?/).test(path.basename(filename))
if (isPartial) {
delete files[filename]
}
Expand Down
2 changes: 1 addition & 1 deletion tests/scripts/anchor-mardown-headings.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ test('anchorMarkdownHeadings', (t) => {
renderer.heading = anchorMarkdownHeadings

const text = '# Title\n# Title'
const output = marked(text, { renderer: renderer })
const output = marked(text, { renderer })
const expected = '<h1 id="header-title">Title' +
'<a id="title" class="anchor" ' +
'href="#title" aria-labelledby="header-title"></a></h1>' +
Expand Down