-
Notifications
You must be signed in to change notification settings - Fork 0
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 flow compatibility #20
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
module.exports = { | ||
parser: 'babel-eslint', | ||
plugins: [ | ||
// Allows correct parsing of flow annotated files. | ||
'flowtype' | ||
], | ||
rules: { | ||
// Makes flow `type` definitions defines | ||
'flowtype/define-flow-type': 1, | ||
// Do not allow spaces before type declarations, i.e. let a: number, not let a : number | ||
'flowtype/space-before-type-colon': [ | ||
1, | ||
'never' | ||
], | ||
// Marks flow type declarations as used to prevent no-unused-vars for types | ||
'flowtype/use-flow-type': 1, | ||
// Enforces camelcase for type definitions | ||
'flowtype/type-id-match': [ | ||
2, | ||
'^([A-Z]+[a-z0-9A-Z]*)$' | ||
] | ||
}, | ||
settings: { | ||
// Only use the flow linter for files with `@flow` | ||
flowtype: { | ||
onlyFilesWithFlowAnnotation: true | ||
} | ||
}, | ||
parserOptions: { | ||
// Required to support import/export syntax when using types | ||
sourceType: 'module' | ||
} | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module.exports = { | ||
parserOptions: { | ||
ecmaFeatures: { | ||
experimentalObjectRestSpread: true | ||
} | ||
} | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,14 +30,15 @@ | |
}, | ||
"homepage": "https://github.com/mixmaxhq/eslint-config-mixmax#readme", | ||
"optionalDependencies": { | ||
"babel-eslint": "^7.2.3", | ||
"babel-eslint": "^8.2.1", | ||
"eslint-plugin-flowtype": "^2.41.0", | ||
"eslint-plugin-react": "^7.1.0" | ||
}, | ||
"peerDependencies": { | ||
"eslint": ">= 3" | ||
"eslint": ">=4.14.0" | ||
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. can you please update the README with updated dependency installation instructions? (describing the optional separately, it looks like the README is outdated in other ways - mentioning forthcoming configs that have already been added, not including the |
||
}, | ||
"devDependencies": { | ||
"eslint": ">=3", | ||
"eslint": ">=4.14.0", | ||
"eslint-config-mixmax": "^0.7.0", | ||
"pre-commit": "^1.2.2" | ||
}, | ||
|
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.
sweet