Skip to content

Commit

Permalink
Merge pull request #1676 from storybooks/stricter-lint-imports
Browse files Browse the repository at this point in the history
Stricter linting rules for imports
  • Loading branch information
Hypnosphi authored Aug 22, 2017
2 parents fc1aecb + 8721f07 commit 70d8829
Show file tree
Hide file tree
Showing 43 changed files with 95 additions and 136 deletions.
6 changes: 5 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,20 @@ module.exports = {
'space-before-function-paren': ignore,
'import/no-unresolved': warn,
'import/extensions': [
// because of highlight.js and fuse.js
warn,
{
js: 'never',
json: 'always',
},
],
'import/no-extraneous-dependencies': [
warn,
error,
{
devDependencies: [
'examples/**',
'**/example/**',
'*.js',
'**/*.test.js',
'**/scripts/*.js',
'**/stories/*.js',
Expand Down
4 changes: 0 additions & 4 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@ Issue:

## What I did



## How to test



Is this testable with jest or storyshots?

Does this need a new example in the kitchen sink apps?
Expand Down
6 changes: 3 additions & 3 deletions addons/centered/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
"scripts": {
"prepublish": "node ../../scripts/prepublish.js"
},
"peerDependencies": {
"react": "*"
},
"dependencies": {
"global": "^4.3.2"
},
"peerDependencies": {
"react": "*"
}
}
2 changes: 2 additions & 0 deletions addons/comments/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 0 additions & 2 deletions addons/comments/src/stories/index.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
2 changes: 1 addition & 1 deletion addons/notes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
"dependencies": {
"@storybook/addons": "^3.2.6",
"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"
Expand Down
2 changes: 0 additions & 2 deletions addons/notes/src/register.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
5 changes: 5 additions & 0 deletions docs/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
settings: {
'import/core-modules': ['config'],
},
};
130 changes: 65 additions & 65 deletions examples/cra-kitchen-sink/src/__snapshots__/storyshots.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -345,13 +345,13 @@ exports[`Storyshots AddonInfo.DocgenButton DocgenButton 1`] = `
</tr>
<tr>
<td>
enm
label
</td>
<td>
other
string
</td>
<td>
no
yes
</td>
<td>
-
Expand All @@ -360,22 +360,32 @@ exports[`Storyshots AddonInfo.DocgenButton DocgenButton 1`] = `
</tr>
<tr>
<td>
label
onClick
</td>
<td>
string
func
</td>
<td>
yes
no
</td>
<td>
-
<span>
<span
style={
Object {
"color": "#170",
}
}
>
onClick()
</span>
</span>
</td>
<td />
</tr>
<tr>
<td>
msg
one
</td>
<td>
other
Expand All @@ -390,32 +400,22 @@ exports[`Storyshots AddonInfo.DocgenButton DocgenButton 1`] = `
</tr>
<tr>
<td>
onClick
two
</td>
<td>
func
other
</td>
<td>
no
</td>
<td>
<span>
<span
style={
Object {
"color": "#170",
}
}
>
onClick()
</span>
</span>
-
</td>
<td />
</tr>
<tr>
<td>
one
msg
</td>
<td>
other
Expand All @@ -430,7 +430,7 @@ exports[`Storyshots AddonInfo.DocgenButton DocgenButton 1`] = `
</tr>
<tr>
<td>
two
enm
</td>
<td>
other
Expand Down Expand Up @@ -1747,50 +1747,50 @@ exports[`Storyshots Button with new info 1`] = `
<tbody>
<tr>
<td>
age
children
</td>
<td>
number
node
</td>
<td>
no
yes
</td>
<td>
<span>
<span
style={
Object {
"color": "#a11",
}
}
>
0
</span>
</span>
-
</td>
<td />
</tr>
<tr>
<td>
children
isAmazing
</td>
<td>
node
bool
</td>
<td>
yes
no
</td>
<td>
-
<span>
<span
style={
Object {
"color": "#a11",
}
}
>
false
</span>
</span>
</td>
<td />
</tr>
<tr>
<td>
isAmazing
age
</td>
<td>
bool
number
</td>
<td>
no
Expand All @@ -1804,7 +1804,7 @@ exports[`Storyshots Button with new info 1`] = `
}
}
>
false
0
</span>
</span>
</td>
Expand Down Expand Up @@ -2301,50 +2301,50 @@ exports[`Storyshots Button with some info 1`] = `
<tbody>
<tr>
<td>
age
children
</td>
<td>
number
node
</td>
<td>
no
yes
</td>
<td>
<span>
<span
style={
Object {
"color": "#a11",
}
}
>
0
</span>
</span>
-
</td>
<td />
</tr>
<tr>
<td>
children
isAmazing
</td>
<td>
node
bool
</td>
<td>
yes
no
</td>
<td>
-
<span>
<span
style={
Object {
"color": "#a11",
}
}
>
false
</span>
</span>
</td>
<td />
</tr>
<tr>
<td>
isAmazing
age
</td>
<td>
bool
number
</td>
<td>
no
Expand All @@ -2358,7 +2358,7 @@ exports[`Storyshots Button with some info 1`] = `
}
}
>
false
0
</span>
</span>
</td>
Expand Down
1 change: 1 addition & 0 deletions examples/crna-kitchen-sink/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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 { TouchableNativeFeedback } from 'react-native';
Expand Down
Original file line number Diff line number Diff line change
@@ -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 { TouchableHighlight } from 'react-native';
Expand Down
Original file line number Diff line number Diff line change
@@ -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 { View } from 'react-native';
Expand Down
2 changes: 0 additions & 2 deletions examples/crna-kitchen-sink/storybook/stories/Welcome/index.js
Original file line number Diff line number Diff line change
@@ -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 { View, Text } from 'react-native';
Expand Down
1 change: 1 addition & 0 deletions examples/react-native-vanilla/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -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 { TouchableNativeFeedback } from 'react-native';
Expand Down
Loading

0 comments on commit 70d8829

Please sign in to comment.