Skip to content

Commit 217d376

Browse files
authoredFeb 24, 2022
Merge pull request #241 from MyEtherWallet/updates/lint
update linters
2 parents 26f3dc1 + 51c84b6 commit 217d376

20 files changed

+60
-45
lines changed
 

‎.eslintignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
dist/
2+
node_modules/

‎.eslintrc.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
module.exports = {
22
'env': {
33
'browser': true,
4-
'es6': true
4+
'es6': true,
5+
'node': true
56
},
67
'extends': [
78
'eslint:recommended',
@@ -21,6 +22,6 @@ module.exports = {
2122
'vue'
2223
],
2324
'rules': {
24-
'quotes': ['error', 'single'],
25+
'quotes': ['error', 'single']
2526
}
2627
};

‎CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
### Release 0.7.20-beta
2+
3+
### feature
4+
- update eslint config, lint script and mew-select search method [#241] (https://github.com/MyEtherWallet/mew-components/pull/241)
5+
16
### Release 0.7.19-beta
27

38
### feature

‎package-lock.json

+9-8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"private": false,
1212
"scripts": {
1313
"serve": "vue-cli-service serve",
14-
"lint": "vue-cli-service lint && eslint --fix 'src/**/*.vue'",
14+
"lint": "vue-cli-service lint && eslint . --ext .js --ext .vue",
1515
"build": "npm run build:umd & npm run build:es & npm run build:unpkg",
1616
"build-bundle": "vue-cli-service build --target lib --name mew-components ./src/wrapper.js",
1717
"build:umd": "rollup --config rollup.config.js --format umd --file dist/mew-components.umd.js",
@@ -32,6 +32,7 @@
3232
"eslint-config-eslint": "^6.0.0",
3333
"fibers": "^5.0.0",
3434
"git-url-parse": "^11.1.2",
35+
"lodash": "^4.17.21",
3536
"material-design-icons-iconfont": "^5.0.1",
3637
"minimist": "^1.2.5",
3738
"rollup-plugin-uglify-es": "0.0.1",

‎src/components/MewPopup/MewPopup.vue

+19-9
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@
1212
:scrollable="scrollable"
1313
@click:outside="handleClickOutside"
1414
>
15-
<v-card color="white" class="pa-0">
15+
<v-card
16+
color="white"
17+
class="pa-0"
18+
>
1619
<!--
1720
=====================================================================================
1821
Dialog Header
@@ -63,8 +66,15 @@
6366
Dialog action
6467
=====================================================================================
6568
-->
66-
<v-card-actions v-if="hasButtons" class="py-5 py-md-8">
67-
<v-row class="pa-0" justify="space-around" dense>
69+
<v-card-actions
70+
v-if="hasButtons"
71+
class="py-5 py-md-8"
72+
>
73+
<v-row
74+
class="pa-0"
75+
justify="space-around"
76+
dense
77+
>
6878
<v-col
6979
cols="12"
7080
:sm="!rightBtn ? '12' : '6'"
@@ -105,7 +115,7 @@
105115
</template>
106116

107117
<script>
108-
import MewButton from "@/components/MewButton/MewButton.vue";
118+
import MewButton from '@/components/MewButton/MewButton.vue';
109119
110120
export default {
111121
components: { MewButton },
@@ -115,7 +125,7 @@ export default {
115125
*/
116126
title: {
117127
type: String,
118-
default: "",
128+
default: '',
119129
},
120130
/**
121131
* Hide top right close button
@@ -139,7 +149,7 @@ export default {
139149
leftBtn: {
140150
type: Object,
141151
default: () => {
142-
return { text: "Cancel", color: "primary", method: () => {} };
152+
return { text: 'Cancel', color: 'primary', method: () => {} };
143153
},
144154
},
145155
/**
@@ -150,8 +160,8 @@ export default {
150160
type: Object,
151161
default: () => {
152162
return {
153-
text: "Confirm",
154-
color: "primary",
163+
text: 'Confirm',
164+
color: 'primary',
155165
enabled: true,
156166
method: () => {},
157167
};
@@ -169,7 +179,7 @@ export default {
169179
*/
170180
maxWidth: {
171181
type: String,
172-
default: "600",
182+
default: '600',
173183
},
174184
/**
175185
* Displays v-card-text if there is popup body content

‎src/components/MewSelect/MewSelect.vue

+4-9
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@
221221
</template>
222222
<script>
223223
import MewTokenContainer from '@/components/MewTokenContainer/MewTokenContainer.vue';
224+
import get from 'lodash/get';
224225
225226
export default {
226227
name: 'MewSelect',
@@ -322,15 +323,9 @@ export default {
322323
} else {
323324
const foundItems = this.items.filter((item) => {
324325
const searchValue = String(newVal).toLowerCase();
325-
const value = item.hasOwnProperty('value')
326-
? String(item.value).toLowerCase()
327-
: '';
328-
const name = item.hasOwnProperty('name')
329-
? String(item.name).toLowerCase()
330-
: '';
331-
const subtext = item.hasOwnProperty('subtext')
332-
? String(item.subtext).toLowerCase()
333-
: '';
326+
const value = String(get(item, 'value', '')).toLowerCase();
327+
const name = String(get(item, 'name', '')).toLowerCase();
328+
const subtext = String(get(item, 'subtext', '')).toLowerCase();
334329
return (
335330
name.includes(searchValue) ||
336331
subtext.includes(searchValue) ||

‎stories/MewAddressSelect/MewAddressSelect.stories.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const addressesArray = [
3636
},
3737
];
3838

39-
export const mewAddressSelect = () => ({
39+
export const MEWAddressSelect = () => ({
4040
components: { MewAddressSelect },
4141
props: {
4242
label: {

‎stories/MewBadge/MewBadge.stories.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const badgeOptions = {
2727
warning: 'warning'
2828
}
2929

30-
export const mewBadge = () => ({
30+
export const MEWBadge = () => ({
3131
components: { MewBadge },
3232
props: {
3333
enableDarkMode: {

‎stories/MewBanner/MewBanner.stories.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const textObj = {
2424
exit: 'Exit Dapp'
2525
}
2626

27-
export const mewBanner = () => ({
27+
export const MEWBanner = () => ({
2828
components: { MewBanner },
2929
props: {
3030
enableDarkMode: {

‎stories/MewCopy/MewCopy.stories.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export default {
1818
decorators: [withKnobs]
1919
};
2020

21-
export const mewCopy = () => ({
21+
export const MEWCopy = () => ({
2222
data() {
2323
return {
2424
inputValue: 'Copied value'

‎stories/MewIcon/MewIcon.stories.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { withKnobs, boolean, text, number } from '@storybook/addon-knobs';
1+
import { withKnobs, boolean, number } from '@storybook/addon-knobs';
22
import MewIcon from '@/components/MewIcon/MewIcon.vue';
33
import MewIconDoc from './MewIcon.mdx';
44

‎stories/MewIconButton/MewIconButton.stories.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const optionsObj = {
4545
display: 'inline-radio',
4646
};
4747

48-
export const MEWButton = () => ({
48+
export const MEWIconButton = () => ({
4949
components: { MewIconButton },
5050
props: {
5151
disabled: {

‎stories/MewToast/MewToast.stories.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const linkObj = {
3838
url: ''
3939
}
4040

41-
export const mewToast = () => ({
41+
export const MEWToast = () => ({
4242
components: { MewToast, MewButton },
4343
props: {
4444
duration: {

‎stories/MewToggle/MewToggle.stories.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ export default {
2121

2222
const buttonDefaultGroup = ['1D', '1W', '1M', '1Y', 'All'];
2323

24-
const buttonPercentageGroup = ['25%', '50%', '75%', 'Max'];
24+
// const buttonPercentageGroup = ['25%', '50%', '75%', 'Max'];
2525

2626
const buttonTypes = {
2727
custom: 'custom',
2828
default: 'default',
2929
percentage: 'percentage'
3030
}
3131

32-
export const mewToggle = () => ({
32+
export const MEWToggle = () => ({
3333
components: { MewToggle },
3434
props: {
3535
enableDarkMode: {

‎stories/MewTokenContainer/MewTokenContainer.stories.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const sizeOptions = {
2626
large: 'large'
2727
}
2828

29-
export const mewTokenContainer = () => ({
29+
export const MEWTokenContainer = () => ({
3030
components: { MewTokenContainer },
3131
props: {
3232
enableDarkMode: {

‎stories/MewTooltip/MewTooltip.stories.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export default {
1717
decorators: [withKnobs]
1818
};
1919

20-
export const mewTooltip = () => ({
20+
export const MEWTooltip = () => ({
2121
components: { MewTooltip },
2222
props: {
2323
enableDarkMode: {

‎stories/MewTransformHash/MewTransformHash.stories.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export default {
1717
decorators: [withKnobs]
1818
};
1919

20-
export const mewTransformHash = () => ({
20+
export const MEWTransformHash = () => ({
2121
components: { MewTransformHash },
2222
props: {
2323
enableDarkMode: {

‎stories/MewWarningSheet/MewWarningSheet.stories.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const linkObj = {
2424
url: 'https://www.myetherwallet.com/'
2525
};
2626

27-
export const mewWarningSheet = () => ({
27+
export const MEWWarningSheet = () => ({
2828
components: { MewWarningSheet },
2929
props: {
3030
enableDarkMode: {

‎yarn.lock

+3-3
Original file line numberDiff line numberDiff line change
@@ -7415,9 +7415,9 @@
74157415
"version" "0.6.8"
74167416

74177417
"follow-redirects@^1.0.0":
7418-
"integrity" "sha512-+hbxoLbFMbRKDwohX8GkTataGqO6Jb7jGwpAlwgy2bIz25XtRm7KEzJM76R1WiNT5SwZkX4Y75SwBolkpmE7iQ=="
7419-
"resolved" "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.7.tgz"
7420-
"version" "1.14.7"
7418+
"integrity" "sha512-1x0S9UVJHsQprFcEC/qnNzBLcIxsjAV905f/UkQxbclCsoTWlacCNOpQa/anodLl2uaEKFhfWOvM2Qg77+15zA=="
7419+
"resolved" "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.8.tgz"
7420+
"version" "1.14.8"
74217421

74227422
"for-in@^1.0.2":
74237423
"integrity" "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA="

0 commit comments

Comments
 (0)
Please sign in to comment.