Skip to content
This repository has been archived by the owner on Mar 31, 2024. It is now read-only.

Commit

Permalink
re-enable and autofix quotes rule
Browse files Browse the repository at this point in the history
  • Loading branch information
spalger committed Aug 29, 2016
1 parent d8cd9cb commit f4f390f
Show file tree
Hide file tree
Showing 23 changed files with 92 additions and 93 deletions.
1 change: 0 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@
extends: '@elastic/kibana'
rules:
no-unused-vars: off
quotes: off
2 changes: 1 addition & 1 deletion src/cli/cluster/__tests__/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ describe('CLI cluster manager', function () {

describe('#parseIncomingMessage()', function () {
context('on a started worker', function () {
it(`is bound to fork's message event`, async function () {
it('is bound to fork\'s message event', async function () {
const worker = setup();
await worker.start();
sinon.assert.calledWith(worker.fork.on, 'message');
Expand Down
2 changes: 1 addition & 1 deletion src/cli/cluster/base_path_proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export default class BasePathProxy {

server.route({
method: '*',
path: `/{oldBasePath}/{kbnPath*}`,
path: '/{oldBasePath}/{kbnPath*}',
handler(req, reply) {
const {oldBasePath, kbnPath = ''} = req.params;

Expand Down
18 changes: 9 additions & 9 deletions src/cli/serve/__tests__/reload_logging_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import es from 'event-stream';
import readYamlConfig from '../read_yaml_config';
import expect from 'expect.js';

const testConfigFile = follow(`fixtures/reload_logging_config/kibana.test.yml`);
const cli = follow(`../../../../bin/kibana`);
const testConfigFile = follow('fixtures/reload_logging_config/kibana.test.yml');
const cli = follow('../../../../bin/kibana');

function follow(file) {
return relative(process.cwd(), resolve(__dirname, file));
Expand All @@ -22,19 +22,19 @@ function setLoggingJson(enabled) {
return conf;
}

describe(`Server logging configuration`, function () {
describe('Server logging configuration', function () {

const isWindows = /^win/.test(process.platform);
if (isWindows) {
it('SIGHUP is not a feature of Windows.');
} else {
it(`should be reloadable via SIGHUP process signaling`, function (done) {
it('should be reloadable via SIGHUP process signaling', function (done) {
this.timeout(60000);

let asserted = false;
let json = Infinity;
const conf = setLoggingJson(true);
const child = spawn(cli, [`--config`, testConfigFile]);
const child = spawn(cli, ['--config', testConfigFile]);

child.on('error', err => {
done(new Error(`error in child process while attempting to reload config. ${err.stack || err.message || err}`));
Expand Down Expand Up @@ -62,7 +62,7 @@ describe(`Server logging configuration`, function () {
function parseJsonLogLine(line) {
try {
const data = JSON.parse(line);
const listening = data.tags.indexOf(`listening`) !== -1;
const listening = data.tags.indexOf('listening') !== -1;
if (listening) {
switchToPlainTextLog();
}
Expand All @@ -74,13 +74,13 @@ describe(`Server logging configuration`, function () {
function switchToPlainTextLog() {
json = 3; // ignore both "reloading" messages + ui settings status message
setLoggingJson(false);
child.kill(`SIGHUP`); // reload logging config
child.kill('SIGHUP'); // reload logging config
}

function expectPlainTextLogLine(line) {
// assert
const tags = `[\u001b[32minfo\u001b[39m][\u001b[36mconfig\u001b[39m]`;
const status = `Reloaded logging configuration due to SIGHUP.`;
const tags = '[\u001b[32minfo\u001b[39m][\u001b[36mconfig\u001b[39m]';
const status = 'Reloaded logging configuration due to SIGHUP.';
const expected = `${tags} ${status}`;
const actual = line.slice(-expected.length);
expect(actual).to.eql(expected);
Expand Down
2 changes: 1 addition & 1 deletion src/cli_plugin/install/kibana.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export async function rebuildCache(settings, logger) {

export function assertVersion(settings) {
if (!settings.plugins[0].version) {
throw new Error (`Plugin version not found. Check package.json in archive`);
throw new Error ('Plugin version not found. Check package.json in archive');
}

const actual = cleanVersion(settings.plugins[0].version);
Expand Down
2 changes: 1 addition & 1 deletion src/cli_plugin/install/progress.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default class Progress {
}

complete() {
this.logger.log(`Transfer complete`, false);
this.logger.log('Transfer complete', false);
}

}
2 changes: 1 addition & 1 deletion src/core_plugins/elasticsearch/lib/check_es_version.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ module.exports = function (server) {
return 'Elasticsearch v' + node.version + ' @ ' + node.http_address + ' (' + node.ip + ')';
});

const message = `This version of Kibana requires Elasticsearch ` +
const message = 'This version of Kibana requires Elasticsearch ' +
`${engineVersion} on all nodes. I found ` +
`the following incompatible nodes in your cluster: ${badNodeNames.join(',')}`;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ app.directive('pipelineSetup', function () {
},
controller: function ($scope, debounce, Private, Notifier) {
const ingest = Private(IngestProvider);
const notify = new Notifier({ location: `Ingest Pipeline Setup` });
const notify = new Notifier({ location: 'Ingest Pipeline Setup' });
$scope.sample = {};

//determines which processors are available on the cluster
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe('draggable_* directives', function () {
];

// create the markup
const $elem = angular.element(`<div draggable-container="items">`);
const $elem = angular.element('<div draggable-container="items">');
$elem.html(markup);

// compile the directive
Expand Down Expand Up @@ -52,21 +52,21 @@ describe('draggable_* directives', function () {
});

it('should not be able to move extraneous DOM elements', function () {
const bare = angular.element(`<div>`);
const bare = angular.element('<div>');
const { $scope } = init();
expect($scope.drake.canMove(bare[0])).to.eql(false);
});

it('should not be able to move non-[draggable-item] elements', function () {
const bare = angular.element(`<div>`);
const bare = angular.element('<div>');
const { $scope, $elem } = init();
$elem.append(bare);
expect($scope.drake.canMove(bare[0])).to.eql(false);
});

it('shouldn\'t be able to move extraneous [draggable-item] elements', function () {
const anotherParent = angular.element(`<div draggable-container="items">`);
const item = angular.element(`<div draggable-item="items[0]">`);
const anotherParent = angular.element('<div draggable-container="items">');
const item = angular.element('<div draggable-item="items[0]">');
const scope = $rootScope.$new();
anotherParent.append(item);
$compile(anotherParent)(scope);
Expand All @@ -82,7 +82,7 @@ describe('draggable_* directives', function () {
<div draggable-handle></div>
</div>
`);
const item = $elem.find(`[draggable-item]`);
const item = $elem.find('[draggable-item]');
expect($scope.drake.canMove(item[0])).to.eql(false);
});

Expand All @@ -92,14 +92,14 @@ describe('draggable_* directives', function () {
<div draggable-handle></div>
</div>
`);
const handle = $elem.find(`[draggable-handle]`);
const handle = $elem.find('[draggable-handle]');
expect($scope.drake.canMove(handle[0])).to.eql(true);
});
});

describe('draggable_item', function () {
it('should be required to be a child to [draggable-container]', function () {
const item = angular.element(`<div draggable-item="items[0]">`);
const item = angular.element('<div draggable-item="items[0]">');
const scope = $rootScope.$new();
expect(() => {
$compile(item)(scope);
Expand All @@ -110,7 +110,7 @@ describe('draggable_* directives', function () {

describe('draggable_handle', function () {
it('should be required to be a child to [draggable-item]', function () {
const handle = angular.element(`<div draggable-handle>`);
const handle = angular.element('<div draggable-handle>');
const scope = $rootScope.$new();
expect(() => {
$compile(handle)(scope);
Expand Down
54 changes: 27 additions & 27 deletions src/fixtures/agg_resp/range.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
export default {
"took": 35,
"timed_out": false,
"_shards": {
"total": 7,
"successful": 7,
"failed": 0
'took': 35,
'timed_out': false,
'_shards': {
'total': 7,
'successful': 7,
'failed': 0
},
"hits": {
"total": 218512,
"max_score": 0,
"hits": []
'hits': {
'total': 218512,
'max_score': 0,
'hits': []
},
"aggregations": {
"1": {
"buckets": {
"*-1024.0": {
"to": 1024,
"to_as_string": "1024.0",
"doc_count": 20904
'aggregations': {
'1': {
'buckets': {
'*-1024.0': {
'to': 1024,
'to_as_string': '1024.0',
'doc_count': 20904
},
"1024.0-2560.0": {
"from": 1024,
"from_as_string": "1024.0",
"to": 2560,
"to_as_string": "2560.0",
"doc_count": 23358
'1024.0-2560.0': {
'from': 1024,
'from_as_string': '1024.0',
'to': 2560,
'to_as_string': '2560.0',
'doc_count': 23358
},
"2560.0-*": {
"from": 2560,
"from_as_string": "2560.0",
"doc_count": 174250
'2560.0-*': {
'from': 2560,
'from_as_string': '2560.0',
'doc_count': 174250
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/optimize/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ module.exports = async (kbnServer, server, config) => {
if (!invalidBundles.getIds().length) {
server.log(
['debug', 'optimize'],
`All bundles are cached and ready to go!`
'All bundles are cached and ready to go!'
);
return;
}
Expand Down
2 changes: 1 addition & 1 deletion src/optimize/lazy/lazy.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module.exports = async (kbnServer, server, config) => {


if (!isWorker) {
throw new Error(`lazy optimization is only available in "watch" mode`);
throw new Error('lazy optimization is only available in "watch" mode');
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/optimize/lazy/lazy_optimizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ module.exports = class LazyOptimizer extends BaseOptimizer {

logRunStart() {
this.log(['info', 'optimize'], {
tmpl: `Lazy optimization started`,
tmpl: 'Lazy optimization started',
bundles: this.bundles.getIds()
});
}
Expand Down
4 changes: 2 additions & 2 deletions src/server/config/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ module.exports = () => Joi.object({
port: Joi.number().default(5601),
maxPayloadBytes: Joi.number().default(1048576),
autoListen: Joi.boolean().default(true),
defaultRoute: Joi.string().default('/app/kibana').regex(/^\//, `start with a slash`),
basePath: Joi.string().default('').allow('').regex(/(^$|^\/.*[^\/]$)/, `start with a slash, don't end with one`),
defaultRoute: Joi.string().default('/app/kibana').regex(/^\//, 'start with a slash'),
basePath: Joi.string().default('').allow('').regex(/(^$|^\/.*[^\/]$)/, 'start with a slash, don\'t end with one'),
ssl: Joi.object({
cert: Joi.string(),
key: Joi.string()
Expand Down
2 changes: 1 addition & 1 deletion src/ui/public/agg_table/__tests__/_table.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ describe('AggTable Directive', function () {

it('should use the export-title attribute', function () {
const expected = 'export file name';
const $el = $compile(`<kbn-agg-table table="table" export-title="exportTitle">`)($scope);
const $el = $compile('<kbn-agg-table table="table" export-title="exportTitle">')($scope);
$scope.$digest();

const $tableScope = $el.isolateScope();
Expand Down
8 changes: 4 additions & 4 deletions src/ui/public/chrome/__tests__/nav_controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe('chrome nav controls', function () {
return {
name: 'control',
order: 100,
template: `<span id="testTemplateEl"></span>`
template: '<span id="testTemplateEl"></span>'
};
});

Expand All @@ -45,21 +45,21 @@ describe('chrome nav controls', function () {
return {
name: 'control2',
order: 2,
template: `<span id="2", class="testControl"></span>`
template: '<span id="2", class="testControl"></span>'
};
});
stubRegistry.register(function () {
return {
name: 'control1',
order: 1,
template: `<span id="1", class="testControl"></span>`
template: '<span id="1", class="testControl"></span>'
};
});
stubRegistry.register(function () {
return {
name: 'control3',
order: 3,
template: `<span id="3", class="testControl"></span>`
template: '<span id="3", class="testControl"></span>'
};
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe('globalNavLink directive', () => {
describe('interface', () => {

describe('isActive attribute', () => {
it(`doesn't apply the active class when false`, () => {
it('doesn\'t apply the active class when false', () => {
const element = create({
isActive: false,
});
Expand All @@ -59,7 +59,7 @@ describe('globalNavLink directive', () => {
});

describe('isDisabled attribute', () => {
it(`doesn't apply the is-global-nav-link-disabled class when false`, () => {
it('doesn\'t apply the is-global-nav-link-disabled class when false', () => {
const element = create({
isDisabled: false,
});
Expand Down Expand Up @@ -107,7 +107,7 @@ describe('globalNavLink directive', () => {
});

describe('kbnRoute attribute', () => {
it(`is applied to the link when href isn't defined`, () => {
it('is applied to the link when href isn\'t defined', () => {
const attrs = {
kbnRoute: '#test',
};
Expand All @@ -116,7 +116,7 @@ describe('globalNavLink directive', () => {
expect(link.attr('href')).to.be(attrs.kbnRoute);
});

it(`isn't applied to the link when href is defined`, () => {
it('isn\'t applied to the link when href is defined', () => {
const attrs = {
href: 'link to a website',
kbnRoute: '#test',
Expand Down Expand Up @@ -147,7 +147,7 @@ describe('globalNavLink directive', () => {
expect(placeholder.length).to.be(0);
});

it(`is set as the img src`, () => {
it('is set as the img src', () => {
const attrs = {
icon: 'icon url',
};
Expand Down Expand Up @@ -176,7 +176,7 @@ describe('globalNavLink directive', () => {
expect(placeholder.length).to.be(1);
});

it(`uses the title's first letter as the placeholder`, () => {
it('uses the title\'s first letter as the placeholder', () => {
const attrs = {
icon: undefined,
title: 'Xyz',
Expand Down
Loading

0 comments on commit f4f390f

Please sign in to comment.