remove jsx and react from eslint config and add eslint modules

This commit is contained in:
Ersun Warncke 2019-03-08 12:16:21 -04:00
parent a2b5793f49
commit b31022e329
3 changed files with 17 additions and 34 deletions

View file

@ -1,14 +1,10 @@
{
"extends": [
"standard",
"standard-react",
"prettier",
"prettier/react",
"prettier/standard",
"plugin:jsx-a11y/recommended"
"prettier/standard"
],
"plugins": [
"jsx-a11y",
"mocha",
"chai-expect",
"chai-friendly"
@ -19,17 +15,8 @@
"globals": {
"expect": true,
"define": true,
"$": true,
"angular": true,
// Injected in layout.pug
"user_id": true,
"ace": true
},
"settings": {
// Tell eslint-plugin-react to detect which version of React we are using
"react": {
"version": "detect"
}
},
"rules": {
"max-len": ["error", {
@ -38,24 +25,6 @@
"ignorePattern": "(^\\s*(it|describe)\\s*\\(['\"]|^import\\s*.*\\s*from\\s*['\"]|^.*\\s*=\\s*require\\(['\"])"
}],
// Fix conflict between prettier & standard by overriding to prefer
// double quotes
"jsx-quotes": ["error", "prefer-double"],
// Override weird behaviour of jsx-a11y label-has-for (says labels must be
// nested *and* have for/id attributes)
"jsx-a11y/label-has-for": [
"error",
{
"required": {
"some": [
"nesting",
"id"
]
}
}
],
// Add some mocha specific rules
"mocha/handle-done-callback": "error",
"mocha/no-exclusive-tests": "error",

View file

@ -1,7 +1,7 @@
const bunyan = require('bunyan')
const request = require('request')
Logger = module.exports = {
const Logger = module.exports = {
initialize(name) {
this.isProduction =
(process.env['NODE_ENV'] || '').toLowerCase() === 'production'
@ -50,6 +50,9 @@ Logger = module.exports = {
}-setLogLevelEndTime`
}
request(options, (err, response, body) => {
if (err) {
return
}
if (parseInt(body) > Date.now()) {
this.logger.level('trace')
} else {

View file

@ -10,7 +10,8 @@
"scripts": {
"test": "mocha test/**/*.js",
"format": "prettier-eslint '**/*.js' --list-different",
"format:fix": "prettier-eslint '**/*.js' --write"
"format:fix": "prettier-eslint '**/*.js' --write",
"lint": "eslint -f unix ."
},
"dependencies": {
"bunyan": "1.8.12",
@ -19,6 +20,16 @@
},
"devDependencies": {
"chai": "4.2.0",
"eslint": "^4.18.1",
"eslint-config-prettier": "^3.1.0",
"eslint-config-standard": "^11.0.0",
"eslint-plugin-chai-expect": "^1.1.1",
"eslint-plugin-chai-friendly": "^0.4.1",
"eslint-plugin-import": "^2.9.0",
"eslint-plugin-mocha": "^5.2.0",
"eslint-plugin-node": "^6.0.0",
"eslint-plugin-promise": "^3.6.0",
"eslint-plugin-standard": "^3.0.1",
"mocha": "5.2.0",
"sandboxed-module": "2.0.3",
"sinon": "7.2.3",