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

Stricter linting rules for imports #1676

Merged
merged 24 commits into from
Aug 22, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
cb92897
Promote no-extraneous-dependencies to error level and make it pass
Hypnosphi Aug 18, 2017
4344121
Promote import/extensions to error level as it has no violations
Hypnosphi Aug 18, 2017
2aede2c
Revert an unintended change
Hypnosphi Aug 18, 2017
63eaa5a
Merge branch 'master' into stricter-lint-imports
ndelangen Aug 18, 2017
37d0195
Fix new lint problem
Hypnosphi Aug 18, 2017
a82f305
Restrict import/extensions to warning in docs package
Hypnosphi Aug 18, 2017
5d7f79c
Merge branch 'master' into stricter-lint-imports
Hypnosphi Aug 18, 2017
a9c19f3
Merge branch 'master' into stricter-lint-imports
Hypnosphi Aug 18, 2017
79a2b93
Merge branch 'master' into stricter-lint-imports
Hypnosphi Aug 18, 2017
4b49148
Merge branch 'master' into stricter-lint-imports
Hypnosphi Aug 18, 2017
85aeb4e
Fix new errors
Hypnosphi Aug 18, 2017
fb5e28f
Merge remote-tracking branch 'upstream/master' into stricter-lint-imp…
Hypnosphi Aug 19, 2017
ec0a3e5
Merge branch 'master' into stricter-lint-imports
Hypnosphi Aug 19, 2017
02beceb
Merge branch 'master' into stricter-lint-imports
Hypnosphi Aug 20, 2017
339dbe0
Merge branch 'master' into stricter-lint-imports
Hypnosphi Aug 20, 2017
3ed8297
Merge branch 'master' into stricter-lint-imports
Hypnosphi Aug 20, 2017
c0dc821
Merge remote-tracking branch 'upstream/master' into stricter-lint-imp…
Hypnosphi Aug 20, 2017
2bde6b5
Merge remote-tracking branch 'upstream/stricter-lint-imports' into st…
Hypnosphi Aug 20, 2017
8b26086
Restrict import/extensions to warning everywhere
Hypnosphi Aug 20, 2017
34daf41
Merge branch 'master' into stricter-lint-imports
Hypnosphi Aug 21, 2017
aa47d71
Merge branch 'master' into stricter-lint-imports
Hypnosphi Aug 21, 2017
88ef5b2
Merge branch 'master' into stricter-lint-imports
Hypnosphi Aug 22, 2017
0e33495
Merge remote-tracking branch 'upstream/master' into stricter-lint-imp…
Hypnosphi Aug 22, 2017
8721f07
Fix new lint errors
Hypnosphi Aug 22, 2017
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
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