Skip to content

Commit 327085c

Browse files
committed
running eslint fix
1 parent f2de5c5 commit 327085c

File tree

8 files changed

+52
-52
lines changed

8 files changed

+52
-52
lines changed

src/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ function macros(babel) {
4747

4848
let binding = path.scope.getBinding(localBindingName);
4949

50-
binding.referencePaths.forEach(p => {
50+
binding.referencePaths.forEach((p) => {
5151
p.replaceWith(buildIdentifier(flagValue, flagName));
5252
});
5353

@@ -75,7 +75,7 @@ function macros(babel) {
7575

7676
let body = path.get('body');
7777

78-
body.forEach(item => {
78+
body.forEach((item) => {
7979
if (item.isImportDeclaration()) {
8080
let importPath = item.node.source.value;
8181

@@ -104,7 +104,7 @@ function macros(babel) {
104104
};
105105
}
106106

107-
macros.baseDir = function() {
107+
macros.baseDir = function () {
108108
return path.dirname(__dirname);
109109
};
110110

src/utils/builder.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ module.exports = class Builder {
160160
if (
161161
meta &&
162162
meta.properties &&
163-
!meta.properties.some(prop => prop.key.name === 'id' || prop.key.value === 'id')
163+
!meta.properties.some((prop) => prop.key.name === 'id' || prop.key.value === 'id')
164164
) {
165165
throw new ReferenceError(`deprecate's meta information requires an "id" field.`);
166166
}
@@ -183,7 +183,7 @@ module.exports = class Builder {
183183
}
184184

185185
_getIdentifiers(args) {
186-
return args.filter(arg => this.t.isIdentifier(arg));
186+
return args.filter((arg) => this.t.isIdentifier(arg));
187187
}
188188

189189
_createGlobalExternalHelper(identifier, args, ns) {
@@ -199,7 +199,7 @@ module.exports = class Builder {
199199
_buildLogicalExpressions(identifiers, callExpression) {
200200
let t = this.t;
201201

202-
return debugIdentifier => {
202+
return (debugIdentifier) => {
203203
identifiers.unshift(debugIdentifier);
204204
identifiers.push(callExpression);
205205
let logicalExpressions;

src/utils/macros.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ module.exports = class Macros {
3232
* Collects the import bindings for the debug tools.
3333
*/
3434
collectDebugToolsSpecifiers(specifiers) {
35-
specifiers.forEach(specifier => {
35+
specifiers.forEach((specifier) => {
3636
if (specifier.node.imported && SUPPORTED_MACROS.indexOf(specifier.node.imported.name) > -1) {
3737
this.localDebugBindings.push(specifier.get('local'));
3838
}
@@ -47,7 +47,7 @@ module.exports = class Macros {
4747

4848
if (
4949
this.builder.t.isCallExpression(expression) &&
50-
this.localDebugBindings.some(b => b.node.name === expression.callee.name)
50+
this.localDebugBindings.some((b) => b.node.name === expression.callee.name)
5151
) {
5252
let imported = path.scope.getBinding(expression.callee.name).path.node.imported.name;
5353
this.builder[`${imported}`](path);
@@ -57,7 +57,7 @@ module.exports = class Macros {
5757
_cleanImports() {
5858
if (!this.debugHelpers.module) {
5959
if (this.localDebugBindings.length > 0) {
60-
let importPath = this.localDebugBindings[0].findParent(p => p.isImportDeclaration());
60+
let importPath = this.localDebugBindings[0].findParent((p) => p.isImportDeclaration());
6161
if (importPath === null) {
6262
// import declaration in question seems to have already been removed
6363
return;
@@ -67,7 +67,7 @@ module.exports = class Macros {
6767
if (specifiers.length === this.localDebugBindings.length) {
6868
this.localDebugBindings[0].parentPath.parentPath.remove();
6969
} else {
70-
this.localDebugBindings.forEach(binding => binding.parentPath.remove());
70+
this.localDebugBindings.forEach((binding) => binding.parentPath.remove());
7171
}
7272
}
7373
}

src/utils/normalize-options.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ function parseFlags(options) {
4444
let flagsProvided = options.flags || [];
4545

4646
let combinedFlags = {};
47-
flagsProvided.forEach(flagsDefinition => {
47+
flagsProvided.forEach((flagsDefinition) => {
4848
let source = flagsDefinition.source;
4949
let flagsForSource = (combinedFlags[source] = combinedFlags[source] || {});
5050

@@ -77,7 +77,7 @@ function parseFlags(options) {
7777
legacyFeatures = [legacyFeatures];
7878
}
7979

80-
legacyFeatures.forEach(flagsDefinition => {
80+
legacyFeatures.forEach((flagsDefinition) => {
8181
let source = flagsDefinition.source;
8282
let flagsForSource = (combinedFlags[source] = combinedFlags[source] || {});
8383

@@ -100,7 +100,7 @@ function parseFlags(options) {
100100
null,
101101
2
102102
)}`;
103-
// eslint-disable-next-line no-console
103+
104104
console.warn(msg);
105105
}
106106

tests/create-tests.js

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ function createTests(options) {
99
const presets = options.presets;
1010
const transform = options.transform;
1111

12-
afterEach(function() {
12+
afterEach(function () {
1313
Object.assign(console, CONSOLE);
1414
});
1515

16-
describe('Feature Flags', function() {
16+
describe('Feature Flags', function () {
1717
const h = transformTestHelper({
1818
presets,
1919
plugins: [
@@ -51,7 +51,7 @@ function createTests(options) {
5151
);
5252
});
5353

54-
describe('Debug Macros', function() {
54+
describe('Debug Macros', function () {
5555
let h = transformTestHelper({
5656
presets,
5757
plugins: [
@@ -80,7 +80,7 @@ function createTests(options) {
8080
h.generateTest('log-expansion');
8181
});
8282

83-
describe('Debug macros idempotnency', function() {
83+
describe('Debug macros idempotnency', function () {
8484
let h = transformTestHelper({
8585
presets,
8686
plugins: [[DebugToolsPlugin]],
@@ -89,7 +89,7 @@ function createTests(options) {
8989
h.generateTest('missing-debug-tools-options');
9090
});
9191

92-
describe('foreign debug imports', function() {
92+
describe('foreign debug imports', function () {
9393
let h = transformTestHelper({
9494
presets,
9595
plugins: [
@@ -109,7 +109,7 @@ function createTests(options) {
109109
],
110110

111111
[
112-
function(babel) {
112+
function (babel) {
113113
let t = babel.types;
114114

115115
return {
@@ -118,7 +118,7 @@ function createTests(options) {
118118
ImportSpecifier(path) {
119119
let importedName = path.node.imported.name;
120120
if (importedName === 'inspect') {
121-
let importDeclarationPath = path.findParent(p => p.isImportDeclaration());
121+
let importDeclarationPath = path.findParent((p) => p.isImportDeclaration());
122122
let binding = path.scope.getBinding(importedName);
123123
let references = binding.referencePaths;
124124

@@ -148,7 +148,7 @@ function createTests(options) {
148148
h.generateTest('shared-debug-module');
149149
});
150150

151-
describe('Global External Test Helpers', function() {
151+
describe('Global External Test Helpers', function () {
152152
let h = transformTestHelper({
153153
presets,
154154
plugins: [
@@ -171,11 +171,11 @@ function createTests(options) {
171171
h.generateTest('global-external-helpers');
172172
});
173173

174-
describe('ember-cli-babel configuration', function() {
175-
describe('Ember < 3.27', function() {
176-
describe('legacy config API', function() {
177-
beforeEach(function() {
178-
console.warn = () => {}; // eslint-disable-line
174+
describe('ember-cli-babel configuration', function () {
175+
describe('Ember < 3.27', function () {
176+
describe('legacy config API', function () {
177+
beforeEach(function () {
178+
console.warn = () => {};
179179
});
180180

181181
let h = transformTestHelper({
@@ -206,7 +206,7 @@ function createTests(options) {
206206
h.generateTest('ember-cli-babel-config-pre-3-27');
207207
});
208208

209-
describe('default configuration', function() {
209+
describe('default configuration', function () {
210210
let h = transformTestHelper({
211211
presets,
212212
plugins: [
@@ -231,8 +231,8 @@ function createTests(options) {
231231
});
232232
});
233233

234-
describe('Ember >= 3.27', function() {
235-
describe('default configuration', function() {
234+
describe('Ember >= 3.27', function () {
235+
describe('default configuration', function () {
236236
let h = transformTestHelper({
237237
presets,
238238
plugins: [
@@ -258,7 +258,7 @@ function createTests(options) {
258258
});
259259
});
260260

261-
describe('Retain Module External Test Helpers', function() {
261+
describe('Retain Module External Test Helpers', function () {
262262
let h = transformTestHelper({
263263
presets,
264264
plugins: [
@@ -281,7 +281,7 @@ function createTests(options) {
281281
h.generateTest('retain-module-external-helpers');
282282
});
283283

284-
describe('Svelte Builds', function() {
284+
describe('Svelte Builds', function () {
285285
let h = transformTestHelper({
286286
presets,
287287
plugins: [
@@ -324,7 +324,7 @@ function createTests(options) {
324324
h.generateTest('development-svelte-builds');
325325
});
326326

327-
describe('Inline Env Flags', function() {
327+
describe('Inline Env Flags', function () {
328328
let h = transformTestHelper({
329329
presets,
330330
plugins: [
@@ -345,7 +345,7 @@ function createTests(options) {
345345
h.generateTest('debug-flag');
346346
});
347347

348-
describe('Retains non-macro types', function() {
348+
describe('Retains non-macro types', function () {
349349
let h = transformTestHelper({
350350
presets,
351351
plugins: [
@@ -366,7 +366,7 @@ function createTests(options) {
366366
h.generateTest('does-not-modify-non-imported-flags');
367367
});
368368

369-
describe('Removes Imports Without Specifiers', function() {
369+
describe('Removes Imports Without Specifiers', function () {
370370
let h = transformTestHelper({
371371
presets,
372372
plugins: [
@@ -386,7 +386,7 @@ function createTests(options) {
386386
h.generateTest('removes-imports-without-specifiers');
387387
});
388388

389-
describe('Runtime Feature Flags', function() {
389+
describe('Runtime Feature Flags', function () {
390390
let h = transformTestHelper({
391391
presets,
392392
plugins: [
@@ -415,7 +415,7 @@ function createTests(options) {
415415
h.generateTest('runtime-feature-flags');
416416
});
417417

418-
describe('Runtime default export features', function() {
418+
describe('Runtime default export features', function () {
419419
let h = transformTestHelper({
420420
presets,
421421
plugins: [
@@ -444,7 +444,7 @@ function createTests(options) {
444444
h.generateTest('default-export-features');
445445
});
446446

447-
describe('Retains runtime feature flag definitions', function() {
447+
describe('Retains runtime feature flag definitions', function () {
448448
let h = transformTestHelper({
449449
presets,
450450
plugins: [
@@ -477,7 +477,7 @@ function createTests(options) {
477477
function transformTestHelper(options) {
478478
return {
479479
generateTest(fixtureName) {
480-
it(fixtureName, function() {
480+
it(fixtureName, function () {
481481
let sample = fs.readFileSync(`./fixtures/${fixtureName}/sample.js`, 'utf-8');
482482
let expectation = fs.readFileSync(
483483
`./fixtures/${fixtureName}/expectation${babelVersion}.js`,
@@ -488,7 +488,7 @@ function createTests(options) {
488488
},
489489

490490
generateErrorTest(fixtureName, error) {
491-
it(fixtureName, function() {
491+
it(fixtureName, function () {
492492
let sample = fs.readFileSync(`./fixtures/${fixtureName}/sample.js`, 'utf-8');
493493
expect(() => transform(sample, options)).toThrow(error);
494494
});

tests/ensure-baseDir-test.js

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

33
const DebugToolsPlugin = require('..');
44

5-
describe('baseDir', function() {
6-
it('returns directory with package.json', function() {
5+
describe('baseDir', function () {
6+
it('returns directory with package.json', function () {
77
let baseDir = DebugToolsPlugin.baseDir();
88
let pkg = require(baseDir + '/package');
99

tests/normalize-options-test.js

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

33
const normalizeOptions = require('../src/utils/normalize-options').normalizeOptions;
44

5-
describe('normalizeOptions', function() {
5+
describe('normalizeOptions', function () {
66
let originalConsole = Object.assign({}, console);
77

8-
afterEach(function() {
8+
afterEach(function () {
99
Object.assign(console, originalConsole);
1010
});
1111

12-
it('does not require the `debugTools` options', function() {
12+
it('does not require the `debugTools` options', function () {
1313
let actual = normalizeOptions({});
1414

1515
let expected = {
@@ -26,7 +26,7 @@ describe('normalizeOptions', function() {
2626
expect(actual).toEqual(expected);
2727
});
2828

29-
it('converts "old style" options into the newer style (with deprecation)', function() {
29+
it('converts "old style" options into the newer style (with deprecation)', function () {
3030
let warnings = [];
3131
console.warn = warning => warnings.push(warning); // eslint-disable-line
3232

@@ -75,7 +75,7 @@ describe('normalizeOptions', function() {
7575
]);
7676
});
7777

78-
it('sets flag to false when svelte version matches the flag version', function() {
78+
it('sets flag to false when svelte version matches the flag version', function () {
7979
let actual = normalizeOptions({
8080
debugTools: {
8181
source: 'whatever',
@@ -118,7 +118,7 @@ describe('normalizeOptions', function() {
118118
expect(actual).toEqual(expected);
119119
});
120120

121-
it('sets flag to false when svelte version is higher than flag version', function() {
121+
it('sets flag to false when svelte version is higher than flag version', function () {
122122
let actual = normalizeOptions({
123123
debugTools: {
124124
source: 'whatever',
@@ -144,7 +144,7 @@ describe('normalizeOptions', function() {
144144
expect(actual).toEqual(expected);
145145
});
146146

147-
it('sets flag to true when svelte version is lower than flag version', function() {
147+
it('sets flag to true when svelte version is lower than flag version', function () {
148148
let actual = normalizeOptions({
149149
debugTools: {
150150
source: 'whatever',
@@ -170,7 +170,7 @@ describe('normalizeOptions', function() {
170170
expect(actual).toEqual(expected);
171171
});
172172

173-
it('sets flag to true when svelte version is a beta version higher than flag version', function() {
173+
it('sets flag to true when svelte version is a beta version higher than flag version', function () {
174174
let actual = normalizeOptions({
175175
debugTools: {
176176
source: 'whatever',

0 commit comments

Comments
 (0)