<commit_before>;
(function() {

  /* Sparkline AddIn, based on jquery.sparkline.js sparklines.
   *
   */
  var sparkline = {
    name: "sparkline",
    label: "Sparkline",
    defaults: {
      type: 'line'
    },
    init: function(){

      // Register this for datatables sort
      var myself = this;
      $.fn.dataTableExt.oSort[this.name+'-asc'] = function(a,b){
        return myself.sort(a,b)
      };
      $.fn.dataTableExt.oSort[this.name+'-desc'] = function(a,b){
        return myself.sort(b,a)
      };

    },

    sort: function(a,b){
      return this.sumStrArray(a) - this.sumStrArray(b);
    },

    sumStrArray: function(arr){
      return arr.split(',').reduce(function(prev, curr, index, array){
        console.log("Current " + curr +"; prev " +  prev);
        return parseFloat(curr) + (typeof(prev)==='number'?prev:parseFloat(prev));
      });
    },

    implementation: function (tgt, st, opt) {
      var t = $(tgt);
      t.sparkline(st.value.split(/,/),opt);
      t.removeClass("sparkline");
    }
  };
  Dashboards.registerAddIn("Table", "colType", new AddIn(sparkline));

  var pvSparkline = {
    name: "pvSparkline",
    label: "Protovis Sparkline",
    defaults: {
      height: 10,
      strokeStyle: "#000",
      lineWidth: 1,
      width: undefined,
      canvasMargin: 2
    },
    init: function(){

      // Register this for datatables sort
      var myself = this;
      $.fn.dataTableExt.oSort[this.name+'-asc'] = function(a,b){
        return myself.sort(a,b)
      };
      $.fn.dataTableExt.oSort[this.name+'-desc'] = function(a,b){
        return myself.sort(b,a)
      };

    },

    sort: function(a,b){
      return this.sumStrArray(a) - this.sumStrArray(b);
    },

    sumStrArray: function(arr){
      return arr.split(',').reduce(function(prev, curr, index, array){
        console.log("Current " + curr +"; prev " +  prev);
        return parseFloat(curr) + (typeof(prev)==='number'?prev:parseFloat(prev));
      });
    },

    implementation: function(tgt, st, opt) {
      var ph = $(tgt),
      sparklineData = st.value,
      data = sparklineData.split(",");
      n = data.length,
      w = opt.width || ph.width(),
      h = opt.height,
      min = pv.min.index(data),
      max = pv.max.index(data);
      ph.empty();

      var container = $("

").appendTo(ph);

      //console.log("count "+count);

      var vis = new pv.Panel()
      .canvas(container.get(0))
      .width(w)
      .height(h)
      .margin(opt.canvasMargin);

      vis.add(pv.Line)
      .data(data)
      .left(pv.Scale.linear(0, n - 1).range(0, w).by(pv.index))
      .bottom(pv.Scale.linear(data).range(0, h))
      .strokeStyle(opt.strokeStyle)
      .lineWidth(opt.lineWidth);

      vis.render();

    }
  };
  Dashboards.registerAddIn("Table", "colType", new AddIn(pvSparkline));

  var dataBar = {
    name: "dataBar",
    label: "Data Bar",
    defaults: {
      widthRatio:1,
      height: 10,
      startColor: "#55A4D6",
      endColor: "#448FC8",
      stroke: null,
      max: undefined,
      includeValue: false,
      valueFormat: function(v, format, st) {
        return "" + sprintf(format || "%.1f",v) ;
      }
    },
    init: function(){
      $.fn.dataTableExt.oSort[this.name+'-asc'] = $.fn.dataTableExt.oSort['numeric-asc'];
      $.fn.dataTableExt.oSort[this.name+'-desc'] = $.fn.dataTableExt.oSort['numeric-desc'];
    },
    implementation: function(tgt, st, opt) {
      var max = opt.max || Math.max.apply(Math,st.tableData.map(function(e){
        return Math.abs(e[st.colIdx]);
      }));
      var cell = $(tgt);
      cell.empty();

      var ph =$("

").addClass('dataBarContainer').appendTo(cell);
      var wtmp = opt.widthRatio * ph.width();
      var htmp = opt.height;

      var value = st.value;
      var leftVal=0, rightVal=parseFloat(value);
      if(leftVal>rightVal){
        leftVal = value;
        rightVal = 0;
      }
      var delta = rightVal - leftVal;
      var xx = pv.Scale.linear(0,max).range(0,wtmp);

      var paper = Raphael(ph.get(0), xx(delta), htmp);
      var c = paper.rect(xx(leftVal), 0, xx(delta), htmp);

      c.attr({
        fill: "90-"+opt.startColor + "-" + opt.endColor,
        stroke: opt.stroke,
        title: "Value: "+ value
      });

      if(opt.includeValue) {
        ph.append("" + opt.valueFormat(st.value, st.colFormat, st) + "" );
      }
    }
  };
  Dashboards.registerAddIn("Table", "colType", new AddIn(dataBar));

  var trendArrow = {
    name: "trendArrow",
    label: "Trend Arrows",
    defaults: {
      good: true,
      includeValue: false,
      valueFormat: function(v,format,st) {
        return sprintf(format || "%.1f",v);
      }
    },
    init: function(){
      $.fn.dataTableExt.oSort[this.name+'-asc'] = $.fn.dataTableExt.oSort['numeric-asc'];
      $.fn.dataTableExt.oSort[this.name+'-desc'] = $.fn.dataTableExt.oSort['numeric-desc'];
    },
    implementation: function(tgt, st, opt) {
      var ph = $(tgt),
      qualityClass = opt.good ? "good" : "bad",
      trendClass =  st.value < 0 ? "down" : "up";
      var trend = $("

");
      trend.addClass('trend ' + trendClass + ' '  + qualityClass);
      ph.empty();
      if(opt.includeValue) {
        ph.append(opt.valueFormat(st.value, st.colFormat, st));
      }
      ph.append(trend);
    }
  };
  Dashboards.registerAddIn("Table", "colType", new AddIn(trendArrow));

  var link = {
    name: "hyperlink",
    label: "Hyperlink",
    defaults:{
      openInNewTab: true,
      prependHttpIfNeeded: true,
      regexp: null,
      pattern: null,
      urlReference: 2,
      labelReference: 1
    },

    init: function(){
      $.fn.dataTableExt.oSort[this.name+'-asc'] = $.fn.dataTableExt.oSort['string-asc'];
      $.fn.dataTableExt.oSort[this.name+'-desc'] = $.fn.dataTableExt.oSort['string-desc'];
    },

    implementation: function(tgt, st, opt){

      var ph = $(tgt);
      var link, label;
      if (opt.pattern) {
        var re = new RegExp(opt.pattern),
          results = re.exec(st.value);
        link = results[opt.urlReference];
        label = results[opt.labelReference];
      } else {
        link = st.value;
        label = st.value;
      }
      if (opt.prependHttpIfNeeded && !/^https?:\/\//.test(link)){
        link = "http://" + link;
      }
      // is this text an hyperlink?
      if(opt.regexp == null || (new RegExp(opt.regexp).test(st.value))){
        var a = $("").attr("href",link).addClass("hyperlinkAddIn");
        a.text(label);
        if(opt.openInNewTab){
          a.attr("target","_blank");
        }
        ph.empty().append(a);
      }
    }

  };
  Dashboards.registerAddIn("Table", "colType", new AddIn(link));

  var circle = {
    name: "circle",
    label: "Circle",
    defaults:{
      canvasSize: 10,
      radius: 4,
      color: 'black',
      title: function(st) {return "Value: " + st.value;}
    },

    implementation: function(tgt, st, opt){
      var p = $(tgt).empty(),
        v = st.value,
        op,
        options = {},
        w,
        paper;

      for (key in opt) if (opt.hasOwnProperty(key)) {
        op = opt[key];
        options[key] = typeof op == 'function' ?
          op.call(this,st):
          op;
      }
      w = options.canvasSize;
      paper = Raphael(tgt, options.canvasSize, options.canvasSize);
      var r = paper.circle(w/2,w/2,options.radius);
      r.attr({
          fill: options.color,
          opacity: 1,
          "stroke-width":0,
          "title": options.title
      });
    }

  };
  Dashboards.registerAddIn("Table", "colType", new AddIn(circle));

  var bullet = {
    name: "cccBulletChart",
    label: "Bullet Chart",
    defaults:{
      height: 40,
      animate: false,
      orientation: "horizontal",
      bulletSize: 16,     // Bullet height
      bulletSpacing: 150, // Spacing between bullets
      bulletMargin: 5,   // Left margin
      // Specific values
      bulletRanges: [30,80,100],
      extensionPoints: {
        "bulletMarker_shape":"triangle",
        "bulletTitle_textStyle":"green",
        "bulletMeasure_fillStyle":"black",
        "bulletRuleLabel_font":"8px sans-serif",
        "bulletRule_height": 5
      }
    },

    init: function(){
      $.fn.dataTableExt.oSort[this.name+'-asc'] = $.fn.dataTableExt.oSort['string-asc'];
      $.fn.dataTableExt.oSort[this.name+'-desc'] = $.fn.dataTableExt.oSort['string-desc'];
    },

    sort: function()  {

    },

    implementation: function(tgt, st, opt){
      var chartOptions = $.extend(true,{},opt);
      var $tgt = $(tgt);
      var target = $("").appendTo($tgt.empty());
      var values = st.value.split(",");
      var data = this.getData(values);

      chartOptions.canvas = target.get(0);
      chartOptions.width = chartOptions.width || $tgt.width();
      chartOptions.bulletMeasures = [values[0]];
      chartOptions.bulletMarkers = [values[1]];

      var chart = new pvc.BulletChart(chartOptions);
      chart.setData(data,{});
      chart.render();
    },

    getData: function(values) {
      var dataSet = {
          resultset: [values],
          metadata: []
        },
        i;
      for (i = 0; i < values.length;i++) {
        dataSet.metadata.push({
          colIndex: i,
          colType: "String",
          colName: ""
        });
      }
      return dataSet;
    }
  };
  Dashboards.registerAddIn("Table", "colType", new AddIn(bullet));

 var formattedText = {
    name: "formattedText",
    label: "Formatted Text",
    defaults: {
      textFormat: function(v, st) {return st.colFormat ? sprintf(st.colFormat,v) : v;}
    },

    init: function(){
      $.fn.dataTableExt.oSort[this.name+'-asc'] = $.fn.dataTableExt.oSort['string-asc'];
      $.fn.dataTableExt.oSort[this.name+'-desc'] = $.fn.dataTableExt.oSort['string-desc'];
    },

    implementation: function(tgt, st, opt){
      var text = opt.textFormat.call(this, st.value, st, opt);
      $(tgt).empty().append(text);
    }

  };
  Dashboards.registerAddIn("Table", "colType", new AddIn(formattedText));

})();

<commit_msg>- Added dataBar addin support for background image<commit_after>;
(function() {

  /* Sparkline AddIn, based on jquery.sparkline.js sparklines.
   *
   */
  var sparkline = {
    name: "sparkline",
    label: "Sparkline",
    defaults: {
      type: 'line'
    },
    init: function(){

      // Register this for datatables sort
      var myself = this;
      $.fn.dataTableExt.oSort[this.name+'-asc'] = function(a,b){
        return myself.sort(a,b)
      };
      $.fn.dataTableExt.oSort[this.name+'-desc'] = function(a,b){
        return myself.sort(b,a)
      };

    },

    sort: function(a,b){
      return this.sumStrArray(a) - this.sumStrArray(b);
    },

    sumStrArray: function(arr){
      return arr.split(',').reduce(function(prev, curr, index, array){
        console.log("Current " + curr +"; prev " +  prev);
        return parseFloat(curr) + (typeof(prev)==='number'?prev:parseFloat(prev));
      });
    },

    implementation: function (tgt, st, opt) {
      var t = $(tgt);
      t.sparkline(st.value.split(/,/),opt);
      t.removeClass("sparkline");
    }
  };
  Dashboards.registerAddIn("Table", "colType", new AddIn(sparkline));

  var pvSparkline = {
    name: "pvSparkline",
    label: "Protovis Sparkline",
    defaults: {
      height: 10,
      strokeStyle: "#000",
      lineWidth: 1,
      width: undefined,
      canvasMargin: 2
    },
    init: function(){

      // Register this for datatables sort
      var myself = this;
      $.fn.dataTableExt.oSort[this.name+'-asc'] = function(a,b){
        return myself.sort(a,b)
      };
      $.fn.dataTableExt.oSort[this.name+'-desc'] = function(a,b){
        return myself.sort(b,a)
      };

    },

    sort: function(a,b){
      return this.sumStrArray(a) - this.sumStrArray(b);
    },

    sumStrArray: function(arr){
      return arr.split(',').reduce(function(prev, curr, index, array){
        console.log("Current " + curr +"; prev " +  prev);
        return parseFloat(curr) + (typeof(prev)==='number'?prev:parseFloat(prev));
      });
    },

    implementation: function(tgt, st, opt) {
      var ph = $(tgt),
      sparklineData = st.value,
      data = sparklineData.split(",");
      n = data.length,
      w = opt.width || ph.width(),
      h = opt.height,
      min = pv.min.index(data),
      max = pv.max.index(data);
      ph.empty();

      var container = $("

").appendTo(ph);

      //console.log("count "+count);

      var vis = new pv.Panel()
      .canvas(container.get(0))
      .width(w)
      .height(h)
      .margin(opt.canvasMargin);

      vis.add(pv.Line)
      .data(data)
      .left(pv.Scale.linear(0, n - 1).range(0, w).by(pv.index))
      .bottom(pv.Scale.linear(data).range(0, h))
      .strokeStyle(opt.strokeStyle)
      .lineWidth(opt.lineWidth);

      vis.render();

    }
  };
  Dashboards.registerAddIn("Table", "colType", new AddIn(pvSparkline));

  var dataBar = {
    name: "dataBar",
    label: "Data Bar",
    defaults: {
      widthRatio:1,
      height: 10,
      startColor: "#55A4D6",
      endColor: "#448FC8",
      backgroundImage: undefined,
      stroke: null,
      max: undefined,
      includeValue: false,
      valueFormat: function(v, format, st) {
        return "" + sprintf(format || "%.1f",v) ;
      }
    },
    init: function(){
      $.fn.dataTableExt.oSort[this.name+'-asc'] = $.fn.dataTableExt.oSort['numeric-asc'];
      $.fn.dataTableExt.oSort[this.name+'-desc'] = $.fn.dataTableExt.oSort['numeric-desc'];
    },
    implementation: function(tgt, st, opt) {
      var max = opt.max || Math.max.apply(Math,st.tableData.map(function(e){
        return Math.abs(e[st.colIdx]);
      }));
      var cell = $(tgt);
      cell.empty();

      var ph =$("

").addClass('dataBarContainer').appendTo(cell);
      var wtmp = opt.widthRatio * ph.width();
      var htmp = opt.height;

      var value = st.value;
      var leftVal=0, rightVal=parseFloat(value);
      if(leftVal>rightVal){
        leftVal = value;
        rightVal = 0;
      }
      var delta = rightVal - leftVal;
      var xx = pv.Scale.linear(0,max).range(0,wtmp);

      var paper = Raphael(ph.get(0), xx(delta), htmp);
      var c = paper.rect(xx(leftVal), 0, xx(delta), htmp);

      c.attr({
        fill: opt.backgroundImage?"url('"+opt.backgroundImage+"')":"90-"+opt.startColor + "-" + opt.endColor,
        stroke: opt.stroke,
        title: "Value: "+ value
      });

      if(opt.includeValue) {
        ph.append("" + opt.valueFormat(st.value, st.colFormat, st) + "" );
      }
    }
  };
  Dashboards.registerAddIn("Table", "colType", new AddIn(dataBar));

  var trendArrow = {
    name: "trendArrow",
    label: "Trend Arrows",
    defaults: {
      good: true,
      includeValue: false,
      valueFormat: function(v,format,st) {
        return sprintf(format || "%.1f",v);
      }
    },
    init: function(){
      $.fn.dataTableExt.oSort[this.name+'-asc'] = $.fn.dataTableExt.oSort['numeric-asc'];
      $.fn.dataTableExt.oSort[this.name+'-desc'] = $.fn.dataTableExt.oSort['numeric-desc'];
    },
    implementation: function(tgt, st, opt) {
      var ph = $(tgt),
      qualityClass = opt.good ? "good" : "bad",
      trendClass =  st.value < 0 ? "down" : "up";
      var trend = $("

");
      trend.addClass('trend ' + trendClass + ' '  + qualityClass);
      ph.empty();
      if(opt.includeValue) {
        ph.append(opt.valueFormat(st.value, st.colFormat, st));
      }
      ph.append(trend);
    }
  };
  Dashboards.registerAddIn("Table", "colType", new AddIn(trendArrow));

  var link = {
    name: "hyperlink",
    label: "Hyperlink",
    defaults:{
      openInNewTab: true,
      prependHttpIfNeeded: true,
      regexp: null,
      pattern: null,
      urlReference: 2,
      labelReference: 1
    },

    init: function(){
      $.fn.dataTableExt.oSort[this.name+'-asc'] = $.fn.dataTableExt.oSort['string-asc'];
      $.fn.dataTableExt.oSort[this.name+'-desc'] = $.fn.dataTableExt.oSort['string-desc'];
    },

    implementation: function(tgt, st, opt){

      var ph = $(tgt);
      var link, label;
      if (opt.pattern) {
        var re = new RegExp(opt.pattern),
          results = re.exec(st.value);
        link = results[opt.urlReference];
        label = results[opt.labelReference];
      } else {
        link = st.value;
        label = st.value;
      }
      if (opt.prependHttpIfNeeded && !/^https?:\/\//.test(link)){
        link = "http://" + link;
      }
      // is this text an hyperlink?
      if(opt.regexp == null || (new RegExp(opt.regexp).test(st.value))){
        var a = $("").attr("href",link).addClass("hyperlinkAddIn");
        a.text(label);
        if(opt.openInNewTab){
          a.attr("target","_blank");
        }
        ph.empty().append(a);
      }
    }

  };
  Dashboards.registerAddIn("Table", "colType", new AddIn(link));

  var circle = {
    name: "circle",
    label: "Circle",
    defaults:{
      canvasSize: 10,
      radius: 4,
      color: 'black',
      title: function(st) {return "Value: " + st.value;}
    },

    implementation: function(tgt, st, opt){
      var p = $(tgt).empty(),
        v = st.value,
        op,
        options = {},
        w,
        paper;

      for (key in opt) if (opt.hasOwnProperty(key)) {
        op = opt[key];
        options[key] = typeof op == 'function' ?
          op.call(this,st):
          op;
      }
      w = options.canvasSize;
      paper = Raphael(tgt, options.canvasSize, options.canvasSize);
      var r = paper.circle(w/2,w/2,options.radius);
      r.attr({
          fill: options.color,
          opacity: 1,
          "stroke-width":0,
          "title": options.title
      });
    }

  };
  Dashboards.registerAddIn("Table", "colType", new AddIn(circle));

  var bullet = {
    name: "cccBulletChart",
    label: "Bullet Chart",
    defaults:{
      height: 40,
      animate: false,
      orientation: "horizontal",
      bulletSize: 16,     // Bullet height
      bulletSpacing: 150, // Spacing between bullets
      bulletMargin: 5,   // Left margin
      // Specific values
      bulletRanges: [30,80,100],
      extensionPoints: {
        "bulletMarker_shape":"triangle",
        "bulletTitle_textStyle":"green",
        "bulletMeasure_fillStyle":"black",
        "bulletRuleLabel_font":"8px sans-serif",
        "bulletRule_height": 5
      }
    },

    init: function(){
      $.fn.dataTableExt.oSort[this.name+'-asc'] = $.fn.dataTableExt.oSort['string-asc'];
      $.fn.dataTableExt.oSort[this.name+'-desc'] = $.fn.dataTableExt.oSort['string-desc'];
    },

    sort: function()  {

    },

    implementation: function(tgt, st, opt){
      var chartOptions = $.extend(true,{},opt);
      var $tgt = $(tgt);
      var target = $("").appendTo($tgt.empty());
      var values = st.value.split(",");
      var data = this.getData(values);

      chartOptions.canvas = target.get(0);
      chartOptions.width = chartOptions.width || $tgt.width();
      chartOptions.bulletMeasures = [values[0]];
      chartOptions.bulletMarkers = [values[1]];

      var chart = new pvc.BulletChart(chartOptions);
      chart.setData(data,{});
      chart.render();
    },

    getData: function(values) {
      var dataSet = {
          resultset: [values],
          metadata: []
        },
        i;
      for (i = 0; i < values.length;i++) {
        dataSet.metadata.push({
          colIndex: i,
          colType: "String",
          colName: ""
        });
      }
      return dataSet;
    }
  };
  Dashboards.registerAddIn("Table", "colType", new AddIn(bullet));

 var formattedText = {
    name: "formattedText",
    label: "Formatted Text",
    defaults: {
      textFormat: function(v, st) {return st.colFormat ? sprintf(st.colFormat,v) : v;}
    },

    init: function(){
      $.fn.dataTableExt.oSort[this.name+'-asc'] = $.fn.dataTableExt.oSort['string-asc'];
      $.fn.dataTableExt.oSort[this.name+'-desc'] = $.fn.dataTableExt.oSort['string-desc'];
    },

    implementation: function(tgt, st, opt){
      var text = opt.textFormat.call(this, st.value, st, opt);
      $(tgt).empty().append(text);
    }

  };
  Dashboards.registerAddIn("Table", "colType", new AddIn(formattedText));

})();

<|endoftext|>


<commit_before>import React, { Component } from 'react'
import Harvest from './Harvest/Harvest'
import HarvestDetail from './HarvestDetail/HarvestDetail'
import Accordion from '../../Accordion/Accordion'

class HarvestsSection extends Component {
  render() {
    let harvests = []

    harvests.push(this.props.catalog.lastHarvesting)
    harvests.push(this.props.catalog.lastHarvesting)
    harvests.push(this.props.catalog.lastHarvesting)
    harvests.push(this.props.catalog.lastHarvesting)

    return (

        {harvests.map((harvest , idx) =>
            <Accordion
              key={idx}
              title={<Harvest harvest={harvest} />}
              content={<HarvestDetail harvest={harvest} />} />
        )}

    )
  }
}

export default HarvestsSection
<commit_msg>Turn HarvestsSection to stateless compoenent<commit_after>import React from 'react'
import Harvest from './Harvest/Harvest'
import HarvestDetail from './HarvestDetail/HarvestDetail'
import Accordion from '../../Accordion/Accordion'

const HarvestsSection = () => {
    let harvests = []

    harvests.push(this.props.catalog.lastHarvesting)
    harvests.push(this.props.catalog.lastHarvesting)
    harvests.push(this.props.catalog.lastHarvesting)
    harvests.push(this.props.catalog.lastHarvesting)

    return (

        {harvests.map((harvest , idx) =>
            <Accordion
              key={idx}
              title={<Harvest harvest={harvest} />}
              content={<HarvestDetail harvest={harvest} />} />
        )}

    )
}

export default HarvestsSection
<|endoftext|>


<commit_before>module.exports = {
  env: {
    browser: true,
    node: true
  },
  extends: [
    'standard',
    'plugin:prettier/recommended',
    'plugin:react/recommended'
  ],
  plugins: ['@typescript-eslint'],
  parser: '@typescript-eslint/parser',
  parserOptions: {
    sourceType: 'module',
    project: './tsconfig.json',
    ecmaFeatures: {
      jsx: true
    }
  },
  rules: {
    '@typescript-eslint/adjacent-overload-signatures': 'error',
    'prettier/prettier': [
      'error',
      {
        singleQuote: true,
        semi: false
      }
    ],
    yoda: 'off',
    'react/prop-types': 'off',
    'import/first': 'off',
    'no-unused-vars': 'off',
    '@typescript-eslint/no-unused-vars': 'error',
    'no-dupe-class-members': 'off'
  },
  globals: {
    browser: true
  }
}
<commit_msg>chore: remove display name<commit_after>module.exports = {
  env: {
    browser: true,
    node: true
  },
  extends: [
    'standard',
    'plugin:prettier/recommended',
    'plugin:react/recommended'
  ],
  plugins: ['@typescript-eslint'],
  parser: '@typescript-eslint/parser',
  parserOptions: {
    sourceType: 'module',
    project: './tsconfig.json',
    ecmaFeatures: {
      jsx: true
    }
  },
  rules: {
    '@typescript-eslint/adjacent-overload-signatures': 'error',
    'prettier/prettier': [
      'error',
      {
        singleQuote: true,
        semi: false
      }
    ],
    yoda: 'off',
    'react/display-name': 'off',
    'react/prop-types': 'off',
    'import/first': 'off',
    'no-unused-vars': 'off',
    '@typescript-eslint/no-unused-vars': 'error',
    'no-dupe-class-members': 'off'
  },
  globals: {
    browser: true
  }
}
<|endoftext|>


<commit_before>'use strict';

module.exports = {
  root: true,
  env: {
    browser: false,
    es2021: true,
    node: true
  },
  reportUnusedDisableDirectives: true,
  rules: {
    'accessor-pairs': 'error',
    'array-bracket-spacing': ['error', 'never'],
    'arrow-body-style': ['error', 'always'],
    'arrow-parens': ['error', 'always'],
    'arrow-spacing': ['error', { 'before': true, 'after': true }],
    'block-spacing': ['error', 'always'],
    'brace-style': ['error', '1tbs', { 'allowSingleLine': true }],
    'class-methods-use-this': 'error',
    'comma-dangle': ['error', 'never'],
    'comma-spacing': ['error', { 'before': false, 'after': true }],
    'comma-style': ['error', 'last'],
    'computed-property-spacing': ['error', 'never', { 'enforceForClassMembers': true }],
    'constructor-super': 'error',
    'curly': 'error',
    'default-case-last': 'error',
    'default-param-last': 'error',
    'dot-location': ['error', 'property'],
    'eol-last': 'error',
    'eqeqeq': 'error',
    'func-call-spacing': ['error', 'never'],
    'generator-star-spacing': ['error', { 'before': true, 'after': false }],
    'getter-return': 'error',
    'indent': ['error', 2, { 'SwitchCase': 1 }],
    'key-spacing': ['error', { 'beforeColon': false, 'afterColon': true }],
    'keyword-spacing': ['error', { 'before': true, 'after': true }],
    'new-cap': ['error', { 'newIsCap': true, 'capIsNew': false }],
    'new-parens': 'error',
    'no-array-constructor': 'error',
    'no-async-promise-executor': 'error',
    'no-caller': 'error',
    'no-class-assign': 'error',
    'no-compare-neg-zero': 'error',
    'no-cond-assign': 'error',
    'no-confusing-arrow': 'error',
    'no-const-assign': 'error',
    'no-constant-condition': 'error',
    'no-constructor-return': 'error',
    'no-control-regex': 'error',
    'no-debugger': 'error',
    'no-delete-var': 'error',
    'no-dupe-args': 'error',
    'no-dupe-class-members': 'error',
    'no-dupe-else-if': 'error',
    'no-dupe-keys': 'error',
    'no-duplicate-case': 'error',
    'no-duplicate-imports': 'error',
    'no-empty-character-class': 'error',
    'no-empty-pattern': 'error',
    'no-eval': 'error',
    'no-ex-assign': 'error',
    'no-extend-native': 'error',
    'no-extra-bind': 'error',
    'no-extra-boolean-cast': 'error',
    'no-extra-parens': ['error', 'functions'],
    'no-extra-semi': 'error',
    'no-fallthrough': 'error',
    'no-floating-decimal': 'error',
    'no-func-assign': 'error',
    'no-global-assign': 'error',
    'no-implied-eval': 'error',
    'no-inner-declarations': ['error', 'functions'],
    'no-invalid-regexp': 'error',
    'no-irregular-whitespace': 'error',
    'no-iterator': 'error',
    'no-label-var': 'error',
    'no-labels': ['error', { 'allowLoop': true, 'allowSwitch': true }],
    'no-lone-blocks': 'error',
    'no-loss-of-precision': 'error',
    'no-misleading-character-class': 'error',
    'no-mixed-spaces-and-tabs': 'error',
    'no-multi-spaces': ['error', { 'ignoreEOLComments': true }],
    'no-multi-str': 'error',
    'no-multiple-empty-lines': ['error', { 'max': 2 }],
    'no-new': 'error',
    'no-new-func': 'error',
    'no-new-object': 'error',
    'no-new-symbol': 'error',
    'no-new-wrappers': 'error',
    'no-obj-calls': 'error',
    'no-octal': 'error',
    'no-octal-escape': 'error',
    'no-proto': 'error',
    'no-redeclare': 'error',
    'no-regex-spaces': 'error',
    'no-restricted-exports': 'error',
    'no-return-assign': 'error',
    'no-self-assign': 'error',
    'no-self-compare': 'error',
    'no-sequences': 'error',
    'no-setter-return': 'error',
    'no-shadow-restricted-names': 'error',
    'no-sparse-arrays': 'error',
    'no-this-before-super': 'error',
    'no-throw-literal': 'error',
    'no-trailing-spaces': 'error',
    'no-var': 'error',
    'no-undef': 'error',
    'no-undef-init': 'error',
    'no-unexpected-multiline': 'error',
    'no-unneeded-ternary': ['error', { 'defaultAssignment': false }],
    'no-unreachable': 'error',
    'no-unreachable-loop': 'error',
    'no-unsafe-finally': 'error',
    'no-unsafe-negation': 'error',
    'no-unsafe-optional-chaining': 'error',
    'no-unused-expressions': 'error',
    'no-unused-vars': ['error', { 'vars': 'all', 'args': 'none' }],
    'no-use-before-define': ['error', 'nofunc'],
    'no-useless-backreference': 'error',
    'no-useless-call': 'error',
    'no-useless-catch': 'error',
    'no-useless-computed-key': 'error',
    'no-useless-constructor': 'error',
    'no-useless-escape': 'error',
    'no-useless-return': 'error',
    'no-whitespace-before-property': 'error',
    'no-with': 'error',
    'object-curly-spacing': ['error', 'always'],
    'object-property-newline': ['error', { 'allowMultiplePropertiesPerLine': true }],
    'one-var': ['error', 'never'],
    'one-var-declaration-per-line': ['error', 'always'],
    'operator-linebreak': ['error', 'after'],
    'padded-blocks': ['error', 'never'],
    'prefer-const': 'error',
    'prefer-exponentiation-operator': 'error',
    'prefer-numeric-literals': 'error',
    'prefer-regex-literals': 'error',
    'prefer-rest-params': 'error',
    'prefer-spread': 'error',
    'quotes': ['error', 'single', 'avoid-escape'],
    'radix': 'error',
    'require-atomic-updates': 'error',
    'require-await': 'error',
    'rest-spread-spacing': ['error', 'never'],
    'semi': ['error', 'always'],
    'semi-spacing': ['error', { 'before': false, 'after': true }],
    'space-before-blocks': ['error', 'always'],
    'space-before-function-paren': ['error', { 'anonymous': 'never', 'named': 'never', 'asyncArrow': 'always' }],
    'space-in-parens': ['error', 'never'],
    'space-infix-ops': 'error',
    'space-unary-ops': ['error', { 'words': true, 'nonwords': false }],
    'spaced-comment': ['error', 'always', { 'markers': ['global', 'globals', 'eslint', 'eslint-disable', '*package', '!', ','] }],
    'strict': ['error', 'global'],
    'switch-colon-spacing': ['error', { 'after': true, 'before': true }],
    'symbol-description': 'error',
    'template-curly-spacing': 'error',
    'unicode-bom': ['error', 'never'],
    'use-isnan': 'error',
    'valid-typeof': 'error',
    'wrap-iife': ['error', 'any'],
    'yield-star-spacing': ['error', 'before'],
    'yoda': ['error', 'never']
  }
};
<commit_msg>update to ecmaVersion 2022<commit_after>'use strict';

module.exports = {
  root: true,
  env: {
    browser: false,
    es2021: true,
    node: true
  },
  parserOptions: { ecmaVersion: 2022 },
  reportUnusedDisableDirectives: true,
  rules: {
    'accessor-pairs': 'error',
    'array-bracket-spacing': ['error', 'never'],
    'arrow-body-style': ['error', 'always'],
    'arrow-parens': ['error', 'always'],
    'arrow-spacing': ['error', { 'before': true, 'after': true }],
    'block-spacing': ['error', 'always'],
    'brace-style': ['error', '1tbs', { 'allowSingleLine': true }],
    'class-methods-use-this': 'error',
    'comma-dangle': ['error', 'never'],
    'comma-spacing': ['error', { 'before': false, 'after': true }],
    'comma-style': ['error', 'last'],
    'computed-property-spacing': ['error', 'never', { 'enforceForClassMembers': true }],
    'constructor-super': 'error',
    'curly': 'error',
    'default-case-last': 'error',
    'default-param-last': 'error',
    'dot-location': ['error', 'property'],
    'eol-last': 'error',
    'eqeqeq': 'error',
    'func-call-spacing': ['error', 'never'],
    'generator-star-spacing': ['error', { 'before': true, 'after': false }],
    'getter-return': 'error',
    'indent': ['error', 2, { 'SwitchCase': 1 }],
    'key-spacing': ['error', { 'beforeColon': false, 'afterColon': true }],
    'keyword-spacing': ['error', { 'before': true, 'after': true }],
    'new-cap': ['error', { 'newIsCap': true, 'capIsNew': false }],
    'new-parens': 'error',
    'no-array-constructor': 'error',
    'no-async-promise-executor': 'error',
    'no-caller': 'error',
    'no-class-assign': 'error',
    'no-compare-neg-zero': 'error',
    'no-cond-assign': 'error',
    'no-confusing-arrow': 'error',
    'no-const-assign': 'error',
    'no-constant-condition': 'error',
    'no-constructor-return': 'error',
    'no-control-regex': 'error',
    'no-debugger': 'error',
    'no-delete-var': 'error',
    'no-dupe-args': 'error',
    'no-dupe-class-members': 'error',
    'no-dupe-else-if': 'error',
    'no-dupe-keys': 'error',
    'no-duplicate-case': 'error',
    'no-duplicate-imports': 'error',
    'no-empty-character-class': 'error',
    'no-empty-pattern': 'error',
    'no-eval': 'error',
    'no-ex-assign': 'error',
    'no-extend-native': 'error',
    'no-extra-bind': 'error',
    'no-extra-boolean-cast': 'error',
    'no-extra-parens': ['error', 'functions'],
    'no-extra-semi': 'error',
    'no-fallthrough': 'error',
    'no-floating-decimal': 'error',
    'no-func-assign': 'error',
    'no-global-assign': 'error',
    'no-implied-eval': 'error',
    'no-inner-declarations': ['error', 'functions'],
    'no-invalid-regexp': 'error',
    'no-irregular-whitespace': 'error',
    'no-iterator': 'error',
    'no-label-var': 'error',
    'no-labels': ['error', { 'allowLoop': true, 'allowSwitch': true }],
    'no-lone-blocks': 'error',
    'no-loss-of-precision': 'error',
    'no-misleading-character-class': 'error',
    'no-mixed-spaces-and-tabs': 'error',
    'no-multi-spaces': ['error', { 'ignoreEOLComments': true }],
    'no-multi-str': 'error',
    'no-multiple-empty-lines': ['error', { 'max': 2 }],
    'no-new': 'error',
    'no-new-func': 'error',
    'no-new-object': 'error',
    'no-new-symbol': 'error',
    'no-new-wrappers': 'error',
    'no-obj-calls': 'error',
    'no-octal': 'error',
    'no-octal-escape': 'error',
    'no-proto': 'error',
    'no-redeclare': 'error',
    'no-regex-spaces': 'error',
    'no-restricted-exports': 'error',
    'no-return-assign': 'error',
    'no-self-assign': 'error',
    'no-self-compare': 'error',
    'no-sequences': 'error',
    'no-setter-return': 'error',
    'no-shadow-restricted-names': 'error',
    'no-sparse-arrays': 'error',
    'no-this-before-super': 'error',
    'no-throw-literal': 'error',
    'no-trailing-spaces': 'error',
    'no-var': 'error',
    'no-undef': 'error',
    'no-undef-init': 'error',
    'no-unexpected-multiline': 'error',
    'no-unneeded-ternary': ['error', { 'defaultAssignment': false }],
    'no-unreachable': 'error',
    'no-unreachable-loop': 'error',
    'no-unsafe-finally': 'error',
    'no-unsafe-negation': 'error',
    'no-unsafe-optional-chaining': 'error',
    'no-unused-expressions': 'error',
    'no-unused-vars': ['error', { 'vars': 'all', 'args': 'none' }],
    'no-use-before-define': ['error', 'nofunc'],
    'no-useless-backreference': 'error',
    'no-useless-call': 'error',
    'no-useless-catch': 'error',
    'no-useless-computed-key': 'error',
    'no-useless-constructor': 'error',
    'no-useless-escape': 'error',
    'no-useless-return': 'error',
    'no-whitespace-before-property': 'error',
    'no-with': 'error',
    'object-curly-spacing': ['error', 'always'],
    'object-property-newline': ['error', { 'allowMultiplePropertiesPerLine': true }],
    'one-var': ['error', 'never'],
    'one-var-declaration-per-line': ['error', 'always'],
    'operator-linebreak': ['error', 'after'],
    'padded-blocks': ['error', 'never'],
    'prefer-const': 'error',
    'prefer-exponentiation-operator': 'error',
    'prefer-numeric-literals': 'error',
    'prefer-regex-literals': 'error',
    'prefer-rest-params': 'error',
    'prefer-spread': 'error',
    'quotes': ['error', 'single', 'avoid-escape'],
    'radix': 'error',
    'require-atomic-updates': 'error',
    'require-await': 'error',
    'rest-spread-spacing': ['error', 'never'],
    'semi': ['error', 'always'],
    'semi-spacing': ['error', { 'before': false, 'after': true }],
    'space-before-blocks': ['error', 'always'],
    'space-before-function-paren': ['error', { 'anonymous': 'never', 'named': 'never', 'asyncArrow': 'always' }],
    'space-in-parens': ['error', 'never'],
    'space-infix-ops': 'error',
    'space-unary-ops': ['error', { 'words': true, 'nonwords': false }],
    'spaced-comment': ['error', 'always', { 'markers': ['global', 'globals', 'eslint', 'eslint-disable', '*package', '!', ','] }],
    'strict': ['error', 'global'],
    'switch-colon-spacing': ['error', { 'after': true, 'before': true }],
    'symbol-description': 'error',
    'template-curly-spacing': 'error',
    'unicode-bom': ['error', 'never'],
    'use-isnan': 'error',
    'valid-typeof': 'error',
    'wrap-iife': ['error', 'any'],
    'yield-star-spacing': ['error', 'before'],
    'yoda': ['error', 'never']
  }
};
<|endoftext|>


<commit_before>/* eslint-env serviceworker */

let baseDatetime = ''

function getMyVersion () {
  fetch(self.location.href)
  .then(function (resp) {
    console.log('Running ServiceWorker version ' + resp.headers.get('Server'))
  })
}

self.addEventListener('install', function (event) {
  console.log('Installing ServiceWorker.')
})

self.addEventListener('activate', function (event) {
  console.log('Activating ServiceWorker.')
})

self.addEventListener('fetch', function (event) {
  let request = event.request

  const url = new URL(event.request.url)
  const isNavigation = event.request.mode === 'navigate'
  const isWebUI = event.request.url.indexOf('/webui/') !== -1
  const isDaemon = event.request.url.indexOf('/daemon/') !== -1
  const isConfig = event.request.url.indexOf('/config/') !== -1
  const isReplayRoot = (url.pathname === '/' || url.pathname === '')
  const isRootMemento = event.request.url === event.request.referrer
  //var isAMemento = event.request.url.indexOf('/memento/') !== -1 || event.request.url.match('\/[0-9]{14}\/') !== null
  const isAMemento = event.request.url.match('\/[0-9]{14}\/') !== null

  let referrerDatetime = event.request.referrer.match(/\/([0-9]{14})\//)
  if (referrerDatetime !== null) {
    referrerDatetime = referrerDatetime[1]
  }

  if (isNavigation || isReplayRoot || isDaemon || isConfig) {
    return // Internal asset, no SW needed
  }

  // TODO: consult the referrer header on each request instead of using a global var
  //if ( event.request.url.split('/')[2] !== document.location.host) {
  if (!isNavigation && !isWebUI && !isDaemon && !isRootMemento && !isConfig && !isAMemento) { // Do not rewrite webui embedded resources or daemon
       // TODO: use a 3XX redirect to better guide the browser
       //  if hostname == referrer, check to ensure serviceworker does not run infinitely on each embedded resource
    request = reroute(event.request, referrerDatetime) // Only embedded resources
    console.log('REROUTING request for ' + event.request.url + ' to ' + request.url)
  }

  event.respondWith(
    fetch(request).then(serverFetch, serverFailure).catch(serverFailure)
  )

  function serverFetch (response) {
    console.log('Fetching from server.')
    getMyVersion()
    return response
  }

  function serverFailure () {
    console.log('Fetching from server failed.')
    return new Response('
Service Unavailable
', {
      status: 503,
      statusText: 'Service Unavailable',
      headers: new Headers({
        'Content-Type': 'text/html'
      })
    })
  }

  function reroute (request, datetime) {
    // TODO: Use replay host/ip and host here instead
    return new Request(`${self.location.origin}/memento/${datetime}/${request.url}`) // TODO: Rm hard-code for server
  }
})
<commit_msg>Removing comments that are not relevant anymore after the merge of #341<commit_after>/* eslint-env serviceworker */

let baseDatetime = ''

function getMyVersion () {
  fetch(self.location.href)
  .then(function (resp) {
    console.log('Running ServiceWorker version ' + resp.headers.get('Server'))
  })
}

self.addEventListener('install', function (event) {
  console.log('Installing ServiceWorker.')
})

self.addEventListener('activate', function (event) {
  console.log('Activating ServiceWorker.')
})

self.addEventListener('fetch', function (event) {
  let request = event.request

  const url = new URL(event.request.url)
  const isNavigation = event.request.mode === 'navigate'
  const isWebUI = event.request.url.indexOf('/webui/') !== -1
  const isDaemon = event.request.url.indexOf('/daemon/') !== -1
  const isConfig = event.request.url.indexOf('/config/') !== -1
  const isReplayRoot = (url.pathname === '/' || url.pathname === '')
  const isRootMemento = event.request.url === event.request.referrer
  //var isAMemento = event.request.url.indexOf('/memento/') !== -1 || event.request.url.match('\/[0-9]{14}\/') !== null
  const isAMemento = event.request.url.match('\/[0-9]{14}\/') !== null

  let referrerDatetime = event.request.referrer.match(/\/([0-9]{14})\//)
  if (referrerDatetime !== null) {
    referrerDatetime = referrerDatetime[1]
  }

  if (isNavigation || isReplayRoot || isDaemon || isConfig) {
    return // Internal asset, no SW needed
  }

  // TODO: consult the referrer header on each request instead of using a global var
  //if ( event.request.url.split('/')[2] !== document.location.host) {
  if (!isNavigation && !isWebUI && !isDaemon && !isRootMemento && !isConfig && !isAMemento) { // Do not rewrite webui embedded resources or daemon
       // TODO: use a 3XX redirect to better guide the browser
       //  if hostname == referrer, check to ensure serviceworker does not run infinitely on each embedded resource
    request = reroute(event.request, referrerDatetime) // Only embedded resources
    console.log('REROUTING request for ' + event.request.url + ' to ' + request.url)
  }

  event.respondWith(
    fetch(request).then(serverFetch, serverFailure).catch(serverFailure)
  )

  function serverFetch (response) {
    console.log('Fetching from server.')
    getMyVersion()
    return response
  }

  function serverFailure () {
    console.log('Fetching from server failed.')
    return new Response('
Service Unavailable
', {
      status: 503,
      statusText: 'Service Unavailable',
      headers: new Headers({
        'Content-Type': 'text/html'
      })
    })
  }

  function reroute (request, datetime) {
    return new Request(`${self.location.origin}/memento/${datetime}/${request.url}`)
  }
})
<|endoftext|>


<commit_before>module.exports = {
    "env": {
        "browser": true,
        "es6": true
    },
    "globals": {
        "$": true,
        "droll": true,
    },
    "rules": {
        "no-console": 2,
        "no-extra-semi": 2,
        "no-inner-declarations": 2,
        "no-mixed-spaces-and-tabs": 2,
        "no-redeclare": 2,
        "no-unreachable": 2,

        "indent": [
            "error",
            "tab"
        ]
    }
};
<commit_msg>chore(eslint): add rule to prefer const declarations<commit_after>module.exports = {
	"env": {
		"browser": true,
		"es6": true
	},
	"globals": {
		"$": true,
		"droll": true,
	},
	"rules": {
		"no-console": 2,
		"no-extra-semi": 2,
		"no-inner-declarations": 2,
		"no-mixed-spaces-and-tabs": 2,
		"no-redeclare": 2,
		"no-unreachable": 2,
		"prefer-const": [
			"warn",
			{
				"destructuring": "any",
				"ignoreReadBeforeAssign": false
			}
		],

		"indent": [
			"error",
			"tab"
		]
	}
}<|endoftext|>


<commit_before>/**
 * ESLint conf extending JS Standard Code Style (https://github.com/feross/eslint-config-standard) + a few globals
 */
module.exports = {
  'env': {
    'node': true,
    'jquery': true,
    'browser': true
  },
  'globals': {
    'chrome': false,
    'TD': false
  },
  'extends': 'airbnb-base',
  'rules': {
    'no-param-reassign': 0,
    'max-len': 0
  }
};
<commit_msg>:bike:<commit_after>/**
 * ESLint conf extending JS Standard Code Style (https://github.com/feross/eslint-config-standard) + a few globals
 */
module.exports = {
  'env': {
    'node': true,
    'jquery': true,
    'browser': true
  },
  'globals': {
    'chrome': false,
    'TD': false
  },
  'extends': 'airbnb-base',
  'rules': {
    'no-param-reassign': 0,
    'max-len': 0,
    'arrow-body-style': 0
  }
};
<|endoftext|>


<commit_before>module.exports = {
  "parser": "babel-eslint",
  "env": {
    "browser": true,
    "jest": true,
    "node": true,
    "es6": true
  },
  "extends": ["eslint:recommended", "plugin:react/recommended"],
  "parserOptions": {
    "ecmaFeatures": {
      "experimentalObjectRestSpread": true,
      "jsx": true
    },
    "sourceType": "module"
  },
  "plugins": [
    "react", "flowtype"
  ],
  "settings": {
    "react": {
      "version": "16.5",
      "flowVersion": "0.81"
    }
  },
  "rules": {
    "flowtype/define-flow-type": 1,
    "flowtype/require-valid-file-annotation": ["error", "always"],

    "react/no-unescaped-entities": ["off"],

    "indent": ["error", 2],
    "linebreak-style": ["error", "unix"],
    "quotes": ["error", "single", "avoid-escape"],
    "semi": ["error", "always"],
    "no-var": ["error"],
    "brace-style": ["error"],
    "array-bracket-spacing": ["error", "never"],
    "block-spacing": ["error", "always"],
    "no-spaced-func": ["error"],
    "no-whitespace-before-property": ["error"],
    "space-before-blocks": ["error", "always"],
    "keyword-spacing": ["error"]
  }
};
<commit_msg>Update eslint settings<commit_after>module.exports = {
  "parser": "babel-eslint",
  "env": {
    "browser": true,
    "jest": true,
    "node": true,
    "es6": true
  },
  "extends": ["eslint:recommended", "plugin:react/recommended"],
  "parserOptions": {
    "ecmaFeatures": {
      "experimentalObjectRestSpread": true,
      "jsx": true
    },
    "sourceType": "module"
  },
  "plugins": [
    "react", "flowtype"
  ],
  "settings": {
    "react": {
      "version": "16.6",
      "flowVersion": "0.84"
    }
  },
  "rules": {
    "flowtype/define-flow-type": 1,
    "flowtype/require-valid-file-annotation": ["error", "always"],

    "react/no-unescaped-entities": ["off"],

    "indent": ["error", 2],
    "linebreak-style": ["error", "unix"],
    "quotes": ["error", "single", "avoid-escape"],
    "semi": ["error", "always"],
    "no-var": ["error"],
    "brace-style": ["error"],
    "array-bracket-spacing": ["error", "never"],
    "block-spacing": ["error", "always"],
    "no-spaced-func": ["error"],
    "no-whitespace-before-property": ["error"],
    "space-before-blocks": ["error", "always"],
    "keyword-spacing": ["error"]
  }
};
<|endoftext|>


<commit_before>module.exports = {
    "env": {
        "es6": true,
        "node": true
    },
    "extends": "eslint:recommended",
    "parserOptions": {
        "sourceType": "module"
    },
    "rules": {
        "indent": [
            "error",
            2
        ],
        "linebreak-style": [
            "error",
            "unix"
        ],
        "quotes": [
            "error",
            "single"
        ],
        "semi": [
            "error",
            "always"
        ]
    }
};
<commit_msg>Updates the eslint with single quotes :thumbsup:<commit_after>module.exports = {
    'env': {
        'es6': true,
        'node': true
    },
    'extends': 'eslint:recommended',
    'parserOptions': {
        'sourceType': 'module'
    },
    'rules': {
        'indent': [
            'error',
            2
        ],
        'linebreak-style': [
            'error',
            'unix'
        ],
        'quotes': [
            'error',
            'single'
        ],
        'semi': [
            'error',
            'always'
        ]
    }
};
<|endoftext|>


<commit_before>module.exports = {
  "extends": "airbnb",
  "env": {
    "es6": true,
    "node": true,
    "browser": true
  },
  "parser": "babel-eslint",
  "parserOptions": {
    "sourceType": "module"
  },
  "rules": {
    "jsx-a11y/click-events-have-key-events": 0,
    "jsx-a11y/no-noninteractive-element-interactions": 0,
    "jsx-a11y/no-autofocus": 0,
    "jsx-a11y/anchor-is-valid": 0,
    "react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }],
    "react/prefer-stateless-function": 0,
    "react/no-danger": 0,
    "import/no-extraneous-dependencies": 0,
    "import/no-unresolved": 0,
    "import/extensions": 0,
    "camelcase": 0,
    "no-underscore-dangle": 0,
    "no-debugger": 0,
  }
};
<commit_msg>This is no longer considered an issue<commit_after>module.exports = {
  "extends": "airbnb",
  "env": {
    "es6": true,
    "node": true,
    "browser": true
  },
  "parser": "babel-eslint",
  "parserOptions": {
    "sourceType": "module"
  },
  "rules": {
    "jsx-a11y/click-events-have-key-events": 0,
    "jsx-a11y/no-noninteractive-element-interactions": 0,
    "jsx-a11y/no-autofocus": 0,
    "jsx-a11y/anchor-is-valid": 0,
    "react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }],
    "react/prefer-stateless-function": 0,
    "react/no-danger": 0,
    "react/no-did-mount-set-state": 0,
    "import/no-extraneous-dependencies": 0,
    "import/no-unresolved": 0,
    "import/extensions": 0,
    "camelcase": 0,
    "no-underscore-dangle": 0,
    "no-debugger": 0,
  }
};
<|endoftext|>


<commit_before>module.exports = {
  parser: '@typescript-eslint/parser',
  parserOptions: {
    ecmaVersion: 2020, // Allows for the parsing of modern ECMAScript features
    sourceType: 'module', // Allows for the use of imports
  },
  extends: [
    'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin
    'prettier/@typescript-eslint', // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
    'plugin:prettier/recommended', // Enables eslint-plugin-prettier and eslint-config-prettier. This will display prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
  ],
  rules: {
    '@typescript-eslint/ban-ts-comment': 'warn',
    'no-console': 'warn',
  },
};
<commit_msg>:wrench: Update eslint-rules<commit_after>module.exports = {
  parser: '@typescript-eslint/parser',
  parserOptions: {
    ecmaVersion: 2020, // Allows for the parsing of modern ECMAScript features
    sourceType: 'module', // Allows for the use of imports
  },
  extends: [
    'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin
    'prettier/@typescript-eslint', // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
    'plugin:prettier/recommended', // Enables eslint-plugin-prettier and eslint-config-prettier. This will display prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
  ],
  rules: {
    '@typescript-eslint/no-empty-interface': 'off',
    '@typescript-eslint/ban-ts-comment': 'warn',
    'no-console': 'warn',
  },
};
<|endoftext|>


<commit_before>module.exports = {
  parserOptions: {
    ecmaVersion: 2017,
    sourceType: 'module',
    ecmaFeatures: {impliedStrict: true}
  },
  env: {},
  globals: {

    DOMParser: false,
    Element: false,
    EventTarget: false,
    HTMLDocument: false,
    HTMLTableElement: false,
    Image: false,
    Node: false,
    XPathResult: false,
    console: false,
    document: false,
    localStorage: false,
    location: false,
    performance: false,
    setTimeout: false,
    window: false,

    module: false,
    process: false,
    require: false,

    $: false,
    jQuery: false,

    GM_info: false,

    FSH: true,
    localforage: false,
    ga: false,
    GameController: false,
    GameData: false
  },
  'extends': 'eslint:recommended',
  rules: {

    /*  Possible Errors  */
    'no-await-in-loop': ['error'],
    'no-compare-neg-zero': ['error'],
    'no-console': ['error', {allow: ['error']}],
    'no-extra-parens': ['error', 'all', {conditionalAssign: false}],
    'no-prototype-builtins': ['error'],
    'no-template-curly-in-string': ['error'],
    'valid-jsdoc': ['error'],

    /*  Best Practices  */
    'accessor-pairs': ['error'],
    'array-callback-return': ['error'],
    'block-scoped-var': ['error'],
    'class-methods-use-this': ['error'],
    complexity: ['error', 3],
    'consistent-return': ['off'],
    curly: ['error'],
    'default-case': ['error'],
    'dot-location': ['error', 'property'],
    'dot-notation': ['error'],
    eqeqeq: ['error'],
    'guard-for-in': ['error'],
    'no-alert': ['warn'],
    'no-caller': ['error'],
    'no-div-regex': ['error'],
    'no-else-return': ['error'],
    'no-empty-function': ['error'],
    'no-eq-null': ['error'],
    'no-eval': ['error'],
    'no-extend-native': ['error'],
    'no-extra-bind': ['error'],
    'no-extra-label': ['error'],
    'no-floating-decimal': ['error'],
    'no-implicit-coercion': ['error'],
    'no-implicit-globals': ['error'],
    'no-implied-eval': ['error'],
    'no-invalid-this': ['error'],
    'no-iterator': ['error'],
    'no-labels': ['error'],
    'no-lone-blocks': ['error'],
    'no-loop-func': ['error'],
    // 'no-magic-numbers': ['error', {
    //   'ignore': [-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 24, 60, 100, 1000],
    //   'ignoreArrayIndexes': true
    // }],
    'no-multi-spaces': ['error'],
    'no-multi-str': ['error'],
    'no-new': ['error'],
    'no-new-func': ['error'],
    'no-new-wrappers': ['error'],
    'no-octal-escape': ['error'],
    'no-param-reassign': ['error'],
    'no-proto': ['error'],
    'no-restricted-properties': ['error'],
    'no-return-assign': ['error'],
    'no-return-await': ['error'],
    'no-script-url': ['error'],
    'no-self-compare': ['error'],
    'no-sequences': ['error'],
    'no-throw-literal': ['error'],
    'no-unmodified-loop-condition': ['error'],
    'no-unused-expressions': ['error'],
    'no-useless-call': ['error'],
    'no-useless-concat': ['error'],
    'no-useless-escape': ['error'],
    'no-useless-return': ['error'],
    'no-void': ['error'],
    // 'no-warning-comments': ['warn'],
    'no-with': ['error'],
    'prefer-promise-reject-errors': ['error'],
    radix: ['error'],
    'require-await': ['error'],
    'vars-on-top': ['off'],
    'wrap-iife': ['error', 'outside'],
    yoda: ['error'],

    /*  Variables  */
    'init-declarations': ['off'],
    'no-catch-shadow': ['error'],
    'no-label-var': ['error'],
    'no-restricted-globals': ['error', 'event'],
    'no-shadow': ['error'],
    'no-shadow-restricted-names': ['error'],
    'no-undef-init': ['error'],
    'no-undefined': ['error'],
    'no-use-before-define': ['error'],

    /*  Stylistic Issues  */
    'array-bracket-spacing': ['error', 'never'],
    'block-spacing': ['error', 'never'],
    'brace-style': ['error', '1tbs', {allowSingleLine: true}],
    camelcase: ['off'],
    'capitalized-comments': ['off'],
    'comma-dangle': ['error', 'only-multiline'],
    'comma-spacing': ['error'],
    'comma-style': ['error'],
    'computed-property-spacing': ['error'],
    'consistent-this': ['error', 'that'],
    'eol-last': ['error'],
    'func-call-spacing': ['error'],
    'func-name-matching': ['error'],
    // 'func-names': ['error', 'as-needed'],
    'func-style': ['error', 'declaration'],
    'id-blacklist': ['off'],
    'id-length': ['off'],
    'id-match': ['off'],
    indent: ['error', 2],
    'jsx-quotes': ['off'],
    'key-spacing': ['error'],
    'keyword-spacing': ['error'],
    'line-comment-position': ['off'],
    'linebreak-style': ['error', 'windows'],
    'lines-around-comment': ['off'],
    'lines-around-directive': ['off'],
    'max-depth': ['error', 2],
    'max-len': ['error', {
      code: 80,
      ignoreComments: true,
      ignoreTrailingComments: true,
      ignoreUrls: true
    }],
    'max-lines': ['error', {
      max: 239, // 200
      skipBlankLines: true,
      skipComments: true
    }],
    'max-nested-callbacks': ['error', 2],
    'max-params': ['error', 5],
    'max-statements': ['error', 27],
    'max-statements-per-line': ['error', {max: 3}],
    'multiline-ternary': ['off'],
    'new-cap': ['error', {
      capIsNewExceptions: [
        'Deferred',
        'DataTable'
      ]
    }],
    'new-parens': ['error'],
    'newline-after-var': ['off'],
    'newline-before-return': ['off'],
    'newline-per-chained-call': ['off'],
    'no-array-constructor': ['error'],
    'no-bitwise': ['error'],
    'no-continue': ['off'],
    'no-inline-comments': ['off'],
    'no-lonely-if': ['error'],
    'no-mixed-operators': ['off'],
    'no-multi-assign': ['error'],
    'no-multiple-empty-lines': ['error', {
      max: 1,
      maxEOF: 1,
      maxBOF: 1
    }],
    'no-negated-condition': ['off'],
    'no-nested-ternary': ['error'],
    'no-new-object': ['error'],
    'no-plusplus': ['error', {allowForLoopAfterthoughts: true}],
    'no-restricted-syntax': ['off'],
    'no-tabs': ['error'],
    'no-ternary': ['error'],
    'no-trailing-spaces': ['error'],
    'no-underscore-dangle': ['off'],
    'no-unneeded-ternary': ['error', {defaultAssignment: false}],
    'no-whitespace-before-property': ['error'],
    'nonblock-statement-body-position': ['off'],
    'object-curly-newline': ['error', {multiline: true}],
    'object-curly-spacing': ['error', 'never'],
    'object-property-newline': ['error',
      {allowMultiplePropertiesPerLine: true}],
    'one-var': ['error', 'never'],
    'one-var-declaration-per-line': ['error', 'always'],
    'operator-assignment': ['error', 'always'],
    'operator-linebreak': ['error', 'after'],
    'padded-blocks': ['off'],
    'quote-props': ['error', 'as-needed', {keywords: true, numbers: true}],
    quotes: ['error', 'single'],
    'require-jsdoc': ['off'],
    semi: ['error'],
    'semi-spacing': ['error'],
    'sort-keys': ['off'],
    'sort-vars': ['off'],
    'space-before-blocks': ['error'],
    'space-before-function-paren': ['error', 'never'],
    'space-in-parens': ['error'],
    'space-infix-ops': ['error'],
    'space-unary-ops': ['error', {words: true, nonwords: false}],
    'spaced-comment': ['warn', 'always', {
      markers: ['#if', '#set'],
      exceptions: ['#else', '#endif']
    }],
    'template-tag-spacing': ['off'],
    'unicode-bom': ['error'],
    'wrap-regex': ['off'],

    /*  ECMAScript 6  */
    'no-duplicate-imports': ['error', {includeExports: true}],
    'sort-imports': ['error', {
      memberSyntaxSortOrder: [
        'none', 'single', 'multiple', 'all'
      ]
    }],
  }
};
<commit_msg>Promise and arrow functions<commit_after>module.exports = {
  parserOptions: {
    ecmaVersion: 2017,
    sourceType: 'module',
    ecmaFeatures: {impliedStrict: true}
  },
  env: {},
  globals: {

    DOMParser: false,
    Element: false,
    EventTarget: false,
    HTMLDocument: false,
    HTMLTableElement: false,
    Image: false,
    Node: false,
    Promise: false,
    XPathResult: false,
    console: false,
    document: false,
    localStorage: false,
    location: false,
    performance: false,
    setTimeout: false,
    window: false,

    module: false,
    process: false,
    require: false,

    $: false,
    jQuery: false,

    GM_info: false,

    FSH: true,
    localforage: false,
    ga: false,
    GameController: false,
    GameData: false
  },
  'extends': 'eslint:recommended',
  rules: {

    /*  Possible Errors  */
    'no-await-in-loop': ['error'],
    'no-compare-neg-zero': ['error'],
    'no-console': ['error', {allow: ['error']}],
    'no-extra-parens': ['error', 'all', {conditionalAssign: false}],
    'no-prototype-builtins': ['error'],
    'no-template-curly-in-string': ['error'],
    'valid-jsdoc': ['error'],

    /*  Best Practices  */
    'accessor-pairs': ['error'],
    'array-callback-return': ['error'],
    'block-scoped-var': ['error'],
    'class-methods-use-this': ['error'],
    complexity: ['error', 3],
    'consistent-return': ['off'],
    curly: ['error'],
    'default-case': ['error'],
    'dot-location': ['error', 'property'],
    'dot-notation': ['error'],
    eqeqeq: ['error'],
    'guard-for-in': ['error'],
    'no-alert': ['warn'],
    'no-caller': ['error'],
    'no-div-regex': ['error'],
    'no-else-return': ['error'],
    'no-empty-function': ['error'],
    'no-eq-null': ['error'],
    'no-eval': ['error'],
    'no-extend-native': ['error'],
    'no-extra-bind': ['error'],
    'no-extra-label': ['error'],
    'no-floating-decimal': ['error'],
    'no-implicit-coercion': ['error'],
    'no-implicit-globals': ['error'],
    'no-implied-eval': ['error'],
    'no-invalid-this': ['error'],
    'no-iterator': ['error'],
    'no-labels': ['error'],
    'no-lone-blocks': ['error'],
    'no-loop-func': ['error'],
    // 'no-magic-numbers': ['error', {
    //   'ignore': [-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 24, 60, 100, 1000],
    //   'ignoreArrayIndexes': true
    // }],
    'no-multi-spaces': ['error'],
    'no-multi-str': ['error'],
    'no-new': ['error'],
    'no-new-func': ['error'],
    'no-new-wrappers': ['error'],
    'no-octal-escape': ['error'],
    'no-param-reassign': ['error'],
    'no-proto': ['error'],
    'no-restricted-properties': ['error'],
    'no-return-assign': ['error'],
    'no-return-await': ['error'],
    'no-script-url': ['error'],
    'no-self-compare': ['error'],
    'no-sequences': ['error'],
    'no-throw-literal': ['error'],
    'no-unmodified-loop-condition': ['error'],
    'no-unused-expressions': ['error'],
    'no-useless-call': ['error'],
    'no-useless-concat': ['error'],
    'no-useless-escape': ['error'],
    'no-useless-return': ['error'],
    'no-void': ['error'],
    // 'no-warning-comments': ['warn'],
    'no-with': ['error'],
    'prefer-promise-reject-errors': ['error'],
    radix: ['error'],
    'require-await': ['error'],
    'vars-on-top': ['off'],
    'wrap-iife': ['error', 'outside'],
    yoda: ['error'],

    /*  Variables  */
    'init-declarations': ['off'],
    'no-catch-shadow': ['error'],
    'no-label-var': ['error'],
    'no-restricted-globals': ['error', 'event'],
    'no-shadow': ['error'],
    'no-shadow-restricted-names': ['error'],
    'no-undef-init': ['error'],
    'no-undefined': ['error'],
    'no-use-before-define': ['error'],

    /*  Stylistic Issues  */
    'array-bracket-spacing': ['error', 'never'],
    'block-spacing': ['error', 'never'],
    'brace-style': ['error', '1tbs', {allowSingleLine: true}],
    camelcase: ['off'],
    'capitalized-comments': ['off'],
    'comma-dangle': ['error', 'only-multiline'],
    'comma-spacing': ['error'],
    'comma-style': ['error'],
    'computed-property-spacing': ['error'],
    'consistent-this': ['error', 'that'],
    'eol-last': ['error'],
    'func-call-spacing': ['error'],
    'func-name-matching': ['error'],
    // 'func-names': ['error', 'as-needed'],
    'func-style': ['error', 'declaration', {'allowArrowFunctions': true}],
    'id-blacklist': ['off'],
    'id-length': ['off'],
    'id-match': ['off'],
    indent: ['error', 2],
    'jsx-quotes': ['off'],
    'key-spacing': ['error'],
    'keyword-spacing': ['error'],
    'line-comment-position': ['off'],
    'linebreak-style': ['error', 'windows'],
    'lines-around-comment': ['off'],
    'lines-around-directive': ['off'],
    'max-depth': ['error', 2],
    'max-len': ['error', {
      code: 80,
      ignoreComments: true,
      ignoreTrailingComments: true,
      ignoreUrls: true
    }],
    'max-lines': ['error', {
      max: 239, // 200
      skipBlankLines: true,
      skipComments: true
    }],
    'max-nested-callbacks': ['error', 2],
    'max-params': ['error', 5],
    'max-statements': ['error', 27],
    'max-statements-per-line': ['error', {max: 3}],
    'multiline-ternary': ['off'],
    'new-cap': ['error', {
      capIsNewExceptions: [
        'Deferred',
        'DataTable'
      ]
    }],
    'new-parens': ['error'],
    'newline-after-var': ['off'],
    'newline-before-return': ['off'],
    'newline-per-chained-call': ['off'],
    'no-array-constructor': ['error'],
    'no-bitwise': ['error'],
    'no-continue': ['off'],
    'no-inline-comments': ['off'],
    'no-lonely-if': ['error'],
    'no-mixed-operators': ['off'],
    'no-multi-assign': ['error'],
    'no-multiple-empty-lines': ['error', {
      max: 1,
      maxEOF: 1,
      maxBOF: 1
    }],
    'no-negated-condition': ['off'],
    'no-nested-ternary': ['error'],
    'no-new-object': ['error'],
    'no-plusplus': ['error', {allowForLoopAfterthoughts: true}],
    'no-restricted-syntax': ['off'],
    'no-tabs': ['error'],
    'no-ternary': ['error'],
    'no-trailing-spaces': ['error'],
    'no-underscore-dangle': ['off'],
    'no-unneeded-ternary': ['error', {defaultAssignment: false}],
    'no-whitespace-before-property': ['error'],
    'nonblock-statement-body-position': ['off'],
    'object-curly-newline': ['error', {multiline: true}],
    'object-curly-spacing': ['error', 'never'],
    'object-property-newline': ['error',
      {allowMultiplePropertiesPerLine: true}],
    'one-var': ['error', 'never'],
    'one-var-declaration-per-line': ['error', 'always'],
    'operator-assignment': ['error', 'always'],
    'operator-linebreak': ['error', 'after'],
    'padded-blocks': ['off'],
    'quote-props': ['error', 'as-needed', {keywords: true, numbers: true}],
    quotes: ['error', 'single'],
    'require-jsdoc': ['off'],
    semi: ['error'],
    'semi-spacing': ['error'],
    'sort-keys': ['off'],
    'sort-vars': ['off'],
    'space-before-blocks': ['error'],
    'space-before-function-paren': ['error', 'never'],
    'space-in-parens': ['error'],
    'space-infix-ops': ['error'],
    'space-unary-ops': ['error', {words: true, nonwords: false}],
    'spaced-comment': ['warn', 'always', {
      markers: ['#if', '#set'],
      exceptions: ['#else', '#endif']
    }],
    'template-tag-spacing': ['off'],
    'unicode-bom': ['error'],
    'wrap-regex': ['off'],

    /*  ECMAScript 6  */
    'no-duplicate-imports': ['error', {includeExports: true}],
    'sort-imports': ['error', {
      memberSyntaxSortOrder: [
        'none', 'single', 'multiple', 'all'
      ]
    }],
  }
};
<|endoftext|>


<commit_before>const schemaJson = require('./app/graph/schema.json');

const ERROR = 'error';
const WARN = 'warn';
const OFF = 'off';

module.exports = {
  parser: 'babel-eslint',
  extends: [
    'eslint:recommended',
    'plugin:import/react',
    'plugin:import/recommended',
    'plugin:react/recommended',
    'plugin:flowtype/recommended'
  ],
  globals: {
    require: true,
    Features: true,
    process: true,
    Stripe: true
  },
  env: {
    es6: true,
    browser: true
  },
  plugins: [
    'import',
    'react',
    'flowtype',
    'relay',
    'graphql'
  ],
  rules: {
  'array-bracket-spacing': [ ERROR, 'never' ],
    'arrow-parens': WARN,
    'arrow-spacing': WARN,
    'brace-style': [ ERROR, '1tbs', { allowSingleLine: true } ],
    'comma-dangle': [ ERROR, 'never' ],
    'comma-spacing': ERROR,
    'comma-style': [ ERROR, 'last' ],
    'curly': [ ERROR, 'all' ],
    'eqeqeq': [ ERROR, 'smart' ],
    'id-length': ERROR,
    'indent': [ ERROR, 2, { SwitchCase: 1, MemberExpression: 1, FunctionDeclaration: { parameters: 'first' }, FunctionExpression: { parameters: 'first' } } ],
    'jsx-quotes': ERROR,
    'key-spacing': ERROR,
    'keyword-spacing': ERROR,
    'linebreak-style': ERROR,
    'no-const-assign': ERROR,
    'no-duplicate-imports': ERROR,
    'no-else-return': WARN,
    'no-eval': ERROR,
    'no-implied-eval': ERROR,
    'no-multi-spaces': ERROR,
    'no-new-require': ERROR,
    'no-trailing-spaces': ERROR,
    'no-unsafe-negation': ERROR,
    'no-unused-vars': [ ERROR, { varsIgnorePattern: '^_' } ],
    'no-useless-rename': WARN,
    'no-var': WARN,
    'object-curly-spacing': [ ERROR, 'always' ],
    'one-var': [ ERROR, { initialized: 'never' } ],
    'one-var-declaration-per-line': ERROR,
    'prefer-const': WARN,
    'radix': WARN,
    'semi': ERROR,
    'semi-spacing': ERROR,
    'space-before-function-paren': [ ERROR, 'never' ],
    'space-in-parens': [ ERROR, 'never' ],
    'space-infix-ops': ERROR,
    'space-unary-ops': ERROR,
    'strict': ERROR,
    'unicode-bom': ERROR,

    'flowtype/delimiter-dangle': ERROR,
    'flowtype/no-dupe-keys': ERROR,
    'flowtype/no-primitive-constructor-types': ERROR,
    'flowtype/object-type-delimiter': ERROR,
    'flowtype/require-valid-file-annotation': ERROR,
    'flowtype/semi': ERROR,

    'import/extensions': ERROR,
    'import/unambiguous': OFF,
    'import/no-unresolved': OFF, // Handled by Flow.

    'react/display-name': [ ERROR, { ignoreTranspilerName: false } ],
    'react/forbid-prop-types': OFF,
    'react/jsx-boolean-value': [ ERROR, 'always' ],
    'react/jsx-closing-bracket-location': ERROR,
    'react/jsx-curly-spacing': ERROR,
    'react/jsx-equals-spacing': [ ERROR, 'never' ],
    'react/jsx-first-prop-new-line': [ ERROR, 'multiline' ],
    'react/jsx-handler-names': ERROR,
    'react/jsx-indent': [ ERROR, 2 ],
    'react/jsx-indent-props': [ ERROR, 2 ],
    'react/jsx-key': ERROR,
    'react/jsx-max-props-per-line': [ ERROR, { when: 'multiline' } ],
    'react/jsx-no-bind': [ WARN, { ignoreRefs: true } ],
    'react/jsx-no-comment-textnodes': ERROR,
    'react/jsx-no-duplicate-props': ERROR,
    'react/jsx-no-literals': OFF,
    'react/jsx-no-target-blank': ERROR,
    'react/jsx-no-undef': ERROR,
    'react/jsx-pascal-case': ERROR,
    'react/jsx-sort-prop-types': OFF,
    'react/jsx-sort-props': OFF,
    'react/jsx-uses-react': ERROR,
    'react/jsx-uses-vars': ERROR,
    'react/jsx-wrap-multilines': ERROR,
    'react/no-array-index-key': WARN,
    'react/no-danger': OFF,
    'react/no-danger-with-children': ERROR,
    'react/no-deprecated': WARN,
    'react/no-did-mount-set-state': ERROR,
    'react/no-did-update-set-state': ERROR,
    'react/no-direct-mutation-state': ERROR,
    'react/no-is-mounted': ERROR,
    'react/no-multi-comp': [ ERROR, { ignoreStateless: true } ],
    'react/no-set-state': OFF,
    'react/no-string-refs': ERROR,
    'react/no-unescaped-entities': ERROR,
    'react/no-unknown-property': ERROR,
    'react/no-unused-prop-types': ERROR,
    'react/prefer-es6-class': ERROR,
    'react/prefer-stateless-function': OFF,
    'react/prop-types': ERROR,
    'react/react-in-jsx-scope': ERROR,
    'react/require-optimization': ERROR,
    'react/require-render-return': ERROR,
    'react/self-closing-comp': WARN,
    'react/sort-comp': OFF,
    'react/style-prop-object': WARN,
    'react/jsx-tag-spacing': ERROR,
    'react/void-dom-elements-no-children': ERROR,

    'relay/graphql-syntax': ERROR,
    'relay/compat-uses-vars': WARN,
    'relay/graphql-naming': ERROR,
    'relay/generated-flow-types': WARN,
    'relay/no-future-added-value': WARN,
    'relay/unused-fields': WARN,

    'graphql/named-operations': [ WARN, { env: 'relay', schemaJson } ],
    'graphql/no-deprecated-fields': [ ERROR, { env: 'relay', schemaJson } ],
    'graphql/template-strings': [ ERROR, { env: 'relay', tagName: 'graphql', schemaJson } ]
  }
};<commit_msg>Disable the template-string linter — it’s just too loud right now. Hopefully we’ll get back to it.<commit_after>const schemaJson = require('./app/graph/schema.json');

const ERROR = 'error';
const WARN = 'warn';
const OFF = 'off';

module.exports = {
  parser: 'babel-eslint',
  extends: [
    'eslint:recommended',
    'plugin:import/react',
    'plugin:import/recommended',
    'plugin:react/recommended',
    'plugin:flowtype/recommended'
  ],
  globals: {
    require: true,
    Features: true,
    process: true,
    Stripe: true
  },
  env: {
    es6: true,
    browser: true
  },
  plugins: [
    'import',
    'react',
    'flowtype',
    'relay',
    'graphql'
  ],
  rules: {
  'array-bracket-spacing': [ ERROR, 'never' ],
    'arrow-parens': WARN,
    'arrow-spacing': WARN,
    'brace-style': [ ERROR, '1tbs', { allowSingleLine: true } ],
    'comma-dangle': [ ERROR, 'never' ],
    'comma-spacing': ERROR,
    'comma-style': [ ERROR, 'last' ],
    'curly': [ ERROR, 'all' ],
    'eqeqeq': [ ERROR, 'smart' ],
    'id-length': ERROR,
    'indent': [ ERROR, 2, { SwitchCase: 1, MemberExpression: 1, FunctionDeclaration: { parameters: 'first' }, FunctionExpression: { parameters: 'first' } } ],
    'jsx-quotes': ERROR,
    'key-spacing': ERROR,
    'keyword-spacing': ERROR,
    'linebreak-style': ERROR,
    'no-const-assign': ERROR,
    'no-duplicate-imports': ERROR,
    'no-else-return': WARN,
    'no-eval': ERROR,
    'no-implied-eval': ERROR,
    'no-multi-spaces': ERROR,
    'no-new-require': ERROR,
    'no-trailing-spaces': ERROR,
    'no-unsafe-negation': ERROR,
    'no-unused-vars': [ ERROR, { varsIgnorePattern: '^_' } ],
    'no-useless-rename': WARN,
    'no-var': WARN,
    'object-curly-spacing': [ ERROR, 'always' ],
    'one-var': [ ERROR, { initialized: 'never' } ],
    'one-var-declaration-per-line': ERROR,
    'prefer-const': WARN,
    'radix': WARN,
    'semi': ERROR,
    'semi-spacing': ERROR,
    'space-before-function-paren': [ ERROR, 'never' ],
    'space-in-parens': [ ERROR, 'never' ],
    'space-infix-ops': ERROR,
    'space-unary-ops': ERROR,
    'strict': ERROR,
    'unicode-bom': ERROR,

    'flowtype/delimiter-dangle': ERROR,
    'flowtype/no-dupe-keys': ERROR,
    'flowtype/no-primitive-constructor-types': ERROR,
    'flowtype/object-type-delimiter': ERROR,
    'flowtype/require-valid-file-annotation': ERROR,
    'flowtype/semi': ERROR,

    'import/extensions': ERROR,
    'import/unambiguous': OFF,
    'import/no-unresolved': OFF, // Handled by Flow.

    'react/display-name': [ ERROR, { ignoreTranspilerName: false } ],
    'react/forbid-prop-types': OFF,
    'react/jsx-boolean-value': [ ERROR, 'always' ],
    'react/jsx-closing-bracket-location': ERROR,
    'react/jsx-curly-spacing': ERROR,
    'react/jsx-equals-spacing': [ ERROR, 'never' ],
    'react/jsx-first-prop-new-line': [ ERROR, 'multiline' ],
    'react/jsx-handler-names': ERROR,
    'react/jsx-indent': [ ERROR, 2 ],
    'react/jsx-indent-props': [ ERROR, 2 ],
    'react/jsx-key': ERROR,
    'react/jsx-max-props-per-line': [ ERROR, { when: 'multiline' } ],
    'react/jsx-no-bind': [ WARN, { ignoreRefs: true } ],
    'react/jsx-no-comment-textnodes': ERROR,
    'react/jsx-no-duplicate-props': ERROR,
    'react/jsx-no-literals': OFF,
    'react/jsx-no-target-blank': ERROR,
    'react/jsx-no-undef': ERROR,
    'react/jsx-pascal-case': ERROR,
    'react/jsx-sort-prop-types': OFF,
    'react/jsx-sort-props': OFF,
    'react/jsx-uses-react': ERROR,
    'react/jsx-uses-vars': ERROR,
    'react/jsx-wrap-multilines': ERROR,
    'react/no-array-index-key': WARN,
    'react/no-danger': OFF,
    'react/no-danger-with-children': ERROR,
    'react/no-deprecated': WARN,
    'react/no-did-mount-set-state': ERROR,
    'react/no-did-update-set-state': ERROR,
    'react/no-direct-mutation-state': ERROR,
    'react/no-is-mounted': ERROR,
    'react/no-multi-comp': [ ERROR, { ignoreStateless: true } ],
    'react/no-set-state': OFF,
    'react/no-string-refs': ERROR,
    'react/no-unescaped-entities': ERROR,
    'react/no-unknown-property': ERROR,
    'react/no-unused-prop-types': ERROR,
    'react/prefer-es6-class': ERROR,
    'react/prefer-stateless-function': OFF,
    'react/prop-types': ERROR,
    'react/react-in-jsx-scope': ERROR,
    'react/require-optimization': ERROR,
    'react/require-render-return': ERROR,
    'react/self-closing-comp': WARN,
    'react/sort-comp': OFF,
    'react/style-prop-object': WARN,
    'react/jsx-tag-spacing': ERROR,
    'react/void-dom-elements-no-children': ERROR,

    'relay/graphql-syntax': ERROR,
    'relay/compat-uses-vars': WARN,
    'relay/graphql-naming': ERROR,
    'relay/generated-flow-types': WARN,
    'relay/no-future-added-value': WARN,
    'relay/unused-fields': WARN,

    'graphql/named-operations': [ WARN, { env: 'relay', schemaJson } ],
    'graphql/no-deprecated-fields': [ ERROR, { env: 'relay', schemaJson } ],
    // Disabled for now — it’s just a bit too noisy.
    // 'graphql/template-strings': [ WARN, { env: 'relay', validators: 'all', schemaJson } ]
  }
};<|endoftext|>


<commit_before>import Component from '@ember/component';
import { computed } from 'ember-decorators/object';
import { alias, equal } from 'ember-decorators/object/computed';
import { service } from 'ember-decorators/service';

import moment from 'moment';

const NOVEMBER_2017_RETIREMENT = '2017-11-28T12:00:00-08:00';
const LATEST_TRUSTY_RELEASE = '2017-12-12T17:25:00-00:00';

export default Component.extend({
  @service auth: null,
  @service features: null,

  @alias('job.queue') queue: null,
  @alias('job.config') jobConfig: null,

  @computed('job.isFinished')
  conjugatedRun(isFinished) {
    return isFinished ? 'ran' : 'is running';
  },

  @equal('queue', 'builds.linux') isLegacyInfrastructure: null,
  @equal('queue', 'builds.ec2') isTrustySudoFalse: null,

  @computed('job.startedAt', 'queue', 'job.config.dist')
  isTrustySudoRequired(startedAt, queue, dist) {
    if (queue === 'builds.gce' && dist === 'trusty') {
      const jobRanAfterReleaseDate = Date.parse(startedAt) > Date.parse(LATEST_TRUSTY_RELEASE);
      if (jobRanAfterReleaseDate) {
        return true;
      }
    }

    return false;
  },

  @equal('queue', 'builds.macstadium6') isMacStadium6: null,

  @computed('queue', 'job.config.dist', 'job.config.language')
  isPreciseEOL(queue, dist, language) {
    if (queue === 'builds.gce' && dist === 'precise') {
      if (language !== 'android') {
        return true;
      }
    }
  },

  @alias('jobConfig.osx_image') macOSImage: null,

  deprecatedXcodeImages: ['xcode8.1', 'xcode8.2', 'xcode6.4'],

  imageToRetirementDate: {
    'xcode8.1': NOVEMBER_2017_RETIREMENT,
    'xcode8.2': NOVEMBER_2017_RETIREMENT
  },

  imageToNewImage: {
    'xcode8.1': 'xcode8.3',
    'xcode8.2': 'xcode8.3'
  },

  newImageStrings: {
    'xcode8.3': 'Xcode 8.3',
    'xcode7.3': 'Xcode 7.3.1',
    'xcode6.4': 'Xcode 6.4'
  },

  @computed('isMacStadium6', 'macOSImage')
  isDeprecatedOrRetiredMacImage(isMacStadium6, macOSImage) {
    return isMacStadium6 && this.get('deprecatedXcodeImages').includes(macOSImage);
  },

  // eslint-disable-next-line
  @computed('job.startedAt', 'macOSImage', 'job.isFinished', 'conjugatedRun', 'isDeprecatedOrRetiredMacImage')
  deprecatedOrRetiredMacImageMessage(startedAt, image, isFinished, conjugatedRun) {
    if (image === 'xcode6.4') {
      return `Running builds with Xcode 6.4 in Travis CI is deprecated and will be removed in January 2019. If Xcode 6.4 is critical to your builds, please contact our support team at support@travis-ci.com to discuss options.`;
    }

    const retirementDate = Date.parse(this.get('imageToRetirementDate')[image]);

    const newImage = this.get('imageToNewImage')[image];
    const newImageString = this.get('newImageStrings')[newImage];
    const newImageAnchor = newImageString.replace(' ', '-');
    const newImageURLString = `<a href='https://docs.travis-ci.com/user/reference/osx/#${newImageAnchor}'>${newImageString}</a>`;
    const imageRetirementAnnouncementURL = 'https://blog.travis-ci.com/2017-11-21-xcode8-3-default-image-announce';

    const jobRanBeforeRetirementDate = Date.parse(startedAt) < retirementDate;
    const retirementDateIsInTheFuture = retirementDate > new Date();

    const formattedRetirementDate = moment(retirementDate).format('MMMM D, YYYY');

    const retirementLink =
      `
      ${retirementDateIsInTheFuture ? 'will be retired' : 'was retired'}
      on ${formattedRetirementDate}`;

    let retirementSentence, routingSentence;

    if (retirementDateIsInTheFuture) {
      retirementSentence = `This job ${conjugatedRun} on an OS X image that ${retirementLink}.`;
    } else {
      retirementSentence = `
        This job ${isFinished ? 'was configured to run on' : 'is configured to run on'}
        an OS X image that ${retirementLink}.`;
    }

    if (retirementDateIsInTheFuture) {
      routingSentence =
        `After that, it will route to our ${newImageURLString} image.`;
    } else if (jobRanBeforeRetirementDate) {
      routingSentence = `New jobs will route to our ${newImageURLString} image.`;
    } else {
      routingSentence = `It was routed to our ${newImageURLString} image.`;
    }

    return `${retirementSentence} ${routingSentence}`;
  }
});
<commit_msg>Fix line length of deprecation message<commit_after>import Component from '@ember/component';
import { computed } from 'ember-decorators/object';
import { alias, equal } from 'ember-decorators/object/computed';
import { service } from 'ember-decorators/service';

import moment from 'moment';

const NOVEMBER_2017_RETIREMENT = '2017-11-28T12:00:00-08:00';
const LATEST_TRUSTY_RELEASE = '2017-12-12T17:25:00-00:00';

export default Component.extend({
  @service auth: null,
  @service features: null,

  @alias('job.queue') queue: null,
  @alias('job.config') jobConfig: null,

  @computed('job.isFinished')
  conjugatedRun(isFinished) {
    return isFinished ? 'ran' : 'is running';
  },

  @equal('queue', 'builds.linux') isLegacyInfrastructure: null,
  @equal('queue', 'builds.ec2') isTrustySudoFalse: null,

  @computed('job.startedAt', 'queue', 'job.config.dist')
  isTrustySudoRequired(startedAt, queue, dist) {
    if (queue === 'builds.gce' && dist === 'trusty') {
      const jobRanAfterReleaseDate = Date.parse(startedAt) > Date.parse(LATEST_TRUSTY_RELEASE);
      if (jobRanAfterReleaseDate) {
        return true;
      }
    }

    return false;
  },

  @equal('queue', 'builds.macstadium6') isMacStadium6: null,

  @computed('queue', 'job.config.dist', 'job.config.language')
  isPreciseEOL(queue, dist, language) {
    if (queue === 'builds.gce' && dist === 'precise') {
      if (language !== 'android') {
        return true;
      }
    }
  },

  @alias('jobConfig.osx_image') macOSImage: null,

  deprecatedXcodeImages: ['xcode8.1', 'xcode8.2', 'xcode6.4'],

  imageToRetirementDate: {
    'xcode8.1': NOVEMBER_2017_RETIREMENT,
    'xcode8.2': NOVEMBER_2017_RETIREMENT
  },

  imageToNewImage: {
    'xcode8.1': 'xcode8.3',
    'xcode8.2': 'xcode8.3'
  },

  newImageStrings: {
    'xcode8.3': 'Xcode 8.3',
    'xcode7.3': 'Xcode 7.3.1',
    'xcode6.4': 'Xcode 6.4'
  },

  @computed('isMacStadium6', 'macOSImage')
  isDeprecatedOrRetiredMacImage(isMacStadium6, macOSImage) {
    return isMacStadium6 && this.get('deprecatedXcodeImages').includes(macOSImage);
  },

  // eslint-disable-next-line
  @computed('job.startedAt', 'macOSImage', 'job.isFinished', 'conjugatedRun', 'isDeprecatedOrRetiredMacImage')
  deprecatedOrRetiredMacImageMessage(startedAt, image, isFinished, conjugatedRun) {
    if (image === 'xcode6.4') {
      return `Running builds with Xcode 6.4 in Travis CI is deprecated and will be
removed in January 2019. If Xcode 6.4 is critical to your builds, please contact our support team
at support@travis-ci.com to discuss options.`;
    }

    const retirementDate = Date.parse(this.get('imageToRetirementDate')[image]);

    const newImage = this.get('imageToNewImage')[image];
    const newImageString = this.get('newImageStrings')[newImage];
    const newImageAnchor = newImageString.replace(' ', '-');
    const newImageURLString = `<a href='https://docs.travis-ci.com/user/reference/osx/#${newImageAnchor}'>${newImageString}</a>`;
    const imageRetirementAnnouncementURL = 'https://blog.travis-ci.com/2017-11-21-xcode8-3-default-image-announce';

    const jobRanBeforeRetirementDate = Date.parse(startedAt) < retirementDate;
    const retirementDateIsInTheFuture = retirementDate > new Date();

    const formattedRetirementDate = moment(retirementDate).format('MMMM D, YYYY');

    const retirementLink =
      `
      ${retirementDateIsInTheFuture ? 'will be retired' : 'was retired'}
      on ${formattedRetirementDate}`;

    let retirementSentence, routingSentence;

    if (retirementDateIsInTheFuture) {
      retirementSentence = `This job ${conjugatedRun} on an OS X image that ${retirementLink}.`;
    } else {
      retirementSentence = `
        This job ${isFinished ? 'was configured to run on' : 'is configured to run on'}
        an OS X image that ${retirementLink}.`;
    }

    if (retirementDateIsInTheFuture) {
      routingSentence =
        `After that, it will route to our ${newImageURLString} image.`;
    } else if (jobRanBeforeRetirementDate) {
      routingSentence = `New jobs will route to our ${newImageURLString} image.`;
    } else {
      routingSentence = `It was routed to our ${newImageURLString} image.`;
    }

    return `${retirementSentence} ${routingSentence}`;
  }
});
<|endoftext|>


<commit_before>var shell = require("shelljs/global"),
		exec = require("child_process").exec;

if (!test('-f', 'bower.json')) {
	if (!which('bower')) {
		echo('bower module not installed');
		echo('run npm install -g bower && npm install');
		echo('aborting');
		exit(1);
	} else {
		echo('installing bower components');
		exec('bower installed');
	}
} else {
	echo('bower.json is initialised');
}

if (test('-f', 'secrets-sample.coffee') && !test('-f', 'secrets.coffee')) {
	echo('creating your very own secrets');
	cp('secrets-sample.coffee', 'secrets.coffee');
	echo('secrets.coffee created');
} else {
	echo('secrets.coffee is ready');
}

if (!test('-d', 'jspm_packages')) {
	if (!which('jspm')) {
		echo('jspm not installed');
		echo('run npm install -g jspm && npm install');
		echo('aborting');
		exit(1);
	} else {
		echo('installing jspm packages');
		exec('jspm install');
	}
} else {
	echo('jspm packages installed');
}

if (!test('-L', 'styleguide/src/assets/toolkit/assets')) {
	echo('symlinking styleguide assets to site assets');
	cd('styleguide/src/assets/toolkit');
	ln('-s', '../../../../src/site/templates/assets', 'assets');
	echo('assets symlinked');
} else {
	echo('styleguide correctly symlinked to site assets');
}

<commit_msg>retab<commit_after>var shell = require("shelljs/global"),
    exec = require("child_process").exec;

if (!test('-f', 'bower.json')) {
  if (!which('bower')) {
    echo('bower module not installed');
    echo('run npm install -g bower && npm install');
    echo('aborting');
    exit(1);
  } else {
    echo('installing bower components');
    exec('bower install').stdout.pipe(process.stdout);
  }
} else {
  echo('bower.json is initialised');
}

if (test('-f', 'secrets-sample.coffee') && !test('-f', 'secrets.coffee')) {
  echo('creating your very own secrets');
  cp('secrets-sample.coffee', 'secrets.coffee');
  echo('secrets.coffee created');
} else {
  echo('secrets.coffee is ready');
}

if (!test('-d', 'jspm_packages')) {
  if (!which('jspm')) {
    echo('jspm not installed');
    echo('run npm install -g jspm && npm install');
    echo('aborting');
    exit(1);
  } else {
    echo('installing jspm packages');
    exec('jspm install').stdout.pipe(process.stdout);
  }
} else {
  echo('jspm packages installed');
}

if (!test('-L', 'styleguide/src/assets/toolkit/assets')) {
  echo('symlinking styleguide assets to site assets');
  cd('styleguide/src/assets/toolkit');
  ln('-s', '../../../../src/site/templates/assets', 'assets');
  echo('assets symlinked');
} else {
  echo('styleguide correctly symlinked to site assets');
}

<|endoftext|>


<commit_before>'use strict';

/**
 * This module is a thin layer over the native module. It's aim is to obscure
 * implementation details for registering callbacks, changing settings, etc.
*/

var React, {NativeModules, NativeAppEventEmitter, DeviceEventEmitter} = require('react-native');

var AudioPlayerManager = NativeModules.AudioPlayerManager;
var AudioRecorderManager = NativeModules.AudioRecorderManager;

var AudioPlayer = {
  play: function(path) {
    AudioPlayerManager.play(path);
  },
  playWithUrl: function(url) {
    AudioPlayerManager.playWithUrl(url);
  },
  pause: function() {
    AudioPlayerManager.pause();
  },
  unpause: function() {
    AudioPlayerManager.unpause();
  },
  stop: function() {
    AudioPlayerManager.stop();
  },
  setCurrentTime: function(time) {
    AudioPlayerManager.setCurrentTime(time);
  },
  skipToSeconds: function(position) {
    AudioPlayerManager.skipToSeconds(position);
  },
  setProgressSubscription: function() {
    if (this.progressSubscription) this.progressSubscription.remove();
    this.progressSubscription = DeviceEventEmitter.addListener('playerProgress',
      (data) => {
        if (this.onProgress) {
          this.onProgress(data);
        }
      }
    );
  },
  setFinishedSubscription: function() {
    if (this.finishedSubscription) this.finishedSubscription.remove();
    this.finishedSubscription = DeviceEventEmitter.addListener('playerFinished',
      (data) => {
        if (this.onFinished) {
          this.onFinished(data);
        }
      }
    );
  },
  getDuration: function(callback) {
    AudioPlayerManager.getDuration((error, duration) => {
      callback(duration);
    })
  },
  getCurrentTime: function(callback) {
    AudioPlayerManager.getCurrentTime((error, currentTime) => {
      callback(currentTime);
    })
  },
};

var AudioRecorder = {
  prepareRecordingAtPath: function(path, options) {

    var recordingOptions = null;

    if (!options) {
      recordingOptions = {
        SampleRate: 44100.0,
        Channels: 2,
        AudioQuality: 'High'
      };
    } else {
      recordingOptions = options;
    }

    AudioRecorderManager.prepareRecordingAtPath(
      path,
      recordingOptions.SampleRate,
      recordingOptions.Channels,
      recordingOptions.AudioQuality
    );

    if (this.progressSubscription) this.progressSubscription.remove();
    this.progressSubscription = NativeAppEventEmitter.addListener('recordingProgress',
      (data) => {
        if (this.onProgress) {
          this.onProgress(data);
        }
      }
    );

    if (this.finishedSubscription) this.finishedSubscription.remove();
    this.finishedSubscription = NativeAppEventEmitter.addListener('recordingFinished',
      (data) => {
        if (this.onFinished) {
          this.onFinished(data);
        }
      }
    );
  },
  startRecording: function() {
    AudioRecorderManager.startRecording();
  },
  pauseRecording: function() {
    AudioRecorderManager.pauseRecording();
  },
  stopRecording: function() {
    AudioRecorderManager.stopRecording();
  },
  playRecording: function() {
    AudioRecorderManager.playRecording();
  },
  stopPlaying: function() {
    AudioRecorderManager.stopPlaying();
  },
  checkAuthorizationStatus: AudioRecorderManager.checkAuthorizationStatus,
  requestAuthorization: function() {
    AudioRecorderManager.requestAuthorization();
  },
};

module.exports = {AudioPlayer, AudioRecorder};
<commit_msg>Changed the way the JS calls requestAuthorization to work with promise<commit_after>'use strict';

/**
 * This module is a thin layer over the native module. It's aim is to obscure
 * implementation details for registering callbacks, changing settings, etc.
*/

var React, {NativeModules, NativeAppEventEmitter, DeviceEventEmitter} = require('react-native');

var AudioPlayerManager = NativeModules.AudioPlayerManager;
var AudioRecorderManager = NativeModules.AudioRecorderManager;

var AudioPlayer = {
  play: function(path) {
    AudioPlayerManager.play(path);
  },
  playWithUrl: function(url) {
    AudioPlayerManager.playWithUrl(url);
  },
  pause: function() {
    AudioPlayerManager.pause();
  },
  unpause: function() {
    AudioPlayerManager.unpause();
  },
  stop: function() {
    AudioPlayerManager.stop();
  },
  setCurrentTime: function(time) {
    AudioPlayerManager.setCurrentTime(time);
  },
  skipToSeconds: function(position) {
    AudioPlayerManager.skipToSeconds(position);
  },
  setProgressSubscription: function() {
    if (this.progressSubscription) this.progressSubscription.remove();
    this.progressSubscription = DeviceEventEmitter.addListener('playerProgress',
      (data) => {
        if (this.onProgress) {
          this.onProgress(data);
        }
      }
    );
  },
  setFinishedSubscription: function() {
    if (this.finishedSubscription) this.finishedSubscription.remove();
    this.finishedSubscription = DeviceEventEmitter.addListener('playerFinished',
      (data) => {
        if (this.onFinished) {
          this.onFinished(data);
        }
      }
    );
  },
  getDuration: function(callback) {
    AudioPlayerManager.getDuration((error, duration) => {
      callback(duration);
    })
  },
  getCurrentTime: function(callback) {
    AudioPlayerManager.getCurrentTime((error, currentTime) => {
      callback(currentTime);
    })
  },
};

var AudioRecorder = {
  prepareRecordingAtPath: function(path, options) {

    var recordingOptions = null;

    if (!options) {
      recordingOptions = {
        SampleRate: 44100.0,
        Channels: 2,
        AudioQuality: 'High'
      };
    } else {
      recordingOptions = options;
    }

    AudioRecorderManager.prepareRecordingAtPath(
      path,
      recordingOptions.SampleRate,
      recordingOptions.Channels,
      recordingOptions.AudioQuality
    );

    if (this.progressSubscription) this.progressSubscription.remove();
    this.progressSubscription = NativeAppEventEmitter.addListener('recordingProgress',
      (data) => {
        if (this.onProgress) {
          this.onProgress(data);
        }
      }
    );

    if (this.finishedSubscription) this.finishedSubscription.remove();
    this.finishedSubscription = NativeAppEventEmitter.addListener('recordingFinished',
      (data) => {
        if (this.onFinished) {
          this.onFinished(data);
        }
      }
    );
  },
  startRecording: function() {
    AudioRecorderManager.startRecording();
  },
  pauseRecording: function() {
    AudioRecorderManager.pauseRecording();
  },
  stopRecording: function() {
    AudioRecorderManager.stopRecording();
  },
  playRecording: function() {
    AudioRecorderManager.playRecording();
  },
  stopPlaying: function() {
    AudioRecorderManager.stopPlaying();
  },
  checkAuthorizationStatus: AudioRecorderManager.checkAuthorizationStatus,
  requestAuthorization: AudioRecorderManager.requestAuthorization,
};

module.exports = {AudioPlayer, AudioRecorder};
<|endoftext|>


<commit_before>//v1.0 as Starting Point
//v2.0 Cleaning up code. Setting up Menu Structure

//Declare and Initialize Variables
var audio_Bell = new Audio("http://xenko.comxa.com/Ship_Bell.mp3");
	audio_Bell.volume=1;
var audio_Chime = new Audio("http://xenko.comxa.com/Chime.mp3");
	audio_Chime.volume=1;
var i = 0;
var IdleStatus = 0;
var incoming_ONG = 0;
var KeepBlue = 0;
var NinjaAutoClickStatus = 0;
var RKAutoClickStatus = 0;
var RKAlertFrequency = 8;
var Time_to_ONG = 1800000;

//Beach Ball Startup
	//Create Menu
	$('#optionsItems').append('

RK Auto Click

');

	//Set Settings
	IdleStatus = prompt("Set to idle? (1 = Yes, 0 = No)");
	RKAutoClickStatus = IdleStatus;
	NinjaAutoClickStatus = IdleStatus;
	if (Molpy.Got('Kitnip') == 1){RKAlertFrequency = 10;}

//Main Loop
setInterval(function() {
    RedundaKitty();
    Ninja();
}, 1800);

function Ninja() {
	//Ninja Warnings and Incoming ONG Warning
    Time_to_ONG = (Molpy.NPlength * 1000) - Molpy.ONGelapsed;
	if (Molpy.ninjad == 0) {
        if (Molpy.npbONG == 0) {
			$("#beach").css("border","4px solid red");
        }
        else {
            incoming_ONG = 0;
            if (NinjaAutoClickStatus == 1) {
                Molpy.ClickBeach();
                $("#beach").css("border","4px solid blue");
                KeepBlue = 1;
            }
            else {
            $("#beach").css("border","4px solid green");
            }

        }
	}
    else if (Time_to_ONG <= 15000) {
        $("#beach").css("border","4px solid yellow");
            if (incoming_ONG == 0) {
                audio_Chime.play();
                incoming_ONG = 1;
            }
    }
    else if (KeepBlue == 0) {
        $("#beach").css("border","1px solid white");
	}
}

function RedundaKitty() {
	i = Molpy.redactedToggle - Molpy.redactedCountup;

	if (Molpy.redactedVisible > 0) {
		//Clicks if AutoClicker Enabled
		if (RKAutoClickStatus == 1) {
			Molpy.ClickRedacted();
		}

		else {
			//Redundakitty Notifications (Title Bar and Audio)
			document.title = "! kitten !";
			if (Math.floor(i % RKAlertFrequency) == 0) {
				audio_Bell.play();
			}
		}
	}
	else {
		document.title = Molpy.redactedToggle-Molpy.redactedCountup;
		if (i != 0) { i = 0; }
	}
}

function SwitchOption(toSwitch) {
	if (toSwith == 'RKAutoClick') {
		RKAutoClickStatus++;
		if (RKAutoClickStatus > 1) {
			RKAutoClickStatus = 0;
		}
	}
}<commit_msg>Bug Fix RKAutoClick Switch<commit_after>//v1.0 as Starting Point
//v2.0 Cleaning up code. Setting up Menu Structure

//Declare and Initialize Variables
var audio_Bell = new Audio("http://xenko.comxa.com/Ship_Bell.mp3");
	audio_Bell.volume=1;
var audio_Chime = new Audio("http://xenko.comxa.com/Chime.mp3");
	audio_Chime.volume=1;
var i = 0;
var IdleStatus = 0;
var incoming_ONG = 0;
var KeepBlue = 0;
var NinjaAutoClickStatus = 0;
var RKAutoClickStatus = 0;
var RKAlertFrequency = 8;
var Time_to_ONG = 1800000;

//Beach Ball Startup
	//Create Menu
	$('#optionsItems').append('

RK Auto Click

');

	//Set Settings
	IdleStatus = prompt("Set to idle? (1 = Yes, 0 = No)");
	RKAutoClickStatus = IdleStatus;
	NinjaAutoClickStatus = IdleStatus;
	if (Molpy.Got('Kitnip') == 1){RKAlertFrequency = 10;}

//Main Loop
setInterval(function() {
    RedundaKitty();
    Ninja();
}, 1800);

function Ninja() {
	//Ninja Warnings and Incoming ONG Warning
    Time_to_ONG = (Molpy.NPlength * 1000) - Molpy.ONGelapsed;
	if (Molpy.ninjad == 0) {
        if (Molpy.npbONG == 0) {
			$("#beach").css("border","4px solid red");
        }
        else {
            incoming_ONG = 0;
            if (NinjaAutoClickStatus == 1) {
                Molpy.ClickBeach();
                $("#beach").css("border","4px solid blue");
                KeepBlue = 1;
            }
            else {
            $("#beach").css("border","4px solid green");
            }

        }
	}
    else if (Time_to_ONG <= 15000) {
        $("#beach").css("border","4px solid yellow");
            if (incoming_ONG == 0) {
                audio_Chime.play();
                incoming_ONG = 1;
            }
    }
    else if (KeepBlue == 0) {
        $("#beach").css("border","1px solid white");
	}
}

function RedundaKitty() {
	i = Molpy.redactedToggle - Molpy.redactedCountup;

	if (Molpy.redactedVisible > 0) {
		//Clicks if AutoClicker Enabled
		if (RKAutoClickStatus == 1) {
			Molpy.ClickRedacted();
		}

		else {
			//Redundakitty Notifications (Title Bar and Audio)
			document.title = "! kitten !";
			if (Math.floor(i % RKAlertFrequency) == 0) {
				audio_Bell.play();
			}
		}
	}
	else {
		document.title = Molpy.redactedToggle-Molpy.redactedCountup;
		if (i != 0) { i = 0; }
	}
}

function SwitchOption(toSwitch) {
	if (toSwith == 'RKAutoClick') {
		RKAutoClickStatus++;
		if (RKAutoClickStatus > 1) {
			RKAutoClickStatus = 0;
		}
	}
}<|endoftext|>