Skip to content
This repository has been archived by the owner on Feb 9, 2023. It is now read-only.

Commit

Permalink
Fix ESLint errors and warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
denysdovhan committed Jan 3, 2017
1 parent fc64faa commit 35a487a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 16 deletions.
3 changes: 2 additions & 1 deletion ns.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable */
/**
* Created by papostol on 27/01/2015.
*/
Expand All @@ -12,4 +13,4 @@ Handlebars.initNS = function (ns, obj) {
Handlebars.initNS(levels.join('.'), obj[first]);
}
return obj[first];
};
};
2 changes: 1 addition & 1 deletion postinstall.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable */
/**
* Created by Paul on 10/11/2015.
*/
Expand Down Expand Up @@ -26,4 +27,3 @@ runtime.forEach(function(r) {
});
});
});

29 changes: 15 additions & 14 deletions test/test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint no-undef: 0 */
'use strict';

const sysPath = require('path');
Expand All @@ -14,7 +15,7 @@ describe('Plugin', () => {

beforeEach(() => {
plugin = new Plugin({
plugins: {}
plugins: {},
});
});

Expand All @@ -31,7 +32,7 @@ describe('Plugin', () => {
it('should include runtime compiler', () => {
const expected = [
sysPath.join(process.cwd(), 'dist', 'handlebars.runtime.js'),
sysPath.join(process.cwd(), 'ns.js')
sysPath.join(process.cwd(), 'ns.js'),
];
plugin = new Plugin(config.runtimeTrue);

Expand All @@ -41,7 +42,7 @@ describe('Plugin', () => {
it('should include full compiler', () => {
const expected = [
sysPath.join(process.cwd(), 'dist', 'handlebars.js'),
sysPath.join(process.cwd(), 'ns.js')
sysPath.join(process.cwd(), 'ns.js'),
];
plugin = new Plugin(config.runtimeFalse);

Expand All @@ -51,7 +52,7 @@ describe('Plugin', () => {
it('should include full optimized compiler', () => {
const expected = [
sysPath.join(process.cwd(), 'dist', 'handlebars.min.js'),
sysPath.join(process.cwd(), 'ns.js')
sysPath.join(process.cwd(), 'ns.js'),
];
plugin = new Plugin(config.runtimeFalseOptimizedTrue);

Expand All @@ -61,7 +62,7 @@ describe('Plugin', () => {
it('should include runtime compiler with amd', () => {
const expected = [
sysPath.join(process.cwd(), 'dist', 'handlebars.runtime.amd.js'),
sysPath.join(process.cwd(), 'ns.js')
sysPath.join(process.cwd(), 'ns.js'),
];
plugin = new Plugin(config.runtimeTrueAmdTrue);

Expand All @@ -71,7 +72,7 @@ describe('Plugin', () => {
it('should include optimized runtime compiler', () => {
const expected = [
sysPath.join(process.cwd(), 'dist', 'handlebars.runtime.min.js'),
sysPath.join(process.cwd(), 'ns.js')
sysPath.join(process.cwd(), 'ns.js'),
];
plugin = new Plugin(config.runtimeTrueOptimizeTrue);

Expand All @@ -81,7 +82,7 @@ describe('Plugin', () => {
it('should include optimized runtime compiler with amd', () => {
const expected = [
sysPath.join(process.cwd(), 'dist', 'handlebars.runtime.amd.min.js'),
sysPath.join(process.cwd(), 'ns.js')
sysPath.join(process.cwd(), 'ns.js'),
];
plugin = new Plugin(config.runtimeTrueAmdTrueOptimizeTrue);

Expand All @@ -94,7 +95,7 @@ describe('Plugin', () => {
it('should include amd compiler', () => {
const expected = [
sysPath.join(process.cwd(), 'dist', 'handlebars.amd.js'),
sysPath.join(process.cwd(), 'ns.js')
sysPath.join(process.cwd(), 'ns.js'),
];
plugin = new Plugin(config.amdTrue);

Expand All @@ -104,7 +105,7 @@ describe('Plugin', () => {
it('should include optimized amd compiler', () => {
const expected = [
sysPath.join(process.cwd(), 'dist', 'handlebars.amd.min.js'),
sysPath.join(process.cwd(), 'ns.js')
sysPath.join(process.cwd(), 'ns.js'),
];
plugin = new Plugin(config.amdTrueOptimizeTrue);

Expand All @@ -114,7 +115,7 @@ describe('Plugin', () => {
it('should not include amd compiler', () => {
const expected = [
sysPath.join(process.cwd(), 'dist', 'handlebars.js'),
sysPath.join(process.cwd(), 'ns.js')
sysPath.join(process.cwd(), 'ns.js'),
];
plugin = new Plugin(config.amdFalse);

Expand All @@ -133,8 +134,8 @@ describe('Plugin', () => {
const expected = '<p>hello</p>';

return plugin.compile({data: content, path: 'templates/hello.hbs'}).then(data => {
eval(data);
expect(JST.Sub['hello']({a: 'hello'})).to.equal(expected);
eval(data); // eslint-disable-line
expect(JST.Sub.hello({a: 'hello'})).to.equal(expected);
});
});
});
Expand All @@ -149,8 +150,8 @@ describe('Plugin', () => {
const expected = '<p>hello</p>';

return plugin.compile({data: content, path: 'templates/hello'}).then(data => {
eval(data);
expect(test_templates['hello']({a: 'hello'})).to.equal(expected);
eval(data); // eslint-disable-line
expect(test_templates.hello({a: 'hello'})).to.equal(expected); // eslint-disable-line
});
});
});
Expand Down

0 comments on commit 35a487a

Please sign in to comment.