Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update linters #241

Merged
merged 2 commits into from
Feb 24, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
update linters
Jessica Peng committed Feb 16, 2022
commit e8b6e4887bf421e8009167e89a0f37a4cf626186
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist/
node_modules/
5 changes: 3 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
module.exports = {
'env': {
'browser': true,
'es6': true
'es6': true,
'node': true
},
'extends': [
'eslint:recommended',
@@ -21,6 +22,6 @@ module.exports = {
'vue'
],
'rules': {
'quotes': ['error', 'single'],
'quotes': ['error', 'single']
}
};
17 changes: 9 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@
"private": false,
"scripts": {
"serve": "vue-cli-service serve",
"lint": "vue-cli-service lint && eslint --fix 'src/**/*.vue'",
"lint": "vue-cli-service lint && eslint . --ext .js --ext .vue",
"build": "npm run build:umd & npm run build:es & npm run build:unpkg",
"build-bundle": "vue-cli-service build --target lib --name mew-components ./src/wrapper.js",
"build:umd": "rollup --config rollup.config.js --format umd --file dist/mew-components.umd.js",
@@ -32,6 +32,7 @@
"eslint-config-eslint": "^6.0.0",
"fibers": "^5.0.0",
"git-url-parse": "^11.1.2",
"lodash": "^4.17.21",
"material-design-icons-iconfont": "^5.0.1",
"minimist": "^1.2.5",
"rollup-plugin-uglify-es": "0.0.1",
28 changes: 19 additions & 9 deletions src/components/MewPopup/MewPopup.vue
Original file line number Diff line number Diff line change
@@ -12,7 +12,10 @@
:scrollable="scrollable"
@click:outside="handleClickOutside"
>
<v-card color="white" class="pa-0">
<v-card
color="white"
class="pa-0"
>
<!--
=====================================================================================
Dialog Header
@@ -63,8 +66,15 @@
Dialog action
=====================================================================================
-->
<v-card-actions v-if="hasButtons" class="py-5 py-md-8">
<v-row class="pa-0" justify="space-around" dense>
<v-card-actions
v-if="hasButtons"
class="py-5 py-md-8"
>
<v-row
class="pa-0"
justify="space-around"
dense
>
<v-col
cols="12"
:sm="!rightBtn ? '12' : '6'"
@@ -105,7 +115,7 @@
</template>

<script>
import MewButton from "@/components/MewButton/MewButton.vue";
import MewButton from '@/components/MewButton/MewButton.vue';

export default {
components: { MewButton },
@@ -115,7 +125,7 @@ export default {
*/
title: {
type: String,
default: "",
default: '',
},
/**
* Hide top right close button
@@ -139,7 +149,7 @@ export default {
leftBtn: {
type: Object,
default: () => {
return { text: "Cancel", color: "primary", method: () => {} };
return { text: 'Cancel', color: 'primary', method: () => {} };
},
},
/**
@@ -150,8 +160,8 @@ export default {
type: Object,
default: () => {
return {
text: "Confirm",
color: "primary",
text: 'Confirm',
color: 'primary',
enabled: true,
method: () => {},
};
@@ -169,7 +179,7 @@ export default {
*/
maxWidth: {
type: String,
default: "600",
default: '600',
},
/**
* Displays v-card-text if there is popup body content
13 changes: 4 additions & 9 deletions src/components/MewSelect/MewSelect.vue
Original file line number Diff line number Diff line change
@@ -221,6 +221,7 @@
</template>
<script>
import MewTokenContainer from '@/components/MewTokenContainer/MewTokenContainer.vue';
import get from 'lodash/get';

export default {
name: 'MewSelect',
@@ -322,15 +323,9 @@ export default {
} else {
const foundItems = this.items.filter((item) => {
const searchValue = String(newVal).toLowerCase();
const value = item.hasOwnProperty('value')
? String(item.value).toLowerCase()
: '';
const name = item.hasOwnProperty('name')
? String(item.name).toLowerCase()
: '';
const subtext = item.hasOwnProperty('subtext')
? String(item.subtext).toLowerCase()
: '';
const value = String(get(item, 'value', '')).toLowerCase();
const name = String(get(item, 'name', '')).toLowerCase();
const subtext = String(get(item, 'subtext', '')).toLowerCase();
return (
name.includes(searchValue) ||
subtext.includes(searchValue) ||
2 changes: 1 addition & 1 deletion stories/MewAddressSelect/MewAddressSelect.stories.js
Original file line number Diff line number Diff line change
@@ -36,7 +36,7 @@ const addressesArray = [
},
];

export const mewAddressSelect = () => ({
export const MEWAddressSelect = () => ({
components: { MewAddressSelect },
props: {
label: {
2 changes: 1 addition & 1 deletion stories/MewBadge/MewBadge.stories.js
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@ const badgeOptions = {
warning: 'warning'
}

export const mewBadge = () => ({
export const MEWBadge = () => ({
components: { MewBadge },
props: {
enableDarkMode: {
2 changes: 1 addition & 1 deletion stories/MewBanner/MewBanner.stories.js
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@ const textObj = {
exit: 'Exit Dapp'
}

export const mewBanner = () => ({
export const MEWBanner = () => ({
components: { MewBanner },
props: {
enableDarkMode: {
2 changes: 1 addition & 1 deletion stories/MewCopy/MewCopy.stories.js
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@ export default {
decorators: [withKnobs]
};

export const mewCopy = () => ({
export const MEWCopy = () => ({
data() {
return {
inputValue: 'Copied value'
2 changes: 1 addition & 1 deletion stories/MewIcon/MewIcon.stories.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { withKnobs, boolean, text, number } from '@storybook/addon-knobs';
import { withKnobs, boolean, number } from '@storybook/addon-knobs';
import MewIcon from '@/components/MewIcon/MewIcon.vue';
import MewIconDoc from './MewIcon.mdx';

2 changes: 1 addition & 1 deletion stories/MewIconButton/MewIconButton.stories.js
Original file line number Diff line number Diff line change
@@ -45,7 +45,7 @@ const optionsObj = {
display: 'inline-radio',
};

export const MEWButton = () => ({
export const MEWIconButton = () => ({
components: { MewIconButton },
props: {
disabled: {
2 changes: 1 addition & 1 deletion stories/MewToast/MewToast.stories.js
Original file line number Diff line number Diff line change
@@ -38,7 +38,7 @@ const linkObj = {
url: ''
}

export const mewToast = () => ({
export const MEWToast = () => ({
components: { MewToast, MewButton },
props: {
duration: {
4 changes: 2 additions & 2 deletions stories/MewToggle/MewToggle.stories.js
Original file line number Diff line number Diff line change
@@ -21,15 +21,15 @@ export default {

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

const buttonPercentageGroup = ['25%', '50%', '75%', 'Max'];
// const buttonPercentageGroup = ['25%', '50%', '75%', 'Max'];

const buttonTypes = {
custom: 'custom',
default: 'default',
percentage: 'percentage'
}

export const mewToggle = () => ({
export const MEWToggle = () => ({
components: { MewToggle },
props: {
enableDarkMode: {
2 changes: 1 addition & 1 deletion stories/MewTokenContainer/MewTokenContainer.stories.js
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@ const sizeOptions = {
large: 'large'
}

export const mewTokenContainer = () => ({
export const MEWTokenContainer = () => ({
components: { MewTokenContainer },
props: {
enableDarkMode: {
2 changes: 1 addition & 1 deletion stories/MewTooltip/MewTooltip.stories.js
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@ export default {
decorators: [withKnobs]
};

export const mewTooltip = () => ({
export const MEWTooltip = () => ({
components: { MewTooltip },
props: {
enableDarkMode: {
2 changes: 1 addition & 1 deletion stories/MewTransformHash/MewTransformHash.stories.js
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@ export default {
decorators: [withKnobs]
};

export const mewTransformHash = () => ({
export const MEWTransformHash = () => ({
components: { MewTransformHash },
props: {
enableDarkMode: {
2 changes: 1 addition & 1 deletion stories/MewWarningSheet/MewWarningSheet.stories.js
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@ const linkObj = {
url: 'https://www.myetherwallet.com/'
};

export const mewWarningSheet = () => ({
export const MEWWarningSheet = () => ({
components: { MewWarningSheet },
props: {
enableDarkMode: {
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
@@ -7415,9 +7415,9 @@
"version" "0.6.8"

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

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