Skip to content

Commit

Permalink
Merge pull request #4 from namics/develop
Browse files Browse the repository at this point in the history
v2.1.0
  • Loading branch information
smollweide authored Nov 29, 2016
2 parents a98da56 + 35e2c32 commit 104791b
Show file tree
Hide file tree
Showing 20 changed files with 100 additions and 18 deletions.
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/test
/processing
/documentation
/.idea/
9 changes: 7 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
language: node_js
before_script:
- npm install eslint eslint-plugin-import
script:
- npm test
node_js:
- "5.5"
- "4.4.6"
- "6"
- "5"
- "4"
42 changes: 36 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,58 @@
# ESLint config Namics

[![Build Status](https://img.shields.io/travis/namics/eslint-config-namics/master.svg)](https://travis-ci.org/namics/eslint-config-namics)
[![Build Status](https://ci.appveyor.com/api/projects/status/sroqr91h6gjecoqi/branch/master?svg=true)](https://ci.appveyor.com/project/smollweide/eslint-config-namics/branch/master)
[![Dependencies](https://img.shields.io/david/namics/eslint-config-namics/master.svg)](https://david-dm.org/namics/eslint-config-namics)
[![npm](https://img.shields.io/npm/v/@namics/eslint-config.svg)](https://www.npmjs.com/package/@namics/eslint-config)
[![Codestyle](https://img.shields.io/badge/codestyle-namics-green.svg)](https://github.com/namics/eslint-config-namics)

## Installation
```bash
$ npm install --save-dev @namics/eslint-config
$ 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/es5-browser` - ES5 + browser
- `@namics/eslint-config/configurations/es5-node` - ES5 + node
- `@namics/eslint-config/configurations/es5-browser` - ES5 + browser (deprecated)
- `@namics/eslint-config/configurations/es5-node` - ES5 + node (deprecated)

### .eslintrc.js
### .eslintrc.js (add globals here if needed)
```
module.exports = {
"extends": "@namics/eslint-config/configurations/es6-browser.js"
}
```

### .eslintignore
```
/.idea/
/node_modules/
```

### package.json
```
"scripts": {
"lint": "npm run lint:js",
"lint:js": "node_modules/.bin/eslint **/*.jsx **/*.js"
},
```
then run `npm run lint`

### Example usage in project tree
- .eslintrc.js (es6-react)
- .eslintignore
- src
- app.jsx
- test
- .eslintrc.js (es6-node)
- index.js
- scripts
- .eslintrc.js (es5-node)
- index.js

## Documentation
- [Best practices](./documentation/best-practices.md) (ES5 + ES6)
- [Style](./documentation/style.md) (ES5 + ES6)
Expand All @@ -39,9 +67,11 @@ module.exports = {
## 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/airbnb/javascript)
* [AirBnB](https://github.com/airbnb) for sharing their eslint config in [JavaScript Style Guide](https://github.com/walmartlabs/eslint-config-walmart)
* [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)

## Roadmap
- Support for ES2016 (ES7)

## License
[MIT License](./LICENSE)
Expand Down
27 changes: 27 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# appveyor file
# http://www.appveyor.com/docs/appveyor-yml

environment:
matrix:
- nodejs_version: 4
- nodejs_version: 5
- nodejs_version: 6

version: "{build}"
build: off
deploy: off
matrix:
fast_finish: true

install:
- ps: Install-Product node $env:nodejs_version
- npm --version
- npm -g install npm@3
- set PATH=%APPDATA%\npm;%PATH%
- npm install eslint eslint-plugin-import
- npm install --ignore-scripts --force

test_script:
- node --version
- npm --version
- npm test
3 changes: 2 additions & 1 deletion documentation/react.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ const Hello = <Hello personal />;
<Hello name={{ firstname: 'John', lastname: 'Doe' }} />;
<Hello name={
firstname
} />;
}
/>;

```
<br />
Expand Down
19 changes: 11 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@namics/eslint-config",
"version": "2.0.0",
"version": "2.1.0",
"description": "Default configurations for eslint",
"author": "Simon Mollweide <simon.mollweide@namics.com>",
"license": "MIT",
Expand All @@ -17,8 +17,9 @@
},
"main": "configurations/es6-browser.js",
"scripts": {
"lint": "eslint ./test",
"test": "eslint ./test"
"lint": "npm run lint:js",
"lint:js": "node_modules/.bin/eslint **/*.jsx **/*.js",
"test": "npm run lint"
},
"keywords": [
"code checker",
Expand All @@ -33,11 +34,13 @@
"react",
"jsx"
],
"peerDependencies": {
"eslint": "^3.0.0",
"eslint-plugin-import": "^2.0.0"
},
"dependencies": {
"eslint": "^3.5.0",
"eslint-find-rules": "^1.13.2",
"eslint-plugin-import": "^1.15.0",
"eslint-plugin-jsx-a11y": "^2.2.2",
"eslint-plugin-react": "^6.3.0"
"eslint-find-rules": "^1.14.3",
"eslint-plugin-jsx-a11y": "^3.0.1",
"eslint-plugin-react": "^6.7.1"
}
}
1 change: 1 addition & 0 deletions test/es6-react/rules/react-a11y/aria-props.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
/* eslint react/prefer-stateless-function: 0*/
/* eslint react/prefer-es6-class: 0*/
/* eslint react/prop-types: 0*/
/* eslint react/jsx-indent: 0*/
/* eslint object-shorthand: 0*/
// <!START
// Bad
Expand Down
1 change: 1 addition & 0 deletions test/es6-react/rules/react-a11y/aria-role.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
/* eslint react/prefer-es6-class: 0*/
/* eslint react/prop-types: 0*/
/* eslint object-shorthand: 0*/
/* eslint react/jsx-indent: 0*/
// <!START
// Bad
/*
Expand Down
1 change: 1 addition & 0 deletions test/es6-react/rules/react-a11y/href-no-hash.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
/* eslint react/prefer-es6-class: 0*/
/* eslint react/prop-types: 0*/
/* eslint object-shorthand: 0*/
/* eslint react/jsx-indent: 0*/
// <!START
// Bad
/*
Expand Down
1 change: 1 addition & 0 deletions test/es6-react/rules/react-a11y/img-redundant-alt.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
/* eslint react/prefer-es6-class: 0*/
/* eslint react/prop-types: 0*/
/* eslint object-shorthand: 0*/
/* eslint react/jsx-indent: 0*/
// <!START
// Bad
/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
/* eslint react/prop-types: 0*/
/* eslint react/jsx-sort-props: 0*/
/* eslint object-shorthand: 0*/
/* eslint react/jsx-indent: 0*/
// <!START
// Bad
<div onMouseOver={() => {}} />;
Expand Down
1 change: 1 addition & 0 deletions test/es6-react/rules/react-a11y/onclick-has-focus.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
/* eslint react/prop-types: 0*/
/* eslint react/jsx-sort-props: 0*/
/* eslint object-shorthand: 0*/
/* eslint react/jsx-indent: 0*/
// <!START
// Bad
<span onClick="submitForm();">Submit</span>;
Expand Down
1 change: 1 addition & 0 deletions test/es6-react/rules/react-a11y/onclick-has-role.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
/* eslint react/jsx-sort-props: 0*/
/* eslint react/jsx-no-undef: 0*/
/* eslint object-shorthand: 0*/
/* eslint react/jsx-indent: 0*/
// <!START
// Bad
<div onClick={() => {}} />;
Expand Down
1 change: 1 addition & 0 deletions test/es6-react/rules/react-a11y/tabindex-no-positive.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
/* eslint react/jsx-sort-props: 0*/
/* eslint react/jsx-no-undef: 0*/
/* eslint object-shorthand: 0*/
/* eslint react/jsx-indent: 0*/
// DESCRIPTION = Enforce tabIndex value is not greater than zero.
// STATUS = 0

Expand Down
4 changes: 3 additions & 1 deletion test/es6-react/rules/react/jsx-curly-spacing.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
/* eslint react/jsx-first-prop-new-line: 0*/
/* eslint object-shorthand: 0*/
/* eslint no-unused-expressions: 0*/
/* eslint react/jsx-indent: 0*/
// <!START
// Bad
/*
Expand All @@ -32,6 +33,7 @@
<Hello name={{ firstname: 'John', lastname: 'Doe' }} />;
<Hello name={
firstname
} />;
}
/>;
// END!>

1 change: 1 addition & 0 deletions test/es6-react/rules/react/jsx-equals-spacing.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
/* eslint react/jsx-no-undef: 0*/
/* eslint object-shorthand: 0*/
/* eslint no-unused-expressions: 0*/
/* eslint react/jsx-indent: 0*/
// <!START
// Bad
/*
Expand Down
1 change: 1 addition & 0 deletions test/es6-react/rules/react/jsx-handler-names.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
/* eslint react/jsx-no-undef: 0*/
/* eslint object-shorthand: 0*/
/* eslint no-unused-expressions: 0*/
/* eslint react/jsx-indent: 0*/
// <!START
// Bad
/*
Expand Down
1 change: 1 addition & 0 deletions test/es6-react/rules/react/jsx-max-props-per-line.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
/* eslint react/jsx-no-undef: 0*/
/* eslint object-shorthand: 0*/
/* eslint no-unused-expressions: 0*/
/* eslint react/jsx-indent: 0*/
// <!START
// Bad
/*
Expand Down
1 change: 1 addition & 0 deletions test/es6-react/rules/react/jsx-no-undef.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
/* eslint react/prop-types: 0*/
/* eslint object-shorthand: 0*/
/* eslint no-unused-expressions: 0*/
/* eslint react/jsx-indent: 0*/
// <!START
// Bad
/*
Expand Down
1 change: 1 addition & 0 deletions test/es6-react/rules/react/jsx-space-before-closing.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
/* eslint react/jsx-no-undef: 0*/
/* eslint object-shorthand: 0*/
/* eslint no-unused-expressions: 0*/
/* eslint react/jsx-indent: 0*/
// <!START
// Bad
/*
Expand Down

0 comments on commit 104791b

Please sign in to comment.