Skip to content

Commit

Permalink
Switch to own ESLint config
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelmeuli committed Feb 6, 2019
1 parent a6cbde7 commit 575f146
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 44 deletions.
2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

35 changes: 5 additions & 30 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ root: true

extends:
- airbnb
- "@samuelmeuli/eslint-config/react"
- prettier

env:
Expand All @@ -11,33 +12,7 @@ env:
plugins:
- html

rules:
capitalized-comments:
- error
- always
- ignoreConsecutiveComments: true
ignorePattern: prettier-ignore
no-console:
- error
- allow:
- error

# React
react/button-has-type: error
react/jsx-filename-extension:
- error
- extensions:
- .js
react/jsx-indent:
- error
- tab
react/jsx-indent-props:
- error
- tab
react/jsx-one-expression-per-line: off

# Project-specific
global-require: off
import/no-extraneous-dependencies: off
import/prefer-default-export: off
jsx-a11y/no-autofocus: off
settings:
# Electron
import/core-modules:
- electron
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"start:webpack": "webpack --mode development",
"start:webpack-watch": "webpack --mode development --watch",
"start:electron": "electron .",
"format:any": "prettier --ignore-path .gitignore --print-width 100 --write",
"format:js": "prettier --ignore-path .gitignore --print-width 100 --single-quote --write",
"format:any": "prettier --print-width 100 --write",
"format:js": "prettier --print-width 100 --single-quote --write",
"lint:css": "stylelint --fix",
"lint:scss": "stylelint --fix --syntax scss",
"lint:js": "eslint --ext .html,.js",
Expand Down Expand Up @@ -56,6 +56,7 @@
"@babel/core": "^7.1.2",
"@babel/preset-env": "^7.1.0",
"@babel/preset-react": "^7.0.0",
"@samuelmeuli/eslint-config": "~1.0.0",
"@samuelmeuli/stylelint-config": "1.0.0",
"babel-loader": "^8.0.4",
"copy-webpack-plugin": "^4.6.0",
Expand Down Expand Up @@ -113,8 +114,8 @@
},
"lint-staged": {
"*.{html,js}": [
"yarn format:js",
"yarn lint:js",
"yarn format:js",
"git add"
],
"*.css": [
Expand Down
3 changes: 2 additions & 1 deletion src/main.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
/* eslint-disable global-require */

const { app, BrowserWindow } = require('electron');
require('electron-debug')();
const { autoUpdater } = require('electron-updater');

const { getWindow, setWindow } = require('./main/window');


function onClosed() {
// Dereference the window
setWindow(null);
Expand Down
16 changes: 11 additions & 5 deletions src/main/i18n/i18n.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
const { app } = require('electron');

const translationsDe = require('./translations/de');
const translationsEn = require('./translations/en');
const translationsEs = require('./translations/es');
const translationsFr = require('./translations/fr');
const translationsPt = require('./translations/pt');

const DEFAULT_LANG = 'en';
const TRANSLATIONS = {
de: require('./translations/de'),
en: require('./translations/en'),
es: require('./translations/es'),
fr: require('./translations/fr'),
pt: require('./translations/pt')
translationsDe,
translationsEn,
translationsEs,
translationsFr,
translationsPt
};

const systemLang = app.getLocale();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export default class PasswordCreation extends PureComponent {
type="password"
value={password1}
placeholder={t('password')}
autoFocus
autoFocus // eslint-disable-line jsx-a11y/no-autofocus
required
onChange={this.onChangePassword1}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export default class PasswordPrompt extends PureComponent {
value={password}
onChange={this.onChange}
placeholder={t('password')}
autoFocus
autoFocus // eslint-disable-line jsx-a11y/no-autofocus
required
ref={i => {
this.input = i;
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const root = document.createElement('div');
root.id = 'root';
document.body.appendChild(root);

// Render react app inside root
// Render React app inside root
ReactDOM.render(
<Provider store={store}>
<AppContainer />
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -696,6 +696,11 @@
resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz#2b5a3ab3f918cca48a8c754c08168e3f03eba61b"
integrity sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw==

"@samuelmeuli/eslint-config@~1.0.0":
version "1.0.0"
resolved "https://registry.yarnpkg.com/@samuelmeuli/eslint-config/-/eslint-config-1.0.0.tgz#3f8ea14705e00860dce59299a710303d0de98767"
integrity sha512-nXnMvZJQj2UEM9Blobvn428UzbjimqvqUrZgJO6Dmr2xok4/igQBEB7pmteGllDFlKJsOynJ50zNa0xQ1GBnNg==

"@samuelmeuli/[email protected]":
version "1.0.0"
resolved "https://registry.yarnpkg.com/@samuelmeuli/stylelint-config/-/stylelint-config-1.0.0.tgz#ce700e4236e20e4be1cb203c3413315706306dee"
Expand Down

0 comments on commit 575f146

Please sign in to comment.