Skip to content

Commit 2644ee5

Browse files
committed
Fix linting
1 parent 0e04d70 commit 2644ee5

File tree

9 files changed

+97
-76
lines changed

9 files changed

+97
-76
lines changed

addon/components/bs-form.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,21 @@ import RSVP from 'rsvp';
44
import BsForm from 'ember-bootstrap/components/bs-form';
55

66
export default BsForm.extend({
7-
'__ember-bootstrap_subclass' : true,
7+
'__ember-bootstrap_subclass': true,
88

99
hasValidator: notEmpty('model.validate'),
1010

1111
validate(model) {
1212
let m = model;
1313

14-
assert('Model must be a Changeset instance', m && typeof m.validate === 'function');
15-
return new RSVP.Promise( function(resolve, reject) {
16-
m.validate().then(
17-
() => {
18-
model.get('isValid') ? resolve() : reject();
19-
},
20-
reject
21-
);
14+
assert(
15+
'Model must be a Changeset instance',
16+
m && typeof m.validate === 'function'
17+
);
18+
return new RSVP.Promise(function (resolve, reject) {
19+
m.validate().then(() => {
20+
model.get('isValid') ? resolve() : reject();
21+
}, reject);
2222
});
23-
}
23+
},
2424
});

addon/components/bs-form/element.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ export default class BsFormElementWithChangesetValidationsSupport extends BsForm
6262
// run initial validation if
6363
// - visibility of validations changed
6464
let canValidate = this.hasValidator && this.args.property;
65-
let validationVisibilityChanged = !validationShowBefore && this.showOwnValidation;
65+
let validationVisibilityChanged =
66+
!validationShowBefore && this.showOwnValidation;
6667
if (canValidate && validationVisibilityChanged) {
6768
await this.args.model.validate(this.args.property);
6869
}

app/components/bs-form.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export { default } from 'ember-bootstrap-changeset-validations/components/bs-form';
1+
export { default } from 'ember-bootstrap-changeset-validations/components/bs-form';

app/components/bs-form/element.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export { default } from 'ember-bootstrap-changeset-validations/components/bs-form/element';
1+
export { default } from 'ember-bootstrap-changeset-validations/components/bs-form/element';

ember-cli-build.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module.exports = function (defaults) {
88
'ember-bootstrap': {
99
bootstrapVersion: 4,
1010
importBootstrapFont: false,
11-
importBootstrapCSS: true
11+
importBootstrapCSS: true,
1212
},
1313
});
1414

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
"ember-resolver": "^8.0.3",
6060
"ember-source": "~4.2.0",
6161
"ember-source-channel-url": "^3.0.0",
62-
"ember-template-lint": "^4.2.0",
62+
"ember-template-lint": "^4.3.0",
6363
"ember-try": "^2.0.0",
6464
"eslint": "^7.32.0",
6565
"eslint-config-prettier": "^8.4.0",

tests/dummy/app/controllers/application.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { action } from '@ember/object';
33
import Changeset from 'ember-changeset';
44
import {
55
validatePresence,
6-
validateLength
6+
validateLength,
77
} from 'ember-changeset-validations/validators';
88
import lookupValidator from 'ember-changeset-validations';
99

@@ -12,10 +12,7 @@ class Model {
1212
}
1313

1414
const Validation = {
15-
name: [
16-
validatePresence(true),
17-
validateLength({ min: 4 })
18-
]
15+
name: [validatePresence(true), validateLength({ min: 4 })],
1916
};
2017

2118
export default class ApplicationController extends Controller {
@@ -25,7 +22,11 @@ export default class ApplicationController extends Controller {
2522
constructor() {
2623
super(...arguments);
2724

28-
this.changeset = new Changeset(this.model, lookupValidator(Validation), Validation);
25+
this.changeset = new Changeset(
26+
this.model,
27+
lookupValidator(Validation),
28+
Validation
29+
);
2930
}
3031

3132
@action

0 commit comments

Comments
 (0)