Skip to content

Commit

Permalink
Merge pull request input-output-hk#1335 from input-output-hk/chore/dd…
Browse files Browse the repository at this point in the history
…w-536-automate-code-formatting

[DDW-536] Automate code formatting
  • Loading branch information
nikolaglumac authored Mar 13, 2019
2 parents 229848a + aacf8a3 commit a8fcb1e
Show file tree
Hide file tree
Showing 439 changed files with 11,587 additions and 6,512 deletions.
9 changes: 9 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
dist
release
main.js
.cache-loader
logs
node_modules
translations
tests
features/support/default-wallet.json
mainnet-genesis-dryrun-with-stakeholders.json
source/renderer/app/i18n/locales
nodemon.json
97 changes: 35 additions & 62 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -8,80 +8,53 @@
"extends": [
"airbnb",
"plugin:flowtype/recommended",
"plugin:react/recommended"
"plugin:react/recommended",
"prettier",
"prettier/babel",
"prettier/flowtype",
"prettier/react"
],
"env": {
"browser": true,
"mocha": true,
"node": true
},
"rules": {
"arrow-parens": ["off"],
"consistent-return": "off",
"comma-dangle": "off",
"generator-star-spacing": "off",
"import/no-unresolved": ["error", { "ignore": ["electron"] }],
"import/no-extraneous-dependencies": "off",
"import/no-dynamic-require": "off",
"import/prefer-default-export": "off",
"lines-between-class-members": 0,
"no-use-before-define": "off",
"operator-linebreak": 0,
"promise/param-names": 2,
"promise/always-return": 2,
"promise/catch-or-return": 2,
"promise/no-native": 0,
"react/button-has-type": 0,
"react/jsx-no-bind": 0,
"react/jsx-filename-extension": ["error", { "extensions": [".js", ".jsx"] }],
"react/jsx-closing-bracket-location": 1,
"react/jsx-one-expression-per-line": 0,
"react/prefer-stateless-function": "off",
"react/no-unused-prop-types": "off",
"react/prop-types": 0,
"react/sort-comp": 0,
"react/require-default-props": 0,
"react/destructuring-assignment": 0,
"react/no-access-state-in-setstate": 0,
"class-methods-use-this": 0,
"no-duplicate-imports": 0,
"consistent-return": "warn",
"flowtype/generic-spacing": 0,
"jsx-a11y/alt-text": 0,
"lines-between-class-members": 0,
"global-require": 0,
"import/extensions": 0,
"import/no-dynamic-require": 0,
"import/no-extraneous-dependencies": 0,
"import/prefer-default-export": 0,
"no-await-in-loop": 0,
"no-bitwise": 0,
"no-param-reassign": 0,
"no-plusplus": 0,
"no-bitwise": 0,
"no-return-assign": "warn",
"no-return-await": "warn",
"no-underscore-dangle": 0,
"no-console": 0,
"no-mixed-operators": 0,
"prefer-template": 0,
"no-unused-vars": 1,
"no-trailing-spaces": 1,
"padded-blocks": 0,
"no-undef": 1,
"arrow-body-style": 1,
"key-spacing": 1,
"no-empty-function": 1,
"max-len": 1,
"no-useless-escape": 1,
"prefer-const": 1,
"object-curly-spacing": 1,
"spaced-comment": 1,
"quotes": 1,
"import/imports-first": 1,
"no-multi-spaces": 1,
"no-multiple-empty-lines": 1,
"react/jsx-indent": 1,
"global-require": "off",
"prefer-destructuring": 0,
"no-return-await": 0,
"function-paren-newline": 0,
"react/no-array-index-key": 0,
"object-curly-newline": 0,
"jsx-a11y/alt-text": 0,
"no-await-in-loop": 0,
"no-unused-expressions": "warn",
"no-use-before-define": 0,
"no-restricted-syntax": 0,
"no-return-assign": 0,
"prefer-promise-reject-errors": 0,
"no-unused-expressions": 0,
"import/extensions": 0
"prefer-destructuring": "warn",
"prefer-promise-reject-errors": "warn",
"prefer-template": "warn",
"react/button-has-type": 0,
"react/destructuring-assignment": 0,
"react/jsx-no-bind": "warn",
"react/jsx-wrap-multilines": 0,
"react/jsx-filename-extension": 0,
"react/no-access-state-in-setstate": "warn",
"react/no-array-index-key": "warn",
"react/no-unused-prop-types": "warn",
"react/prefer-stateless-function": 0,
"react/prop-types": "warn",
"react/require-default-props": 0,
"react/sort-comp": 0
},
"plugins": [
"flowtype",
Expand Down
4 changes: 4 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"trailingComma": "es5",
"singleQuote": true
}
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ Changelog

### Chores

- Implemented `pretier` formatting tool and set up automation for basic maintainance tasks ([PR 1335](https://github.com/input-output-hk/daedalus/pull/1335))
- Replaced "Ada" with "ada" ([PR 1317](https://github.com/input-output-hk/daedalus/pull/1317), [PR 1336](https://github.com/input-output-hk/daedalus/pull/1336))
- Improved the internal IPC communication ([PR 1332](https://github.com/input-output-hk/daedalus/pull/1332))
- Improved Webpack 4 build performance ([PR 1320](https://github.com/input-output-hk/daedalus/pull/1320))
- Introduced automated code formatting with prettier ([PR 1335](https://github.com/input-output-hk/daedalus/pull/1335))

## 0.13.0

Expand Down
19 changes: 11 additions & 8 deletions features/step_definitions/about-dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,24 @@ import { Given, When, Then } from 'cucumber';
import { expect } from 'chai';
import packageJson from '../../package.json';

Given(/^I open the About dialog$/, async function () {
Given(/^I open the About dialog$/, async function() {
this.client.execute(() => daedalus.actions.app.openAboutDialog.trigger());
});

When(/^I close the About dialog$/, function () {
When(/^I close the About dialog$/, function() {
this.client.execute(() => daedalus.actions.app.closeAboutDialog.trigger());
});

Then(/^the About dialog is (hidden|visible)/, async function (state) {
Then(/^the About dialog is (hidden|visible)/, async function(state) {
const isVisible = state === 'visible';
return this.client.waitForVisible('.About_container', null, !isVisible);
});

Then(/^the About dialog and package.json show the same Daedalus version/, async function () {
const { version: packageJsonVersion } = packageJson;
const aboutVersion = await this.client.getText('.About_daedalusVersion');
expect(aboutVersion).to.equal(packageJsonVersion);
});
Then(
/^the About dialog and package.json show the same Daedalus version/,
async function() {
const { version: packageJsonVersion } = packageJson;
const aboutVersion = await this.client.getText('.About_daedalusVersion');
expect(aboutVersion).to.equal(packageJsonVersion);
}
);
21 changes: 11 additions & 10 deletions features/step_definitions/accept-terms-of-use-steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,38 @@ import termsOfUse from '../support/helpers/terms-of-use-helpers';

const TERMS_OF_USE_FORM = '.TermsOfUseForm_component';

Given(/^I have accepted "Terms of use"$/, async function () {
Given(/^I have accepted "Terms of use"$/, async function() {
await termsOfUse.acceptTerms(this.client);
});

Given(/^I didnt accept "Terms of use"$/, async function () {
Given(/^I didnt accept "Terms of use"$/, async function() {
await this.client.execute(() => {
daedalus.reset();
});
});

Given(/^I am on the "Terms of use" screen$/, function () {
Given(/^I am on the "Terms of use" screen$/, function() {
return this.client.waitForVisible(TERMS_OF_USE_FORM);
});

When(/^I click on "I agree with terms of use" checkbox$/, function () {
When(/^I click on "I agree with terms of use" checkbox$/, function() {
return this.waitAndClick('.TermsOfUseForm_component .SimpleCheckbox_root');
});

When(/^I submit the "Terms of use" form$/, function () {
When(/^I submit the "Terms of use" form$/, function() {
return this.waitAndClick('.TermsOfUseForm_submitButton');
});

Then(/^I should not see the "Terms of use" screen anymore$/, function () {
Then(/^I should not see the "Terms of use" screen anymore$/, function() {
return this.client.waitForVisible(TERMS_OF_USE_FORM, null, true);
});

Then(/^I should have "Terms of use" accepted$/, async function () {
const result = await this.client.executeAsync((done) => {
daedalus.stores.profile.getTermsOfUseAcceptanceRequest.execute()
Then(/^I should have "Terms of use" accepted$/, async function() {
const result = await this.client.executeAsync(done => {
daedalus.stores.profile.getTermsOfUseAcceptanceRequest
.execute()
.then(done)
.catch((error) => done(error));
.catch(error => done(error));
});
expect(result.value).to.equal(true);
});
Loading

0 comments on commit a8fcb1e

Please sign in to comment.