Skip to content

Commit 2d3cef8

Browse files
author
Robert Jackson
committed
yarn eslint . --fix
1 parent d7a96c2 commit 2d3cef8

22 files changed

Lines changed: 124 additions & 127 deletions

config/ember-try.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
const getChannelURL = require('ember-source-channel-url');
44

5-
module.exports = function() {
5+
module.exports = function () {
66
return Promise.all([
77
getChannelURL('release'),
88
getChannelURL('beta'),
99
getChannelURL('canary'),
10-
]).then(urls => {
10+
]).then((urls) => {
1111
return {
1212
useYarn: true,
1313
scenarios: [

config/environment.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
module.exports = function(environment) {
3+
module.exports = function (environment) {
44
let ENV = {
55
modulePrefix: 'ember-cli-htmlbars',
66
environment,

ember-cli-build.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const EmberAddon = require('ember-cli/lib/broccoli/ember-addon');
44
const MergeTree = require('broccoli-merge-trees');
55
const { has } = require('@ember/edition-utils');
66

7-
module.exports = function(defaults) {
7+
module.exports = function (defaults) {
88
let hasOctane = has('octane');
99
let appTree = 'tests/dummy/app';
1010
if (hasOctane) {

lib/addDependencyTracker.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function addDependencyTracker(plugin, enableInvalidation) {
1515
// the ast plugin that we can't access with the ast plugin generator that
1616
// we can access.
1717
let lastDependencies = {};
18-
let trackedPlugin = env => {
18+
let trackedPlugin = (env) => {
1919
let templateStackDepth = 0;
2020
let realPlugin = plugin(env);
2121
let visitor = realPlugin.visitor;
@@ -38,7 +38,7 @@ function addDependencyTracker(plugin, enableInvalidation) {
3838
// have to keep a stack counter of Program nodes that we've seen so far.
3939
visitor.Program = {
4040
keys: origKeys,
41-
enter: node => {
41+
enter: (node) => {
4242
templateStackDepth++;
4343
if (templateStackDepth === 1) {
4444
if (realPlugin.resetDependencies) {
@@ -48,7 +48,7 @@ function addDependencyTracker(plugin, enableInvalidation) {
4848
}
4949
if (origEnter) origEnter(node);
5050
},
51-
exit: node => {
51+
exit: (node) => {
5252
if (templateStackDepth === 1) {
5353
if (realPlugin.dependencies) {
5454
lastDependencies[env.meta.moduleName] = realPlugin.dependencies(env.meta.moduleName);
@@ -60,7 +60,7 @@ function addDependencyTracker(plugin, enableInvalidation) {
6060
};
6161
return realPlugin;
6262
};
63-
trackedPlugin.getDependencies = relativePath => {
63+
trackedPlugin.getDependencies = (relativePath) => {
6464
return lastDependencies[relativePath] || [];
6565
};
6666
return trackedPlugin;

lib/colocated-babel-plugin.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// For ease of debuggin / tweaking:
22
// https://astexplorer.net/#/gist/bcca584efdab6c981a75618642c76a22/1e1d262eaeb47b7da66150e0781a02b96e597b25
3-
module.exports = function(babel) {
3+
module.exports = function (babel) {
44
let t = babel.types;
55

66
function makeSetComponentTemplateMemberExpression() {
@@ -68,7 +68,9 @@ module.exports = function(babel) {
6868
return;
6969
}
7070

71-
let defaultSpecifier = path.node.specifiers.find(spec => spec.exported.name === 'default');
71+
let defaultSpecifier = path.node.specifiers.find(
72+
(spec) => spec.exported.name === 'default'
73+
);
7274
if (defaultSpecifier) {
7375
state.setComponentTemplateInjected = true;
7476
path.parent.body.push(

lib/colocated-broccoli-plugin.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ module.exports = class ColocatedTemplateProcessor extends Plugin {
3232
}
3333

3434
inputHasFile(relativePath) {
35-
return !!this.currentEntries().find(e => e.relativePath === relativePath);
35+
return !!this.currentEntries().find((e) => e.relativePath === relativePath);
3636
}
3737

3838
detectRootName() {
39-
let entries = this.currentEntries().filter(e => !e.isDirectory());
39+
let entries = this.currentEntries().filter((e) => !e.isDirectory());
4040

4141
let [first] = entries;
4242
let parts = first.relativePath.split('/');
@@ -48,7 +48,7 @@ module.exports = class ColocatedTemplateProcessor extends Plugin {
4848
root = parts[0];
4949
}
5050

51-
if (!entries.every(e => e.relativePath.startsWith(root))) {
51+
if (!entries.every((e) => e.relativePath.startsWith(root))) {
5252
root = null;
5353
}
5454

@@ -203,7 +203,7 @@ module.exports = class ColocatedTemplateProcessor extends Plugin {
203203
`ember-cli-htmlbars: Unexpected operation when patching files for colocation.\n\tOperation:\n${JSON.stringify(
204204
[method, relativePath]
205205
)}\n\tKnown files:\n${JSON.stringify(
206-
this.currentEntries().map(e => e.relativePath),
206+
this.currentEntries().map((e) => e.relativePath),
207207
null,
208208
2
209209
)}`

lib/ember-addon-main.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ module.exports = {
2525

2626
const semver = require('semver');
2727

28-
let babel = this.parent.addons.find(a => a.name === 'ember-cli-babel');
28+
let babel = this.parent.addons.find((a) => a.name === 'ember-cli-babel');
2929
let hasBabel = babel !== undefined;
3030
let babelVersion = hasBabel && babel.pkg.version;
3131

32-
let ember = this.project.addons.find(a => a.name === 'ember-source');
32+
let ember = this.project.addons.find((a) => a.name === 'ember-source');
3333
let hasEmberSource = ember !== undefined;
3434
let emberVersion = hasEmberSource && ember.pkg.version;
3535

@@ -100,7 +100,7 @@ module.exports = {
100100
}
101101

102102
let legacyInlinePrecompileAddon = this.parent.addons.find(
103-
a => a.name === 'ember-cli-htmlbars-inline-precompile'
103+
(a) => a.name === 'ember-cli-htmlbars-inline-precompile'
104104
);
105105
if (legacyInlinePrecompileAddon !== undefined) {
106106
let heirarchy = [];
@@ -133,7 +133,7 @@ module.exports = {
133133
//
134134
// import hbs from 'htmlbars-inline-precompile';
135135
// import hbs from 'ember-cli-htmlbars-inline-precompile';
136-
legacyInlinePrecompileAddon.included = function() {};
136+
legacyInlinePrecompileAddon.included = function () {};
137137
}
138138
},
139139

lib/utils.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const INLINE_PRECOMPILE_MODULES = Object.freeze({
1414
});
1515

1616
function isInlinePrecompileBabelPluginRegistered(plugins) {
17-
return plugins.some(plugin => {
17+
return plugins.some((plugin) => {
1818
if (Array.isArray(plugin)) {
1919
let [pluginPathOrInstance, options] = plugin;
2020

@@ -42,7 +42,7 @@ function isInlinePrecompileBabelPluginRegistered(plugins) {
4242

4343
function isColocatedBabelPluginRegistered(plugins) {
4444
return plugins.some(
45-
plugin => typeof plugin === 'string' && plugin === require.resolve('./colocated-babel-plugin')
45+
(plugin) => typeof plugin === 'string' && plugin === require.resolve('./colocated-babel-plugin')
4646
);
4747
}
4848

@@ -156,15 +156,15 @@ function initializeEmberENV(templateCompiler, EmberENV) {
156156
if (EmberENV.FEATURES) {
157157
props = Object.keys(EmberENV.FEATURES);
158158

159-
props.forEach(prop => {
159+
props.forEach((prop) => {
160160
templateCompiler._Ember.FEATURES[prop] = EmberENV.FEATURES[prop];
161161
});
162162
}
163163

164164
if (EmberENV) {
165165
props = Object.keys(EmberENV);
166166

167-
props.forEach(prop => {
167+
props.forEach((prop) => {
168168
if (prop === 'FEATURES') {
169169
return;
170170
}

node-tests/ast_plugins_test.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ const addDependencyTracker = require('../lib/addDependencyTracker');
1212
const templateCompiler = require('ember-source/dist/ember-template-compiler.js');
1313
const CANNOT_UNREGISTER_PLUGINS = !templateCompiler.unregisterPlugin;
1414

15-
describe('AST plugins', function() {
15+
describe('AST plugins', function () {
1616
const they = it;
1717
this.timeout(10000);
1818

1919
let input, output, builder, tree, htmlbarsOptions;
2020

2121
beforeEach(
22-
co.wrap(function*() {
22+
co.wrap(function* () {
2323
rewriterCallCount = 0;
2424
input = yield createTempDir();
2525
input.write(fixturify.readSync(`${__dirname}/fixtures`));
@@ -31,7 +31,7 @@ describe('AST plugins', function() {
3131
);
3232

3333
afterEach(
34-
co.wrap(function*() {
34+
co.wrap(function* () {
3535
if (tree) {
3636
tree.unregisterPlugins();
3737
if (tree.processor.processor._cache) {
@@ -102,7 +102,7 @@ describe('AST plugins', function() {
102102

103103
they(
104104
'are accepted and used.',
105-
co.wrap(function*() {
105+
co.wrap(function* () {
106106
if (CANNOT_UNREGISTER_PLUGINS) {
107107
this.skip();
108108
}
@@ -124,7 +124,7 @@ describe('AST plugins', function() {
124124

125125
they(
126126
'will bust the hot cache if the dependency changes.',
127-
co.wrap(function*() {
127+
co.wrap(function* () {
128128
if (CANNOT_UNREGISTER_PLUGINS) {
129129
this.skip();
130130
}
@@ -170,20 +170,20 @@ describe('AST plugins', function() {
170170
})
171171
);
172172

173-
describe('with persistent caching enabled', function() {
173+
describe('with persistent caching enabled', function () {
174174
let forcePersistenceValue;
175-
before(function() {
175+
before(function () {
176176
forcePersistenceValue = process.env.FORCE_PERSISTENCE_IN_CI;
177177
process.env.FORCE_PERSISTENCE_IN_CI = 'true';
178178
});
179179

180-
after(function() {
180+
after(function () {
181181
process.env.FORCE_PERSISTENCE_IN_CI = forcePersistenceValue;
182182
});
183183

184184
they(
185185
'will bust the persistent cache if the template cache key changes.',
186-
co.wrap(function*() {
186+
co.wrap(function* () {
187187
if (CANNOT_UNREGISTER_PLUGINS) {
188188
this.skip();
189189
}

node-tests/colocated-babel-plugin-test.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ const RuntimePlugin = [
1818
},
1919
];
2020

21-
describe('ColocatedBabelPlugin', function() {
21+
describe('ColocatedBabelPlugin', function () {
2222
this.slow(500);
2323

24-
it('can be used with decorators', function() {
24+
it('can be used with decorators', function () {
2525
let { code } = babel.transformSync(
2626
stripIndent`
2727
import Component from '@glimmer/component';
@@ -68,7 +68,7 @@ describe('ColocatedBabelPlugin', function() {
6868
);
6969
});
7070

71-
it('sets the template for non-class default exports', function() {
71+
it('sets the template for non-class default exports', function () {
7272
let { code } = babel.transformSync(
7373
stripIndent`
7474
import MyComponent from 'other-module';
@@ -88,7 +88,7 @@ describe('ColocatedBabelPlugin', function() {
8888
);
8989
});
9090

91-
it('sets the template for named class default exports', function() {
91+
it('sets the template for named class default exports', function () {
9292
let { code } = babel.transformSync(
9393
stripIndent`
9494
import Component from 'somewhere';
@@ -110,7 +110,7 @@ describe('ColocatedBabelPlugin', function() {
110110
);
111111
});
112112

113-
it('sets the template for anonymous class default exports', function() {
113+
it('sets the template for anonymous class default exports', function () {
114114
let { code } = babel.transformSync(
115115
stripIndent`
116116
import Component from 'somewhere';
@@ -130,7 +130,7 @@ describe('ColocatedBabelPlugin', function() {
130130
);
131131
});
132132

133-
it('sets the template for identifier `as default` exports', function() {
133+
it('sets the template for identifier `as default` exports', function () {
134134
let { code } = babel.transformSync(
135135
stripIndent`
136136
import Component from 'somewhere';

0 commit comments

Comments
 (0)