Skip to content

Commit

Permalink
style(lint): fixing linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
rodneyrehm committed Jan 8, 2017
1 parent 3f0728e commit d9a2084
Show file tree
Hide file tree
Showing 114 changed files with 159 additions and 254 deletions.
4 changes: 2 additions & 2 deletions build/build.archive.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ function createArchive(name, type, options) {
const archive = archiver(type, options || {});

output.on('close', function() {
/*eslint-disable no-console */
/* eslint-disable no-console */
console.log(archive.pointer() + ' total bytes');
/*eslint-enable no-console */
/* eslint-enable no-console */
});

archive.on('error', function(err) {
Expand Down
4 changes: 2 additions & 2 deletions build/data-tables/utils/focusable.notes.interface.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,9 @@ class Notes {
const key = source + ' --- ' + target;
let message = this.redirections[key];
if (!message) {
/*eslint-disable no-console */
/* eslint-disable no-console */
console.warn('no redirect resolution for "' + key + '"');
/*eslint-enable no-console */
/* eslint-enable no-console */
message = this._addMessage('Redirecting to ' + target);
this.redirections[key] = message;
}
Expand Down
4 changes: 2 additions & 2 deletions build/data-tables/utils/merge-missing-expected.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ Object.keys(expected).sort().forEach(function(ident) {
result[ident] = expected[ident];
});

/*eslint-disable no-console */
/* eslint-disable no-console */
console.log(JSON.stringify(result, null, 2));
/*eslint-enable no-console */
/* eslint-enable no-console */
11 changes: 5 additions & 6 deletions build/markdownlint.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const config = {
// MD030: false, // Spaces after list markers
MD033: {
// https://github.com/DavidAnson/markdownlint/blob/master/doc/Rules.md#md033---inline-html
/*eslint-disable camelcase */
/* eslint-disable camelcase */
allowed_elements: ['kbd', 'a'],
/*eslint-enable camelcase */
},
Expand All @@ -45,8 +45,8 @@ markdownlint({
frontMatter: /(^---$[^]*?^---$)?(\r\n|\r|\n){1,}/m,
config: config,
}, function(err, result) {
/*eslint-disable no-console */
/*eslint-disable no-process-exit */
/* eslint-disable no-console */
/* eslint-disable no-process-exit */
if (err) {
console.error(err);
process.exit(1);
Expand All @@ -56,8 +56,7 @@ markdownlint({
if (resultString) {
console.error(resultString);
process.exit(1);

}
/*eslint-enable no-console */
/*eslint-enable no-process-exit */
/* eslint-enable no-console */
/* eslint-enable no-process-exit */
});
10 changes: 5 additions & 5 deletions build/metalsmith/assets/website.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*eslint-disable no-var */
/* eslint-disable no-var */
(function() {
'use strict';

Expand Down Expand Up @@ -49,7 +49,7 @@
* Algolia Search
************************************************************/
(function() {
var client = window.algoliasearch('PLCNURI3P6', '572a18e64d6d618a62df82a0d28927b7')
var client = window.algoliasearch('PLCNURI3P6', '572a18e64d6d618a62df82a0d28927b7');
var index = {
api: client.initIndex('ally.api'),
tutorial: client.initIndex('ally.tutorial'),
Expand All @@ -58,8 +58,8 @@

// https://github.com/algolia/autocomplete.js#options
var options = {
//hint: false,
//debug: true,
// hint: false,
// debug: true,
templates: {
footer: '<div class="branding">Powered by <a href="https://www.algolia.com"><img src="https://www.algolia.com/assets/algolia128x40.png" alt="algolia"></a></div>',
},
Expand Down Expand Up @@ -117,7 +117,7 @@
},
];

function handleSelected(event, suggestion /*, dataset*/) {
function handleSelected(event, suggestion /*, dataset */) {
location.href = '/' + suggestion.url;
}

Expand Down
4 changes: 2 additions & 2 deletions build/metalsmith/helpers/log-data.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

module.exports = function(context) {
/*eslint-disable no-console */
/* eslint-disable no-console */
// context.name - helper name
// context.hash - arguments map
// context.data - data map
Expand All @@ -19,5 +19,5 @@ module.exports = function(context) {
console.log('dumping everything because of circular references');
console.log(context.data.root);
}
/*eslint-enable no-console */
/* eslint-enable no-console */
};
8 changes: 4 additions & 4 deletions build/metalsmith/markdown/markdown-container-example.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

const examples = require('../parse-examples');

module.exports = function(md/*, options*/) {
module.exports = function(md/*, options */) {
md.core.ruler.push('container_example', function(state) {
const tokens = state.tokens
const tokens = state.tokens;
let containerOpen;
let headingContent;

Expand All @@ -29,9 +29,9 @@ module.exports = function(md/*, options*/) {
const example = examples[url];

if (!example) {
/*eslint-disable no-console */
/* eslint-disable no-console */
console.error('could not find example', url);
/*eslint-enable no-console */
/* eslint-enable no-console */
}

if (headingContent) {
Expand Down
6 changes: 3 additions & 3 deletions build/metalsmith/markdown/markdown-link-code.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ module.exports = function(md, options) {
: getUrlByReplace;

md.core.ruler.push('link-code', function(state) {
const tokens = state.tokens
const tokens = state.tokens;
for (let i = 0; i < tokens.length; i++) {
if (tokens[i].type !== 'inline') {
continue
continue;
}

let inLink = false;
Expand All @@ -47,7 +47,7 @@ module.exports = function(md, options) {
}

if (code.type !== 'code_inline' || inLink) {
continue
continue;
}

const match = code.content.match(options.pattern);
Expand Down
2 changes: 0 additions & 2 deletions build/metalsmith/metalsmith.markdown.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@



const markdown = require('metalsmith-markdownit');
const markdownOptions = {
linkify: true,
Expand Down
1 change: 0 additions & 1 deletion build/metalsmith/parse-examples.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ list.forEach(function(file) {
embed: embed,
edit: edit,
};

});

module.exports = examples;
2 changes: 1 addition & 1 deletion build/metalsmith/plugins/absolute-url.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const urlSelector = Object.keys(URI.domAttributes).map(function(tagName) {
return tagName + '[' + URI.domAttributes[tagName] + ']';
}).join(',');

function filter(file, files, filePath /*, options*/) {
function filter(file, files, filePath /*, options */) {
// skip mutations for anything that isn't html
if (filePath.ext !== '.html') {
return true;
Expand Down
12 changes: 6 additions & 6 deletions build/metalsmith/plugins/import-json.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ function importFile(path) {
const content = fs.readFileSync(path, { encoding: 'utf8' });
return JSON.parse(content);
} catch (error) {
/*eslint-disable no-console */
/* eslint-disable no-console */
console.error('could not parse ', path, 'as JSON');
console.error(error);
/*eslint-enable no-console */
/* eslint-enable no-console */
}

return null;
Expand All @@ -32,18 +32,18 @@ function extractMetalsmithFile(files, name) {
const content = files[name].contents.toString();
data = JSON.parse(content);
} catch (error) {
/*eslint-disable no-console */
/* eslint-disable no-console */
console.error('could not parse ', name, 'as JSON');
console.error(error);
/*eslint-enable no-console */
/* eslint-enable no-console */
}

delete files[name];

return data;
}

module.exports = function(options){
module.exports = function(options) {
if (!options) {
options = {};
}
Expand All @@ -67,4 +67,4 @@ module.exports = function(options){

done();
};
}
};
6 changes: 3 additions & 3 deletions build/metalsmith/plugins/link-checker.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ module.exports = function plugin(options) {
}

const file = files[filename];
const contents = file.contents.toString()
const contents = file.contents.toString();
const $ = cheerio.load(contents);
documents[filename] = $;
index[filename] = extractFragmentTargets($);
Expand All @@ -149,10 +149,10 @@ module.exports = function plugin(options) {
Object.keys(documents).forEach(function(filename) {
const errors = verifyLinks(index, filename, documents[filename], options.ignore);
if (errors.length) {
/*eslint-disable no-console */
/* eslint-disable no-console */
console.log('bad links found in', filename);
console.log(JSON.stringify(errors, null, 2));
/*eslint-enable no-console */
/* eslint-enable no-console */
}
});

Expand Down
2 changes: 1 addition & 1 deletion build/metalsmith/plugins/prepare.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const path = require('path');
const cheerio = require('cheerio');
const transform = require('./prepare.transform.js');

module.exports = function plugin(/*options*/) {
module.exports = function plugin(/* options */) {
return function(files, metalsmith, done) {
setImmediate(done);

Expand Down
6 changes: 3 additions & 3 deletions build/metalsmith/plugins/prepare.transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function extractData($, data) {
}
}

function rewriteUrlsFromMdToHtml($/*, data*/) {
function rewriteUrlsFromMdToHtml($/*, data */) {
// rewrite relative *.md to *.html
$('a').each(function() {
const $this = $(this);
Expand All @@ -77,7 +77,7 @@ function rewriteUrlsFromMdToHtml($/*, data*/) {
});
}

function removeEmptyApiSections($/*, data*/) {
function removeEmptyApiSections($/*, data */) {
$('h2').each(function() {
const $headline = $(this);
if ($headline.next().is('h2')) {
Expand Down Expand Up @@ -112,7 +112,7 @@ function extractTableOfContents($, data) {
});
}

function convertCodeLanguageForPrism($/*, data*/) {
function convertCodeLanguageForPrism($/*, data */) {
$('pre > code').each(function() {
const $this = $(this);
const className = $this.attr('class')
Expand Down
4 changes: 2 additions & 2 deletions build/metalsmith/plugins/write-algolia-index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function escapeHtml(string) {
.replace(/'/g, '&quot;');
}

module.exports = function plugin(/*options*/) {
module.exports = function plugin(/* options */) {
return function(files, metalsmith, done) {
const indexes = {
documentation: [],
Expand Down Expand Up @@ -60,5 +60,5 @@ module.exports = function plugin(/*options*/) {
fs.writeFileSync(apiFile, JSON.stringify(indexes.api, null, 2));

done();
}
};
};
10 changes: 5 additions & 5 deletions build/publish.algolia.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ function publish(indexName, fileName) {
const file = path.resolve(process.cwd(), fileName);
const documents = require(file);

index.saveObjects(documents, function(err/*, content*/) {
index.saveObjects(documents, function(err/*, content */) {
if (err) {
/*eslint-disable no-console */
/* eslint-disable no-console */
console.error(err);
/*eslint-enable no-console */
/*eslint-disable no-process-exit */
/* eslint-enable no-console */
/* eslint-disable no-process-exit */
process.exit(1);
/*eslint-enable no-process-exit */
/* eslint-enable no-process-exit */
}
});
}
Expand Down
8 changes: 4 additions & 4 deletions build/publish.website.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ const options = {
};

pages.publish(source, options, function(err) {
/*eslint-disable no-console */
/*eslint-disable no-process-exit */
/* eslint-disable no-console */
/* eslint-disable no-process-exit */
if (err) {
console.error(err);
process.exit(1);
}
/*eslint-enable no-console */
/*eslint-enable no-process-exit */
/* eslint-enable no-console */
/* eslint-enable no-process-exit */
});
4 changes: 2 additions & 2 deletions build/report-deployment.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ function setStatus(options, done) {
options.owner = data.owner;
options.repo = data.repo;
options.sha = data.sha;
/*eslint-disable camelcase */
/* eslint-disable camelcase */
options.target_url = options.url;
/*eslint-enable camelcase */
/* eslint-enable camelcase */
github.repos.createStatus(options, function(err) {
if (err) {
throw err;
Expand Down
16 changes: 8 additions & 8 deletions build/web-tests/build.event-sequence.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ const config = {
};

requirejs.optimize(config, function(/* buildResponse */) {
//buildResponse is just a text output of the modules
//included. Load the built file for the contents.
//Use config.out to get the optimized file contents.
//var contents = fs.readFileSync(config.out, 'utf8');
// buildResponse is just a text output of the modules
// included. Load the built file for the contents.
// Use config.out to get the optimized file contents.
// var contents = fs.readFileSync(config.out, 'utf8');
}, function(err) {
/*eslint-disable no-console */
/* eslint-disable no-console */
console.log(err);
/*eslint-enable no-console */
/*eslint-disable no-process-exit */
/* eslint-enable no-console */
/* eslint-disable no-process-exit */
process.exit(1);
/*eslint-enable no-process-exit */
/* eslint-enable no-process-exit */
});
16 changes: 8 additions & 8 deletions build/web-tests/build.focusable.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ const config = {
};

requirejs.optimize(config, function(/* buildResponse */) {
//buildResponse is just a text output of the modules
//included. Load the built file for the contents.
//Use config.out to get the optimized file contents.
//var contents = fs.readFileSync(config.out, 'utf8');
// buildResponse is just a text output of the modules
// included. Load the built file for the contents.
// Use config.out to get the optimized file contents.
// var contents = fs.readFileSync(config.out, 'utf8');
}, function(err) {
/*eslint-disable no-console */
/* eslint-disable no-console */
console.log(err);
/*eslint-enable no-console */
/*eslint-disable no-process-exit */
/* eslint-enable no-console */
/* eslint-disable no-process-exit */
process.exit(1);
/*eslint-enable no-process-exit */
/* eslint-enable no-process-exit */
});
Loading

0 comments on commit d9a2084

Please sign in to comment.