Skip to content

Commit 6a3c88b

Browse files
Add eslint, cleanup
1 parent c61dbdd commit 6a3c88b

File tree

5 files changed

+149
-9
lines changed

5 files changed

+149
-9
lines changed

.eslintrc.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
module.exports = {
2+
"env": {
3+
"browser": true,
4+
"es6": true
5+
},
6+
"extends": "eslint:recommended",
7+
"parserOptions": {
8+
"sourceType": "module",
9+
"ecmaVersion": 2017
10+
},
11+
"rules": {
12+
"indent": [
13+
"error",
14+
4
15+
],
16+
"linebreak-style": [
17+
"error",
18+
"unix"
19+
],
20+
"quotes": [
21+
"error",
22+
"single"
23+
],
24+
"semi": [
25+
"error",
26+
"never"
27+
]
28+
}
29+
};

package-lock.json

Lines changed: 109 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@
2929
"chalk": "^2.0.1",
3030
"copy-webpack-plugin": "^4.0.1",
3131
"css-loader": "^0.28.0",
32+
"eslint-plugin-import": "^2.12.0",
33+
"eslint-plugin-node": "^6.0.1",
34+
"eslint-plugin-promise": "^3.8.0",
35+
"eslint-plugin-standard": "^3.1.0",
3236
"extract-text-webpack-plugin": "^3.0.0",
3337
"file-loader": "^1.1.4",
3438
"friendly-errors-webpack-plugin": "^1.6.1",

src/api.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ function initComponent(tag, wrapper = 'body') {
2626
}
2727

2828
function getOrAppendElement(tag, wrapper) {
29-
let element
29+
let element = document.querySelector(tag)
3030

31-
if (element = document.querySelector(tag)) {
31+
if (element) {
3232
return element
3333
}
3434

35-
return wrapper.appendChild(document.createElement(tag));
35+
return wrapper.appendChild(document.createElement(tag))
3636
}
3737

src/framework-delegate.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ export function removeViewFromDom(parentElement, childElement) {
2424
childElement.__vue__.$destroy()
2525
}
2626

27-
parentElement.removeChild(childElement);
27+
parentElement.removeChild(childElement)
2828

29-
return Promise.resolve();
29+
return Promise.resolve()
3030
}
3131

3232
const Delegate = {
@@ -41,10 +41,10 @@ function shouldWrapInIonPage(element) {
4141
}
4242

4343
function isElementNav(element) {
44-
return element.tagName.toUpperCase() === 'ION-NAV';
44+
return element.tagName.toUpperCase() === 'ION-NAV'
4545
}
4646

4747
function isElementModal(element) {
48-
return element.classList.contains('modal-wrapper');
48+
return element.classList.contains('modal-wrapper')
4949
}
5050

0 commit comments

Comments
 (0)