Skip to content

Commit

Permalink
eslint . --ext=js,ts --fix
Browse files Browse the repository at this point in the history
  • Loading branch information
rwjblue committed Sep 30, 2020
1 parent 817a904 commit 8e3a18a
Show file tree
Hide file tree
Showing 378 changed files with 3,196 additions and 3,240 deletions.
2 changes: 1 addition & 1 deletion bin/build-for-publishing.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ Promise.resolve()
.then(
// eslint-disable-next-line
() => console.log('build-for-publishing completed successfully!'),
error => {
(error) => {
// eslint-disable-next-line
console.error(error);
// eslint-disable-next-line
Expand Down
8 changes: 4 additions & 4 deletions bin/changelog.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ compareCommits({
})
.then(processPages)
.then(console.log)
.catch(err => console.error(err));
.catch((err) => console.error(err));

function getCommitMessage(commitInfo) {
let message = commitInfo.commit.message;
Expand Down Expand Up @@ -81,7 +81,7 @@ function processPages(res) {
let contributions = res.commits
.filter(excludeDependabot)
.filter(isMergeOrCherryPick)
.map(commitInfo => {
.map((commitInfo) => {
let message = getCommitMessage(commitInfo);

let mergeFromBranchRegex = /#(\d+) from (.*)\//;
Expand All @@ -107,7 +107,7 @@ function processPages(res) {
return result;
})
.sort(comparePrNumber)
.map(pr => {
.map((pr) => {
let title = pr.title;
let link;
if (pr.number) {
Expand All @@ -123,7 +123,7 @@ function processPages(res) {
.join('\n');

if (github.hasNextPage(res)) {
return github.getNextPage(res).then(nextPage => {
return github.getNextPage(res).then((nextPage) => {
contributions += processPages(nextPage);
});
} else {
Expand Down
2 changes: 1 addition & 1 deletion bin/feature-flag-yuidoc-filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function updateClassReferencesInNamespaces(data) {
}
}

module.exports = function(data) {
module.exports = function (data) {
let featuresToFilter = gatherFeatures();
data.classes = gatherClassesToDocument(data, featuresToFilter);
updateClassReferencesInNamespaces(data);
Expand Down
2 changes: 1 addition & 1 deletion bin/publish_to_s3.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ if (!buildInfo.isBuildForTag) {
TRAVIS_COMMIT: buildInfo.sha,
});

publisher.currentBranch = function() {
publisher.currentBranch = function () {
return buildInfo.channel;
};

Expand Down
2 changes: 1 addition & 1 deletion bin/run-browserstack-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function run(command, args = []) {
return p;
}

(async function() {
(async function () {
await run('ember', ['browserstack:connect']);

try {
Expand Down
10 changes: 5 additions & 5 deletions bin/run-tests-injection.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
/* eslint-disable no-console */
/* globals QUnit */
'use strict';
document.addEventListener('DOMContentLoaded', function() {
document.addEventListener('DOMContentLoaded', function () {
let testsTotal = 0;
let testsPassed = 0;
let testsFailed = 0;
let currentTestAssertions = [];
QUnit.log(function(details) {
QUnit.log(function (details) {
let response;

// Ignore passing assertions
Expand All @@ -32,7 +32,7 @@ document.addEventListener('DOMContentLoaded', function() {
currentTestAssertions.push('Failed assertion: ' + response);
});

QUnit.testDone(function(result) {
QUnit.testDone(function (result) {
let i,
len,
name = '';
Expand All @@ -58,13 +58,13 @@ document.addEventListener('DOMContentLoaded', function() {
currentTestAssertions.length = 0;
});

QUnit.moduleDone(m => {
QUnit.moduleDone((m) => {
console.log(
`Module "${m.name}" finished ${m.total} tests${m.failed > 0 ? `${m.failed} failed` : ''}`
);
});

QUnit.done(function(result) {
QUnit.done(function (result) {
console.log(
'\n' +
'Took ' +
Expand Down
14 changes: 7 additions & 7 deletions bin/run-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const fs = require('fs');
const serve = serveStatic('./dist/', { index: ['index.html', 'index.htm'] });

// Create server.
const server = http.createServer(function(req, res) {
const server = http.createServer(function (req, res) {
let done = finalhandler(req, res);
serve(req, res, done);
});
Expand Down Expand Up @@ -71,15 +71,15 @@ function generateTestsFor(packageName) {

function generateEachPackageTests() {
fs.readdirSync('packages/@ember')
.filter(e => e !== '-internals')
.forEach(e => generateTestsFor(`@ember/${e}`));
.filter((e) => e !== '-internals')
.forEach((e) => generateTestsFor(`@ember/${e}`));

fs.readdirSync('packages/@ember/-internals').forEach(e =>
fs.readdirSync('packages/@ember/-internals').forEach((e) =>
generateTestsFor(`@ember/-internals/${e}`)
);

fs.readdirSync('packages')
.filter(e => e !== '@ember')
.filter((e) => e !== '@ember')
.forEach(generateTestsFor);
}

Expand Down Expand Up @@ -108,11 +108,11 @@ function runInSequence(tasks) {

function runAndExit() {
runInSequence(testFunctions)
.then(function() {
.then(function () {
console.log(chalk.green('Passed!'));
process.exit(0);
})
.catch(function(err) {
.catch(function (err) {
console.error(chalk.red(err.toString()));
console.error(chalk.red('Failed!'));
process.exit(1);
Expand Down
4 changes: 2 additions & 2 deletions bin/yarn-link-glimmer.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ const yarnConfig = JSON.parse(
})
).data
);
const linkedModules = yarnConfig.linkedModules.filter(m => m.startsWith('@glimmer/'));
const linkedModules = yarnConfig.linkedModules.filter((m) => m.startsWith('@glimmer/'));

linkedModules.forEach(mod => {
linkedModules.forEach((mod) => {
child_process.execSync(`yarn link "${mod}"`);
});
4 changes: 2 additions & 2 deletions bin/yarn-unlink-glimmer.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ const yarnConfig = JSON.parse(
})
).data
);
const linkedModules = yarnConfig.linkedModules.filter(m => m.startsWith('@glimmer/'));
const linkedModules = yarnConfig.linkedModules.filter((m) => m.startsWith('@glimmer/'));

linkedModules.forEach(mod => {
linkedModules.forEach((mod) => {
child_process.execSync(`yarn unlink "${mod}"`);
});

Expand Down
10 changes: 5 additions & 5 deletions blueprints/-addon-import.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ const inflector = require('inflection');
module.exports = {
description: 'Generates an import wrapper.',

fileMapTokens: function() {
fileMapTokens: function () {
return {
__name__: function(options) {
__name__: function (options) {
return options.dasherizedModuleName;
},
__path__: function(options) {
__path__: function (options) {
return inflector.pluralize(options.locals.blueprintName);
},
__root__: function(options) {
__root__: function (options) {
if (options.inRepoAddon) {
return path.join('lib', options.inRepoAddon, 'app');
}
Expand All @@ -24,7 +24,7 @@ module.exports = {
};
},

locals: function(options) {
locals: function (options) {
let addonRawName = options.inRepoAddon ? options.inRepoAddon : options.project.name();
let addonName = stringUtil.dasherize(addonRawName);
let fileName = stringUtil.dasherize(options.entity.name);
Expand Down
2 changes: 1 addition & 1 deletion blueprints/acceptance-test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const useTestFrameworkDetector = require('../test-framework-detector');
module.exports = useTestFrameworkDetector({
description: 'Generates an acceptance test for a feature.',

locals: function(options) {
locals: function (options) {
let testFolderRoot = stringUtils.dasherize(options.project.name());

if (options.project.isEmberCLIAddon()) {
Expand Down
16 changes: 8 additions & 8 deletions blueprints/component-addon/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,33 @@ const useEditionDetector = require('../edition-detector');
module.exports = useEditionDetector({
description: 'Generates a component.',

fileMapTokens: function() {
fileMapTokens: function () {
return {
__path__: function(options) {
__path__: function (options) {
if (options.pod) {
return path.join(options.podPath, options.locals.path, options.dasherizedModuleName);
}
return 'components';
},
__name__: function(options) {
__name__: function (options) {
if (options.pod) {
return 'component';
}
return options.dasherizedModuleName;
},
__root__: function(options) {
__root__: function (options) {
if (options.inRepoAddon) {
return path.join('lib', options.inRepoAddon, 'app');
}
return 'app';
},
__templatepath__: function(options) {
__templatepath__: function (options) {
if (options.pod) {
return path.join(options.podPath, options.locals.path, options.dasherizedModuleName);
}
return 'templates/components';
},
__templatename__: function(options) {
__templatename__: function (options) {
if (options.pod) {
return 'template';
}
Expand All @@ -44,11 +44,11 @@ module.exports = useEditionDetector({
};
},

normalizeEntityName: function(entityName) {
normalizeEntityName: function (entityName) {
return normalizeEntityName(entityName);
},

locals: function(options) {
locals: function (options) {
let addonRawName = options.inRepoAddon ? options.inRepoAddon : options.project.name();
let addonName = stringUtil.dasherize(addonRawName);
let fileName = stringUtil.dasherize(options.entity.name);
Expand Down
12 changes: 6 additions & 6 deletions blueprints/component-class-addon/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,21 @@ const useEditionDetector = require('../edition-detector');
module.exports = useEditionDetector({
description: 'Generates a component class.',

fileMapTokens: function() {
fileMapTokens: function () {
return {
__path__: function(options) {
__path__: function (options) {
if (options.pod) {
return path.join(options.podPath, options.locals.path, options.dasherizedModuleName);
}
return 'components';
},
__name__: function(options) {
__name__: function (options) {
if (options.pod) {
return 'component';
}
return options.dasherizedModuleName;
},
__root__: function(options) {
__root__: function (options) {
if (options.inRepoAddon) {
return path.join('lib', options.inRepoAddon, 'app');
}
Expand All @@ -32,11 +32,11 @@ module.exports = useEditionDetector({
};
},

normalizeEntityName: function(entityName) {
normalizeEntityName: function (entityName) {
return normalizeEntityName(entityName);
},

locals: function(options) {
locals: function (options) {
let addonRawName = options.inRepoAddon ? options.inRepoAddon : options.project.name();
let addonName = stringUtil.dasherize(addonRawName);
let fileName = stringUtil.dasherize(options.entity.name);
Expand Down
2 changes: 1 addition & 1 deletion blueprints/component-class/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ module.exports = {
this._super && this._super.init.apply(this, arguments);
let isOctane = has('octane');

this.availableOptions.forEach(option => {
this.availableOptions.forEach((option) => {
if (option.name === 'component-class') {
if (isOctane) {
option.default = '@glimmer/component';
Expand Down
16 changes: 8 additions & 8 deletions blueprints/component-test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const useTestFrameworkDetector = require('../test-framework-detector');

function invocationFor(options) {
let parts = options.entity.name.split('/');
return parts.map(p => stringUtil.classify(p)).join('::');
return parts.map((p) => stringUtil.classify(p)).join('::');
}

module.exports = useTestFrameworkDetector({
Expand All @@ -30,7 +30,7 @@ module.exports = useTestFrameworkDetector({
},
],

fileMapTokens: function() {
fileMapTokens: function () {
return {
__root__() {
return 'tests';
Expand All @@ -47,7 +47,7 @@ module.exports = useTestFrameworkDetector({
};
},

locals: function(options) {
locals: function (options) {
let dasherizedModuleName = stringUtil.dasherize(options.entity.name);
let componentPathName = dasherizedModuleName;
let testType = options.testType || 'integration';
Expand All @@ -68,9 +68,9 @@ module.exports = useTestFrameworkDetector({

let templateInvocation = invocationFor(options);
let componentName = templateInvocation;
let openComponent = descriptor => `<${descriptor}>`;
let closeComponent = descriptor => `</${descriptor}>`;
let selfCloseComponent = descriptor => `<${descriptor} />`;
let openComponent = (descriptor) => `<${descriptor}>`;
let closeComponent = (descriptor) => `</${descriptor}>`;
let selfCloseComponent = (descriptor) => `<${descriptor} />`;

return {
path: getPathOption(options),
Expand All @@ -87,7 +87,7 @@ module.exports = useTestFrameworkDetector({
},

_useNamedHbsImport() {
let htmlbarsAddon = this.project.addons.find(a => a.name === 'ember-cli-htmlbars');
let htmlbarsAddon = this.project.addons.find((a) => a.name === 'ember-cli-htmlbars');

if (htmlbarsAddon && semver.gte(htmlbarsAddon.pkg.version, '4.0.0-alpha.1')) {
return true;
Expand All @@ -96,7 +96,7 @@ module.exports = useTestFrameworkDetector({
return false;
},

afterInstall: function(options) {
afterInstall: function (options) {
if (
!options.dryRun &&
options.testType === 'integration' &&
Expand Down
Loading

0 comments on commit 8e3a18a

Please sign in to comment.