diff --git a/.ci/danger/dangerfile.ts b/.ci/danger/dangerfile.ts index 2a1223028e31..e7d267591d89 100644 --- a/.ci/danger/dangerfile.ts +++ b/.ci/danger/dangerfile.ts @@ -3,7 +3,9 @@ import { execSync } from 'child_process'; execSync('npm install lodash'); -const { flatten, intersection, isEmpty } = require('lodash'); +const flatten = require('lodash/flatten'); +const intersection = require('lodash/intersection'); +const isEmpty = require('lodash/isEmpty'); const pkg = require('../../package.json'); // eslint-disable-line import/newline-after-import const prLogConfig = pkg['pr-log']; diff --git a/.eslintrc.js b/.eslintrc.js index fc1735437888..8bd9c7d9346f 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,42 +1,6 @@ module.exports = { root: true, extends: ['@storybook/eslint-config-storybook'], - rules: { - 'import/extensions': [ - 'error', - 'never', - { ignorePackages: true, md: 'always', svg: 'always', json: 'always', tag: 'always' }, - ], - 'import/no-unresolved': ['error', { ignore: ['@storybook'] }], - 'react/state-in-constructor': 'off', - 'react/static-property-placement': 'off', - 'react/jsx-props-no-spreading': 'off', - 'react/jsx-fragments': 'off', - '@typescript-eslint/ban-ts-ignore': 'off', - '@typescript-eslint/no-object-literal-type-assertion': 'off', - '@typescript-eslint/no-empty-function': 'off', - 'react/sort-comp': [ - 'error', - { - order: [ - 'staticLifecycle', - 'static-methods', - 'instance-variables', - 'lifecycle', - '/^on.+$/', - '/^(get|set)(?!(DerivedStateFromProps|SnapshotBeforeUpdate$)).+$/', - 'instance-methods', - 'instance-variables', - 'everything-else', - 'render', - ], - groups: { - staticLifecycle: ['displayName', 'propTypes', 'defaultProps', 'getDerivedStateFromProps'], - }, - }, - ], - 'max-classes-per-file': 'off', - }, overrides: [ { files: [ diff --git a/package.json b/package.json index 3938bc48d116..bb8377014931 100644 --- a/package.json +++ b/package.json @@ -128,8 +128,8 @@ "@babel/preset-typescript": "^7.3.3", "@babel/runtime": "^7.8.4", "@emotion/snapshot-serializer": "^0.8.2", - "@storybook/eslint-config-storybook": "^2.0.0", - "@storybook/linter-config": "^2.0.0", + "@storybook/eslint-config-storybook": "^2.2.0", + "@storybook/linter-config": "^2.3.0", "@testing-library/react": "^9.2.0", "@types/doctrine": "^0.0.3", "@types/enzyme": "^3.10.3", @@ -165,7 +165,7 @@ "enzyme": "^3.9.0", "enzyme-adapter-react-16": "^1.9.1", "eslint": "^6.5.1", - "eslint-plugin-cypress": "^2.7.0", + "eslint-plugin-cypress": "^2.10.1", "eslint-plugin-react": "^7.15.1", "esm": "^3.2.25", "github-release-from-changelog": "^2.1.0", diff --git a/yarn.lock b/yarn.lock index a845dcab33d2..9e6596bc4948 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3476,30 +3476,30 @@ ember-cli-addon-docs-yuidoc "^0.2.3" ember-cli-babel "^7.1.2" -"@storybook/eslint-config-storybook@^2.0.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@storybook/eslint-config-storybook/-/eslint-config-storybook-2.1.0.tgz#db785ebad0d0e6194e3497e1600ff5be936f943f" - integrity sha512-EFuItxSbxySgtqOpsA4NtwJLBVo9WFzunQ9mOU8X0cd1CkvYAA29Jxm6HAZ9oWyXqbxbypjV7U4XBKa63f46OQ== +"@storybook/eslint-config-storybook@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@storybook/eslint-config-storybook/-/eslint-config-storybook-2.2.0.tgz#21e1ee07b94270a720132d4a27fe0632f211ea6f" + integrity sha512-0qxjJMBfE3aoT6gsLTwDer1FBQNyqVlmRzFOR62ytdaCEpHXQADkiCFVsuolXezBqq6L2HBB+plq55uFqDr0Qw== dependencies: - "@storybook/linter-config" "2.1.0" + "@storybook/linter-config" "2.3.0" -"@storybook/linter-config@2.1.0", "@storybook/linter-config@^2.0.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@storybook/linter-config/-/linter-config-2.1.0.tgz#2a1ba6270de44387ad8b31bbf8435fca832d5233" - integrity sha512-Z/j5bnxATtkTBZSIsJ5+p+Y0xSJyewYoqy72h96T52ZvcSyeCWfllaa3zXrnw0+OOzo02BHr9EByguLuULUbSA== +"@storybook/linter-config@2.3.0", "@storybook/linter-config@^2.3.0": + version "2.3.0" + resolved "https://registry.yarnpkg.com/@storybook/linter-config/-/linter-config-2.3.0.tgz#ac00f4d5dc99783960d73589fa2369335d896bee" + integrity sha512-pgccXgmLFYnajjt3nPp6Ndy34o0LqdQRiIUIPh+V/6s0rlr2upMwYTBtPq4H6WdlMPSQF6anM0oiMPwHbDuVpQ== dependencies: - "@typescript-eslint/eslint-plugin" "^2.7.0" - "@typescript-eslint/parser" "^2.7.0" + "@typescript-eslint/eslint-plugin" "^2.19.2" + "@typescript-eslint/parser" "^2.19.2" eslint-config-airbnb "^18.0.1" - eslint-config-prettier "^6.5.0" + eslint-config-prettier "^6.10.0" eslint-plugin-html "^6.0.0" - eslint-plugin-import "^2.16.0" - eslint-plugin-jest "^23.0.4" + eslint-plugin-import "^2.20.1" + eslint-plugin-jest "^23.7.0" eslint-plugin-json "^2.0.1" eslint-plugin-json-files "^0.8.0" eslint-plugin-jsx-a11y "^6.2.1" - eslint-plugin-prettier "^3.0.1" - eslint-plugin-react "^7.16.0" + eslint-plugin-prettier "^3.1.2" + eslint-plugin-react "^7.18.3" remark-cli "^7.0.1" remark-lint "^6.0.4" remark-preset-lint-recommended "^3.0.2" @@ -4390,7 +4390,7 @@ requireindex "^1.2.0" tsutils "^3.7.0" -"@typescript-eslint/eslint-plugin@^2.10.0", "@typescript-eslint/eslint-plugin@^2.2.0", "@typescript-eslint/eslint-plugin@^2.7.0": +"@typescript-eslint/eslint-plugin@^2.10.0", "@typescript-eslint/eslint-plugin@^2.2.0": version "2.19.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.19.0.tgz#bf743448a4633e4b52bee0c40148ba072ab3adbd" integrity sha512-u7IcQ9qwsB6U806LupZmINRnQjC+RJyv36sV/ugaFWMHTbFm/hlLTRx3gGYJgHisxcGSTnf+I/fPDieRMhPSQQ== @@ -4401,6 +4401,17 @@ regexpp "^3.0.0" tsutils "^3.17.1" +"@typescript-eslint/eslint-plugin@^2.19.2": + version "2.19.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.19.2.tgz#e279aaae5d5c1f2547b4cff99204e1250bc7a058" + integrity sha512-HX2qOq2GOV04HNrmKnTpSIpHjfl7iwdXe3u/Nvt+/cpmdvzYvY0NHSiTkYN257jHnq4OM/yo+OsFgati+7LqJA== + dependencies: + "@typescript-eslint/experimental-utils" "2.19.2" + eslint-utils "^1.4.3" + functional-red-black-tree "^1.0.1" + regexpp "^3.0.0" + tsutils "^3.17.1" + "@typescript-eslint/experimental-utils@2.19.0", "@typescript-eslint/experimental-utils@^2.5.0": version "2.19.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-2.19.0.tgz#d5ca732f22c009e515ba09fcceb5f2127d841568" @@ -4410,6 +4421,15 @@ "@typescript-eslint/typescript-estree" "2.19.0" eslint-scope "^5.0.0" +"@typescript-eslint/experimental-utils@2.19.2": + version "2.19.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-2.19.2.tgz#4611d44cf0f0cb460c26aa7676fc0a787281e233" + integrity sha512-B88QuwT1wMJR750YvTJBNjMZwmiPpbmKYLm1yI7PCc3x0NariqPwqaPsoJRwU9DmUi0cd9dkhz1IqEnwfD+P1A== + dependencies: + "@types/json-schema" "^7.0.3" + "@typescript-eslint/typescript-estree" "2.19.2" + eslint-scope "^5.0.0" + "@typescript-eslint/parser@1.6.0": version "1.6.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-1.6.0.tgz#f01189c8b90848e3b8e45a6cdad27870529d1804" @@ -4419,7 +4439,7 @@ eslint-scope "^4.0.0" eslint-visitor-keys "^1.0.0" -"@typescript-eslint/parser@^2.10.0", "@typescript-eslint/parser@^2.2.0", "@typescript-eslint/parser@^2.7.0": +"@typescript-eslint/parser@^2.10.0", "@typescript-eslint/parser@^2.2.0": version "2.19.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-2.19.0.tgz#912160d9425395d09857dcd5382352bc98be11ae" integrity sha512-s0jZoxAWjHnuidbbN7aA+BFVXn4TCcxEVGPV8lWMxZglSs3NRnFFAlL+aIENNmzB2/1jUJuySi6GiM6uACPmpg== @@ -4429,6 +4449,16 @@ "@typescript-eslint/typescript-estree" "2.19.0" eslint-visitor-keys "^1.1.0" +"@typescript-eslint/parser@^2.19.2": + version "2.19.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-2.19.2.tgz#21f42c0694846367e7d6a907feb08ab2f89c0879" + integrity sha512-8uwnYGKqX9wWHGPGdLB9sk9+12sjcdqEEYKGgbS8A0IvYX59h01o8os5qXUHMq2na8vpDRaV0suTLM7S8wraTA== + dependencies: + "@types/eslint-visitor-keys" "^1.0.0" + "@typescript-eslint/experimental-utils" "2.19.2" + "@typescript-eslint/typescript-estree" "2.19.2" + eslint-visitor-keys "^1.1.0" + "@typescript-eslint/typescript-estree@1.6.0": version "1.6.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-1.6.0.tgz#6cf43a07fee08b8eb52e4513b428c8cdc9751ef0" @@ -4450,6 +4480,19 @@ semver "^6.3.0" tsutils "^3.17.1" +"@typescript-eslint/typescript-estree@2.19.2": + version "2.19.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-2.19.2.tgz#67485b00172f400474d243c6c0be27581a579350" + integrity sha512-Xu/qa0MDk6upQWqE4Qy2X16Xg8Vi32tQS2PR0AvnT/ZYS4YGDvtn2MStOh5y8Zy2mg4NuL06KUHlvCh95j9C6Q== + dependencies: + debug "^4.1.1" + eslint-visitor-keys "^1.1.0" + glob "^7.1.6" + is-glob "^4.0.1" + lodash "^4.17.15" + semver "^6.3.0" + tsutils "^3.17.1" + "@vue/component-compiler-utils@^3.1.0": version "3.1.1" resolved "https://registry.yarnpkg.com/@vue/component-compiler-utils/-/component-compiler-utils-3.1.1.tgz#d4ef8f80292674044ad6211e336a302e4d2a6575" @@ -12078,7 +12121,7 @@ eslint-config-airbnb@^18.0.1: object.assign "^4.1.0" object.entries "^1.1.0" -eslint-config-prettier@^6.5.0: +eslint-config-prettier@^6.10.0: version "6.10.0" resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-6.10.0.tgz#7b15e303bf9c956875c948f6b21500e48ded6a7f" integrity sha512-AtndijGte1rPILInUdHjvKEGbIV06NuvPrqlIEaEaWtbtvJh464mDeyGMdZEQMsGvC0ZVkiex1fSNcC4HAbRGg== @@ -12153,10 +12196,10 @@ eslint-module-utils@^2.3.0, eslint-module-utils@^2.4.0, eslint-module-utils@^2.4 debug "^2.6.9" pkg-dir "^2.0.0" -eslint-plugin-cypress@^2.7.0: - version "2.9.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-cypress/-/eslint-plugin-cypress-2.9.0.tgz#7fa5c5247db8a691aa54661e29a67e5bae4b4a15" - integrity sha512-3x6EQYDB30VHyqFV6leBRf9Zo51FsPWXG+aLtpUSlRtcLGcrbmnfno02E318YYSmGbCJH6K5i+MLCFHBpcyreg== +eslint-plugin-cypress@^2.10.1: + version "2.10.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-cypress/-/eslint-plugin-cypress-2.10.1.tgz#76b15abd5b35975e21b465214ac2173036fbe271" + integrity sha512-Oo52+uEE7caVRIIeNCg743e3QKNY9Fkfd4KCzBq2BqG3EhhndekEu2YTwW6kSgca2jXSPmbGm0HiZktSakl4Og== dependencies: globals "^11.12.0" @@ -12239,7 +12282,7 @@ eslint-plugin-import@2.20.0: read-pkg-up "^2.0.0" resolve "^1.12.0" -eslint-plugin-import@^2.16.0: +eslint-plugin-import@^2.20.1: version "2.20.1" resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.20.1.tgz#802423196dcb11d9ce8435a5fc02a6d3b46939b3" integrity sha512-qQHgFOTjguR+LnYRoToeZWT62XM55MBVXObHM6SKFd1VzDcX/vqT1kAz8ssqigh5eMj8qXcRoXXGZpPP6RfdCw== @@ -12257,7 +12300,7 @@ eslint-plugin-import@^2.16.0: read-pkg-up "^2.0.0" resolve "^1.12.0" -eslint-plugin-jest@^23.0.4: +eslint-plugin-jest@^23.7.0: version "23.7.0" resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-23.7.0.tgz#84d5603b6e745b59898cb6750df6a44782a39b04" integrity sha512-zkiyGlvJeHNjAEz8FaIxTXNblJJ/zj3waNbYbgflK7K6uy0cpE5zJBt/JpJtOBGM/UGkC6BqsQ4n0y7kQ2HA8w== @@ -12310,7 +12353,7 @@ eslint-plugin-jsx-a11y@6.2.3, eslint-plugin-jsx-a11y@^6.2.1: has "^1.0.3" jsx-ast-utils "^2.2.1" -eslint-plugin-prettier@^3.0.1: +eslint-plugin-prettier@^3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.1.2.tgz#432e5a667666ab84ce72f945c72f77d996a5c9ba" integrity sha512-GlolCC9y3XZfv3RQfwGew7NnuFDKsfI4lbvRK+PIIo23SFH+LemGs4cKwzAaRa+Mdb+lQO/STaIayno8T5sJJA== @@ -12365,7 +12408,7 @@ eslint-plugin-react@7.18.0: prop-types "^15.7.2" resolve "^1.14.2" -eslint-plugin-react@^7.15.1, eslint-plugin-react@^7.16.0: +eslint-plugin-react@^7.15.1, eslint-plugin-react@^7.18.3: version "7.18.3" resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.18.3.tgz#8be671b7f6be095098e79d27ac32f9580f599bc8" integrity sha512-Bt56LNHAQCoou88s8ViKRjMB2+36XRejCQ1VoLj716KI1MoE99HpTVvIThJ0rvFmG4E4Gsq+UgToEjn+j044Bg==