mirror of
https://github.com/elastic/kibana.git
synced 2025-06-27 18:51:07 -04:00
apply prettier styles
This commit is contained in:
parent
64ad4f3f92
commit
bf04235dae
7130 changed files with 31393 additions and 37163 deletions
|
@ -31,7 +31,7 @@ exports.normalizeWhitespace = function normalizeWhitespace(string) {
|
|||
return string.replace(/\s+/g, ' ');
|
||||
};
|
||||
|
||||
exports.init = function(context, program, initStep) {
|
||||
exports.init = function (context, program, initStep) {
|
||||
try {
|
||||
return initStep();
|
||||
} catch (error) {
|
||||
|
|
|
@ -39,7 +39,7 @@ module.exports = {
|
|||
},
|
||||
],
|
||||
},
|
||||
create: context => {
|
||||
create: (context) => {
|
||||
return {
|
||||
Program(program) {
|
||||
const licenses = init(context, program, () => {
|
||||
|
@ -70,8 +70,8 @@ module.exports = {
|
|||
|
||||
sourceCode
|
||||
.getAllComments()
|
||||
.filter(node => licenses.includes(normalizeWhitespace(node.value)))
|
||||
.forEach(node => {
|
||||
.filter((node) => licenses.includes(normalizeWhitespace(node.value)))
|
||||
.forEach((node) => {
|
||||
context.report({
|
||||
node,
|
||||
message: 'This license header is not allowed in this file.',
|
||||
|
|
|
@ -22,7 +22,7 @@ const KIBANA_ROOT = path.resolve(__dirname, '../../..');
|
|||
|
||||
function checkModuleNameNode(context, mappings, node) {
|
||||
const mapping = mappings.find(
|
||||
mapping => mapping.from === node.value || node.value.startsWith(`${mapping.from}/`)
|
||||
(mapping) => mapping.from === node.value || node.value.startsWith(`${mapping.from}/`)
|
||||
);
|
||||
|
||||
if (!mapping) {
|
||||
|
@ -105,7 +105,7 @@ module.exports = {
|
|||
},
|
||||
],
|
||||
},
|
||||
create: context => {
|
||||
create: (context) => {
|
||||
const mappings = context.options[0];
|
||||
|
||||
return {
|
||||
|
|
|
@ -40,10 +40,10 @@ module.exports = {
|
|||
},
|
||||
],
|
||||
},
|
||||
create: context => {
|
||||
create: (context) => {
|
||||
return {
|
||||
Program(program) {
|
||||
const license = init(context, program, function() {
|
||||
const license = init(context, program, function () {
|
||||
const options = context.options[0] || {};
|
||||
const license = options.license;
|
||||
|
||||
|
@ -69,7 +69,7 @@ module.exports = {
|
|||
const sourceCode = context.getSourceCode();
|
||||
const comment = sourceCode
|
||||
.getAllComments()
|
||||
.find(node => normalizeWhitespace(node.value) === license.nodeValue);
|
||||
.find((node) => normalizeWhitespace(node.value) === license.nodeValue);
|
||||
|
||||
// no licence comment
|
||||
if (!comment) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue