apply prettier styles

This commit is contained in:
restrry 2020-05-22 09:08:58 +02:00
parent 64ad4f3f92
commit bf04235dae
7130 changed files with 31393 additions and 37163 deletions

View file

@ -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) {

View file

@ -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.',

View 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 {

View file

@ -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) {