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

@metamask/eslint-config*@6.0.0 #10858

Merged
merged 2 commits into from
Apr 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
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
17 changes: 7 additions & 10 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ module.exports = {

extends: [
'@metamask/eslint-config',
'@metamask/eslint-config/config/nodejs',
'@metamask/eslint-config-nodejs',
'prettier',
],

Expand All @@ -48,19 +48,16 @@ module.exports = {
},

rules: {
// Prettier changes and reasoning

'prettier/prettier': 'error',
'import/no-unassigned-import': 'off',
'prefer-object-spread': 'error',
'default-param-last': 'off',
'prefer-object-spread': 'error',
'require-atomic-updates': 'off',

'import/no-unassigned-import': 'off',

'no-invalid-this': 'off',
'@babel/no-invalid-this': 'error',

// prettier handles these
semi: 'off',
// Prettier handles this
'@babel/semi': 'off',

'node/no-process-env': 'off',
Expand Down Expand Up @@ -90,7 +87,7 @@ module.exports = {
},
{
files: ['test/e2e/**/*.spec.js'],
extends: ['@metamask/eslint-config/config/mocha'],
extends: ['@metamask/eslint-config-mocha'],
rules: {
'mocha/no-hooks-for-single-case': 'off',
'mocha/no-setup-in-describe': 'off',
Expand All @@ -110,7 +107,7 @@ module.exports = {
},
{
files: ['**/*.test.js'],
extends: ['@metamask/eslint-config/config/mocha'],
extends: ['@metamask/eslint-config-mocha'],
rules: {
'mocha/no-setup-in-describe': 'off',
},
Expand Down
10 changes: 5 additions & 5 deletions app/scripts/migrations/048.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -352,13 +352,13 @@ describe('migration #48', function () {
data: {
AddressBookController: {
addressBook: {
1: {
'1': {
address1: {
chainId: '1',
foo: 'bar',
},
},
100: {
'100': {
address1: {
chainId: '100',
foo: 'bar',
Expand Down Expand Up @@ -417,7 +417,7 @@ describe('migration #48', function () {
data: {
AddressBookController: {
addressBook: {
2: {
'2': {
address1: {
chainId: '2',
key2: 'kaplar',
Expand Down Expand Up @@ -490,7 +490,7 @@ describe('migration #48', function () {
AddressBookController: {
addressBook: {
'0x1': { foo: { bar: 'baz' } },
kaplar: { foo: { bar: 'baz' } },
'kaplar': { foo: { bar: 'baz' } },
},
bar: {
baz: 'buzz',
Expand All @@ -506,7 +506,7 @@ describe('migration #48', function () {
AddressBookController: {
addressBook: {
'0x1': { foo: { bar: 'baz' } },
kaplar: { foo: { bar: 'baz' } },
'kaplar': { foo: { bar: 'baz' } },
},
bar: {
baz: 'buzz',
Expand Down
2 changes: 1 addition & 1 deletion development/metamaskbot-build-announce.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ async function start() {
body: JSON_PAYLOAD,
headers: {
'User-Agent': 'metamaskbot',
Authorization: `token ${GITHUB_COMMENT_TOKEN}`,
'Authorization': `token ${GITHUB_COMMENT_TOKEN}`,
},
});
if (!response.ok) {
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,9 @@
"@babel/preset-react": "^7.0.0",
"@babel/register": "^7.5.5",
"@lavamoat/allow-scripts": "^1.0.4",
"@metamask/eslint-config": "^5.0.0",
"@metamask/eslint-config": "^6.0.0",
"@metamask/eslint-config-mocha": "^6.0.0",
"@metamask/eslint-config-nodejs": "^6.0.0",
"@metamask/forwarder": "^1.1.0",
"@metamask/test-dapp": "^4.0.1",
"@sentry/cli": "^1.58.0",
Expand Down
2 changes: 1 addition & 1 deletion stylelint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ module.exports = {
'function-parentheses-newline-inside': 'always-multi-line',
'function-parentheses-space-inside': 'never-single-line',
'function-whitespace-after': 'always',
indentation: 2,
'indentation': 2,
'length-zero-no-unit': true,
// 'max-empty-lines': 1,
'media-feature-colon-space-after': 'always',
Expand Down
32 changes: 16 additions & 16 deletions ui/app/components/app/asset-list-item/asset-list-item.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,27 +131,27 @@ const AssetListItem = ({
};

AssetListItem.propTypes = {
className: PropTypes.string,
'className': PropTypes.string,
'data-testid': PropTypes.string,
iconClassName: PropTypes.string,
onClick: PropTypes.func.isRequired,
tokenAddress: PropTypes.string,
tokenSymbol: PropTypes.string,
tokenDecimals: PropTypes.number,
tokenImage: PropTypes.string,
warning: PropTypes.node,
primary: PropTypes.string,
secondary: PropTypes.string,
identiconBorder: PropTypes.bool,
'iconClassName': PropTypes.string,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it too late for me to hate this? 😆

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitively yes! 😂

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're accepting PRs over at /~https://github.com/MetaMask/eslint-config

'onClick': PropTypes.func.isRequired,
'tokenAddress': PropTypes.string,
'tokenSymbol': PropTypes.string,
'tokenDecimals': PropTypes.number,
'tokenImage': PropTypes.string,
'warning': PropTypes.node,
'primary': PropTypes.string,
'secondary': PropTypes.string,
'identiconBorder': PropTypes.bool,
};

AssetListItem.defaultProps = {
className: undefined,
'className': undefined,
'data-testid': undefined,
iconClassName: undefined,
tokenAddress: undefined,
tokenImage: undefined,
warning: undefined,
'iconClassName': undefined,
'tokenAddress': undefined,
'tokenImage': undefined,
'warning': undefined,
};

export default AssetListItem;
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default function UserPreferencedCurrencyDisplay({
ethLogoHeight = 12,
ethNumberOfDecimals,
fiatNumberOfDecimals,
numberOfDecimals: propsNumberOfDecimals,
'numberOfDecimals': propsNumberOfDecimals,
showEthLogo,
type,
...restProps
Expand Down Expand Up @@ -38,22 +38,22 @@ export default function UserPreferencedCurrencyDisplay({
}

UserPreferencedCurrencyDisplay.propTypes = {
className: PropTypes.string,
'className': PropTypes.string,
'data-testid': PropTypes.string,
prefix: PropTypes.string,
value: PropTypes.string,
numberOfDecimals: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
hideLabel: PropTypes.bool,
hideTitle: PropTypes.bool,
style: PropTypes.object,
showEthLogo: PropTypes.bool,
ethLogoHeight: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
type: PropTypes.oneOf([PRIMARY, SECONDARY]),
ethNumberOfDecimals: PropTypes.oneOfType([
'prefix': PropTypes.string,
'value': PropTypes.string,
'numberOfDecimals': PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
'hideLabel': PropTypes.bool,
'hideTitle': PropTypes.bool,
'style': PropTypes.object,
'showEthLogo': PropTypes.bool,
'ethLogoHeight': PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
'type': PropTypes.oneOf([PRIMARY, SECONDARY]),
'ethNumberOfDecimals': PropTypes.oneOfType([
PropTypes.string,
PropTypes.number,
]),
fiatNumberOfDecimals: PropTypes.oneOfType([
'fiatNumberOfDecimals': PropTypes.oneOfType([
PropTypes.string,
PropTypes.number,
]),
Expand Down
16 changes: 8 additions & 8 deletions ui/app/components/ui/button/button.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ const CLASSNAME_ROUNDED = 'btn--rounded';
const CLASSNAME_FIRST_TIME = 'btn--first-time';

const typeHash = {
default: CLASSNAME_DEFAULT,
primary: CLASSNAME_PRIMARY,
secondary: CLASSNAME_SECONDARY,
warning: 'btn-warning',
danger: 'btn-danger',
'default': CLASSNAME_DEFAULT,
'primary': CLASSNAME_PRIMARY,
'secondary': CLASSNAME_SECONDARY,
'warning': 'btn-warning',
'danger': 'btn-danger',
'danger-primary': 'btn-danger-primary',
link: 'btn-link',
'link': 'btn-link',
// TODO: Legacy button type to be deprecated
confirm: CLASSNAME_CONFIRM,
raised: CLASSNAME_RAISED,
'confirm': CLASSNAME_CONFIRM,
'raised': CLASSNAME_RAISED,
'first-time': CLASSNAME_FIRST_TIME,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,17 @@ export default function CurrencyDisplay({
}

CurrencyDisplay.propTypes = {
className: PropTypes.string,
currency: PropTypes.string,
'className': PropTypes.string,
'currency': PropTypes.string,
'data-testid': PropTypes.string,
denomination: PropTypes.oneOf([GWEI]),
displayValue: PropTypes.string,
hideLabel: PropTypes.bool,
hideTitle: PropTypes.bool,
numberOfDecimals: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
prefix: PropTypes.string,
prefixComponent: PropTypes.node,
style: PropTypes.object,
suffix: PropTypes.string,
value: PropTypes.string,
'denomination': PropTypes.oneOf([GWEI]),
'displayValue': PropTypes.string,
'hideLabel': PropTypes.bool,
'hideTitle': PropTypes.bool,
'numberOfDecimals': PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
'prefix': PropTypes.string,
'prefixComponent': PropTypes.node,
'style': PropTypes.object,
'suffix': PropTypes.string,
'value': PropTypes.string,
};
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ const basic = {
const advanced = {
'Network Name': 'Ethereum Mainnet',
'Chain ID': '1',
Ticker: 'ETH',
'Ticker': 'ETH',
};

const tooltips = {
'Network Name': 'The name that is associated with this network',
'Chain ID': 'The numeric value representing the ID of this network',
Ticker: 'The currency symbol of the primary currency for this network',
'Ticker': 'The currency symbol of the primary currency for this network',
};

export const definitionList = () => (
Expand Down
12 changes: 6 additions & 6 deletions ui/app/components/ui/icon-button/icon-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ export default function IconButton({
}

IconButton.propTypes = {
onClick: PropTypes.func.isRequired,
Icon: PropTypes.func.isRequired,
disabled: PropTypes.bool,
label: PropTypes.string.isRequired,
tooltipRender: PropTypes.func,
className: PropTypes.string,
'onClick': PropTypes.func.isRequired,
'Icon': PropTypes.func.isRequired,
'disabled': PropTypes.bool,
'label': PropTypes.string.isRequired,
'tooltipRender': PropTypes.func,
'className': PropTypes.string,
'data-testid': PropTypes.string,
};
18 changes: 9 additions & 9 deletions ui/app/components/ui/list-item/list-item.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ export default function ListItem({
}

ListItem.propTypes = {
title: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
titleIcon: PropTypes.node,
subtitle: PropTypes.node,
children: PropTypes.node,
icon: PropTypes.node,
rightContent: PropTypes.node,
midContent: PropTypes.node,
className: PropTypes.string,
onClick: PropTypes.func,
'title': PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
'titleIcon': PropTypes.node,
'subtitle': PropTypes.node,
'children': PropTypes.node,
'icon': PropTypes.node,
'rightContent': PropTypes.node,
'midContent': PropTypes.node,
'className': PropTypes.string,
'onClick': PropTypes.func,
'data-testid': PropTypes.string,
};
18 changes: 9 additions & 9 deletions ui/app/components/ui/menu/menu-item.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,20 @@ const MenuItem = ({
);

MenuItem.propTypes = {
children: PropTypes.node.isRequired,
className: PropTypes.string,
'children': PropTypes.node.isRequired,
'className': PropTypes.string,
'data-testid': PropTypes.string,
iconClassName: PropTypes.string,
onClick: PropTypes.func,
subtitle: PropTypes.node,
'iconClassName': PropTypes.string,
'onClick': PropTypes.func,
'subtitle': PropTypes.node,
};

MenuItem.defaultProps = {
className: undefined,
'className': undefined,
'data-testid': undefined,
iconClassName: undefined,
onClick: undefined,
subtitle: undefined,
'iconClassName': undefined,
'onClick': undefined,
'subtitle': undefined,
};

export default MenuItem;
12 changes: 6 additions & 6 deletions ui/app/components/ui/tabs/tab/tab.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ const Tab = (props) => {
};

Tab.propTypes = {
activeClassName: PropTypes.string,
className: PropTypes.string,
'activeClassName': PropTypes.string,
'className': PropTypes.string,
'data-testid': PropTypes.string,
isActive: PropTypes.bool, // required, but added using React.cloneElement
name: PropTypes.string.isRequired,
onClick: PropTypes.func,
tabIndex: PropTypes.number, // required, but added using React.cloneElement
'isActive': PropTypes.bool, // required, but added using React.cloneElement
'name': PropTypes.string.isRequired,
'onClick': PropTypes.func,
'tabIndex': PropTypes.number, // required, but added using React.cloneElement
};

Tab.defaultProps = {
Expand Down
Loading