Skip to content

Commit

Permalink
Merge pull request #7 from namics/feature/flow
Browse files Browse the repository at this point in the history
feature/flow
  • Loading branch information
smollweide authored Apr 21, 2017
2 parents f23cbe9 + a9aa850 commit efa6eae
Show file tree
Hide file tree
Showing 37 changed files with 1,080 additions and 37 deletions.
9 changes: 9 additions & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[ignore]

[include]

[libs]

[options]
unsafe.enable_getters_and_setters=true
esproposal.decorators=ignore
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
.DS_Store
.idea
.vscode
/npm-debug.log
npm-debug.log
node_modules
/test/*/.*.md
13 changes: 9 additions & 4 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
/test
/processing
/documentation
/.idea/
.nodes
.DS_Store
.idea
.vscode
npm-debug.log
node_modules
test
processing
documentation
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ script:
- npm test
node_js:
- "6"
- "5"
- "4"
- "4"
19 changes: 16 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
$ npm install --save-dev eslint eslint-plugin-import @namics/eslint-config
```


## Usage
- `@namics/eslint-config/configurations/es6-browser` - ES6 + browser
- `@namics/eslint-config/configurations/es6-react` - ES6 + react
- `@namics/eslint-config/configurations/es6-node` - ES6 + node
- `@namics/eslint-config/configurations/flow` - flow
- `@namics/eslint-config/configurations/es5-browser` - ES5 + browser (deprecated)
- `@namics/eslint-config/configurations/es5-node` - ES5 + node (deprecated)

Expand All @@ -26,6 +26,17 @@ module.exports = {
}
```

### with flow
Flowtype rules will be accepted if the flow annotation was defined in first line of each file.
```
module.exports = {
"extends": [
"@namics/eslint-config/configurations/flow.js"
"@namics/eslint-config/configurations/es6-react.js"
],
}
```

### .eslintignore
```
/.idea/
Expand All @@ -36,7 +47,7 @@ module.exports = {
```
"scripts": {
"lint": "npm run lint:js",
"lint:js": "node_modules/.bin/eslint **/*.jsx **/*.js"
"lint:js": "node_modules/.bin/eslint src/**/*.jsx src/**/*.js"
},
```
then run `npm run lint`
Expand All @@ -63,12 +74,14 @@ then run `npm run lint`
- [Imports](./documentation/imports.md) (ES6)
- [React](./documentation/react.md) (ES6)
- [React A11y](./documentation/react-a11y.md) (ES6)
- [Flow](./documentation/flow.md) (ES6)

## Thanks to
* [Namics.](https://www.namics.com/en/)
* [ESLint](https://github.com/eslint/eslint) for ESLint and the documentation [eslint.org](http://eslint.org/)
* [Walmart](https://github.com/walmartlabs) for sharing their config in [eslint-config-walmart](https://github.com/walmartlabs/eslint-config-walmart)
* [AirBnB](https://github.com/airbnb) for sharing their eslint config in [JavaScript Style Guide](https://github.com/airbnb/javascript)
* [Gajus Kuizinas](https://github.com/gajus) for eslint-plugin-flowtype [eslint-plugin-flowtype](https://github.com/gajus/eslint-plugin-flowtype)

## Roadmap
- Support for ES2016 (ES7)
Expand All @@ -78,4 +91,4 @@ then run `npm run lint`


## Changelog
Please see the [Releases](https://github.com/namics/eslint-config-namics/releases)
Please see the [Releases](https://github.com/namics/eslint-config-namics/releases)
3 changes: 1 addition & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
environment:
matrix:
- nodejs_version: 4
- nodejs_version: 5
- nodejs_version: 6

version: "{build}"
Expand All @@ -24,4 +23,4 @@ install:
test_script:
- node --version
- npm --version
- npm test
- npm test
12 changes: 6 additions & 6 deletions configurations/es5.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
module.exports = {

extends: [
'../rules/es6-disable',
'../rules/node-disable',
'../rules/best-practices',
'../rules/errors',
'../rules/style',
'../rules/variables',
'../rules/es6-disable.js',
'../rules/node-disable.js',
'../rules/best-practices.js',
'../rules/errors.js',
'../rules/style.js',
'../rules/variables.js',
].map(require.resolve),
env: {},
parserOptions: {
Expand Down
4 changes: 2 additions & 2 deletions configurations/es6-react.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ module.exports = {
],
'extends': [
'./es6.js',
'../rules/react',
'../rules/react-a11y',
'../rules/react.js',
'../rules/react-a11y.js',
].map(require.resolve),
'env': {
'browser': true,
Expand Down
14 changes: 7 additions & 7 deletions configurations/es6.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ module.exports = {
},
},
extends: [
'../rules/node-disable',
'../rules/best-practices',
'../rules/errors',
'../rules/style',
'../rules/variables',
'../rules/imports',
'../rules/es6',
'../rules/node-disable.js',
'../rules/best-practices.js',
'../rules/errors.js',
'../rules/style.js',
'../rules/variables.js',
'../rules/imports.js',
'../rules/es6.js',
].map(require.resolve),

parserOptions: {
Expand Down
16 changes: 16 additions & 0 deletions configurations/flow.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

module.exports = {

'parser': 'babel-eslint',
'plugins': [
'flowtype',
],
'extends': [
'../rules/flow.js',
],
'settings': {
'flowtype': {
'onlyFilesWithFlowAnnotation': true,
},
},
};
Loading

0 comments on commit efa6eae

Please sign in to comment.