diff --git a/.eslintrc.yml b/.eslintrc.yml index da0b0928c95c20f63c19298fa1f20a43e5771318..7800ae5298ff2167fbba3ed0b3f3c81317385dbd 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -7,7 +7,6 @@ plugins: - import - prettier - - dependencies rules: prettier/prettier: - 2 @@ -538,8 +537,8 @@ # Import plugin rules. import/no-unresolved: - - 0 # doesn't properly handle paths - - { "ignore": ['^bundle-loader\?'] } + - 2 + - { "ignore": ['^bundle-loader\?'], commonjs: true } import/named: - 2 import/default: @@ -586,7 +585,9 @@ import/no-namespace: - 0 import/extensions: - - 0 + - 2 + - "ignorePackages" + - {json: "always", js: "never"} import/order: - 0 import/newline-after-import: @@ -600,16 +601,6 @@ - {"allow": ["**/*.css"]} import/no-named-default: - 2 - - # Ensure the dependency use the appropriate case. - dependencies/case-sensitive: - - 2 - # Ensure there are no cyclic imports. - dependencies/no-cycles: - - 2 - # This check is already provided by import/no-unresolved. - dependencies/no-unresolved: - - 0 - # Ensure JSON imports do have an extension in the import statement. - dependencies/require-json-ext: + import/no-cycle: - 2 + - { commonjs: true} diff --git a/client/components/charts/index.js b/client/components/charts/index.js index 873fca141577b51eac80120f0298a5b0105f50c8..857d200e22effcd2479caef34e03b32439be9dac 100644 --- a/client/components/charts/index.js +++ b/client/components/charts/index.js @@ -11,7 +11,7 @@ import BalanceChart from './balance-chart'; import CategoryCharts from './category-charts'; import { MODAL_SLUG } from './default-params-modal'; -import TabsContainer from '../ui/tabs.js'; +import TabsContainer from '../ui/tabs'; const ShowParamsButton = connect( null, diff --git a/client/components/duplicates/index.js b/client/components/duplicates/index.js index 17b09177f0c0a0fca8e449095384b623a16b5848..fbdfd1c2352994962326cbf6e4bb0a830d551331 100644 --- a/client/components/duplicates/index.js +++ b/client/components/duplicates/index.js @@ -12,7 +12,7 @@ import { actions, get, rx } from '../../store'; import URL from '../../urls'; import Pair from './item'; -import { MODAL_SLUG } from './default-params-modal.js'; +import { MODAL_SLUG } from './default-params-modal'; const OpenModaleButton = connect( null, diff --git a/client/components/ui/fuzzy-or-native-select.js b/client/components/ui/fuzzy-or-native-select.js index c53c5edf028121670fd99cccb27b097aad900c94..80a0c8a5d6e0f2bf31f386f8716480af91903219 100644 --- a/client/components/ui/fuzzy-or-native-select.js +++ b/client/components/ui/fuzzy-or-native-select.js @@ -5,7 +5,7 @@ import Select, { createFilter } from 'react-select'; import Creatable from 'react-select/creatable'; import { get } from '../../store'; -import { assert } from '../../helpers.js'; +import { assert } from '../../helpers'; const REACT_SELECT_FILTER = createFilter({ ignoreCase: true, diff --git a/client/components/ui/loading.js b/client/components/ui/loading.js index 668502ff23895bdb30778a6de7ea3a3941838f5d..d58d2434991e64d56261c7a97b615d9cbaea3468 100644 --- a/client/components/ui/loading.js +++ b/client/components/ui/loading.js @@ -5,7 +5,7 @@ import { connect } from 'react-redux'; import { get } from '../../store'; import { areWeFunYet, translate as $t } from '../../helpers'; -import ExternalLink from './external-link.js'; +import ExternalLink from './external-link'; import DisplayIf from './display-if'; let showLicense = areWeFunYet(); diff --git a/client/helpers.js b/client/helpers.js index 904bfe0791cede2a909cb183cfddae674b6b58af..cbfcb8ba4367deb6544db0c053178815a7e66ec3 100644 --- a/client/helpers.js +++ b/client/helpers.js @@ -19,7 +19,7 @@ import { shouldIncludeInBalance as shouldIncludeInBalance_, shouldIncludeInOutstandingSum as shouldIncludeInOutstandingSum_, FETCH_STATUS_SUCCESS as FETCH_STATUS_SUCCESS_ -} from '../shared/helpers.js'; +} from '../shared/helpers'; export const maybeHas = maybeHas_; export const setupTranslator = setupTranslator_; diff --git a/package.json b/package.json index 3ac21af711f0c3deddbf0d55d477f4a0e4b6a44d..d5b7048f28ec1e90c234d6dae90be1701413de6a 100644 --- a/package.json +++ b/package.json @@ -12,95 +12,95 @@ }, "main": "client/main.js", "dependencies": { - "@babel/polyfill": "7.4.4", + "@babel/polyfill": "7.6.0", "body-parser": "1.19.0", "cozydb": "0.1.13", - "currency-formatter": "1.5.4", + "currency-formatter": "1.5.5", "errorhandler": "1.5.1", "express": "4.17.1", "ini": "1.3.5", - "log4js": "4.3.1", + "log4js": "5.3.0", "method-override": "3.0.0", "moment": "2.24.0", - "node-polyglot": "2.3.0", - "nodemailer": "6.2.1", + "node-polyglot": "2.4.0", + "nodemailer": "6.3.1", "ofx": "0.4.0", "ospath": "1.2.2", - "pouchdb": "7.0.0", + "pouchdb": "7.1.1", "regex-escape": "3.4.9", - "semver": "6.1.1" + "semver": "6.3.0" }, "devDependencies": { - "@babel/cli": "7.4.4", - "@babel/core": "7.4.5", - "@babel/node": "7.4.5", - "@babel/plugin-proposal-class-properties": "7.4.4", - "@babel/plugin-proposal-decorators": "7.4.4", - "@babel/plugin-proposal-export-namespace-from": "7.2.0", - "@babel/plugin-proposal-function-sent": "7.2.0", + "@babel/cli": "7.6.4", + "@babel/core": "7.6.4", + "@babel/node": "7.6.3", + "@babel/plugin-proposal-class-properties": "7.5.5", + "@babel/plugin-proposal-decorators": "7.6.0", + "@babel/plugin-proposal-export-namespace-from": "7.5.2", + "@babel/plugin-proposal-function-sent": "7.5.0", "@babel/plugin-proposal-json-strings": "7.2.0", "@babel/plugin-proposal-numeric-separator": "7.2.0", "@babel/plugin-proposal-throw-expressions": "7.2.0", "@babel/plugin-syntax-dynamic-import": "7.2.0", "@babel/plugin-syntax-import-meta": "7.2.0", - "@babel/preset-env": "7.4.5", - "@babel/preset-react": "7.0.0", - "@babel/register": "7.4.4", - "babel-eslint": "10.0.1", + "@babel/preset-env": "7.6.3", + "@babel/preset-react": "7.6.3", + "@babel/register": "7.6.2", + "babel-eslint": "10.0.3", "babel-loader": "8.0.6", "babel-plugin-transform-react-remove-prop-types": "0.4.24", "bundle-loader": "0.5.6", "c3": "0.4.23", - "concurrently": "4.1.0", - "copy-webpack-plugin": "5.0.3", - "css-loader": "2.1.1", + "concurrently": "5.0.0", + "copy-webpack-plugin": "5.0.4", + "css-loader": "3.2.0", "cssnano": "4.1.10", "dygraphs": "2.1.0", - "eslint": "5.16.0", + "eslint": "6.5.1", "eslint-plugin-dependencies": "2.4.0", - "eslint-plugin-import": "2.17.3", - "eslint-plugin-prettier": "3.1.0", - "eslint-plugin-react": "7.13.0", - "file-loader": "3.0.1", + "eslint-plugin-import": "2.18.2", + "eslint-plugin-prettier": "3.1.1", + "eslint-plugin-react": "7.16.0", + "file-loader": "4.2.0", "font-awesome": "4.7.0", "generate-json-webpack-plugin": "0.3.1", - "image-webpack-loader": "5.0.0", + "image-webpack-loader": "6.0.0", "json-loader": "0.5.7", "json-strip-loader": "1.0.5", "lodash.throttle": "4.1.1", - "mini-css-extract-plugin": "0.7.0", - "mocha": "6.1.4", - "nodemon": "1.19.1", + "mini-css-extract-plugin": "0.8.0", + "mocha": "6.2.2", + "nodemon": "1.19.4", "normalize.css": "8.0.1", - "onchange": "6.0.0", - "optimize-css-assets-webpack-plugin": "5.0.1", - "prettier": "1.17.1", + "onchange": "6.1.0", + "optimize-css-assets-webpack-plugin": "5.0.3", + "prettier": "1.18.2", "primer-tooltips": "2.0.0", "prop-types": "15.7.2", - "raw-loader": "2.0.0", + "raw-loader": "3.1.0", "rc-color-picker": "1.2.6", - "react": "16.8.6", - "react-dom": "16.8.6", - "react-flatpickr": "3.9.0", - "react-modal": "3.8.1", - "react-redux": "7.0.3", - "react-router-dom": "5.0.0", - "react-select": "3.0.4", - "react-toastify": "5.2.1", - "redux": "4.0.1", + "react": "16.11.0", + "react-dom": "16.11.0", + "react-flatpickr": "3.9.1", + "react-modal": "3.10.1", + "react-redux": "7.1.1", + "react-router-dom": "5.1.2", + "react-select": "3.0.8", + "react-toastify": "5.4.0", + "redux": "4.0.4", "redux-thunk": "2.3.0", "reselect": "4.0.0", "scripty": "1.9.1", "should": "13.2.3", - "stylelint": "10.0.1", - "stylelint-config-standard": "18.3.0", - "updeep": "1.1.0", - "url-loader": "1.1.2", - "webpack": "4.32.2", - "webpack-bundle-analyzer": "3.3.2", - "webpack-cli": "3.3.2", - "webpack-dev-server": "3.5.1", - "webpack-spritesmith": "1.0.1", + "stylelint": "11.1.1", + "stylelint-config-standard": "19.0.0", + "updeep": "1.2.0", + "url-loader": "2.2.0", + "webpack": "4.41.2", + "webpack-bundle-analyzer": "3.6.0", + "webpack-cli": "3.3.9", + "webpack-dev-server": "3.9.0", + "webpack-spritesmith": "1.0.2", "whatwg-fetch": "3.0.0" }, "scripts": { diff --git a/server/config.js b/server/config.js index aec3c81f953b4d8213eb121b37d69b84858da6fc..16b1028648f8607e775d7a665c7318d03ba0f857 100644 --- a/server/config.js +++ b/server/config.js @@ -2,7 +2,7 @@ import path from 'path'; import ospath from 'ospath'; import { assert, makeLogger } from './helpers'; -import { setLogFilePath } from './lib/logger.js'; +import { setLogFilePath } from './lib/logger'; let log = makeLogger('apply-config'); diff --git a/server/helpers.js b/server/helpers.js index 4ecc212bf1e12350b28d32e246f8ec6c6d8abc5e..9e8245a62f871fc8bcb40bf27ae7907766c32cb9 100644 --- a/server/helpers.js +++ b/server/helpers.js @@ -12,7 +12,7 @@ import { shouldIncludeInBalance as shouldIncludeInBalance_, shouldIncludeInOutstandingSum as shouldIncludeInOutstandingSum_, FETCH_STATUS_SUCCESS as FETCH_STATUS_SUCCESS_ -} from './shared/helpers.js'; +} from './shared/helpers'; import errors from './shared/errors.json'; import Logger from './lib/logger'; diff --git a/server/lib/sources/weboob.js b/server/lib/sources/weboob.js index ea1b003f64d2654e2866c8f4574734103342f35c..1604635ffc9a1164c9eeb39c02baa4dba5a1e25a 100644 --- a/server/lib/sources/weboob.js +++ b/server/lib/sources/weboob.js @@ -151,9 +151,7 @@ function callWeboob(command, access, debug = false, forceUpdate = false) { SessionsMap.has(access.id) ) { log.warn( - `Resetting session for access from bank ${access.vendorId} with login ${ - access.login - }` + `Resetting session for access from bank ${access.vendorId} with login ${access.login}` ); SessionsMap.delete(access.id); } @@ -172,9 +170,7 @@ function callWeboob(command, access, debug = false, forceUpdate = false) { if (access && stdout.session) { log.info( - `Saving session for access from bank ${access.vendorId} with login ${ - access.login - }` + `Saving session for access from bank ${access.vendorId} with login ${access.login}` ); SessionsMap.set(access.id, stdout.session); } diff --git a/server/models/pouch/migrations.js b/server/models/pouch/migrations.js index 49e9b563e3496d6d96dbea9539c0c5f8d5b01491..f20aca9009f49e581dca10b07ad02601c3cb82e0 100644 --- a/server/models/pouch/migrations.js +++ b/server/models/pouch/migrations.js @@ -485,9 +485,7 @@ let migrations = [ } } catch (e) { log.info( - `Found invalid access.customFields for access with id=${ - access.id - }, replacing by empty array.` + `Found invalid access.customFields for access with id=${access.id}, replacing by empty array.` ); await Accesses.update(userId, access.id, { customFields: '[]' }); } @@ -629,9 +627,7 @@ let migrations = [ let budget = await Budgets.byCategory(userId, category.id); if (!budget || budget.length === 0) { log.info( - `Migrating budget for category ${ - category.label - } with period ${month}/${year}` + `Migrating budget for category ${category.label} with period ${month}/${year}` ); await Budgets.create(userId, { categoryId: category.id, diff --git a/tests/client/banks-store.js b/tests/client/banks-store.js index 0f86e408a059171a9feef100bf8f4c25d67e50b5..028b0b4d2497bcc07756b5c0860f6d5f6e300954 100644 --- a/tests/client/banks-store.js +++ b/tests/client/banks-store.js @@ -1,7 +1,7 @@ import should from 'should'; import { get } from '../../client/store'; -import { testing } from '../../client/store/banks.js'; +import { testing } from '../../client/store/banks'; import { setupTranslator } from '../../client/helpers'; import banks from '../../shared/banks.json';