<commit_before>"use strict";

module.exports = function(cms){
  if(!cms) throw new Error("You have to specify the cms object");

//# Mandantory Setup:
  var ext = cms.createExtension({package: require("./package.json")});

  ext.on("install", function(event){ // set options, but don't run or make available in cms
    //# Seting extension-config:
    ext.config.route = ext.config.route || "/"+ext.name;
    /* nce-mongoose-store
    ext.config.modelName = ext.config.modelName || ext.name;
    */
    /* nce-winston
    ext.config.logger = ext.config.logger || {};
    */

    //# Declarations and settings:
    /* nce-winston
    ext.logger = cms.getExtension("winston").createLogger(ext.name, ext.config.logger);
    */

    /* nce-mongoose-store
    var store = cms.getExtension("mongoose-store");
    var schema = store.createSchema({});
    schema.methods.xy = function(){};
    schema.statics.xy = function(cb){cb();};
    ext.model = store.createModel(schema);
    */
  });

  ext.on("uninstall", function(event){ // undo installation
    //# Undeclare:
    /* nce-winston
    cms.getExtension("winston").removeLogger(ext.name);
    */
  });

  ext.on("activate", function(event){ // don't set options, just run, make available in cms or register.
	  if(cms.requestMiddlewares.indexOf(router) === -1) {
		  cms.requestMiddlewares.push(router);
	  }
  });

  ext.on("deactivate", function(event){ // undo activation
	  if(cms.requestMiddlewares.indexOf(router) !== -1) {
		  cms.requestMiddlewares.splice(cms.requestMiddlewares.indexOf(router), 1);
	  }
  });

//# Private declarations:
  var router = function(req, res, next){
    var backend = cms.getExtension("backend");
    if(req.url.substr(0, backend.config.route.length+ext.config.subRoute.length) === backend.config.route+ext.config.subRoute) {
      try{throw new Error("Dummy extension");} catch(e){console.error(e)};
    }

    return next();
  };

//# Public declarations and exports:
  ext.dummy = function(opts, cb){
    // a dummy method here...
  }

  return ext;
}<commit_msg>#5: Change the name of the variable cms to nce<commit_after>"use strict";

module.exports = function(nce){
  if(!nce) throw new Error("You have to specify the nce object");

//# Mandantory Setup:
  var ext = nce.createExtension({package: require("./package.json")});

  ext.on("install", function(event){ // set options, but don't run or make available in nce
    //# Seting extension-config:
    ext.config.route = ext.config.route || "/"+ext.name;
    /* nce-mongoose-store
    ext.config.modelName = ext.config.modelName || ext.name;
    */
    /* nce-winston
    ext.config.logger = ext.config.logger || {};
    */

    //# Declarations and settings:
    /* nce-winston
    ext.logger = nce.getExtension("winston").createLogger(ext.name, ext.config.logger);
    */

    /* nce-mongoose-store
    var store = nce.getExtension("mongoose-store");
    var schema = store.createSchema({});
    schema.methods.xy = function(){};
    schema.statics.xy = function(cb){cb();};
    ext.model = store.createModel(schema);
    */
  });

  ext.on("uninstall", function(event){ // undo installation
    //# Undeclare:
    /* nce-winston
    nce.getExtension("winston").removeLogger(ext.name);
    */
  });

  ext.on("activate", function(event){ // don't set options, just run, make available in nce or register.
	  if(nce.requestMiddlewares.indexOf(router) === -1) {
		  nce.requestMiddlewares.push(router);
	  }
  });

  ext.on("deactivate", function(event){ // undo activation
	  if(nce.requestMiddlewares.indexOf(router) !== -1) {
		  nce.requestMiddlewares.splice(nce.requestMiddlewares.indexOf(router), 1);
	  }
  });

//# Private declarations:
  var router = function(req, res, next){
    var backend = nce.getExtension("backend");
    if(req.url.substr(0, backend.config.route.length+ext.config.subRoute.length) === backend.config.route+ext.config.subRoute) {
      try{throw new Error("Dummy extension");} catch(e){console.error(e)};
    }

    return next();
  };

//# Public declarations and exports:
  ext.dummy = function(opts, cb){
    // a dummy method here...
  }

  return ext;
}<|endoftext|>


<commit_before>function body_onload() {
  YESBtn.onclick = yes_onclick;
  // PARTIALLYBtn.onclick = partially_onclick;
  // NOBtn.onlick = no_onclick;
}

function yes_onclick() {
  console.log("clicked");
  document.getElementsByClassName("tickmark1").style.display="block";
}
<commit_msg>modify buttons on click<commit_after>function body_onload() {
  YESBtn.onclick = yes_onclick;
  // PARTIALLYBtn.onclick = partially_onclick;
  // NOBtn.onlick = no_onclick;
}

function yes_onclick() {
  console.log("clicked");
  // document.getElementsByClassName("tickmark1").style.display="block";
//  document.getElementById('YESBtn').style.backgroundColor = "green";
}
<|endoftext|>


<commit_before>var express = require('express'),
  router = express.Router(),
  mongoose = require('mongoose'),
  request = require('request');
  fs = require('fs');

var _ = require('lodash');
var Disciplina = require("./models/disciplina");

// pega a lista de disciplinas, horarios do site da matricula
module.exports.getDisciplinas = function (cb) {
		request.get("https://matricula.ufabc.edu.br/cache/todasDisciplinas.js", function (error, response, body) {
    try {
			data = JSON.parse(body.replace('todasDisciplinas=', '').replace(';', ''));
      data = JSON.parse(fs.readFileSync(__dirname + "/data/todasDisciplinas.js", "utf8")
        .replace('todasDisciplinas=', '')
        .replace(';', ''));
      var new_data = {}
      for(key in data) {
        new_data[data[key].id] = data[key];
      }
      cb(new_data);
		} catch (err) {
			//getDisciplinas();
		}
	});
}

// pega a contagem de creditos por disciplina
module.exports.getContagem = function (cb) {
		request.get("https://matricula.ufabc.edu.br/cache/contagemMatriculas.js", function (error, response, body) {
		try {
			data = JSON.parse(body.replace('contagemMatriculas=', '').replace(';', ''));
			data = JSON.parse(fs.readFileSync(__dirname + "/data/contagemMatriculas.js", "utf8")
        .replace('contagemMatriculas=', '')
        .replace(';', ''));
      cb(data);
		} catch (err) {
			//getContagem();
		}
	})
}

// pega as matriculas efetuadas por todos os alunos
module.exports.getMatriculas = function (cb) {
		request.get("https://matricula.ufabc.edu.br/cache/matriculas.js", function (error, response, body) {
		try {
			data = JSON.parse(body.replace('matriculas=', '').replace(';', ''));
			data = JSON.parse(fs.readFileSync(__dirname + "/data/matriculas.js", "utf8")
        .replace('matriculas=', '')
        .replace(';', ''));
      cb(data);
		} catch (err) {
			//getMatriculas();
		}
	})
}

// pega as matriculas efetuadas por todos os alunos
module.exports.getCortes = function (id, vagas, nomes, requisicoes, obg, codigo, cb) {
	fazCorte(id, function (body, criterio) {
		cb(vagas, nomes, requisicoes, id, obg, codigo, body, criterio);
	})
}

module.exports.cursos_ids = {
  'Bacharelado em Ciências da Computação' : 73,
  'Bacharelado em Ciência da Computação': 73,
  'Bacharelado em Ciência e Tecnologia': 76,
  'Bacharelado em Ciências Biológicas': 72,
  'Bacharelado em Ciências Econômicas': 60,
  'Bacharelado em Ciências e Humanidades': 78,
  'Bacharelado em Filosofia': 66,
  'Bacharelado em Física': 84,
  'Bacharelado em Matemática': 77,
  'Bacharelado em Neurociência' : 80,
  'Bacharelado em Planejamento Territorial': 67,
  'Bacharelado em Políticas Públicas': 58,
  'Bacharelado em Química': 70,
  'Bacharelado em Relações Internacionais': 83,
  'Engenharia Aeroespacial': 82,
  'Engenharia Ambiental e Urbana': 61,
  'Engenharia Biomédica': 74,
  'Engenharia de Energia': 62,
  'Engenharia de Gestão': 79,
  'Engenharia de Informação' : 64,
  'Engenharia de Instrumentação, Automação e Robótica': 57,
  'Engenharia de Materiais': 71,
  'Licenciatura em Ciências Biológicas': 69,
  'Licenciatura em Filosofia':  65,
  'Licenciatura em Física': 81,
  'Licenciatura em Matemática': 63,
  'Licenciatura em Química': 59
	}

module.exports.disciplinas_ideal = [
  'BCM0506-15', //COMUNICACAO E REDES
  'BCJ0203-15', // ELETROMAG
  'BIN0406-15', // IPE
  'BCN0405-15', // IEDO
  'BIR0004-15', //EPISTEMOLOGICAS
  'BHO0102-15', // DESENVOL. E SUSTE.
  'BHO0002-15', // PENSA. ECONOMICO
  'BHP0201-15', // TEMAS E PROBLE
  'BHO0101-15', // ESTADO E RELA
  'BIR0603-15', // CTS
  'BHQ0003-15', // INTEPRE. BRASIL
  'BHQ0001-15', // IDENT.E CULTURA
]

module.exports.fazCorte = fazCorte;

function fazCorte (disciplina_id, cb) {
  Disciplina.aggregate([{
    $match : {
      disciplina_id: disciplina_id
    }
  },{
    $unwind : "$alunos_matriculados"
  },{
   $lookup:
     {
       from: "alunos",
       localField: "alunos_matriculados",
       foreignField: "aluno_id",
       as: "alunos_matriculados"
     }
  },
  {
    $match: { "alunos_matriculados": { $ne: [] } }
  },{
    $unwind : "$alunos_matriculados"
  },{
    $unwind : "$alunos_matriculados.cursos"
  }, {
    $project: {
      turno: 1,
      ideal_quad: 1,
      aluno_id: "$alunos_matriculados.aluno_id",
      aluno : "$alunos_matriculados.cursos",
      obrigatorias: "$obrigatorias"
    }
  }], function (err, resp) {
    // se nao conseguir pegar o turno
    // eh pq nao tem conhecimento de nenhum cidado na turma
    try {
        var turno_disciplina = resp[0].turno;
        var ideal = resp[0].ideal_quad;
    } catch (err) {
      cb({pos: 1, total: 1});
      return;
    }
    // verifica se tem reserva de vaga
    var cleaned = resp.map(function (item) {
      _.pull(item.obrigatorias, 76, 78); // BCT e BCH
      var reserva = _.includes(item.obrigatorias, item.aluno.id_curso);
      if (!reserva) {
        item.aluno.ind_afinidade = 0;
      }
      return {  cr : item.aluno.cr,
                cp: item.aluno.cp,
                ik: item.aluno.ind_afinidade,
                reserva: reserva,
                turno: item.aluno.turno,
                curso: item.aluno.nome_curso,
                id: item.aluno_id}
    });
    // escolhe como vai filtrar por turno
    var sort_turno = 0;
    if (turno_disciplina == "diurno") {
      sort_turno = 'asc';
    } else if (turno_disciplina == "noturno") {
      sort_turno = 'desc';
    }

    var sort_type = ""
    var sort_second_type = ""
    if (ideal) {
      sort_type = 'cr';
      sort_second_type = 'cp';
    } else {
      sort_type = 'cp';
      sort_second_type = 'cr';
    }

    var test = _.orderBy(cleaned, ['reserva', 'turno', 'ik', sort_type, sort_second_type], ['desc', sort_turno, 'desc', 'desc', 'desc']);
    var sem_duplicados = _.uniqBy(test, 'id');
    cb(sem_duplicados, sort_type);
    }
  )
}

module.exports.todasDisciplinasById = function (todasDisciplinas) {
  var disciplinas = {};
  todasDisciplinas.forEach(function(disciplina){
    disciplinas[disciplina.id] = disciplina;
  })

  return disciplinas;
};

module.exports.matriculasByDisciplinas = function (matriculas) {
  var disciplinas = {};
  for (aluno_id in matriculas) {
    matriculas[aluno_id].forEach(function (disciplina_id) {
      (disciplinas[disciplina_id] = disciplinas[disciplina_id] || [])
        .push(aluno_id);
    })
  }
  return disciplinas;
};<commit_msg>Fix corte<commit_after>var express = require('express'),
  router = express.Router(),
  mongoose = require('mongoose'),
  request = require('request');
  fs = require('fs');

var _ = require('lodash');
var Disciplina = require("./models/disciplina");

// pega a lista de disciplinas, horarios do site da matricula
module.exports.getDisciplinas = function (cb) {
		request.get("https://matricula.ufabc.edu.br/cache/todasDisciplinas.js", function (error, response, body) {
    try {
			data = JSON.parse(body.replace('todasDisciplinas=', '').replace(';', ''));
      data = JSON.parse(fs.readFileSync(__dirname + "/data/todasDisciplinas.js", "utf8")
        .replace('todasDisciplinas=', '')
        .replace(';', ''));
      var new_data = {}
      for(key in data) {
        new_data[data[key].id] = data[key];
      }
      cb(new_data);
		} catch (err) {
			//getDisciplinas();
		}
	});
}

// pega a contagem de creditos por disciplina
module.exports.getContagem = function (cb) {
		request.get("https://matricula.ufabc.edu.br/cache/contagemMatriculas.js", function (error, response, body) {
		try {
			data = JSON.parse(body.replace('contagemMatriculas=', '').replace(';', ''));
			data = JSON.parse(fs.readFileSync(__dirname + "/data/contagemMatriculas.js", "utf8")
        .replace('contagemMatriculas=', '')
        .replace(';', ''));
      cb(data);
		} catch (err) {
			//getContagem();
		}
	})
}

// pega as matriculas efetuadas por todos os alunos
module.exports.getMatriculas = function (cb) {
		request.get("https://matricula.ufabc.edu.br/cache/matriculas.js", function (error, response, body) {
		try {
			data = JSON.parse(body.replace('matriculas=', '').replace(';', ''));
			data = JSON.parse(fs.readFileSync(__dirname + "/data/matriculas.js", "utf8")
        .replace('matriculas=', '')
        .replace(';', ''));
      cb(data);
		} catch (err) {
			//getMatriculas();
		}
	})
}

// pega as matriculas efetuadas por todos os alunos
module.exports.getCortes = function (id, vagas, nomes, requisicoes, obg, codigo, cb) {
	fazCorte(id, function (body, criterio) {
		cb(vagas, nomes, requisicoes, id, obg, codigo, body, criterio);
	})
}

module.exports.cursos_ids = {
  'Bacharelado em Ciências da Computação' : 73,
  'Bacharelado em Ciência da Computação': 73,
  'Bacharelado em Ciência e Tecnologia': 76,
  'Bacharelado em Ciências Biológicas': 72,
  'Bacharelado em Ciências Econômicas': 60,
  'Bacharelado em Ciências e Humanidades': 78,
  'Bacharelado em Filosofia': 66,
  'Bacharelado em Física': 84,
  'Bacharelado em Matemática': 77,
  'Bacharelado em Neurociência' : 80,
  'Bacharelado em Planejamento Territorial': 67,
  'Bacharelado em Políticas Públicas': 58,
  'Bacharelado em Química': 70,
  'Bacharelado em Relações Internacionais': 83,
  'Engenharia Aeroespacial': 82,
  'Engenharia Ambiental e Urbana': 61,
  'Engenharia Biomédica': 74,
  'Engenharia de Energia': 62,
  'Engenharia de Gestão': 79,
  'Engenharia de Informação' : 64,
  'Engenharia de Instrumentação, Automação e Robótica': 57,
  'Engenharia de Materiais': 71,
  'Licenciatura em Ciências Biológicas': 69,
  'Licenciatura em Filosofia':  65,
  'Licenciatura em Física': 81,
  'Licenciatura em Matemática': 63,
  'Licenciatura em Química': 59
	}

module.exports.disciplinas_ideal = [
  'BCM0506-15', //COMUNICACAO E REDES
  'BCJ0203-15', // ELETROMAG
  'BIN0406-15', // IPE
  'BCN0405-15', // IEDO
  'BIR0004-15', //EPISTEMOLOGICAS
  'BHO0102-15', // DESENVOL. E SUSTE.
  'BHO0002-15', // PENSA. ECONOMICO
  'BHP0201-15', // TEMAS E PROBLE
  'BHO0101-15', // ESTADO E RELA
  'BIR0603-15', // CTS
  'BHQ0003-15', // INTEPRE. BRASIL
  'BHQ0001-15', // IDENT.E CULTURA
]

module.exports.fazCorte = fazCorte;

function fazCorte (disciplina_id, cb) {
  Disciplina.aggregate([{
    $match : {
      disciplina_id: disciplina_id
    }
  },{
    $unwind : "$alunos_matriculados"
  },{
   $lookup:
     {
       from: "alunos",
       localField: "alunos_matriculados",
       foreignField: "aluno_id",
       as: "alunos_matriculados"
     }
  },
  {
    $match: { "alunos_matriculados": { $ne: [] } }
  },{
    $unwind : "$alunos_matriculados"
  },{
    $unwind : "$alunos_matriculados.cursos"
  }, {
    $project: {
      turno: 1,
      ideal_quad: 1,
      aluno_id: "$alunos_matriculados.aluno_id",
      aluno : "$alunos_matriculados.cursos",
      obrigatorias: "$obrigatorias"
    }
  }], function (err, resp) {
    // se nao conseguir pegar o turno
    // eh pq nao tem conhecimento de nenhum cidado na turma
    try {
        var turno_disciplina = resp[0].turno;
        var ideal = resp[0].ideal_quad;
    } catch (err) {
      cb({pos: 1, total: 1});
      return;
    }
    // verifica se tem reserva de vaga
    var cleaned = resp.map(function (item) {
      _.pull(item.obrigatorias, 20, 22); // BCT e BCH
      var reserva = _.includes(item.obrigatorias, item.aluno.id_curso);
      if (!reserva) {
        item.aluno.ind_afinidade = 0;
      }
      return {  cr : item.aluno.cr,
                cp: item.aluno.cp,
                ik: item.aluno.ind_afinidade,
                reserva: reserva,
                turno: item.aluno.turno,
                curso: item.aluno.nome_curso,
                id: item.aluno_id}
    });
    // escolhe como vai filtrar por turno
    var sort_turno = 0;
    if (turno_disciplina == "diurno") {
      sort_turno = 'asc';
    } else if (turno_disciplina == "noturno") {
      sort_turno = 'desc';
    }

    var sort_type = ""
    var sort_second_type = ""
    if (ideal) {
      sort_type = 'cr';
      sort_second_type = 'cp';
    } else {
      sort_type = 'cp';
      sort_second_type = 'cr';
    }

    var test = _.orderBy(cleaned, ['reserva', 'turno', 'ik', sort_type, sort_second_type], ['desc', sort_turno, 'desc', 'desc', 'desc']);
    var sem_duplicados = _.uniqBy(test, 'id');
    cb(sem_duplicados, sort_type);
    }
  )
}

module.exports.todasDisciplinasById = function (todasDisciplinas) {
  var disciplinas = {};
  todasDisciplinas.forEach(function(disciplina){
    disciplinas[disciplina.id] = disciplina;
  })

  return disciplinas;
};

module.exports.matriculasByDisciplinas = function (matriculas) {
  var disciplinas = {};
  for (aluno_id in matriculas) {
    matriculas[aluno_id].forEach(function (disciplina_id) {
      (disciplinas[disciplina_id] = disciplinas[disciplina_id] || [])
        .push(aluno_id);
    })
  }
  return disciplinas;
};<|endoftext|>


<commit_before>import React, {Component} from 'react';
import { Row, Col } from 'antd';

import SignIn from './SignIn';
import Home from './Home';

import './App.css';

class App extends Component {
  constructor(props) {
    super(props);
    this.state = {
      user: null
    };
  }

  handleAuthChange = (user) => {
    this.setState({
      user: user,
    });
  }

  render() {
    return (

        <Row
          type="flex"
          justify="space-between"
          className="navbar"
          align="middle"
          >
          <Col className="Logo">Football Picks</Col>
          <Col><SignIn handleAuthChange={this.handleAuthChange} /></Col>
        </Row>
        <Home currentSeason="2016" currentWeek="1" signedInUser={this.state.user} />

    );
  }
}

export default App;
<commit_msg>fix current season<commit_after>import React, {Component} from 'react';
import { Row, Col } from 'antd';

import SignIn from './SignIn';
import Home from './Home';

import './App.css';

class App extends Component {
  constructor(props) {
    super(props);
    this.state = {
      user: null
    };
  }

  handleAuthChange = (user) => {
    this.setState({
      user: user,
    });
  }

  render() {
    return (

        <Row
          type="flex"
          justify="space-between"
          className="navbar"
          align="middle"
          >
          <Col className="Logo">Football Picks</Col>
          <Col><SignIn handleAuthChange={this.handleAuthChange} /></Col>
        </Row>
        <Home currentSeason="2018" currentWeek="1" signedInUser={this.state.user} />

    );
  }
}

export default App;
<|endoftext|>


<commit_before>/**
 * Inherit in mixin mode, the reciever will inherit own properties from the supplier, but the prototype
 * chain will be not involved, so the reciever will not be the instance of supplier's constructor.
 *
 * Example:
 *     function Animal (name) {
 *         this.name = name;
 *     }
 *     Animal.prototype.sayName = function () {
 *         console.log(this.name);
 *     }
 *     function Dog () {
 *         // use super constructor to initailize properties if it is necessary.
 *         Animal.call(this, 'dog');
 *     }
 *     mixin(Dog.prototype, Animal.prototype, true);
 *     Dog.prototype.constructor = Dog; // it is necessary when entire flag is true.
 *
 *     var dog = new Dog();
 *     dog.sayName(); // 'dog'
 *     console.log(dog instanceof Animal) // false;
 *
 * @param {object} reciever - The object which recieve the properties from supplier.
 * @param {object} supplier - The object which supply own properties to the reciever.
 * @param {boolean} entire - Only enumarable properties will be supplied if this flag is set to falsy.
 */
exports.mixin = function (reciever, supplier, entire) {
    // return enumarable properties or not
	var iterator = entire ? Object.getOwnPropertyNames : Object.keys;
    // check es5
    if (Object.getOwnPropertyDescriptor) {
        iterator.call(null, supplier).forEach(function (key) {
            var descriptor = Object.getOwnPropertyDescriptor(supplier, key);
            Object.defineProperty(reciever, key, descriptor);
        });
    }
    // compatibility for es3, use shadow copy
    else {
        for (var key in supplier) if (supplier.hasOwnProperty(key)) {
            reciever[key] = supplier[key];
        }
    }
};

/**
 * Inherit in pseudo-class mode, the prototype chain will be involved and the instance of child will be an
 * instance of parent just like class inheritance.
 *
 * Example:
 *     function Animal (name) {
 *         this.name = name;
 *     }
 *     Animal.prototype.sayName = function () {
 *         console.log(this.name);
 *     }
 *     function Dog () {
 *         // use super constructor to initailize properties if it is necessary.
 *         Animal.call(this, 'dog');
 *     }
 *     inherit(Dog, Animal);
 *
 *     var dog = new Dog();
 *     dog.sayName(); // 'dog'
 *     console.log(dog instanceof Animal) // true;
 *
 * @param {Function} child - The child function whose prototype will inherit from the parent's prototype.
 * @param {Function} parent - The parent function whose prototype will be inherited.
 */
exports.inherit = function (Ctor, Parent) {
    // check es5
    if(Object.create) {
        Ctor.prototype = Object.create(Parent.prototype, {
            constructor: {
                enumerable: false,
                writable: true,
                configurable: true,
                value: Ctor
            }
        });
    }
    // compatibility for es3
    else {
        Ctor.prototype = new Parent();
        Ctor.prototype.constructor = Ctor;
    }

    return Ctor;
};<commit_msg>fix comment<commit_after>/**
 * Inherit in mixin mode, the reciever will inherit own properties from the supplier, but the prototype
 * chain will be not involved, so the reciever will not be the instance of supplier's constructor.
 *
 * Example:
 *     function Animal (name) {
 *         this.name = name;
 *     }
 *     Animal.prototype.sayName = function () {
 *         console.log(this.name);
 *     }
 *     function Dog () {
 *         // use super constructor to initailize properties if it is necessary.
 *         Animal.call(this, 'dog');
 *     }
 *     mixin(Dog.prototype, Animal.prototype, true);
 *     Dog.prototype.constructor = Dog; // it is necessary when entire flag is true.
 *
 *     var dog = new Dog();
 *     dog.sayName(); // 'dog'
 *     console.log(dog instanceof Animal) // false;
 *
 * @param {object} reciever - The object which recieve the properties from supplier.
 * @param {object} supplier - The object which supply own properties to the reciever.
 * @param {boolean} entire - Only enumarable properties will be supplied if this flag is set to falsy.
 */
exports.mixin = function (reciever, supplier, entire) {
    // return enumarable properties or not
	var iterator = entire ? Object.getOwnPropertyNames : Object.keys;
    // check es5
    if (Object.getOwnPropertyDescriptor) {
        iterator.call(null, supplier).forEach(function (key) {
            var descriptor = Object.getOwnPropertyDescriptor(supplier, key);
            Object.defineProperty(reciever, key, descriptor);
        });
    }
    // compatibility for es3, use shadow copy
    else {
        for (var key in supplier) if (supplier.hasOwnProperty(key)) {
            reciever[key] = supplier[key];
        }
    }
};

/**
 * Inherit in pseudo-class mode, the prototype chain will be involved and the instance of child will be an
 * instance of parent just like class inheritance.
 *
 * Example:
 *     function Animal (name) {
 *         this.name = name;
 *     }
 *     Animal.prototype.sayName = function () {
 *         console.log(this.name);
 *     }
 *     function Dog () {
 *         // use super constructor to initailize properties if it is necessary.
 *         Animal.call(this, 'dog');
 *     }
 *     inherit(Dog, Animal);
 *
 *     var dog = new Dog();
 *     dog.sayName(); // 'dog'
 *     console.log(dog instanceof Animal) // true;
 *
 * @param {Function} Ctor - The child function whose prototype will inherit from the parent's prototype.
 * @param {Function} Parent - The parent function whose prototype will be inherited.
 */
exports.inherit = function (Ctor, Parent) {
    // check es5
    if(Object.create) {
        Ctor.prototype = Object.create(Parent.prototype, {
            constructor: {
                enumerable: false,
                writable: true,
                configurable: true,
                value: Ctor
            }
        });
    }
    // compatibility for es3
    else {
        Ctor.prototype = new Parent();
        Ctor.prototype.constructor = Ctor;
    }

    return Ctor;
};<|endoftext|>


<commit_before>function startViews(cubes) {

  this.cubes = cubes;

  getCubes = function() {
    return this.cubes
  }

  var xy = document.getElementById("view_xy");
  if (xy && xy.getContext) {
    ctxy = xy.getContext("2d");
  }

  var xz = document.getElementById("view_xz");
  if (xz && xz.getContext) {
    ctxz = xz.getContext("2d");
    // aqui vai o loop
  }

  var zy = document.getElementById("view_zy");
  if (zy && zy.getContext) {
    ctzy = zy.getContext("2d");
    //aqui vai o loop
  }

  var view = document.getElementById("view");
  if (view && view.getContext) {
    ctview = view.getContext("2d");
    //aqui vai o loop
  }

  //definir as cores da view
  ctxy.fillStyle = "rgb(240,240,240)";
  ctxy.fillRect(0,0,580,367);
  ctxy.strokeStyle = "rgb(0, 0, 0)";

  drawXY = function() {
    var cubes = getCubes().getCubes();
    for (var x = 0; x < cubes.length; x++) {
      var cube = cubes[x];
      for (var i = 0; i < 6; i++) {
        var f = cube.faces[i];
        ctxy.beginPath();
        ctxy.moveTo(cube.vertices[[f[0]]].x, cube.vertices[[f[0]]].y);
        ctxy.lineTo(cube.vertices[[f[1]]].x, cube.vertices[[f[1]]].y);
        ctxy.lineTo(cube.vertices[[f[2]]].x, cube.vertices[[f[2]]].y);
        ctxy.lineTo(cube.vertices[[f[3]]].x, cube.vertices[[f[3]]].y);
        ctxy.closePath();
        ctxy.stroke();
      }
    }
  }

  drawXZ = function () {

  }

  drawZX = function () {

  }

  drawView = function () {

  }

  function drawCube() {
    drawXY();
    drawXZ();
    drawZX();
    drawView();
  }

  //Adiciona a função click apenas no canvas, xy retorna 1
  xy.addEventListener('click', function(event) {
    cubes = getCubes();
    var cube = new Cube();
    cube.createCube(event.x, event.y, 0);
    cubes.addCube(cube);
    console.log(cubes);
    drawCube();
  });

  xz.addEventListener('click', function(event) {
    cubes = getCubes();
    var cube = new Cube();
    cube.createCube(event.x, 0, event.y);
    cubes.addCube(cube);
    console.log(cubes);
    drawCube();
  });

  //Adiciona a função click apenas no canvas, xz retorna 2

  //definir as cores da view
  ctxz.fillStyle = "rgb(240,240,240)";
  ctxz.fillRect(0,0,580,367);

  //Adiciona a função click apenas no canvas, yz retorna 3
  zy.addEventListener('click', function(event) {
    alert("sou um ZY");

  });

  //definir as cores da view
  ctzy.fillStyle = "rgb(240,240,240)";
  ctzy.fillRect(0,0,580,367);

  //Adiciona a função click apenas no canvas, pers retorna 4
  view.addEventListener('click', function(event) {
    alert("sou uma View");

  });

  //definir as cores da view
  ctview.fillStyle = "rgb(240,240,240)";
  ctview.fillRect(0,0,580,367);

}
<commit_msg>Fixed axis problem<commit_after>function startViews(cubes) {

  this.cubes = cubes;

  getCubes = function() {
    return this.cubes
  }

  var xy = document.getElementById("view_xy");
  if (xy && xy.getContext) {
    ctxy = xy.getContext("2d");
  }

  var xz = document.getElementById("view_xz");
  if (xz && xz.getContext) {
    ctxz = xz.getContext("2d");
    // aqui vai o loop
  }

  var zy = document.getElementById("view_zy");
  if (zy && zy.getContext) {
    ctzy = zy.getContext("2d");
    //aqui vai o loop
  }

  var view = document.getElementById("view");
  if (view && view.getContext) {
    ctview = view.getContext("2d");
    //aqui vai o loop
  }

  //definir as cores da view
  ctxy.fillStyle = "rgb(240,240,240)";
  ctxy.fillRect(0,0,580,367);
  ctxy.strokeStyle = "rgb(0, 0, 0)";

  drawXY = function() {
    var cubes = getCubes().getCubes();
    for (var x = 0; x < cubes.length; x++) {
      var cube = cubes[x];
      for (var i = 0; i < 6; i++) {
        var f = cube.faces[i];
        ctxy.beginPath();
        ctxy.moveTo(cube.vertices[[f[0]]].x, cube.vertices[[f[0]]].y);
        ctxy.lineTo(cube.vertices[[f[1]]].x, cube.vertices[[f[1]]].y);
        ctxy.lineTo(cube.vertices[[f[2]]].x, cube.vertices[[f[2]]].y);
        ctxy.lineTo(cube.vertices[[f[3]]].x, cube.vertices[[f[3]]].y);
        ctxy.closePath();
        ctxy.stroke();
      }
    }
  }

  drawXZ = function () {
    var cubes = getCubes().getCubes();
    for (var x = 0; x < cubes.length; x++) {
      var cube = cubes[x];
      for (var i = 0; i < 6; i++) {
        var f = cube.faces[i];
        ctxz.beginPath();
        ctxz.moveTo(cube.vertices[[f[0]]].x, cube.vertices[[f[0]]].z);
        ctxz.lineTo(cube.vertices[[f[1]]].x, cube.vertices[[f[1]]].z);
        ctxz.lineTo(cube.vertices[[f[2]]].x, cube.vertices[[f[2]]].z);
        ctxz.lineTo(cube.vertices[[f[3]]].x, cube.vertices[[f[3]]].z);
        ctxz.closePath();
        ctxz.stroke();
      }
    }
  }

  drawZY = function () {
    var cubes = getCubes().getCubes();
    for (var x = 0; x < cubes.length; x++) {
      var cube = cubes[x];
      for (var i = 0; i < 6; i++) {
        var f = cube.faces[i];
        ctzy.beginPath();
        ctzy.moveTo(cube.vertices[[f[0]]].y, cube.vertices[[f[0]]].z);
        ctzy.lineTo(cube.vertices[[f[1]]].y, cube.vertices[[f[1]]].z);
        ctzy.lineTo(cube.vertices[[f[2]]].y, cube.vertices[[f[2]]].z);
        ctzy.lineTo(cube.vertices[[f[3]]].y, cube.vertices[[f[3]]].z);
        ctzy.closePath();
        ctzy.stroke();
      }
    }
  }

  drawView = function () {

  }

  function drawCube() {
    drawXY();
    drawXZ();
    drawZY();
    drawView();
  }

  //Adiciona a função click apenas no canvas, xy retorna 1
  xy.addEventListener('click', function(event) {
    cubes = getCubes();
    var cube = new Cube();
    cube.createCube(event.x, event.y, 0);
    cubes.addCube(cube);
    console.log(cubes);
    drawCube();
  });

  xz.addEventListener('click', function(event) {
    cubes = getCubes();
    var cube = new Cube();
    var rect = xz.getBoundingClientRect();
    cube.createCube(event.x - rect.left, 0, event.y - rect.top);
    cubes.addCube(cube);
    console.log(cubes);
    drawCube();
  });

  zy.addEventListener('click', function(event) {
    cubes = getCubes();
    var cube = new Cube();
    var rect = xz.getBoundingClientRect();
    cube.createCube(0, event.x - rect.left, event.y - rect.top);
    cubes.addCube(cube);
    console.log(cubes);
    drawCube();
  });

  //Adiciona a função click apenas no canvas, xz retorna 2

  //definir as cores da view
  ctxz.fillStyle = "rgb(240,240,240)";
  ctxz.fillRect(0,0,580,367);

  //definir as cores da view
  ctzy.fillStyle = "rgb(240,240,240)";
  ctzy.fillRect(0,0,580,367);

  //Adiciona a função click apenas no canvas, pers retorna 4
  view.addEventListener('click', function(event) {
    alert("sou uma View");

  });

  //definir as cores da view
  ctview.fillStyle = "rgb(240,240,240)";
  ctview.fillRect(0,0,580,367);

}
<|endoftext|>


<commit_before>import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    modalIsOpen: false,
    mobileMenuIsOpen: false
  },
  mutations: {
    toggleModal: function (state) {
      state.modalIsOpen = !state.modalIsOpen
    },
    toggleMobileMenu: function (state) {
      state.mobileMenuIsOpen = !state.mobileMenuIsOpen
    }
  },
  actions: {
    openModal: function ({ commit }) {
      commit('toggleModal')
    },
    closeModal: function ({ commit }) {
      commit('toggleModal')
    },
    openMobileMenu: function ({ commit }) {
      commit('toggleMobileMenu')
    },
    closeMobileMenu: function ({ commit }) {
      commit('toggleMobileMenu')
    }
  }
})
<commit_msg>added force modal and menu exit actions<commit_after>import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    modalIsOpen: false,
    mobileMenuIsOpen: false
  },
  mutations: {
    toggleModal: function (state) {
      state.modalIsOpen = !state.modalIsOpen
    },
    toggleMobileMenu: function (state) {
      state.mobileMenuIsOpen = !state.mobileMenuIsOpen
    },
    exitModal: function (state) {
      state.modalIsOpen = false
    },
    exitMobileMenu: function (state) {
      state.mobileMenuIsOpen = false
    }
  },
  actions: {
    openModal: function ({ commit }) {
      commit('toggleModal')
    },
    closeModal: function ({ commit }) {
      commit('toggleModal')
    },
    forceModalExit: function ({ commit }) {
      commit('exitModal')
    },
    openMobileMenu: function ({ commit }) {
      commit('toggleMobileMenu')
    },
    closeMobileMenu: function ({ commit }) {
      commit('toggleMobileMenu')
    },
    forceMobileMenuExit: function ({ commit }) {
      commit('exitMobileMenu')
    }
  }
})
<|endoftext|>


<commit_before>const fs = require('fs');

// 11ty Files
const filters = require('./site/_11ty/filters.js');
const shortcodes = require('./site/_11ty/shortcodes.js');
const collections = require('./site/_11ty/collections.js');
const transforms = require('./site/_11ty/transforms.js');

// Markdown Plugins
const markdownIt = require('markdown-it');
const markdownItAnchor = require('markdown-it-anchor');
const markdownItCollapsible = require('markdown-it-collapsible');
const markdownItFootnote = require('markdown-it-footnote');
const markdownItImageSize = require('markdown-it-imsize');
const markdownItToc = require('markdown-it-toc-done-right');
const markdownItVideo = require('markdown-it-video');

// 11ty Plugins
const pluginReadingTime = require('eleventy-plugin-reading-time');
const pluginRss = require('@11ty/eleventy-plugin-rss');

module.exports = function (eleventyConfig) {

  /**
   * Add Collections
   * @link https://www.11ty.dev/docs/collections/
   */
  Object.keys(collections).forEach(collectionName => {
    eleventyConfig.addCollection(collectionName, collections[collectionName])
  });

  /**
   * Add Filters
   * @link https://www.11ty.io/docs/filters/
   */
  Object.keys(filters).forEach(filterName => {
    eleventyConfig.addFilter(filterName, filters[filterName])
  });

  /**
   * Add Shortcodes
   * @link https://www.11ty.io/docs/shortcodes/
   */
  Object.keys(shortcodes).forEach(shortcodeName => {
    eleventyConfig.addShortcode(shortcodeName, shortcodes[shortcodeName])
  });

  /**
   * Add Transforms
   * @link https://www.11ty.io/docs/config/#transforms
   */
  Object.keys(transforms).forEach(transformName => {
    eleventyConfig.addTransform(transformName, transforms[transformName])
  });

  /**
   * Add plugins
   * @link https://www.11ty.dev/docs/plugins/
   */
  eleventyConfig.addPlugin(pluginReadingTime);
  eleventyConfig.addPlugin(pluginRss);

  /**
   * Set custom markdown library instance
   * @link https://www.11ty.dev/docs/languages/liquid/#optional-set-your-own-library-instance
   */
  eleventyConfig.setLibrary('md',
      markdownIt({
        html: true,
        breaks: true,
        typographer: true
      }).use(markdownItAnchor, {
        permalink: true,
        permalinkSymbol: '#',
        permalinkClass: 'bookmark',
        permalinkBefore: false,
        level: 2
      }).use(markdownItCollapsible
       ).use(markdownItImageSize, {
        autofill: true
      }).use(markdownItToc, {
        containerClass: 'md-toc',
        containerId: 'md-toc',
        level: 2
      }).use(markdownItVideo, {
        youtube: { width: 640, height: 390 },
        vimeo: { width: 500, height: 281 },
        vine: { width: 600, height: 600, embed: 'simple' },
        prezi: { width: 550, height: 400 }
      }).use(markdownItFootnote)
  );

  /**
   * Passthrough file copy
   * @link https://www.11ty.io/docs/copy/
   */
  eleventyConfig.addPassthroughCopy('assets');
  eleventyConfig.addPassthroughCopy('images');
  eleventyConfig.addPassthroughCopy('files');
  eleventyConfig.addPassthroughCopy('_redirects');

  /**
   * Opts in to a full deep merge when combining the Data Cascade.
   * @link https://www.11ty.dev/docs/data-deep-merge/#data-deep-merge
   */
  eleventyConfig.setDataDeepMerge(true);

  /**
   * Override BrowserSync Server options
   * @link https://www.11ty.dev/docs/config/#override-browsersync-server-options
   */
  eleventyConfig.setBrowserSyncConfig({
    callbacks: {
      ready: function(err, browserSync) {
        const content_404 = fs.readFileSync('dist/404.html');
        browserSync.addMiddleware("*", (req, res) => {
          // Provides the 404 content without redirect.
          res.write(content_404);
          res.end();
        });
      },
    },
    ui: false,
    ghostMode: false
  });

  /**
   * Configuration
   * @link https://www.11ty.dev/docs/config/#configuration-options
   */
  return {
    dir: {
      input: 'site',
      data: '_data',
      includes: '_includes',
      layouts: '_layouts',
      output: 'dist' // publish directory
    },
    passthroughFileCopy: true,
    templateFormats : ['njk', 'md', 'html', '11ty.js'],
    htmlTemplateEngine : 'njk',
    markdownTemplateEngine : 'njk',
  };

};
<commit_msg>dev(watch): Add _11ty to watch targets<commit_after>const fs = require('fs');

// 11ty Files
const filters = require('./site/_11ty/filters.js');
const shortcodes = require('./site/_11ty/shortcodes.js');
const collections = require('./site/_11ty/collections.js');
const transforms = require('./site/_11ty/transforms.js');

// Markdown Plugins
const markdownIt = require('markdown-it');
const markdownItAnchor = require('markdown-it-anchor');
const markdownItCollapsible = require('markdown-it-collapsible');
const markdownItFootnote = require('markdown-it-footnote');
const markdownItImageSize = require('markdown-it-imsize');
const markdownItToc = require('markdown-it-toc-done-right');
const markdownItVideo = require('markdown-it-video');

// 11ty Plugins
const pluginReadingTime = require('eleventy-plugin-reading-time');
const pluginRss = require('@11ty/eleventy-plugin-rss');

module.exports = function (eleventyConfig) {

  eleventyConfig.addWatchTarget("./site/_11ty");

  /**
   * Add Collections
   * @link https://www.11ty.dev/docs/collections/
   */
  Object.keys(collections).forEach(collectionName => {
    eleventyConfig.addCollection(collectionName, collections[collectionName])
  });

  /**
   * Add Filters
   * @link https://www.11ty.io/docs/filters/
   */
  Object.keys(filters).forEach(filterName => {
    eleventyConfig.addFilter(filterName, filters[filterName])
  });

  /**
   * Add Shortcodes
   * @link https://www.11ty.io/docs/shortcodes/
   */
  Object.keys(shortcodes).forEach(shortcodeName => {
    eleventyConfig.addShortcode(shortcodeName, shortcodes[shortcodeName])
  });

  /**
   * Add Transforms
   * @link https://www.11ty.io/docs/config/#transforms
   */
  Object.keys(transforms).forEach(transformName => {
    eleventyConfig.addTransform(transformName, transforms[transformName])
  });

  /**
   * Add plugins
   * @link https://www.11ty.dev/docs/plugins/
   */
  eleventyConfig.addPlugin(pluginReadingTime);
  eleventyConfig.addPlugin(pluginRss);

  /**
   * Set custom markdown library instance
   * @link https://www.11ty.dev/docs/languages/liquid/#optional-set-your-own-library-instance
   */
  eleventyConfig.setLibrary('md',
      markdownIt({
        html: true,
        breaks: true,
        typographer: true
      }).use(markdownItAnchor, {
        permalink: true,
        permalinkSymbol: '#',
        permalinkClass: 'bookmark',
        permalinkBefore: false,
        level: 2
      }).use(markdownItCollapsible
       ).use(markdownItImageSize, {
        autofill: true
      }).use(markdownItToc, {
        containerClass: 'md-toc',
        containerId: 'md-toc',
        level: 2
      }).use(markdownItVideo, {
        youtube: { width: 640, height: 390 },
        vimeo: { width: 500, height: 281 },
        vine: { width: 600, height: 600, embed: 'simple' },
        prezi: { width: 550, height: 400 }
      }).use(markdownItFootnote)
  );

  /**
   * Passthrough file copy
   * @link https://www.11ty.io/docs/copy/
   */
  eleventyConfig.addPassthroughCopy('assets');
  eleventyConfig.addPassthroughCopy('images');
  eleventyConfig.addPassthroughCopy('files');
  eleventyConfig.addPassthroughCopy('_redirects');

  /**
   * Opts in to a full deep merge when combining the Data Cascade.
   * @link https://www.11ty.dev/docs/data-deep-merge/#data-deep-merge
   */
  eleventyConfig.setDataDeepMerge(true);

  /**
   * Override BrowserSync Server options
   * @link https://www.11ty.dev/docs/config/#override-browsersync-server-options
   */
  eleventyConfig.setBrowserSyncConfig({
    callbacks: {
      ready: function(err, browserSync) {
        const content_404 = fs.readFileSync('dist/404.html');
        browserSync.addMiddleware("*", (req, res) => {
          // Provides the 404 content without redirect.
          res.write(content_404);
          res.end();
        });
      },
    },
    ui: false,
    ghostMode: false
  });

  /**
   * Configuration
   * @link https://www.11ty.dev/docs/config/#configuration-options
   */
  return {
    dir: {
      input: 'site',
      data: '_data',
      includes: '_includes',
      layouts: '_layouts',
      output: 'dist' // publish directory
    },
    passthroughFileCopy: true,
    templateFormats : ['njk', 'md', 'html', '11ty.js'],
    htmlTemplateEngine : 'njk',
    markdownTemplateEngine : 'njk',
  };

};
<|endoftext|>


<commit_before>module.exports = {
  root: true,
  parserOptions: {
    parser: 'babel-eslint',
  },
  env: {
    browser: true,
    node: true,
  },
  extends: [
    'plugin:vue/essential',
    'plugin:vue/strongly-recommended',
    'standard',
  ],
  plugins: [
    'vue',
  ],
  rules: {
    'comma-dangle': ['error', 'always-multiline'],
    'semi': ['error', 'always'],
    'no-console': 'off',
    'no-new': 'off',
    'indent': ['error', 2],
    'vue/script-indent': ['error', 2, { baseIndent: 1, switchCase: 1 }],
    'vue/html-indent': ['error', 2, { attribute: 1, closeBracket: 0, baseIndent: 1 }],
    'vue/html-closing-bracket-newline': ['error', { 'singleline': 'never', multiline: 'always' }],
    'vue/html-quotes': ['error', 'double'],
    'vue/no-multi-spaces': ['error', { ignoreProperties: true }],
    'vue/v-bind-style': ['error', 'shorthand'],
    'vue/component-name-in-template-casing': ['error', 'kebab-case'],
    'vue/html-self-closing': ['error', { html: { 'void': 'never', 'normal': 'never', 'component': 'never' } }],
  },
  overrides: [
    {
      'files': ['*.vue'],
      'rules': {
        'indent': 'off',
      },
    },
  ],
};
<commit_msg>Cleanup the duplicated rules<commit_after>module.exports = {
  root: true,
  parserOptions: {
    parser: 'babel-eslint',
  },
  env: {
    browser: true,
    node: true,
  },
  extends: [
    'plugin:vue/essential',
    'plugin:vue/strongly-recommended',
    'standard',
  ],
  plugins: [
    'vue',
  ],
  rules: {
    'comma-dangle': ['error', 'always-multiline'],
    'semi': ['error', 'always'],
    'no-console': 'off',
    'no-new': 'off',
    'indent': ['error', 2],
    'vue/script-indent': ['error', 2, { baseIndent: 1, switchCase: 1 }],
    'vue/html-indent': ['error', 2, { attribute: 1, closeBracket: 0, baseIndent: 1 }],
    'vue/html-closing-bracket-newline': ['error', { 'singleline': 'never', multiline: 'always' }],
    'vue/component-name-in-template-casing': ['error', 'kebab-case'],
    'vue/html-self-closing': ['error', { html: { 'void': 'never', 'normal': 'never', 'component': 'never' } }],
  },
  overrides: [
    {
      'files': ['*.vue'],
      'rules': {
        'indent': 'off',
      },
    },
  ],
};
<|endoftext|>


<commit_before>module.exports = {
  extends: 'google'
};
<commit_msg>configure eslintrc.js for project-specific guidelines:<commit_after>(function() {
  'use strict';

  module.exports = {
    extends: 'google',
    env: {
      mocha: true
    },
    plugins: ['mocha'],
    rules: {
      'max-len': [2, 150, 2],
      'mocha/handle-done-callback': 2,
      'mocha/no-exclusive-tests': 2,
      'mocha/no-global-tests': 2
    }
  };
})();

<|endoftext|>


<commit_before>module.exports = {
  'extends': ['standard', 'plugin:ava/recommended'],
  'parserOptions': {
    'ecmaVersion': 2017,
    'sourceType': 'module',
    'ecmaFeatures': {
      'impliedStrict': true
    }
  },
  'env': {
    'node': false,
    'node-globals/env': true
  },
  'plugins': ['ava', 'import', 'node-globals', 'react', 'unicorn'],
  'rules': {
    'arrow-parens': ['error', 'as-needed'],
    'import/default': 'error',
    'import/export': 'error',
    'import/extensions': ['error', {'js': 'never', 'json': 'always'}],
    'import/first': 'error',
    'import/imports-first': 'error',
    'import/named': 'error',
    'import/namespace': 'error',
    'import/newline-after-import': 'error',
    'import/no-absolute-path': 'error',
    'import/no-duplicates': 'error',
    'import/no-dynamic-require': 'error',
    'import/no-extraneous-dependencies': ['error', {}],
    'import/no-mutable-exports': 'error',
    'import/no-named-default': 'error',
    'import/no-unresolved': ['error', {'commonjs': true}],
    'import/order': ['error', {'groups': ['builtin', 'external', 'internal', 'parent', 'sibling', 'index']}],
    'no-case-declarations': 'error',
    'no-duplicate-imports': 'off',
    'no-shadow': ['error', {'builtinGlobals': true, 'hoist': 'never'}],
    'no-var': 'error',
    'no-warning-comments': 'warn',
    'object-shorthand': 'error',
    'prefer-const': 'error',
    'promise/always-return': 'error',
    'promise/catch-or-return': 'error',
    'react/jsx-indent': ['error', 2],
    'react/jsx-indent-props': ['error', 2],
    'react/jsx-no-comment-textnodes': 'error',
    'react/jsx-no-duplicate-props': 'error',
    'react/jsx-no-target-blank': 'error',
    'react/jsx-no-undef': 'error',
    'react/jsx-uses-react': 'error',
    'react/jsx-uses-vars': 'error',
    'react/no-deprecated': 'error',
    'react/no-direct-mutation-state': 'error',
    'react/no-find-dom-node': 'error',
    'react/no-is-mounted': 'error',
    'react/no-unknown-property': 'error',
    'react/require-render-return': 'error',
    'react/void-dom-elements-no-children': 'error',
    'unicorn/catch-error-name': 'error',
    'unicorn/explicit-length-check': 'error',
    'unicorn/no-abusive-eslint-disable': 'error',
    'unicorn/no-array-instanceof': 'error',
    'unicorn/no-new-buffer': 'error',
    'unicorn/no-process-exit': 'error',
    'unicorn/number-literal-case': 'error',
    'unicorn/prefer-starts-ends-with': 'error',
    'unicorn/prefer-type-error': 'error',
    'unicorn/throw-new-error': 'error'
  }
}
<commit_msg>Enable max-len rule<commit_after>module.exports = {
  'extends': ['standard', 'plugin:ava/recommended'],
  'parserOptions': {
    'ecmaVersion': 2017,
    'sourceType': 'module',
    'ecmaFeatures': {
      'impliedStrict': true
    }
  },
  'env': {
    'node': false,
    'node-globals/env': true
  },
  'plugins': ['ava', 'import', 'node-globals', 'react', 'unicorn'],
  'rules': {
    'arrow-parens': ['error', 'as-needed'],
    'import/default': 'error',
    'import/export': 'error',
    'import/extensions': ['error', {'js': 'never', 'json': 'always'}],
    'import/first': 'error',
    'import/imports-first': 'error',
    'import/named': 'error',
    'import/namespace': 'error',
    'import/newline-after-import': 'error',
    'import/no-absolute-path': 'error',
    'import/no-duplicates': 'error',
    'import/no-dynamic-require': 'error',
    'import/no-extraneous-dependencies': ['error', {}],
    'import/no-mutable-exports': 'error',
    'import/no-named-default': 'error',
    'import/no-unresolved': ['error', {'commonjs': true}],
    'import/order': ['error', {'groups': ['builtin', 'external', 'internal', 'parent', 'sibling', 'index']}],
    'max-len': ['error', {'code': 130, 'tabWidth': 2, 'ignoreComments': true}],
    'no-case-declarations': 'error',
    'no-duplicate-imports': 'off',
    'no-shadow': ['error', {'builtinGlobals': true, 'hoist': 'never'}],
    'no-var': 'error',
    'no-warning-comments': 'warn',
    'object-shorthand': 'error',
    'prefer-const': 'error',
    'promise/always-return': 'error',
    'promise/catch-or-return': 'error',
    'react/jsx-indent': ['error', 2],
    'react/jsx-indent-props': ['error', 2],
    'react/jsx-no-comment-textnodes': 'error',
    'react/jsx-no-duplicate-props': 'error',
    'react/jsx-no-target-blank': 'error',
    'react/jsx-no-undef': 'error',
    'react/jsx-uses-react': 'error',
    'react/jsx-uses-vars': 'error',
    'react/no-deprecated': 'error',
    'react/no-direct-mutation-state': 'error',
    'react/no-find-dom-node': 'error',
    'react/no-is-mounted': 'error',
    'react/no-unknown-property': 'error',
    'react/require-render-return': 'error',
    'react/void-dom-elements-no-children': 'error',
    'unicorn/catch-error-name': 'error',
    'unicorn/explicit-length-check': 'error',
    'unicorn/no-abusive-eslint-disable': 'error',
    'unicorn/no-array-instanceof': 'error',
    'unicorn/no-new-buffer': 'error',
    'unicorn/no-process-exit': 'error',
    'unicorn/number-literal-case': 'error',
    'unicorn/prefer-starts-ends-with': 'error',
    'unicorn/prefer-type-error': 'error',
    'unicorn/throw-new-error': 'error'
  }
}
<|endoftext|>


<commit_before>/* global module */
module.exports = {
	root: true,

	// Based on the recommended rules
	extends: "eslint:recommended",

	// Default environments
	env: {
		es6: false,
		browser: true,
		jquery: true
	},

	// Globals
	globals: {
		// Libs
		"Handlebars": false,
		"luga": false
	},

	parserOptions: {
		ecmaFeatures: {
			// Enable let and const
			blockBindings: true
		}
	},

	plugins: ['ie11'],

	rules: {
		"camelcase": ["error"],
		"eqeqeq": ["error"],

		"indent": [
			"error",
			"tab",
			{"SwitchCase": 1}
		],

		"new-cap": ["warn"],

		"no-array-constructor": ["error"],
		"no-bitwise": ["error"],
		"no-console": ["warn"],
		"no-caller": ["error"],
		"no-extend-native": ["error"],
		"no-implicit-globals": ["error"],
		"no-multi-assign": ["error"],
		"no-new-func": ["error"],
		"no-new-object": ["error"],
		"no-new-wrappers": ["error"],
		"no-proto": ["error"],
		"no-return-assign": ["error", "always"],
		"no-sequences": ["error"],
		"no-shadow": ["warn"],
		"no-ternary": ["warn"],
		"no-undef": ["error"],
		"no-underscore-dangle": ["error"],
		"no-unused-vars": ["error", {"vars": "all", "args": "none", "ignoreRestSiblings": false}],
		"no-void": ["error"],
		"no-with": ["error"],

		"quotes": [
			"error",
			"double"
		],

		"semi": ["error"],

		// Strict at function level (at least)
		"strict": [
			"error",
			"function"
		],

		// New features, we se "const" always if not possible use "let"
		"prefer-const": ["warn"],

		// JSDoc
		"require-jsdoc": ["warn"],
		"valid-jsdoc": [
			"warn",
			{
				prefer: {
					// Use the right string instead of the left one
					"returns": "return",
					"arg": "param",
					"argument": "param",
					"class": "constructor",
					"virtual": "abstract"
				},
				preferType: {
					// Use the right string instead of the left one
					'object': 'Object',
					'boolean': 'Boolean',
					'number': 'Number',
					'string': 'String',
					'array': 'Array'
				},

				// If and only if the function or method has a return statement (this option value does apply to constructors)
				requireReturn: false,
				requireReturnType: true,
				requireParamDescription: false,
				requireReturnDescription: false
			}
		],

		// IE11 specific rules
		'ie11/no-for-in-const': ['error'], // Error in IE11
		'ie11/no-weak-collections': ['error'], // Error in IE11
		'ie11/no-collection-args': ['error']
	}
};<commit_msg>Updated ESLint config<commit_after>/* global module */
module.exports = {
	root: true,

	// Based on the recommended rules
	extends: "eslint:recommended",

	// Default environments
	env: {
		es6: false,
		browser: true,
		jquery: true
	},

	// Globals
	globals: {
		"luga": false
	},

	parserOptions: {
		ecmaFeatures: {
			// Enable let and const
			blockBindings: true
		}
	},

	plugins: ['ie11'],

	rules: {
		"camelcase": ["error"],
		"eqeqeq": ["error"],

		"indent": [
			"error",
			"tab",
			{"SwitchCase": 1}
		],

		"new-cap": ["warn"],

		"no-array-constructor": ["error"],
		"no-bitwise": ["error"],
		"no-console": ["warn"],
		"no-caller": ["error"],
		"no-extend-native": ["error"],
		"no-implicit-globals": ["error"],
		"no-multi-assign": ["error"],
		"no-new-func": ["error"],
		"no-new-object": ["error"],
		"no-new-wrappers": ["error"],
		"no-proto": ["error"],
		"no-return-assign": ["error", "always"],
		"no-sequences": ["error"],
		"no-shadow": ["warn"],
		"no-ternary": ["warn"],
		"no-undef": ["error"],
		"no-underscore-dangle": ["error"],
		"no-unused-vars": ["error", {"vars": "all", "args": "none", "ignoreRestSiblings": false}],
		"no-void": ["error"],
		"no-with": ["error"],

		"quotes": [
			"error",
			"double"
		],

		"semi": ["error"],

		// Strict at function level (at least)
		"strict": [
			"error",
			"function"
		],

		// New features, we se "const" always if not possible use "let"
		"prefer-const": ["warn"],

		// JSDoc
		"require-jsdoc": ["warn"],
		"valid-jsdoc": [
			"warn",
			{
				prefer: {
					// Use the right string instead of the left one
					"returns": "return",
					"arg": "param",
					"argument": "param",
					"class": "constructor",
					"virtual": "abstract"
				},
				preferType: {
					// Use the right string instead of the left one
					"object": "Object",
					"boolean": "Boolean",
					"number": "Number",
					"function": "Function",
					"string": "String",
					"array": "Array"
				},

				// If and only if the function or method has a return statement (this option value does apply to constructors)
				requireReturn: false,
				requireReturnType: true,
				requireParamDescription: false,
				requireReturnDescription: false
			}
		],

		// IE11 specific rules
		"ie11/no-for-in-const": ["error"], // Error in IE11
		"ie11/no-weak-collections": ["error"], // Error in IE11
		"ie11/no-collection-args": ["error"]
	}
};<|endoftext|>


<commit_before>'use strict';

module.exports = {
  env: {
    es6: true,
    node: true,
  },

  extends: 'eslint:recommended',

  // All of these globals rules apply only to certain files, so we might
  // move them into file-specific settings, although it's a pain.
  globals: {
    Components: false,
    document: false,
    dump: false,
    pref: false,
    window: false,
  },

  parserOptions: {
    ecmaVersion: 8,
  },

  rules: {
    'brace-style': ['error', 'stroustrup', { allowSingleLine: true }],
    'comma-dangle': ['error', 'always-multiline'],
    'indent': [ 'error', 2, { SwitchCase: 1 }],
    'linebreak-style': ['error', 'unix'],
    'no-console': 'off',
    'no-constant-condition': ['error', { checkLoops: false }],
    'no-empty': ['error', { allowEmptyCatch: true }],

    // Cc, Ci, Cr, and Cu are effectively default globals that we define
    // in many scripts as shorthands for properties of the Components global.
    // Their definition is boilerplate that we don't want to customize
    // for each script, so we ignore their nonuse via a varsIgnorePattern.
    //
    // Some of our function definitions are XPCOM interface implementations,
    // and they don't always use all the arguments defined by the interface,
    // but it's still useful to declare their parameters, to make the interface
    // specification more obvious, so we ignore their nonuse via args: none.
    //
    'no-unused-vars': ['error', { varsIgnorePattern: 'Cc|Ci|Cr|Cu', args: 'none' }],

    'quotes': ['error', 'single'],
    'quote-props': ['error', 'consistent-as-needed'],
    'semi': ['error', 'always', { omitLastInOneLineBlock: true }],
    'space-before-function-paren': ['error', 'never'],
  },
};
<commit_msg>enforce keyword spacing<commit_after>'use strict';

module.exports = {
  env: {
    es6: true,
    node: true,
  },

  extends: 'eslint:recommended',

  // All of these globals rules apply only to certain files, so we might
  // move them into file-specific settings, although it's a pain.
  globals: {
    Components: false,
    document: false,
    dump: false,
    pref: false,
    window: false,
  },

  parserOptions: {
    ecmaVersion: 8,
  },

  rules: {
    'brace-style': ['error', 'stroustrup', { allowSingleLine: true }],
    'comma-dangle': ['error', 'always-multiline'],
    'indent': [ 'error', 2, { SwitchCase: 1 }],
    'keyword-spacing': ['error'],
    'linebreak-style': ['error', 'unix'],
    'no-console': 'off',
    'no-constant-condition': ['error', { checkLoops: false }],
    'no-empty': ['error', { allowEmptyCatch: true }],

    // Cc, Ci, Cr, and Cu are effectively default globals that we define
    // in many scripts as shorthands for properties of the Components global.
    // Their definition is boilerplate that we don't want to customize
    // for each script, so we ignore their nonuse via a varsIgnorePattern.
    //
    // Some of our function definitions are XPCOM interface implementations,
    // and they don't always use all the arguments defined by the interface,
    // but it's still useful to declare their parameters, to make the interface
    // specification more obvious, so we ignore their nonuse via args: none.
    //
    'no-unused-vars': ['error', { varsIgnorePattern: 'Cc|Ci|Cr|Cu', args: 'none' }],

    'quotes': ['error', 'single'],
    'quote-props': ['error', 'consistent-as-needed'],
    'semi': ['error', 'always', { omitLastInOneLineBlock: true }],
    'space-before-function-paren': ['error', 'never'],
  },
};
<|endoftext|>


<commit_before>function substr (str, start, len) {
    // Returns part of a string
    //
    // version: 909.322
    // discuss at: http://phpjs.org/functions/substr
    // +     original by: Martijn Wieringa
    // +     bugfixed by: T.Wild
    // +      tweaked by: Onno Marsman
    // +      revised by: Theriault
    // *       example 1: substr('abcdef', 0, -1);
    // *       returns 1: 'abcde'
    // *       example 2: substr(2, 0, -6);
    // *       returns 2: false
    str += '';
    var end = str.length;
    if (start < 0) {
        start += end;
    }
    end = typeof len === 'undefined' ? end : (len < 0 ? len + end : len + start);
    // PHP returns false if start does not fall within the string.
    // PHP returns false if the calculated end comes before the calculated start.
    // PHP returns an empty string if start and end are the same.
    // Otherwise, PHP returns the portion of the string from start to end.
    return start >= str.length || start < 0 || start > end ? !1 : str.slice(start, end);
}<commit_msg>Adding back comments after Theriault code improvements (Please don't delete todo comments unless finished)<commit_after>function substr (str, start, len) {
    // Returns part of a string
    //
    // version: 909.322
    // discuss at: http://phpjs.org/functions/substr
    // +     original by: Martijn Wieringa
    // +     bugfixed by: T.Wild
    // +      tweaked by: Onno Marsman
    // +      revised by: Theriault
    // *       example 1: substr('abcdef', 0, -1);
    // *       returns 1: 'abcde'
    // *       example 2: substr(2, 0, -6);
    // *       returns 2: false

// Add: (?) Use unicode.semantics and/or unicode.runtime_encoding (e.g., with string wrapped in "binary" or "Binary" class) to
// allow access of binary (see file_get_contents()) by: charCodeAt(x) & 0xFF (see https://developer.mozilla.org/En/Using_XMLHttpRequest )
// Fix: Handle 4-byte characters

    str += '';
    var end = str.length;
    if (start < 0) {
        start += end;
    }
    end = typeof len === 'undefined' ? end : (len < 0 ? len + end : len + start);
    // PHP returns false if start does not fall within the string.
    // PHP returns false if the calculated end comes before the calculated start.
    // PHP returns an empty string if start and end are the same.
    // Otherwise, PHP returns the portion of the string from start to end.
    return start >= str.length || start < 0 || start > end ? !1 : str.slice(start, end);
}<|endoftext|>


<commit_before>module.exports = {
  extends: "eslint-config-standard",
  root: true,
  parser: "babel-eslint",
  parserOptions: {
    sourceType: "module",
    ecmaVersion: 8
  },
  ecmaFeatures: {
    jsx: true,
  },
  plugins: ['react'],
  rules: {
    "space-before-function-paren": ["error", "never"],
    "prefer-const": "warn",
    "comma-dangle": ["error", "only-multiline"],
    "space-infix-ops": "off",      // Until eslint #7489 lands
    "new-cap": "off",
    "no-unused-vars": ["error", { "varsIgnorePattern": "^_" }],
    "no-return-assign": "off",
    "no-unused-expressions": "off",
    "one-var": "off",
    "new-parens": "off",
    "indent": ["error", 2, {SwitchCase: 0}],
    "arrow-body-style": ["warn", "as-needed"],

    "no-unused-vars": "off",
    "react/jsx-uses-react": "error",
    "react/jsx-uses-vars": "error",
    "react/react-in-jsx-scope": "error",

    "import/first": "off",
    "operator-linebreak": "off",

    // This rule enforces a comma-first style, such as
    // npm uses. I think it's great, but it can look a bit weird,
    // so we're leaving it off for now (although stock Bones passes
    // the linter with it on). If you decide you want to enforce
    // this rule, change "off" to "error".
    "comma-style": ["off", "first", {
      exceptions: {
        ArrayExpression: true,
        ObjectExpression: true,
      }
    }],
  },
}
<commit_msg>fix: semicolons required<commit_after>module.exports = {
  extends: "eslint-config-standard",
  root: true,
  parser: "babel-eslint",
  parserOptions: {
    sourceType: "module",
    ecmaVersion: 8
  },
  ecmaFeatures: {
    jsx: true,
  },
  plugins: ['react'],
  rules: {
    "semi": [2, "always"],
    "space-before-function-paren": ["error", "never"],
    "prefer-const": "warn",
    "comma-dangle": ["error", "only-multiline"],
    "space-infix-ops": "off",      // Until eslint #7489 lands
    "new-cap": "off",
    "no-unused-vars": ["error", { "varsIgnorePattern": "^_" }],
    "no-return-assign": "off",
    "no-unused-expressions": "off",
    "one-var": "off",
    "new-parens": "off",
    "indent": ["error", 2, {SwitchCase: 0}],
    "arrow-body-style": ["warn", "as-needed"],

    "no-unused-vars": "off",
    "react/jsx-uses-react": "error",
    "react/jsx-uses-vars": "error",
    "react/react-in-jsx-scope": "error",

    "import/first": "off",
    "operator-linebreak": "off",

    // This rule enforces a comma-first style, such as
    // npm uses. I think it's great, but it can look a bit weird,
    // so we're leaving it off for now (although stock Bones passes
    // the linter with it on). If you decide you want to enforce
    // this rule, change "off" to "error".
    "comma-style": ["off", "first", {
      exceptions: {
        ArrayExpression: true,
        ObjectExpression: true,
      }
    }],
  },
}
<|endoftext|>


<commit_before>module.exports = {
  // So parent files don't get applied
  root: true,
  env: {
    es6: true,
    browser: true,
    node: true,
    mocha: true,
  },
  extends: ['airbnb', 'plugin:import/recommended'],
  parser: 'babel-eslint',
  parserOptions: {
    ecmaVersion: 7,
    sourceType: 'module',
  },
  plugins: ['babel', 'import', 'jsx-a11y', 'mocha', 'flowtype', 'material-ui', 'prettier'],
  settings: {
    'import/resolver': {
      webpack: {
        config: './docs/webpackBaseConfig.js',
      },
    },
  },
  rules: {
    'arrow-body-style': 'off', // Not our taste?
    'arrow-parens': 'off', // Incompatible with prettier
    indent: 'off', // Incompatible with prettier
    'space-before-function-paren': 'off', // Incompatible with prettier
    'no-mixed-operators': 'off', // Incompatible with prettier
    'consistent-this': ['error', 'self'],
    'max-len': [
      'error',
      100,
      2,
      {
        ignoreUrls: true,
      },
    ], // airbnb is allowing some edge cases
    'no-console': 'error', // airbnb is using warn
    'no-alert': 'error', // airbnb is using warn
    'no-param-reassign': 'off', // Not our taste?
    'no-prototype-builtins': 'off', // airbnb use error
    'object-curly-spacing': 'off', // use babel plugin rule
    'no-restricted-properties': 'off', // To remove once react-docgen support ** operator.
    'no-unused-vars': ['error', { vars: 'all', args: 'after-used', ignoreRestSiblings: false }], // airbnb use ignoreRestSiblings

    'babel/object-curly-spacing': ['error', 'always'],

    'import/unambiguous': 'off', // scripts
    'import/namespace': ['error', { allowComputed: true }],
    'import/no-extraneous-dependencies': 'off',

    'react/jsx-indent': 'off', // Incompatible with prettier
    'react/jsx-closing-bracket-location': 'off', // Incompatible with prettier
    'react/jsx-wrap-multilines': 'off', // Incompatible with prettier
    'react/jsx-indent-props': 'off', // Incompatible with prettier
    'react/jsx-handler-names': [
      'error',
      {
        // airbnb is disabling this rule
        eventHandlerPrefix: 'handle',
        eventHandlerPropPrefix: 'on',
      },
    ],
    'react/require-default-props': 'off', // airbnb use error
    'react/forbid-prop-types': 'off', // airbnb use error
    'react/jsx-filename-extension': ['error', { extensions: ['.js'] }], // airbnb is using .jsx
    'react/no-danger': 'error', // airbnb is using warn
    'react/no-direct-mutation-state': 'error', // airbnb is disabling this rule
    'react/no-find-dom-node': 'off', // I don't know
    'react/no-unused-prop-types': 'off', // Is still buggy
    'react/sort-prop-types': 'error', // airbnb do nothing here.
    'react/sort-comp': [
      2,
      {
        order: [
          'type-annotations',
          'static-methods',
          'props',
          'lifecycle',
          // '/^handle.+$/', // wishlist -- needs above first
          // '/^(get|set)(?!(InitialState$|DefaultProps$|ChildContext$)).+$/', // wishlist -- needs above first
          'everything-else',
          '/^render.+$/',
          'render',
        ],
      },
    ],

    'material-ui/docgen-ignore-before-comment': 'error',

    'mocha/handle-done-callback': 'error',
    'mocha/no-exclusive-tests': 'error',
    'mocha/no-global-tests': 'error',
    'mocha/no-pending-tests': 'error',
    'mocha/no-skipped-tests': 'error',

    'flowtype/require-valid-file-annotation': ['error', 'always'],
    'flowtype/require-parameter-type': 'off',
    'flowtype/require-return-type': 'off',
    'flowtype/space-after-type-colon': 'off',
    'flowtype/space-before-type-colon': 'off',
    'flowtype/type-id-match': 'off',
  },
};
<commit_msg>[eslint] enable resolution of built-in flow types<commit_after>module.exports = {
  // So parent files don't get applied
  root: true,
  env: {
    es6: true,
    browser: true,
    node: true,
    mocha: true,
  },
  extends: ['airbnb', 'plugin:import/recommended'],
  parser: 'babel-eslint',
  parserOptions: {
    ecmaVersion: 7,
    sourceType: 'module',
  },
  plugins: ['babel', 'import', 'jsx-a11y', 'mocha', 'flowtype', 'material-ui', 'prettier'],
  settings: {
    'import/resolver': {
      webpack: {
        config: './docs/webpackBaseConfig.js',
      },
    },
  },
  rules: {
    'arrow-body-style': 'off', // Not our taste?
    'arrow-parens': 'off', // Incompatible with prettier
    indent: 'off', // Incompatible with prettier
    'space-before-function-paren': 'off', // Incompatible with prettier
    'no-mixed-operators': 'off', // Incompatible with prettier
    'consistent-this': ['error', 'self'],
    'max-len': [
      'error',
      100,
      2,
      {
        ignoreUrls: true,
      },
    ], // airbnb is allowing some edge cases
    'no-console': 'error', // airbnb is using warn
    'no-alert': 'error', // airbnb is using warn
    'no-param-reassign': 'off', // Not our taste?
    'no-prototype-builtins': 'off', // airbnb use error
    'object-curly-spacing': 'off', // use babel plugin rule
    'no-restricted-properties': 'off', // To remove once react-docgen support ** operator.
    'no-unused-vars': ['error', { vars: 'all', args: 'after-used', ignoreRestSiblings: false }], // airbnb use ignoreRestSiblings

    'babel/object-curly-spacing': ['error', 'always'],

    'import/unambiguous': 'off', // scripts
    'import/namespace': ['error', { allowComputed: true }],
    'import/no-extraneous-dependencies': 'off',

    'react/jsx-indent': 'off', // Incompatible with prettier
    'react/jsx-closing-bracket-location': 'off', // Incompatible with prettier
    'react/jsx-wrap-multilines': 'off', // Incompatible with prettier
    'react/jsx-indent-props': 'off', // Incompatible with prettier
    'react/jsx-handler-names': [
      'error',
      {
        // airbnb is disabling this rule
        eventHandlerPrefix: 'handle',
        eventHandlerPropPrefix: 'on',
      },
    ],
    'react/require-default-props': 'off', // airbnb use error
    'react/forbid-prop-types': 'off', // airbnb use error
    'react/jsx-filename-extension': ['error', { extensions: ['.js'] }], // airbnb is using .jsx
    'react/no-danger': 'error', // airbnb is using warn
    'react/no-direct-mutation-state': 'error', // airbnb is disabling this rule
    'react/no-find-dom-node': 'off', // I don't know
    'react/no-unused-prop-types': 'off', // Is still buggy
    'react/sort-prop-types': 'error', // airbnb do nothing here.
    'react/sort-comp': [
      2,
      {
        order: [
          'type-annotations',
          'static-methods',
          'props',
          'lifecycle',
          // '/^handle.+$/', // wishlist -- needs above first
          // '/^(get|set)(?!(InitialState$|DefaultProps$|ChildContext$)).+$/', // wishlist -- needs above first
          'everything-else',
          '/^render.+$/',
          'render',
        ],
      },
    ],

    'material-ui/docgen-ignore-before-comment': 'error',

    'mocha/handle-done-callback': 'error',
    'mocha/no-exclusive-tests': 'error',
    'mocha/no-global-tests': 'error',
    'mocha/no-pending-tests': 'error',
    'mocha/no-skipped-tests': 'error',

    'flowtype/define-flow-type': 'error',
    'flowtype/require-valid-file-annotation': ['error', 'always'],
    'flowtype/require-parameter-type': 'off',
    'flowtype/require-return-type': 'off',
    'flowtype/space-after-type-colon': 'off',
    'flowtype/space-before-type-colon': 'off',
    'flowtype/type-id-match': 'off',
    'flowtype/use-flow-type': 'error',
  },
};
<|endoftext|>


<commit_before>module.exports = {
    "extends": [
        "airbnb",
    ],
    'parser': 'babel-eslint',
    'env': {
        'jest': true,
        "es6": true,
        "node": true,
    },
    'rules': {
        'no-use-before-define': 0,
        'no-console': [1, { allow: ["error", "info"] }],
        "indent": [2, 4, { "SwitchCase": 1 }],
        "class-methods-use-this": 0,
        'react/jsx-no-bind': [2, {
            'ignoreRefs': true,
            'allowBind': true,
        }],
        'react/prop-types': [2, { ignore: ['children'] }],
        "react/jsx-indent": [2, 4],
        "react/jsx-indent-props": [2, 4],
        "react/forbid-prop-types": 0,
        "react/jsx-filename-extension": 0,
        "react/prefer-stateless-function": 0,
        "react/require-extension": 0,
        "import/no-extraneous-dependencies": 0,
        "max-len": ["error", 125, 4,
            {
                "ignoreUrls": true,
                "ignoreComments": false,
                "ignoreStrings": true,
                "ignoreTemplateLiterals": true
            }
        ],
        "jsx-a11y/no-static-element-interactions": "off",
        "no-mixed-operators": "off",
        "no-plusplus": "off"
    }
};<commit_msg>remove react part<commit_after>module.exports = {
    "extends": [
        "airbnb",
    ],
    'parser': 'babel-eslint',
    'env': {
        'jest': true,
        "es6": true,
        "node": true,
    },
    'rules': {
        'no-use-before-define': 0,
        'no-console': [1, { allow: ["error", "info"] }],
        "indent": [2, 4, { "SwitchCase": 1 }],
        "class-methods-use-this": 0,
        "import/no-extraneous-dependencies": 0,
        "max-len": ["error", 125, 4,
            {
                "ignoreUrls": true,
                "ignoreComments": false,
                "ignoreStrings": true,
                "ignoreTemplateLiterals": true
            }
        ],
        "jsx-a11y/no-static-element-interactions": "off",
        "no-mixed-operators": "off",
        "no-plusplus": "off"
    }
};<|endoftext|>


<commit_before>const path = require('path');

module.exports = {
  "parser": "babel-eslint",
  "env": {
    "browser": true,
    "jest": true,
  },
  "settings": {
    "import/resolver": {
      node: {
        paths: [path.resolve(__dirname, './src')],
      },
    },
  },
  "rules": {
    "max-len": ["error", { "code": 180, "ignoreTemplateLiterals": true, "ignoreStrings": true }],
    "no-mixed-operators": ["error", {
      "allowSamePrecedence": true
    }],
    "no-shadow": 1,
    "import/named": ["error"],
    "jsx-a11y/anchor-is-valid": ["warn", {
      "components": ["Link"],
      "specialLink": ["to"],
    }],
    "react/no-array-index-key": 1,
    "react/require-default-props": 0,
    'import/no-extraneous-dependencies': [
      "error",
      {
        devDependencies: [
          '.storybook/**',
          'src/stories/**'
        ]
      }
    ],
    "react/sort-comp": [2],

  },
  "overrides": [
    {
      "files": ["./src/**/*.ts","./src/**/*.tsx"],
      "env": { "browser": true, "jest": true},
      "extends": [
        "airbnb",
        "plugin:@typescript-eslint/recommended",
      ],
      "parser": "@typescript-eslint/parser",
      "parserOptions": {
        "ecmaFeatures": { "jsx": true },
        "sourceType": "module",
        "project": "./tsconfig.json"
      },
      "plugins": ["react", "@typescript-eslint"],
      "rules": {
        "@typescript-eslint/consistent-type-definitions": ["error", "type"],
        "@typescript-eslint/no-inferrable-types": ["error", {"ignoreProperties": true, "ignoreParameters": false}],
        "@typescript-eslint/interface-name-prefix": ["error", { "prefixWithI": "never" }],
        'react/jsx-filename-extension': [1, { 'extensions': ['.ts', '.tsx'] }],
      },
    }
  ]
};
<commit_msg>Remove explicit function type linter. We should be relying on implicit types as much as possible<commit_after>const path = require('path');

module.exports = {
  "parser": "babel-eslint",
  "env": {
    "browser": true,
    "jest": true,
  },
  "settings": {
    "import/resolver": {
      node: {
        paths: [path.resolve(__dirname, './src')],
      },
    },
  },
  "rules": {
    "max-len": ["error", { "code": 180, "ignoreTemplateLiterals": true, "ignoreStrings": true }],
    "no-mixed-operators": ["error", {
      "allowSamePrecedence": true
    }],
    "no-shadow": 1,
    "import/named": ["error"],
    "jsx-a11y/anchor-is-valid": ["warn", {
      "components": ["Link"],
      "specialLink": ["to"],
    }],
    "react/no-array-index-key": 1,
    "react/require-default-props": 0,
    'import/no-extraneous-dependencies': [
      "error",
      {
        devDependencies: [
          '.storybook/**',
          'src/stories/**'
        ]
      }
    ],
    "react/sort-comp": [2],

  },
  "overrides": [
    {
      "files": ["./src/**/*.ts","./src/**/*.tsx"],
      "env": { "browser": true, "jest": true},
      "extends": [
        "airbnb",
        "plugin:@typescript-eslint/recommended",
      ],
      "parser": "@typescript-eslint/parser",
      "parserOptions": {
        "ecmaFeatures": { "jsx": true },
        "sourceType": "module",
        "project": "./tsconfig.json"
      },
      "plugins": ["react", "@typescript-eslint"],
      "rules": {
        "@typescript-eslint/consistent-type-definitions": ["error", "type"],
        "@typescript-eslint/no-inferrable-types": ["error", {"ignoreProperties": true, "ignoreParameters": false}],
        "@typescript-eslint/interface-name-prefix": ["error", { "prefixWithI": "never" }],
        "@typescript-eslint/explicit-function-return-type": "off",
        'react/jsx-filename-extension': [1, { 'extensions': ['.ts', '.tsx'] }],
      },
    }
  ]
};
<|endoftext|>


<commit_before>module.exports = {
  'extends': ['standard', 'plugin:ava/recommended'],
  'parserOptions': {
    'ecmaVersion': 2017,
    'sourceType': 'module',
    'ecmaFeatures': {
      'impliedStrict': true
    }
  },
  'env': {
    'node': false,
    'node-globals/env': true
  },
  'plugins': ['ava', 'import', 'node-globals', 'react', 'unicorn'],
  'rules': {
    'arrow-parens': ['error', 'as-needed'],
    'ava/no-async-fn-without-await': 'error',
    'ava/no-duplicate-modifiers': 'error',
    'import/default': 'error',
    'import/export': 'error',
    'import/extensions': ['error', {'js': 'never', 'json': 'always'}],
    'import/first': 'error',
    'import/imports-first': 'error',
    'import/named': 'error',
    'import/namespace': 'error',
    'import/newline-after-import': 'error',
    'import/no-absolute-path': 'error',
    'import/no-duplicates': 'error',
    'import/no-dynamic-require': 'error',
    'import/no-extraneous-dependencies': ['error', {}],
    'import/no-mutable-exports': 'error',
    'import/no-named-default': 'error',
    'import/no-unresolved': ['error', {'commonjs': true}],
    'import/order': ['error', {'groups': ['builtin', 'external', 'internal', 'parent', 'sibling', 'index']}],
    'no-case-declarations': 'error',
    'no-duplicate-imports': 'off',
    'no-shadow': ['error', {'builtinGlobals': true, 'hoist': 'never'}],
    'no-var': 'error',
    'no-warning-comments': 'warn',
    'object-shorthand': 'error',
    'prefer-const': 'error',
    'promise/always-return': 'error',
    'promise/catch-or-return': 'error',
    'react/jsx-indent': ['error', 2],
    'react/jsx-indent-props': ['error', 2],
    'react/jsx-no-comment-textnodes': 'error',
    'react/jsx-no-duplicate-props': 'error',
    'react/jsx-no-target-blank': 'error',
    'react/jsx-no-undef': 'error',
    'react/jsx-uses-react': 'error',
    'react/jsx-uses-vars': 'error',
    'react/no-deprecated': 'error',
    'react/no-direct-mutation-state': 'error',
    'react/no-find-dom-node': 'error',
    'react/no-is-mounted': 'error',
    'react/no-unknown-property': 'error',
    'react/require-render-return': 'error',
    'react/void-dom-elements-no-children': 'error',
    'unicorn/catch-error-name': 'error',
    'unicorn/explicit-length-check': 'error',
    'unicorn/no-abusive-eslint-disable': 'error',
    'unicorn/no-process-exit': 'error',
    'unicorn/throw-new-error': 'error'
  }
}
<commit_msg>Enable new unicorn rules<commit_after>module.exports = {
  'extends': ['standard', 'plugin:ava/recommended'],
  'parserOptions': {
    'ecmaVersion': 2017,
    'sourceType': 'module',
    'ecmaFeatures': {
      'impliedStrict': true
    }
  },
  'env': {
    'node': false,
    'node-globals/env': true
  },
  'plugins': ['ava', 'import', 'node-globals', 'react', 'unicorn'],
  'rules': {
    'arrow-parens': ['error', 'as-needed'],
    'ava/no-async-fn-without-await': 'error',
    'ava/no-duplicate-modifiers': 'error',
    'import/default': 'error',
    'import/export': 'error',
    'import/extensions': ['error', {'js': 'never', 'json': 'always'}],
    'import/first': 'error',
    'import/imports-first': 'error',
    'import/named': 'error',
    'import/namespace': 'error',
    'import/newline-after-import': 'error',
    'import/no-absolute-path': 'error',
    'import/no-duplicates': 'error',
    'import/no-dynamic-require': 'error',
    'import/no-extraneous-dependencies': ['error', {}],
    'import/no-mutable-exports': 'error',
    'import/no-named-default': 'error',
    'import/no-unresolved': ['error', {'commonjs': true}],
    'import/order': ['error', {'groups': ['builtin', 'external', 'internal', 'parent', 'sibling', 'index']}],
    'no-case-declarations': 'error',
    'no-duplicate-imports': 'off',
    'no-shadow': ['error', {'builtinGlobals': true, 'hoist': 'never'}],
    'no-var': 'error',
    'no-warning-comments': 'warn',
    'object-shorthand': 'error',
    'prefer-const': 'error',
    'promise/always-return': 'error',
    'promise/catch-or-return': 'error',
    'react/jsx-indent': ['error', 2],
    'react/jsx-indent-props': ['error', 2],
    'react/jsx-no-comment-textnodes': 'error',
    'react/jsx-no-duplicate-props': 'error',
    'react/jsx-no-target-blank': 'error',
    'react/jsx-no-undef': 'error',
    'react/jsx-uses-react': 'error',
    'react/jsx-uses-vars': 'error',
    'react/no-deprecated': 'error',
    'react/no-direct-mutation-state': 'error',
    'react/no-find-dom-node': 'error',
    'react/no-is-mounted': 'error',
    'react/no-unknown-property': 'error',
    'react/require-render-return': 'error',
    'react/void-dom-elements-no-children': 'error',
    'unicorn/catch-error-name': 'error',
    'unicorn/explicit-length-check': 'error',
    'unicorn/no-abusive-eslint-disable': 'error',
    'unicorn/no-array-instanceof': 'error',
    'unicorn/no-new-buffer': 'error',
    'unicorn/no-process-exit': 'error',
    'unicorn/number-literal-case': 'error',
    'unicorn/prefer-starts-ends-with': 'error',
    'unicorn/prefer-type-error': 'error',
    'unicorn/throw-new-error': 'error'
  }
}
<|endoftext|>


<commit_before>/** @type {import('eslint').Linter.Config} */
module.exports = {
  env: {
    jest: true,
    node: true
  },
  extends: [
    'airbnb-base',
    'plugin:security/recommended',
    'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin
  ],
  parser: '@typescript-eslint/parser', // Specifies the ESLint parser
  parserOptions: {
    ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
    sourceType: 'module', // Allows for the use of imports
  },
  plugins: [
    'import',
    'security',
    'jest'
  ],
  rules: {
    'jest/no-disabled-tests': [2],
    'jest/no-focused-tests': [2],
    'jest/no-identical-title': [2],
    'jest/prefer-to-have-length': [2],
    'jest/valid-expect': [2],

    '@typescript-eslint/no-empty-interface': [2],
    '@typescript-eslint/no-explicit-any': [2],
    '@typescript-eslint/no-var-requires': [2],
    'import/prefer-default-export': [0],
    'import/extensions': ['error', 'ignorePackages', {
      js: 'never',
      ts: 'never',
    }],
    // TODO: Enable these lint rules:
    // They were disabled to facilitate the transition to TypeScript
    '@typescript-eslint/explicit-function-return-type': [0],
    // These rules disabled during the dependency upgrade on 2020-07-06
    // Check these and re-enable
    '@typescript-eslint/class-name-casing': [0],
    '@typescript-eslint/ban-ts-ignore': [0],
    '@typescript-eslint/ban-types': [0],
    'comma-dangle': [0],
  },
  settings: {
    'import/parsers': {
      '@typescript-eslint/parser': ['.ts', '.tsx']
    },
    'import/resolver': {
      node: {
        extensions: ['.js', '.ts']
      }
    }
  }
};
<commit_msg>Enable lint rule "comma-dangle"<commit_after>/** @type {import('eslint').Linter.Config} */
module.exports = {
  env: {
    jest: true,
    node: true,
  },
  extends: [
    'airbnb-base',
    'plugin:security/recommended',
    'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin
  ],
  parser: '@typescript-eslint/parser', // Specifies the ESLint parser
  parserOptions: {
    ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
    sourceType: 'module', // Allows for the use of imports
  },
  plugins: [
    'import',
    'security',
    'jest',
  ],
  rules: {
    'jest/no-disabled-tests': [2],
    'jest/no-focused-tests': [2],
    'jest/no-identical-title': [2],
    'jest/prefer-to-have-length': [2],
    'jest/valid-expect': [2],

    '@typescript-eslint/no-empty-interface': [2],
    '@typescript-eslint/no-explicit-any': [2],
    '@typescript-eslint/no-var-requires': [2],
    'import/prefer-default-export': [0],
    'import/extensions': ['error', 'ignorePackages', {
      js: 'never',
      ts: 'never',
    }],
    // TODO: Enable these lint rules:
    // They were disabled to facilitate the transition to TypeScript
    '@typescript-eslint/explicit-function-return-type': [0],
    // These rules disabled during the dependency upgrade on 2020-07-06
    // Check these and re-enable
    '@typescript-eslint/class-name-casing': [0],
    '@typescript-eslint/ban-ts-ignore': [0],
    '@typescript-eslint/ban-types': [0],
  },
  settings: {
    'import/parsers': {
      '@typescript-eslint/parser': ['.ts', '.tsx'],
    },
    'import/resolver': {
      node: {
        extensions: ['.js', '.ts'],
      },
    },
  },
};
<|endoftext|>


<commit_before>// @remove-on-eject-begin
/**
 * Copyright (c) 2015-present, Facebook, Inc.
 * All rights reserved.
 *
 * This source code is licensed under the BSD-style license found in the
 * LICENSE file in the root directory of this source tree. An additional grant
 * of patent rights can be found in the PATENTS file in the same directory.
 */
// @remove-on-eject-end

// Inspired by https://github.com/airbnb/javascript but less opinionated.

// We use eslint-loader so even warnings are very visibile.
// This is why we only use "WARNING" level for potential errors,
// and we don't use "ERROR" level at all.

// In the future, we might create a separate list of rules for production.
// It would probably be more strict.

module.exports = {
  root: true,

  parser: 'babel-eslint',

  // import plugin is temporarily disabled, scroll below to see why
  plugins: [/*'import', */'flowtype', 'jsx-a11y', 'react'],

  env: {
    browser: true,
    commonjs: true,
    es6: true,
    jest: true,
    node: true
  },

  parserOptions: {
    ecmaVersion: 6,
    sourceType: 'module',
    ecmaFeatures: {
      jsx: true,
      generators: true,
      experimentalObjectRestSpread: true
    }
  },

  settings: {
    'import/ignore': [
      'node_modules',
      '\\.(json|css|jpg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm)$',
    ],
    'import/extensions': ['.js'],
    'import/resolver': {
      node: {
        extensions: ['.js', '.json']
      }
    }
  },

  rules: {
    // http://eslint.org/docs/rules/
    'array-callback-return': 'warn',
    'default-case': ['warn', { commentPattern: '^no default$' }],
    'dot-location': ['warn', 'property'],
    eqeqeq: ['warn', 'allow-null'],
    'guard-for-in': 'warn',
    'new-parens': 'warn',
    'no-array-constructor': 'warn',
    'no-caller': 'warn',
    'no-cond-assign': ['warn', 'always'],
    'no-const-assign': 'warn',
    'no-control-regex': 'warn',
    'no-delete-var': 'warn',
    'no-dupe-args': 'warn',
    'no-dupe-class-members': 'warn',
    'no-dupe-keys': 'warn',
    'no-duplicate-case': 'warn',
    'no-empty-character-class': 'warn',
    'no-empty-pattern': 'warn',
    'no-eval': 'warn',
    'no-ex-assign': 'warn',
    'no-extend-native': 'warn',
    'no-extra-bind': 'warn',
    'no-extra-label': 'warn',
    'no-fallthrough': 'warn',
    'no-func-assign': 'warn',
    'no-implied-eval': 'warn',
    'no-invalid-regexp': 'warn',
    'no-iterator': 'warn',
    'no-label-var': 'warn',
    'no-labels': ['warn', { allowLoop: false, allowSwitch: false }],
    'no-lone-blocks': 'warn',
    'no-loop-func': 'warn',
    'no-mixed-operators': ['warn', {
      groups: [
        ['&', '|', '^', '~', '<<', '>>', '>>>'],
        ['==', '!=', '===', '!==', '>', '>=', '<', '<='],
        ['&&', '||'],
        ['in', 'instanceof']
      ],
      allowSamePrecedence: false
    }],
    'no-multi-str': 'warn',
    'no-native-reassign': 'warn',
    'no-negated-in-lhs': 'warn',
    'no-new-func': 'warn',
    'no-new-object': 'warn',
    'no-new-symbol': 'warn',
    'no-new-wrappers': 'warn',
    'no-obj-calls': 'warn',
    'no-octal': 'warn',
    'no-octal-escape': 'warn',
    'no-redeclare': 'warn',
    'no-regex-spaces': 'warn',
    'no-restricted-syntax': [
      'warn',
      'LabeledStatement',
      'WithStatement',
    ],
    'no-script-url': 'warn',
    'no-self-assign': 'warn',
    'no-self-compare': 'warn',
    'no-sequences': 'warn',
    'no-shadow-restricted-names': 'warn',
    'no-sparse-arrays': 'warn',
    'no-template-curly-in-string': 'warn',
    'no-this-before-super': 'warn',
    'no-throw-literal': 'warn',
    'no-undef': 'warn',
    'no-unexpected-multiline': 'warn',
    'no-unreachable': 'warn',
    'no-unused-expressions': 'warn',
    'no-unused-labels': 'warn',
    'no-unused-vars': ['warn', { vars: 'local', args: 'none' }],
    'no-use-before-define': ['warn', 'nofunc'],
    'no-useless-computed-key': 'warn',
    'no-useless-concat': 'warn',
    'no-useless-constructor': 'warn',
    'no-useless-escape': 'warn',
    'no-useless-rename': ['warn', {
      ignoreDestructuring: false,
      ignoreImport: false,
      ignoreExport: false,
    }],
    'no-with': 'warn',
    'no-whitespace-before-property': 'warn',
    'operator-assignment': ['warn', 'always'],
    radix: 'warn',
    'require-yield': 'warn',
    'rest-spread-spacing': ['warn', 'never'],
    strict: ['warn', 'never'],
    'unicode-bom': ['warn', 'never'],
    'use-isnan': 'warn',
    'valid-typeof': 'warn',

    // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/

    // TODO: import rules are temporarily disabled because they don't play well
    // with how eslint-loader only checks the file you change. So if module A
    // imports module B, and B is missing a default export, the linter will
    // record this as an issue in module A. Now if you fix module B, the linter
    // will not be aware that it needs to re-lint A as well, so the error
    // will stay until the next restart, which is really confusing.

    // This is probably fixable with a patch to eslint-loader.
    // When file A is saved, we want to invalidate all files that import it
    // *and* that currently have lint errors. This should fix the problem.

    // 'import/default': 'warn',
    // 'import/export': 'warn',
    // 'import/named': 'warn',
    // 'import/namespace': 'warn',
    // 'import/no-amd': 'warn',
    // 'import/no-duplicates': 'warn',
    // 'import/no-extraneous-dependencies': 'warn',
    // 'import/no-named-as-default': 'warn',
    // 'import/no-named-as-default-member': 'warn',
    // 'import/no-unresolved': ['warn', { commonjs: true }],

    // https://github.com/yannickcr/eslint-plugin-react/tree/master/docs/rules
    'react/jsx-equals-spacing': ['warn', 'never'],
    'react/jsx-no-duplicate-props': ['warn', { ignoreCase: true }],
    'react/jsx-no-undef': 'warn',
    'react/jsx-pascal-case': ['warn', {
      allowAllCaps: true,
      ignore: [],
    }],
    'react/jsx-uses-react': 'warn',
    'react/jsx-uses-vars': 'warn',
    'react/no-deprecated': 'warn',
    'react/no-direct-mutation-state': 'warn',
    'react/no-is-mounted': 'warn',
    'react/react-in-jsx-scope': 'warn',
    'react/require-render-return': 'warn',

    // https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules
    'jsx-a11y/aria-role': 'warn',
    'jsx-a11y/img-has-alt': 'warn',
    'jsx-a11y/img-redundant-alt': 'warn',
    'jsx-a11y/no-access-key': 'warn',

    // https://github.com/gajus/eslint-plugin-flowtype
    'flowtype/define-flow-type': 'warn',
    'flowtype/require-valid-file-annotation': 'warn',
    'flowtype/use-flow-type': 'warn',

    // my rule
    "linebreak-style": [ "error", "unix" ],
    "indent": [ "error", 4 ],
    "semi": [ "error", "always" ]
  }
};
<commit_msg>fix .eslintrc.js<commit_after>// @remove-on-eject-begin
/**
 * Copyright (c) 2015-present, Facebook, Inc.
 * All rights reserved.
 *
 * This source code is licensed under the BSD-style license found in the
 * LICENSE file in the root directory of this source tree. An additional grant
 * of patent rights can be found in the PATENTS file in the same directory.
 */
// @remove-on-eject-end

// Inspired by https://github.com/airbnb/javascript but less opinionated.

// We use eslint-loader so even warnings are very visibile.
// This is why we only use "WARNING" level for potential errors,
// and we don't use "ERROR" level at all.

// In the future, we might create a separate list of rules for production.
// It would probably be more strict.

module.exports = {
  root: true,

  parser: 'babel-eslint',

  // import plugin is temporarily disabled, scroll below to see why
  plugins: [/*'import', */'flowtype', 'jsx-a11y', 'react'],

  env: {
    browser: true,
    commonjs: true,
    es6: true,
    jest: true,
    node: true
  },

  parserOptions: {
    ecmaVersion: 6,
    sourceType: 'module',
    ecmaFeatures: {
      jsx: true,
      generators: true,
      experimentalObjectRestSpread: true
    }
  },

  settings: {
    'import/ignore': [
      'node_modules',
      '\\.(json|css|jpg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm)$',
    ],
    'import/extensions': ['.js'],
    'import/resolver': {
      node: {
        extensions: ['.js', '.json']
      }
    }
  },

  rules: {
    // http://eslint.org/docs/rules/
    'array-callback-return': 'warn',
    'default-case': ['warn', { commentPattern: '^no default$' }],
    'dot-location': ['warn', 'property'],
    eqeqeq: ['warn', 'allow-null'],
    'guard-for-in': 'warn',
    'new-parens': 'warn',
    'no-array-constructor': 'warn',
    'no-caller': 'warn',
    'no-cond-assign': ['warn', 'always'],
    'no-const-assign': 'warn',
    'no-control-regex': 'warn',
    'no-delete-var': 'warn',
    'no-dupe-args': 'warn',
    'no-dupe-class-members': 'warn',
    'no-dupe-keys': 'warn',
    'no-duplicate-case': 'warn',
    'no-empty-character-class': 'warn',
    'no-empty-pattern': 'warn',
    'no-eval': 'warn',
    'no-ex-assign': 'warn',
    'no-extend-native': 'warn',
    'no-extra-bind': 'warn',
    'no-extra-label': 'warn',
    'no-fallthrough': 'warn',
    'no-func-assign': 'warn',
    'no-implied-eval': 'warn',
    'no-invalid-regexp': 'warn',
    'no-iterator': 'warn',
    'no-label-var': 'warn',
    'no-labels': ['warn', { allowLoop: false, allowSwitch: false }],
    'no-lone-blocks': 'warn',
    'no-loop-func': 'warn',
    'no-mixed-operators': ['warn', {
      groups: [
        ['&', '|', '^', '~', '<<', '>>', '>>>'],
        ['==', '!=', '===', '!==', '>', '>=', '<', '<='],
        ['&&', '||'],
        ['in', 'instanceof']
      ],
      allowSamePrecedence: false
    }],
    'no-multi-str': 'warn',
    'no-native-reassign': 'warn',
    'no-negated-in-lhs': 'warn',
    'no-new-func': 'warn',
    'no-new-object': 'warn',
    'no-new-symbol': 'warn',
    'no-new-wrappers': 'warn',
    'no-obj-calls': 'warn',
    'no-octal': 'warn',
    'no-octal-escape': 'warn',
    'no-redeclare': 'warn',
    'no-regex-spaces': 'warn',
    'no-restricted-syntax': [
      'warn',
      'LabeledStatement',
      'WithStatement',
    ],
    'no-script-url': 'warn',
    'no-self-assign': 'warn',
    'no-self-compare': 'warn',
    'no-sequences': 'warn',
    'no-shadow-restricted-names': 'warn',
    'no-sparse-arrays': 'warn',
    'no-template-curly-in-string': 'warn',
    'no-this-before-super': 'warn',
    'no-throw-literal': 'warn',
    'no-undef': 'warn',
    'no-unexpected-multiline': 'warn',
    'no-unreachable': 'warn',
    'no-unused-expressions': 'warn',
    'no-unused-labels': 'warn',
    'no-unused-vars': ['warn', { vars: 'local', args: 'none' }],
    'no-use-before-define': ['warn', 'nofunc'],
    'no-useless-computed-key': 'warn',
    'no-useless-concat': 'warn',
    'no-useless-constructor': 'warn',
    'no-useless-escape': 'warn',
    'no-useless-rename': ['warn', {
      ignoreDestructuring: false,
      ignoreImport: false,
      ignoreExport: false,
    }],
    'no-with': 'warn',
    'no-whitespace-before-property': 'warn',
    'operator-assignment': ['warn', 'always'],
    radix: 'warn',
    'require-yield': 'warn',
    'rest-spread-spacing': ['warn', 'never'],
    strict: ['warn', 'never'],
    'unicode-bom': ['warn', 'never'],
    'use-isnan': 'warn',
    'valid-typeof': 'warn',

    // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/

    // TODO: import rules are temporarily disabled because they don't play well
    // with how eslint-loader only checks the file you change. So if module A
    // imports module B, and B is missing a default export, the linter will
    // record this as an issue in module A. Now if you fix module B, the linter
    // will not be aware that it needs to re-lint A as well, so the error
    // will stay until the next restart, which is really confusing.

    // This is probably fixable with a patch to eslint-loader.
    // When file A is saved, we want to invalidate all files that import it
    // *and* that currently have lint errors. This should fix the problem.

    // 'import/default': 'warn',
    // 'import/export': 'warn',
    // 'import/named': 'warn',
    // 'import/namespace': 'warn',
    // 'import/no-amd': 'warn',
    // 'import/no-duplicates': 'warn',
    // 'import/no-extraneous-dependencies': 'warn',
    // 'import/no-named-as-default': 'warn',
    // 'import/no-named-as-default-member': 'warn',
    // 'import/no-unresolved': ['warn', { commonjs: true }],

    // https://github.com/yannickcr/eslint-plugin-react/tree/master/docs/rules
    'react/jsx-equals-spacing': ['warn', 'never'],
    'react/jsx-no-duplicate-props': ['warn', { ignoreCase: true }],
    'react/jsx-no-undef': 'warn',
    'react/jsx-pascal-case': ['warn', {
      allowAllCaps: true,
      ignore: [],
    }],
    'react/jsx-uses-react': 'warn',
    'react/jsx-uses-vars': 'warn',
    'react/no-deprecated': 'warn',
    'react/no-direct-mutation-state': 'warn',
    'react/no-is-mounted': 'warn',
    'react/react-in-jsx-scope': 'warn',
    'react/require-render-return': 'warn',

    // https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules
    'jsx-a11y/aria-role': 'warn',
    'jsx-a11y/img-redundant-alt': 'warn',
    'jsx-a11y/no-access-key': 'warn',

    // https://github.com/gajus/eslint-plugin-flowtype
    'flowtype/define-flow-type': 'warn',
    'flowtype/require-valid-file-annotation': 'warn',
    'flowtype/use-flow-type': 'warn',

    // my rule
    "linebreak-style": [ "error", "unix" ],
    "indent": [ "error", 4 ],
    "semi": [ "error", "always" ]
  }
};
<|endoftext|>