Skip to content

Commit

Permalink
Update eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
markusjwetzel committed Sep 17, 2021
1 parent bd09ff1 commit 96f8250
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 28 deletions.
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@
"css-minimizer-webpack-plugin": "3.0.2",
"deepmerge": "4.2.2",
"device-detector-js": "2.2.10",
"eslint": "6.6.0",
"eslint-config-airbnb": "18.0.1",
"eslint-config-prettier": "6.5.0",
"eslint-import-resolver-node": "0.3.2",
"eslint-plugin-flowtype": "4.3.0",
"eslint-plugin-import": "2.18.2",
"eslint-plugin-jsx-a11y": "6.2.3",
"eslint-plugin-react": "7.16.0",
"eslint-plugin-react-hooks": "1.7.0",
"eslint": "7.32.0",
"eslint-config-airbnb": "18.2.1",
"eslint-config-prettier": "8.3.0",
"eslint-import-resolver-node": "0.3.6",
"eslint-plugin-flowtype": "6.0.1",
"eslint-plugin-import": "2.24.2",
"eslint-plugin-jsx-a11y": "6.4.1",
"eslint-plugin-react": "7.25.2",
"eslint-plugin-react-hooks": "4.2.0",
"express": "4.17.1",
"find-cache-dir": "3.3.2",
"http-proxy": "1.18.1",
Expand Down
8 changes: 3 additions & 5 deletions src/bootstrap/utils/CookieJar.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
const cookie = require('cookie');

const getFromDocument = () => {
return document.cookie || '';
};
const getFromDocument = () => document.cookie || '';

class CookieJar {
constructor(req, res) {
Expand Down Expand Up @@ -41,7 +39,7 @@ class CookieJar {
return;
}

headers['set-cookie'].forEach(raw => {
headers['set-cookie'].forEach((raw) => {
const [pair, ...rawOptions] = raw.split(';');

const pairs = cookie.parse(pair);
Expand All @@ -67,7 +65,7 @@ class CookieJar {

serialize() {
return Object.keys(this.cookies)
.map(key => `${key}=${this.cookies[key]}`)
.map((key) => `${key}=${this.cookies[key]}`)
.join(';');
}
}
Expand Down
9 changes: 4 additions & 5 deletions src/bootstrap/utils/detectLocale.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
const parseUrl = (url, locales) => {
return locales.find(locale => {
return url === `/${locale}` || url.substring(0, locale.length + 2) === `/${locale}/`;
});
};
const parseUrl = (url, locales) =>
locales.find(
(locale) => url === `/${locale}` || url.substring(0, locale.length + 2) === `/${locale}/`,
);

const parseCookie = (cookie, locales) => {
const index = locales.indexOf(cookie);
Expand Down
15 changes: 8 additions & 7 deletions src/config/eslint.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
module.exports = {
parser: 'babel-eslint',
extends: [
'airbnb',
'plugin:flowtype/recommended',
'prettier',
'prettier/flowtype',
'prettier/react',
],
extends: ['airbnb', 'plugin:flowtype/recommended', 'prettier'],
env: {
browser: true,
node: true,
es6: true,
},
plugins: ['flowtype'],
rules: {
// flowtype
'flowtype/space-after-type-colon': 'off',

// import
'import/prefer-default-export': 'off', // conflict when there is only 1 action

Expand All @@ -23,6 +20,10 @@ module.exports = {
// react
'react/jsx-filename-extension': ['error', { extensions: ['.js', '.jsx'] }],
'react/jsx-props-no-spreading': 'off', // we can allow spreading, because objects are well defined by Flow
'react/jsx-one-expression-per-line': 'off', // conflict with prettier
'react/jsx-indent': 'off', // conflict with prettier
'react/jsx-wrap-multilines': 'off', // conflict with prettier
'react/jsx-closing-tag-location': 'off', // conflict with prettier
},
settings: {
'import/resolver': {
Expand Down
4 changes: 2 additions & 2 deletions src/webpack/development/createHttpDevServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ const webpackDevMiddleware = require('webpack-dev-middleware');
const webpackHotMiddleware = require('webpack-hot-middleware');
const mergeWebpackConfig = require('../utils/mergeWebpackConfig');
const defaultWebpackConfig = require('../../config/webpack.dev');
const validateDll = require('../utils/validateDll.js');
const installDll = require('../utils/installDll.js');
const validateDll = require('../utils/validateDll');
const installDll = require('../utils/installDll');

module.exports = function createHttpDevServer(config) {
// create server
Expand Down

0 comments on commit 96f8250

Please sign in to comment.