From 8510e930650b2df5fafdd216e170a3612cc4e01f Mon Sep 17 00:00:00 2001 From: Mael Date: Tue, 26 Jun 2018 08:45:41 +0000 Subject: [PATCH] :sparkles: Eslint --- .eslintrc => .eslintrc.yaml | 3 ++- source/engine/mecanisms.js | 5 +---- test/traverse.test.js | 15 +++------------ 3 files changed, 6 insertions(+), 17 deletions(-) rename .eslintrc => .eslintrc.yaml (80%) diff --git a/.eslintrc b/.eslintrc.yaml similarity index 80% rename from .eslintrc rename to .eslintrc.yaml index 06b11d41d..0f6217b23 100644 --- a/.eslintrc +++ b/.eslintrc.yaml @@ -3,8 +3,9 @@ rules: - 2 - unix quotes: - - 1 // While https://github.com/eslint/eslint/issues/9662#issuecomment-353958854 we don't enforce this + - 1 # While https://github.com/eslint/eslint/issues/9662#issuecomment-353958854 we don't enforce this - single + - avoidEscape: true no-console: 1 no-restricted-globals: [2, "length"] no-global-assign: 0 diff --git a/source/engine/mecanisms.js b/source/engine/mecanisms.js index faa0ec438..d8a4b278b 100644 --- a/source/engine/mecanisms.js +++ b/source/engine/mecanisms.js @@ -23,10 +23,7 @@ import { has, max, min, - subtract, - values, - sortBy, - last + subtract } from 'ramda' import React from 'react' import { Trans } from 'react-i18next' diff --git a/test/traverse.test.js b/test/traverse.test.js index ef9801bc1..8959ff6f4 100644 --- a/test/traverse.test.js +++ b/test/traverse.test.js @@ -1,8 +1,8 @@ import { expect } from 'chai' -import { rules as realRules, enrichRule } from '../source/engine/rules' -import { analyse, parseAll, getTargets } from '../source/engine/traverse' +import { analyse, parseAll } from '../source/engine/traverse' +import { enrichRule } from '../source/engine/rules' -let stateSelector = (state, name) => null +let stateSelector = () => null describe('analyse', function() { it('should directly return simple numerical values', function() { @@ -215,7 +215,6 @@ describe('analyse with mecanisms', function() { tranches: [ { 'en-dessous de': 1, taux: 0.1 }, { de: 1, à: 2, taux: 1.2 }, - , { 'au-dessus de': 2, taux: 10 } ] } @@ -241,7 +240,6 @@ describe('analyse with mecanisms', function() { tranches: [ { 'en-dessous de': 1, taux: 0.05 }, { de: 1, à: 2, taux: 0.4 }, - , { 'au-dessus de': 2, taux: 5 } ] }, @@ -249,7 +247,6 @@ describe('analyse with mecanisms', function() { tranches: [ { 'en-dessous de': 1, taux: 0.05 }, { de: 1, à: 2, taux: 0.8 }, - , { 'au-dessus de': 2, taux: 5 } ] } @@ -278,7 +275,6 @@ describe('analyse with mecanisms', function() { tranches: [ { 'en-dessous de': 1, taux: 0.1 }, { de: 1, à: 2, taux: 1.2 }, - , { 'au-dessus de': 2, taux: 10 } ] }, @@ -287,7 +283,6 @@ describe('analyse with mecanisms', function() { tranches: [ { 'en-dessous de': 1, taux: 0.1 }, { de: 1, à: 2, taux: 1.8 }, - , { 'au-dessus de': 2, taux: 10 } ] } @@ -362,7 +357,6 @@ describe('analyse with mecanisms', function() { tranches: [ { 'en-dessous de': 1, taux: 0.05 }, { de: 1, à: 2, taux: 0.4 }, - , { 'au-dessus de': 2, taux: 5 } ], attributs: { 'dû par': 'salarié' } @@ -371,7 +365,6 @@ describe('analyse with mecanisms', function() { tranches: [ { 'en-dessous de': 1, taux: 0.05 }, { de: 1, à: 2, taux: 0.8 }, - , { 'au-dessus de': 2, taux: 5 } ], attributs: { 'dû par': 'employeur' } @@ -407,7 +400,6 @@ describe('analyse with mecanisms', function() { tranches: [ { 'en-dessous de': 1, taux: 0.05 }, { de: 1, à: 2, taux: 0.4 }, - , { 'au-dessus de': 2, taux: 5 } ], attributs: { 'dû par': 'salarié' } @@ -416,7 +408,6 @@ describe('analyse with mecanisms', function() { tranches: [ { 'en-dessous de': 1, taux: 0.05 }, { de: 1, à: 2, taux: 0.8 }, - , { 'au-dessus de': 2, taux: 5 } ], attributs: { 'dû par': 'employeur' }