From cb928970637d849b0cda4d2c5456613fe5c16a04 Mon Sep 17 00:00:00 2001 From: hypnos Date: Fri, 18 Aug 2017 04:35:25 +0300 Subject: [PATCH 1/8] Promote no-extraneous-dependencies to error level and make it pass --- .eslintrc.js | 5 ++++- addons/comments/package.json | 2 ++ addons/comments/src/stories/index.js | 2 -- addons/notes/package.json | 2 +- addons/notes/src/register.js | 2 -- docs/.eslintrc.js | 5 +++++ .../storybook/stories/Button/index.android.js | 2 -- .../storybook/stories/Button/index.ios.js | 2 -- .../storybook/stories/CenterView/index.js | 2 -- .../storybook/stories/Welcome/index.js | 2 -- .../storybook/stories/Button/index.android.js | 2 -- .../storybook/stories/Button/index.ios.js | 2 -- .../storybook/stories/CenterView/index.js | 2 -- .../storybook/stories/Welcome/index.js | 2 -- lib/cli/generators/.eslintrc.js | 15 +++++++++------ lib/cli/generators/METEOR/index.js | 3 ++- lib/cli/package.json | 1 + package.json | 1 + 18 files changed, 25 insertions(+), 29 deletions(-) create mode 100644 docs/.eslintrc.js diff --git a/.eslintrc.js b/.eslintrc.js index 5110b2dc2708..15efbbffb1dd 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -40,9 +40,12 @@ module.exports = { }, ], 'import/no-extraneous-dependencies': [ - warn, + error, { devDependencies: [ + 'examples/**', + '**/example/**', + '*.js', '**/*.test.js', '**/scripts/*.js', '**/stories/*.js', diff --git a/addons/comments/package.json b/addons/comments/package.json index 12aea5dd6eaf..717a0c12a4e9 100644 --- a/addons/comments/package.json +++ b/addons/comments/package.json @@ -36,6 +36,8 @@ "react-textarea-autosize": "^4.3.0" }, "devDependencies": { + "@storybook/react": "^3.2.5", + "@storybook/addon-actions": "^3.2.0", "@kadira/storybook-database-cloud": "*", "@kadira/storybook-deployer": "*", "git-url-parse": "^6.2.2", diff --git a/addons/comments/src/stories/index.js b/addons/comments/src/stories/index.js index 32dbf81bf158..797bc4d97a7e 100644 --- a/addons/comments/src/stories/index.js +++ b/addons/comments/src/stories/index.js @@ -1,5 +1,3 @@ -/* eslint-disable import/no-extraneous-dependencies, import/no-unresolved */ - import React from 'react'; import { storiesOf } from '@storybook/react'; import { action } from '@storybook/addon-actions'; diff --git a/addons/notes/package.json b/addons/notes/package.json index de7648d47625..11b8031db89b 100644 --- a/addons/notes/package.json +++ b/addons/notes/package.json @@ -21,11 +21,11 @@ "dependencies": { "@storybook/addons": "^3.2.0", "babel-runtime": "^6.23.0", + "prop-types": "^15.5.10", "util-deprecate": "^1.0.2" }, "devDependencies": { "git-url-parse": "^6.2.2", - "prop-types": "^15.5.10", "react": "^15.6.1", "react-addons-test-utils": "^15.5.1", "react-dom": "^15.6.1" diff --git a/addons/notes/src/register.js b/addons/notes/src/register.js index 0eee2bb8383c..13b19425266d 100644 --- a/addons/notes/src/register.js +++ b/addons/notes/src/register.js @@ -1,5 +1,3 @@ -/* eslint-disable import/no-extraneous-dependencies, import/no-unresolved, import/extensions */ - import React from 'react'; import PropTypes from 'prop-types'; import addons from '@storybook/addons'; diff --git a/docs/.eslintrc.js b/docs/.eslintrc.js new file mode 100644 index 000000000000..a66a9a1396a5 --- /dev/null +++ b/docs/.eslintrc.js @@ -0,0 +1,5 @@ +module.exports = { + settings: { + 'import/core-modules': ['config'], + }, +}; diff --git a/examples/crna-kitchen-sink/storybook/stories/Button/index.android.js b/examples/crna-kitchen-sink/storybook/stories/Button/index.android.js index 7a285bc65e46..b8a0d0870899 100644 --- a/examples/crna-kitchen-sink/storybook/stories/Button/index.android.js +++ b/examples/crna-kitchen-sink/storybook/stories/Button/index.android.js @@ -1,5 +1,3 @@ -/* eslint-disable import/no-extraneous-dependencies, import/no-unresolved, import/extensions */ - import React, { PropTypes } from 'react'; import { TouchableNativeFeedback } from 'react-native'; diff --git a/examples/crna-kitchen-sink/storybook/stories/Button/index.ios.js b/examples/crna-kitchen-sink/storybook/stories/Button/index.ios.js index 035cacc61e99..18598ac78374 100644 --- a/examples/crna-kitchen-sink/storybook/stories/Button/index.ios.js +++ b/examples/crna-kitchen-sink/storybook/stories/Button/index.ios.js @@ -1,5 +1,3 @@ -/* eslint-disable import/no-extraneous-dependencies, import/no-unresolved, import/extensions */ - import React, { PropTypes } from 'react'; import { TouchableHighlight } from 'react-native'; diff --git a/examples/crna-kitchen-sink/storybook/stories/CenterView/index.js b/examples/crna-kitchen-sink/storybook/stories/CenterView/index.js index e6c8fc60ee19..fdb503676bd0 100644 --- a/examples/crna-kitchen-sink/storybook/stories/CenterView/index.js +++ b/examples/crna-kitchen-sink/storybook/stories/CenterView/index.js @@ -1,5 +1,3 @@ -/* eslint-disable import/no-extraneous-dependencies, import/no-unresolved, import/extensions */ - import React, { PropTypes } from 'react'; import { View } from 'react-native'; import style from './style'; diff --git a/examples/crna-kitchen-sink/storybook/stories/Welcome/index.js b/examples/crna-kitchen-sink/storybook/stories/Welcome/index.js index 1106a2ba934d..5cc7a2350231 100644 --- a/examples/crna-kitchen-sink/storybook/stories/Welcome/index.js +++ b/examples/crna-kitchen-sink/storybook/stories/Welcome/index.js @@ -1,5 +1,3 @@ -/* eslint-disable import/no-extraneous-dependencies, import/no-unresolved, import/extensions */ - import React, { PropTypes } from 'react'; import { View, Text } from 'react-native'; diff --git a/examples/react-native-vanilla/storybook/stories/Button/index.android.js b/examples/react-native-vanilla/storybook/stories/Button/index.android.js index 7a285bc65e46..b8a0d0870899 100644 --- a/examples/react-native-vanilla/storybook/stories/Button/index.android.js +++ b/examples/react-native-vanilla/storybook/stories/Button/index.android.js @@ -1,5 +1,3 @@ -/* eslint-disable import/no-extraneous-dependencies, import/no-unresolved, import/extensions */ - import React, { PropTypes } from 'react'; import { TouchableNativeFeedback } from 'react-native'; diff --git a/examples/react-native-vanilla/storybook/stories/Button/index.ios.js b/examples/react-native-vanilla/storybook/stories/Button/index.ios.js index 035cacc61e99..18598ac78374 100644 --- a/examples/react-native-vanilla/storybook/stories/Button/index.ios.js +++ b/examples/react-native-vanilla/storybook/stories/Button/index.ios.js @@ -1,5 +1,3 @@ -/* eslint-disable import/no-extraneous-dependencies, import/no-unresolved, import/extensions */ - import React, { PropTypes } from 'react'; import { TouchableHighlight } from 'react-native'; diff --git a/examples/react-native-vanilla/storybook/stories/CenterView/index.js b/examples/react-native-vanilla/storybook/stories/CenterView/index.js index e6c8fc60ee19..fdb503676bd0 100644 --- a/examples/react-native-vanilla/storybook/stories/CenterView/index.js +++ b/examples/react-native-vanilla/storybook/stories/CenterView/index.js @@ -1,5 +1,3 @@ -/* eslint-disable import/no-extraneous-dependencies, import/no-unresolved, import/extensions */ - import React, { PropTypes } from 'react'; import { View } from 'react-native'; import style from './style'; diff --git a/examples/react-native-vanilla/storybook/stories/Welcome/index.js b/examples/react-native-vanilla/storybook/stories/Welcome/index.js index 1106a2ba934d..5cc7a2350231 100644 --- a/examples/react-native-vanilla/storybook/stories/Welcome/index.js +++ b/examples/react-native-vanilla/storybook/stories/Welcome/index.js @@ -1,5 +1,3 @@ -/* eslint-disable import/no-extraneous-dependencies, import/no-unresolved, import/extensions */ - import React, { PropTypes } from 'react'; import { View, Text } from 'react-native'; diff --git a/lib/cli/generators/.eslintrc.js b/lib/cli/generators/.eslintrc.js index 12e147cfff01..c23496387b21 100644 --- a/lib/cli/generators/.eslintrc.js +++ b/lib/cli/generators/.eslintrc.js @@ -1,11 +1,14 @@ const ignore = 0; module.exports = { - rules: { - 'import/no-unresolved': ignore, - 'import/no-extraneous-dependencies': ignore, - 'import/extensions': ignore, - 'global-require': ignore, - 'no-console': ignore, + overrides: { + files: '*/template/**', + rules: { + 'import/no-unresolved': ignore, + 'import/no-extraneous-dependencies': ignore, + 'import/extensions': ignore, + 'global-require': ignore, + 'no-console': ignore, + }, }, }; diff --git a/lib/cli/generators/METEOR/index.js b/lib/cli/generators/METEOR/index.js index 7171c2a2358e..799a9ebc2332 100644 --- a/lib/cli/generators/METEOR/index.js +++ b/lib/cli/generators/METEOR/index.js @@ -1,9 +1,10 @@ +import latestVersion from 'latest-version'; + const mergeDirs = require('merge-dirs').default; const helpers = require('../../lib/helpers'); const path = require('path'); const fs = require('fs'); const JSON5 = require('json5'); -const latestVersion = require('latest-version'); module.exports = Promise.all([ latestVersion('@storybook/react'), diff --git a/lib/cli/package.json b/lib/cli/package.json index 27680a613268..29da3693630e 100644 --- a/lib/cli/package.json +++ b/lib/cli/package.json @@ -31,6 +31,7 @@ "cross-spawn": "^5.0.1", "jscodeshift": "^0.3.30", "json5": "^0.5.1", + "latest-version": "^3.1.0", "merge-dirs": "^0.2.1", "opencollective": "^1.0.3", "shelljs": "^0.7.8", diff --git a/package.json b/package.json index ac79f01a077e..61f453bb5e6c 100644 --- a/package.json +++ b/package.json @@ -62,6 +62,7 @@ "jest-enzyme": "^3.6.1", "lerna": "2.0.0", "lint-staged": "^4.0.2", + "lodash": "^4.17.4", "nodemon": "^1.11.0", "npmlog": "^4.1.2", "prettier": "^1.5.3", From 4344121d464c853d4e0d5bf8c5c7abe3a9d49159 Mon Sep 17 00:00:00 2001 From: hypnos Date: Fri, 18 Aug 2017 05:07:15 +0300 Subject: [PATCH 2/8] Promote import/extensions to error level as it has no violations --- .eslintrc.js | 2 +- lib/cli/generators/.eslintrc.js | 2 -- lib/cli/generators/METEOR/template/.stories/index.js | 2 -- lib/cli/generators/METEOR/template/.storybook/addons.js | 2 -- lib/cli/generators/METEOR/template/.storybook/config.js | 2 -- lib/cli/generators/REACT/template/.storybook/addons.js | 2 -- lib/cli/generators/REACT/template/.storybook/config.js | 2 -- lib/cli/generators/REACT_NATIVE/template/storybook/addons.js | 2 -- .../template/storybook/stories/Button/index.android.js | 2 -- .../REACT_NATIVE/template/storybook/stories/Button/index.ios.js | 2 -- .../REACT_NATIVE/template/storybook/stories/CenterView/index.js | 2 -- .../REACT_NATIVE/template/storybook/stories/Welcome/index.js | 2 -- .../generators/REACT_NATIVE/template/storybook/stories/index.js | 2 -- lib/cli/generators/REACT_NATIVE/template/storybook/storybook.js | 2 +- lib/cli/generators/REACT_SCRIPTS/template/.storybook/addons.js | 2 -- lib/cli/generators/REACT_SCRIPTS/template/.storybook/config.js | 2 -- lib/cli/generators/SFC_VUE/template/.storybook/addons.js | 2 -- lib/cli/generators/SFC_VUE/template/src/stories/index.js | 2 -- lib/cli/generators/VUE/template/.storybook/addons.js | 2 -- lib/cli/generators/VUE/template/.storybook/config.js | 2 -- 20 files changed, 2 insertions(+), 38 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 15efbbffb1dd..ea32c9d34df8 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -33,7 +33,7 @@ module.exports = { 'space-before-function-paren': ignore, 'import/no-unresolved': warn, 'import/extensions': [ - warn, + error, { js: 'never', json: 'always', diff --git a/lib/cli/generators/.eslintrc.js b/lib/cli/generators/.eslintrc.js index c23496387b21..1d03de880fa5 100644 --- a/lib/cli/generators/.eslintrc.js +++ b/lib/cli/generators/.eslintrc.js @@ -6,9 +6,7 @@ module.exports = { rules: { 'import/no-unresolved': ignore, 'import/no-extraneous-dependencies': ignore, - 'import/extensions': ignore, 'global-require': ignore, - 'no-console': ignore, }, }, }; diff --git a/lib/cli/generators/METEOR/template/.stories/index.js b/lib/cli/generators/METEOR/template/.stories/index.js index 2d21134b3223..4afc99366db0 100644 --- a/lib/cli/generators/METEOR/template/.stories/index.js +++ b/lib/cli/generators/METEOR/template/.stories/index.js @@ -1,5 +1,3 @@ -/* eslint-disable import/extensions */ - import React from 'react'; import { storiesOf } from '@storybook/react'; diff --git a/lib/cli/generators/METEOR/template/.storybook/addons.js b/lib/cli/generators/METEOR/template/.storybook/addons.js index beadf411f7cc..6aed412d04af 100644 --- a/lib/cli/generators/METEOR/template/.storybook/addons.js +++ b/lib/cli/generators/METEOR/template/.storybook/addons.js @@ -1,4 +1,2 @@ -/* eslint-disable import/extensions */ - import '@storybook/addon-actions/register'; import '@storybook/addon-links/register'; diff --git a/lib/cli/generators/METEOR/template/.storybook/config.js b/lib/cli/generators/METEOR/template/.storybook/config.js index f525576eb114..140143dad399 100644 --- a/lib/cli/generators/METEOR/template/.storybook/config.js +++ b/lib/cli/generators/METEOR/template/.storybook/config.js @@ -1,5 +1,3 @@ -/* eslint-disable import/extensions */ - import { configure } from '@storybook/react'; function loadStories() { diff --git a/lib/cli/generators/REACT/template/.storybook/addons.js b/lib/cli/generators/REACT/template/.storybook/addons.js index beadf411f7cc..6aed412d04af 100644 --- a/lib/cli/generators/REACT/template/.storybook/addons.js +++ b/lib/cli/generators/REACT/template/.storybook/addons.js @@ -1,4 +1,2 @@ -/* eslint-disable import/extensions */ - import '@storybook/addon-actions/register'; import '@storybook/addon-links/register'; diff --git a/lib/cli/generators/REACT/template/.storybook/config.js b/lib/cli/generators/REACT/template/.storybook/config.js index d109f0da15b1..9154670ab327 100644 --- a/lib/cli/generators/REACT/template/.storybook/config.js +++ b/lib/cli/generators/REACT/template/.storybook/config.js @@ -1,5 +1,3 @@ -/* eslint-disable import/extensions */ - import { configure } from '@storybook/react'; function loadStories() { diff --git a/lib/cli/generators/REACT_NATIVE/template/storybook/addons.js b/lib/cli/generators/REACT_NATIVE/template/storybook/addons.js index beadf411f7cc..6aed412d04af 100644 --- a/lib/cli/generators/REACT_NATIVE/template/storybook/addons.js +++ b/lib/cli/generators/REACT_NATIVE/template/storybook/addons.js @@ -1,4 +1,2 @@ -/* eslint-disable import/extensions */ - import '@storybook/addon-actions/register'; import '@storybook/addon-links/register'; diff --git a/lib/cli/generators/REACT_NATIVE/template/storybook/stories/Button/index.android.js b/lib/cli/generators/REACT_NATIVE/template/storybook/stories/Button/index.android.js index 2cae885acda5..b8a0d0870899 100644 --- a/lib/cli/generators/REACT_NATIVE/template/storybook/stories/Button/index.android.js +++ b/lib/cli/generators/REACT_NATIVE/template/storybook/stories/Button/index.android.js @@ -1,5 +1,3 @@ -/* eslint-disable import/extensions */ - import React, { PropTypes } from 'react'; import { TouchableNativeFeedback } from 'react-native'; diff --git a/lib/cli/generators/REACT_NATIVE/template/storybook/stories/Button/index.ios.js b/lib/cli/generators/REACT_NATIVE/template/storybook/stories/Button/index.ios.js index 9c32872772ab..18598ac78374 100644 --- a/lib/cli/generators/REACT_NATIVE/template/storybook/stories/Button/index.ios.js +++ b/lib/cli/generators/REACT_NATIVE/template/storybook/stories/Button/index.ios.js @@ -1,5 +1,3 @@ -/* eslint-disable import/extensions */ - import React, { PropTypes } from 'react'; import { TouchableHighlight } from 'react-native'; diff --git a/lib/cli/generators/REACT_NATIVE/template/storybook/stories/CenterView/index.js b/lib/cli/generators/REACT_NATIVE/template/storybook/stories/CenterView/index.js index 1ae222fc4858..fdb503676bd0 100644 --- a/lib/cli/generators/REACT_NATIVE/template/storybook/stories/CenterView/index.js +++ b/lib/cli/generators/REACT_NATIVE/template/storybook/stories/CenterView/index.js @@ -1,5 +1,3 @@ -/* eslint-disable import/extensions */ - import React, { PropTypes } from 'react'; import { View } from 'react-native'; import style from './style'; diff --git a/lib/cli/generators/REACT_NATIVE/template/storybook/stories/Welcome/index.js b/lib/cli/generators/REACT_NATIVE/template/storybook/stories/Welcome/index.js index fd1c4d184a44..5cc7a2350231 100644 --- a/lib/cli/generators/REACT_NATIVE/template/storybook/stories/Welcome/index.js +++ b/lib/cli/generators/REACT_NATIVE/template/storybook/stories/Welcome/index.js @@ -1,5 +1,3 @@ -/* eslint-disable import/extensions */ - import React, { PropTypes } from 'react'; import { View, Text } from 'react-native'; diff --git a/lib/cli/generators/REACT_NATIVE/template/storybook/stories/index.js b/lib/cli/generators/REACT_NATIVE/template/storybook/stories/index.js index 606feb7b6732..99ab2205a9d0 100644 --- a/lib/cli/generators/REACT_NATIVE/template/storybook/stories/index.js +++ b/lib/cli/generators/REACT_NATIVE/template/storybook/stories/index.js @@ -1,5 +1,3 @@ -/* eslint-disable import/extensions */ - import React from 'react'; import { Text } from 'react-native'; diff --git a/lib/cli/generators/REACT_NATIVE/template/storybook/storybook.js b/lib/cli/generators/REACT_NATIVE/template/storybook/storybook.js index 2e5726511e75..558e7b3af49b 100644 --- a/lib/cli/generators/REACT_NATIVE/template/storybook/storybook.js +++ b/lib/cli/generators/REACT_NATIVE/template/storybook/storybook.js @@ -1,4 +1,4 @@ -/* eslint-disable import/extensions, global-require */ +/* eslint-disable global-require */ import { AppRegistry } from 'react-native'; import { getStorybookUI, configure } from '@storybook/react-native'; diff --git a/lib/cli/generators/REACT_SCRIPTS/template/.storybook/addons.js b/lib/cli/generators/REACT_SCRIPTS/template/.storybook/addons.js index beadf411f7cc..6aed412d04af 100644 --- a/lib/cli/generators/REACT_SCRIPTS/template/.storybook/addons.js +++ b/lib/cli/generators/REACT_SCRIPTS/template/.storybook/addons.js @@ -1,4 +1,2 @@ -/* eslint-disable import/extensions */ - import '@storybook/addon-actions/register'; import '@storybook/addon-links/register'; diff --git a/lib/cli/generators/REACT_SCRIPTS/template/.storybook/config.js b/lib/cli/generators/REACT_SCRIPTS/template/.storybook/config.js index f97e6c899a04..35430210ce65 100644 --- a/lib/cli/generators/REACT_SCRIPTS/template/.storybook/config.js +++ b/lib/cli/generators/REACT_SCRIPTS/template/.storybook/config.js @@ -1,5 +1,3 @@ -/* eslint-disable import/extensions */ - import { configure } from '@storybook/react'; function loadStories() { diff --git a/lib/cli/generators/SFC_VUE/template/.storybook/addons.js b/lib/cli/generators/SFC_VUE/template/.storybook/addons.js index 4cfa4a658d52..402ccc13eba3 100644 --- a/lib/cli/generators/SFC_VUE/template/.storybook/addons.js +++ b/lib/cli/generators/SFC_VUE/template/.storybook/addons.js @@ -1,4 +1,2 @@ -/* eslint-disable import/extensions */ - import '@storybook/addon-actions/register' import '@storybook/addon-links/register' diff --git a/lib/cli/generators/SFC_VUE/template/src/stories/index.js b/lib/cli/generators/SFC_VUE/template/src/stories/index.js index 94c5b20ad726..b1f09e9bb3d9 100644 --- a/lib/cli/generators/SFC_VUE/template/src/stories/index.js +++ b/lib/cli/generators/SFC_VUE/template/src/stories/index.js @@ -1,5 +1,3 @@ -/* eslint-disable import/extensions */ - import { storiesOf } from '@storybook/vue'; import { action } from '@storybook/addon-actions'; import { linkTo } from '@storybook/addon-links'; diff --git a/lib/cli/generators/VUE/template/.storybook/addons.js b/lib/cli/generators/VUE/template/.storybook/addons.js index 4cfa4a658d52..402ccc13eba3 100644 --- a/lib/cli/generators/VUE/template/.storybook/addons.js +++ b/lib/cli/generators/VUE/template/.storybook/addons.js @@ -1,4 +1,2 @@ -/* eslint-disable import/extensions */ - import '@storybook/addon-actions/register' import '@storybook/addon-links/register' diff --git a/lib/cli/generators/VUE/template/.storybook/config.js b/lib/cli/generators/VUE/template/.storybook/config.js index f30732660180..a26a91bc2afb 100644 --- a/lib/cli/generators/VUE/template/.storybook/config.js +++ b/lib/cli/generators/VUE/template/.storybook/config.js @@ -1,5 +1,3 @@ -/* eslint-disable import/extensions */ - import { configure } from '@storybook/vue' function loadStories() { From 2aede2cfca6b2170916daa06168b7a38ace0d9dd Mon Sep 17 00:00:00 2001 From: hypnos Date: Fri, 18 Aug 2017 05:08:54 +0300 Subject: [PATCH 3/8] Revert an unintended change --- lib/cli/generators/METEOR/index.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/cli/generators/METEOR/index.js b/lib/cli/generators/METEOR/index.js index 799a9ebc2332..7171c2a2358e 100644 --- a/lib/cli/generators/METEOR/index.js +++ b/lib/cli/generators/METEOR/index.js @@ -1,10 +1,9 @@ -import latestVersion from 'latest-version'; - const mergeDirs = require('merge-dirs').default; const helpers = require('../../lib/helpers'); const path = require('path'); const fs = require('fs'); const JSON5 = require('json5'); +const latestVersion = require('latest-version'); module.exports = Promise.all([ latestVersion('@storybook/react'), From 37d01955af6ab0ac93413f92000b4af297fe17e6 Mon Sep 17 00:00:00 2001 From: hypnos Date: Fri, 18 Aug 2017 12:23:25 +0300 Subject: [PATCH 4/8] Fix new lint problem --- lib/components/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/components/package.json b/lib/components/package.json index 9a3561e1976f..3dc486ca788e 100644 --- a/lib/components/package.json +++ b/lib/components/package.json @@ -19,6 +19,7 @@ "prop-types": "^15.5.10" }, "devDependencies": { + "enzyme": "^2.9.1", "react": "^15.6.1", "react-dom": "^15.6.1" }, From a82f305bf4c25cf2600e9cdec0d5d66f4ec5888e Mon Sep 17 00:00:00 2001 From: hypnos Date: Fri, 18 Aug 2017 12:43:35 +0300 Subject: [PATCH 5/8] Restrict import/extensions to warning in docs package --- docs/.eslintrc.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/.eslintrc.js b/docs/.eslintrc.js index a66a9a1396a5..07f80658dc53 100644 --- a/docs/.eslintrc.js +++ b/docs/.eslintrc.js @@ -1,4 +1,16 @@ +const warn = 1; + module.exports = { + rules: { + // because of highlight.js + 'import/extensions': [ + warn, + { + js: 'never', + json: 'always', + }, + ], + }, settings: { 'import/core-modules': ['config'], }, From 85aeb4ee7243dc3f69cdd86783ff550ac344ab70 Mon Sep 17 00:00:00 2001 From: hypnos Date: Fri, 18 Aug 2017 19:10:28 +0300 Subject: [PATCH 6/8] Fix new errors --- addons/centered/package.json | 3 + addons/centered/src/vue.js | 10 +- .../src/__snapshots__/storyshots.test.js.snap | 468 ++++++++++++++++++ examples/vue-kitchen-sink/package.json | 1 + lib/cli/generators/REACT_SCRIPTS/index.js | 1 - 5 files changed, 477 insertions(+), 6 deletions(-) diff --git a/addons/centered/package.json b/addons/centered/package.json index c4a25a5fa69f..981d6b802418 100644 --- a/addons/centered/package.json +++ b/addons/centered/package.json @@ -8,6 +8,9 @@ "scripts": { "prepublish": "node ../../scripts/prepublish.js" }, + "dependencies": { + "global": "^4.3.2" + }, "peerDependencies": { "react": "*" } diff --git a/addons/centered/src/vue.js b/addons/centered/src/vue.js index 5077cb201465..713e7dfeb1de 100644 --- a/addons/centered/src/vue.js +++ b/addons/centered/src/vue.js @@ -1,4 +1,4 @@ -export default function () { +export default function() { return { template: `
@@ -22,8 +22,8 @@ export default function () { }, innerStyle: { margin: 'auto', - } - } - } - } + }, + }; + }, + }; } diff --git a/examples/cra-kitchen-sink/src/__snapshots__/storyshots.test.js.snap b/examples/cra-kitchen-sink/src/__snapshots__/storyshots.test.js.snap index 89c3bf934c34..c939f783a293 100644 --- a/examples/cra-kitchen-sink/src/__snapshots__/storyshots.test.js.snap +++ b/examples/cra-kitchen-sink/src/__snapshots__/storyshots.test.js.snap @@ -1,5 +1,473 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`Storyshots AddonInfo.DocgenButton DocgenButton 1`] = ` +
+
+ +
+ + Show Info + +
+ + × + +
+
+
+

+ AddonInfo.DocgenButton +

+

+ DocgenButton +

+
+
+

+ Some Description +

+
+
+

+ Story Source +

+
+            
+ + < + DocgenButton + + + + + + onClick + + + = + + + + clicked() + + + + + + + + + label + + + = + + + " + Docgen Button + " + + + + + + + + /> + +
+
+
+
+

+ Prop Types +

+
+

+ " + DocgenButton + " Component +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ property + + propType + + required + + default + + description +
+ disabled + + bool + + no + + + + false + + + +
+ enm + + other + + no + + - + +
+ label + + string + + yes + + - + +
+ msg + + other + + no + + - + +
+ onClick + + func + + no + + + + onClick() + + + +
+ one + + other + + no + + - + +
+ two + + other + + no + + - + +
+ union + + other + + no + + - + +
+
+
+
+
+
+
+`; + exports[`Storyshots App full app 1`] = `
Date: Sun, 20 Aug 2017 18:40:47 +0300 Subject: [PATCH 7/8] Restrict import/extensions to warning everywhere --- .eslintrc.js | 3 ++- docs/.eslintrc.js | 12 ------------ 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index ea32c9d34df8..fdb38e0e97c1 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -33,7 +33,8 @@ module.exports = { 'space-before-function-paren': ignore, 'import/no-unresolved': warn, 'import/extensions': [ - error, + // because of highlight.js and fuse.js + warn, { js: 'never', json: 'always', diff --git a/docs/.eslintrc.js b/docs/.eslintrc.js index 07f80658dc53..a66a9a1396a5 100644 --- a/docs/.eslintrc.js +++ b/docs/.eslintrc.js @@ -1,16 +1,4 @@ -const warn = 1; - module.exports = { - rules: { - // because of highlight.js - 'import/extensions': [ - warn, - { - js: 'never', - json: 'always', - }, - ], - }, settings: { 'import/core-modules': ['config'], }, From 8721f0777ddb38cb7c9e25362989aabffbe25196 Mon Sep 17 00:00:00 2001 From: hypnos Date: Tue, 22 Aug 2017 23:25:47 +0300 Subject: [PATCH 8/8] Fix new lint errors --- examples/crna-kitchen-sink/package.json | 1 + examples/react-native-vanilla/package.json | 1 + 2 files changed, 2 insertions(+) diff --git a/examples/crna-kitchen-sink/package.json b/examples/crna-kitchen-sink/package.json index 92828d45d65c..932676ba37cc 100644 --- a/examples/crna-kitchen-sink/package.json +++ b/examples/crna-kitchen-sink/package.json @@ -31,6 +31,7 @@ }, "dependencies": { "expo": "^19.0.0", + "prop-types": "^15.5.10", "react": "16.0.0-alpha.12", "react-native": "^0.46.1" } diff --git a/examples/react-native-vanilla/package.json b/examples/react-native-vanilla/package.json index 54daaba92faf..df1e11bd4020 100644 --- a/examples/react-native-vanilla/package.json +++ b/examples/react-native-vanilla/package.json @@ -8,6 +8,7 @@ "storybook": "storybook start -p 7007" }, "dependencies": { + "prop-types": "^15.5.10", "react": "16.0.0-alpha.6", "react-native": "0.44.1" },