Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 7 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# We can probably lint these later but not important at this point
src/vendor
src/vendor_deprecated
# estraverse stumbles on XJSSpreadAttribute so just ignore tests for now
src/**/__tests__/**
# This should be enabled but that folder has too much in it that doesn't belong
src/test
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"envify": "^3.0.0",
"es3ify": "~0.1.2",
"es5-shim": "^4.0.0",
"eslint": "0.11.0-alpha.0",
"grunt": "~0.4.2",
"grunt-cli": "~0.1.9",
"grunt-compare-size": "~0.4.0",
Expand Down Expand Up @@ -70,7 +71,8 @@
},
"scripts": {
"test": "jest",
"jest": "jest"
"jest": "jest",
"lint": "eslint src"
},
"jest": {
"rootDir": "",
Expand Down
52 changes: 52 additions & 0 deletions src/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
settings:
jsx: true
ecmascript: 6

env:
browser: true
node: true

globals:
__DEV__: true

rules:
# ERRORS
brace-style: 2
space-after-keywords: 2
strict: 2
# We actually have a transform to support this and we fix this for bundled
# releases but not for the npm package, so enforce it strictly
no-comma-dangle: 2
# Make this a warning for now. We do this in a few places so we might need to
# disable
no-unused-expressions: 2
block-scoped-var: 2
eol-last: 2
dot-notation: 2
consistent-return: 2

# WARNINGS
quotes: [1, 'single']
# This is the only one that's hard to track since we don't lint just changes.
max-len: [1, 80]

# 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

# 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 should have this enabled but https://github.com/eslint/eslint/issues/1542
no-unused-vars: 0
# We do this in a few places to align values
key-spacing: 0

# DISABLED. These currently cause errors when running.
no-multi-spaces: 0