-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
add eslint to the project #58
Closed
Closed
Changes from 17 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
68cfc12
add eslint to the project
knowbody 0b9647e
remove no-shadow rule from eslint and fix code
knowbody e8920fb
fix comma-dangle in code
knowbody 6bc0f83
remove comma-dangle rule
knowbody b9fc53b
Merge branch 'master' into add-eslint
knowbody 71ea52a
update travis config
knowbody 1a99f6a
update lint script
knowbody 536814c
remove previous changes to /src
knowbody 5d015e4
Merge branch 'master' into add-eslint
knowbody 0c74103
update eslint packages, remove not needed eslint rules
knowbody c30fc0c
fix code to respect new rules
knowbody b38d1eb
add previously removed commas
knowbody b481201
fix failing tests
knowbody e1d5aec
Merge branch 'master' into add-eslint
knowbody f9fa058
Merge branch 'master' into add-eslint
knowbody e40a950
remove forgotten tags from confilct merge
knowbody eb8974b
fix failing tests
knowbody f59650a
remove all changes made to src/
knowbody 07b8d62
Merge branch 'master' into add-eslint
knowbody File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
dist/ | ||
docs/ | ||
examples/ | ||
node_modules/ | ||
lib/ | ||
scripts/ | ||
# for disable website but should be done as well | ||
website/ | ||
*.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
--- | ||
parser: babel-eslint | ||
|
||
plugins: | ||
- react | ||
|
||
env: | ||
browser: true | ||
node: true | ||
|
||
globals: | ||
__DEV__: true | ||
# Jest / Jasmine | ||
describe: false | ||
xdescribe: false | ||
beforeEach: false | ||
afterEach: false | ||
it: false | ||
xit: false | ||
jest: false | ||
pit: false | ||
expect: false | ||
spyOn: false | ||
jasmine: false | ||
|
||
rules: | ||
# ERRORS | ||
space-before-blocks: 2 | ||
indent: [2, 2, {SwitchCase: 1}] | ||
brace-style: 2 | ||
space-after-keywords: 2 | ||
strict: [2, global] | ||
# Make this a warning for now. We do this in a few places so we might need to | ||
# disable | ||
eol-last: 2 | ||
dot-notation: 2 | ||
dot-location: [2, property] | ||
no-unused-vars: [2, args: none] | ||
quotes: [2, single, avoid-escape] | ||
no-multi-spaces: 2 | ||
|
||
# WISHLIST. One day... | ||
# We'll need a custom version of this that does a subset of the whole rule. | ||
# Otherwise this is just too noisy. | ||
# valid-jsdoc: 1 | ||
# Ideally, we could just warn when *new* lines are added that exceed 80 chars | ||
# while not warning about existing ones (often URLs, etc. which are | ||
# necessarily long), but we don't have a good way to do so. | ||
# max-len: [0, 80] | ||
|
||
# DISABLED. These aren't compatible with our style | ||
# We use this for private/internal variables | ||
no-underscore-dangle: 0 | ||
# We pass constructors around / access them from members | ||
new-cap: 0 | ||
# We do this a lot. | ||
no-use-before-define: 0 | ||
# We do this in a few places to align values | ||
key-spacing: 0 | ||
# It's nice to be able to leave catch blocks empty | ||
no-empty: 0 | ||
# It makes code more readable to make this explicit sometimes | ||
no-undef-init: 0 | ||
|
||
# BROKEN. We'd like to turn these back on. | ||
# causes a ton of noise, eslint is too picky? | ||
block-scoped-var: 0 | ||
|
||
# JSX | ||
# Our transforms set this automatically | ||
react/display-name: 0 | ||
react/jsx-boolean-value: [2, always] | ||
react/jsx-no-undef: 2 | ||
react/jsx-quotes: [2, double] | ||
# We don't care to do this | ||
react/jsx-sort-prop-types: 0 | ||
react/jsx-sort-props: 0 | ||
react/jsx-uses-react: 2 | ||
react/jsx-uses-vars: 2 | ||
# It's easier to test some things this way | ||
react/no-did-mount-set-state: 0 | ||
react/no-did-update-set-state: 0 | ||
# We define multiple components in test files | ||
react/no-multi-comp: 0 | ||
react/no-unknown-property: 2 | ||
# This isn't useful in our test code | ||
react/prop-types: 0 | ||
react/react-in-jsx-scope: 2 | ||
react/self-closing-comp: 2 | ||
# We don't care to do this | ||
react/sort-comp: 0 | ||
react/wrap-multilines: [2, {declaration: false, assignment: false}] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,12 +25,9 @@ describe('RelayContainer', function() { | |
var React; | ||
var ReactTestUtils; | ||
var Relay; | ||
var RelayMetaRoute; | ||
var RelayQuery; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Again, we sincerely appreciate your effort in making these fixes, but we can't accept the PR unless there are zero changes to files in |
||
var RelayRoute; | ||
|
||
var toGraphQL; | ||
|
||
var MockContainer; | ||
var MockComponent; | ||
var RelayTestRenderer; | ||
|
@@ -52,12 +49,9 @@ describe('RelayContainer', function() { | |
React = require('React'); | ||
ReactTestUtils = require('ReactTestUtils'); | ||
Relay = require('Relay'); | ||
RelayMetaRoute = require('RelayMetaRoute'); | ||
RelayQuery = require('RelayQuery'); | ||
RelayRoute = require('RelayRoute'); | ||
|
||
toGraphQL = require('toGraphQL'); | ||
|
||
var render = jest.genMockFunction().mockImplementation(function() { | ||
// Make it easier to expect prop values. | ||
render.mock.calls[render.mock.calls.length - 1].props = this.props; | ||
|
@@ -213,7 +207,6 @@ describe('RelayContainer', function() { | |
}); | ||
|
||
describe('conditional fragments', () => { | ||
var sideshowFragment; | ||
var MockFeed; | ||
var feedFragment; | ||
|
||
|
@@ -227,7 +220,6 @@ describe('RelayContainer', function() { | |
` | ||
} | ||
}); | ||
sideshowFragment = new GraphQL.QueryFragment('Test', 'Viewer'); | ||
feedFragment = | ||
new GraphQL.QueryFragment('Test', 'Viewer', [ | ||
new GraphQL.Field('newsFeed'), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We cannot accept this PR if there are changes to the
src/
directory - rules should lenient enough to allow the code to pass as-is.