Skip to content
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

v4.0.0 #11

Merged
merged 2 commits into from
Jul 14, 2017
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
17 changes: 3 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

## Installation
```bash
$ npm install --save-dev eslint eslint-plugin-import @namics/eslint-config
$ npm install --save-dev @namics/eslint-config
```

## Usage
Expand All @@ -26,16 +26,8 @@ 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/es6-react.js",
"@namics/eslint-config/configurations/flow.js"
]
};
```
####
- [configuration with flowtype](./documentation/with-flow.md)

### .eslintignore
```
Expand Down Expand Up @@ -83,9 +75,6 @@ then run `npm run lint`
* [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)

## License
[MIT License](./LICENSE)

Expand Down
5 changes: 1 addition & 4 deletions configurations/es6-react.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,11 @@ module.exports = {
'ecmaVersion': 6,
'sourceType': 'module',
'ecmaFeatures': {
'generators': false,
'generators': true,
'objectLiteralDuplicateProperties': false,
'jsx': true,
},
},
'ecmaFeatures': {
'jsx': true,
},
'settings': {
'import/resolver': {
'node': {
Expand Down
8 changes: 2 additions & 6 deletions documentation/react-a11y.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,16 +101,14 @@
> disallow href "#"


✓ Enabled (error)
✓ Disabled

```javascript

// Bad
/*
<a href="#" />;
<a href={"#"} />;
<a href={`#`} />;
*/

// Good
<a href="https://github.com" />;
Expand Down Expand Up @@ -184,16 +182,14 @@ function Foo({ alt, src }) {
> require that JSX labels use "htmlFor"


&#10003; Enabled (error)
&#10003; Disabled

```javascript

// Bad
/*
function Foo(props) {
return <label {...props} />;
}
*/

// Good
function Foo({ htmlFor, props }) {
Expand Down
10 changes: 10 additions & 0 deletions documentation/with-flow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
### 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/es6-react.js",
"@namics/eslint-config/configurations/flow.js"
]
};
```
22 changes: 10 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
{
"name": "@namics/eslint-config",
"version": "3.0.0",
"version": "4.0.0",
"description": "Default configurations for eslint",
"author": "Simon Mollweide <simon.mollweide@namics.com>",
"license": "MIT",
"private": false,
"engines": {
"node": ">= 4.4.0"
"node": ">=4 <9",
"npm": ">=3 <6"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -34,17 +35,14 @@
"react",
"jsx"
],
"peerDependencies": {
"eslint": "^3.0.0",
"eslint-plugin-import": "^2.0.0"
},
"dependencies": {
"babel-eslint": "7.2.3",
"eslint": "3.19.0",
"eslint-find-rules": "1.14.3",
"eslint-plugin-flowtype": "2.34.0",
"eslint-plugin-jsx-a11y": "5.0.3",
"eslint-plugin-react": "7.0.1",
"flow-bin": "0.47.0"
"eslint": "4.2.0",
"eslint-find-rules": "3.1.1",
"eslint-plugin-flowtype": "2.35.0",
"eslint-plugin-import": "2.7.0",
"eslint-plugin-jsx-a11y": "6.0.2",
"eslint-plugin-react": "7.1.0",
"flow-bin": "0.50.0"
}
}
4 changes: 2 additions & 2 deletions rules/react-a11y.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module.exports = {

// disallow href "#"
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/href-no-hash.md
'jsx-a11y/href-no-hash': 2,
'jsx-a11y/href-no-hash': 0,

// Require <img> to have a non-empty `alt` prop, or role="presentation"
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/img-has-alt.md
Expand All @@ -31,7 +31,7 @@ module.exports = {

// require that JSX labels use "htmlFor"
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/label-has-for.md
'jsx-a11y/label-has-for': 2,
'jsx-a11y/label-has-for': 0,

// require that mouseover/out come with focus/blur, for keyboard-only users
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/mouse-events-have-key-events.md
Expand Down
1 change: 1 addition & 0 deletions test/es5/rules/best-practices/no-unused-labels.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
/* eslint no-labels: 0*/
/* eslint no-extra-label: 0*/
/* eslint no-restricted-syntax: 0*/
/* eslint indent: 0*/
// <!START
// Bad
/*
Expand Down
1 change: 1 addition & 0 deletions test/es5/rules/errors/no-unexpected-multiline.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
/* eslint no-unused-expressions: 0*/
/* eslint semi: 0*/
/* eslint quotes: 0*/
/* eslint indent: 0*/
// <!START
// Bad
let a = function () {}
Expand Down
7 changes: 2 additions & 5 deletions test/es6-react/rules/react-a11y/href-no-hash.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,13 @@
/* eslint react/jsx-indent: 0*/
// <!START
// Bad
/*
<a href="#" />;
<a href={"#"} />;
<a href={`#`} />;
*/
<a href={'#'} />;
<a href={'#'} />;

// Good
<a href="https://github.com" />;
<a href="#section" />;
<a href="foo" />;
<a href={undefined} />;
// END!>

3 changes: 1 addition & 2 deletions test/es6-react/rules/react/jsx-curly-spacing.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@
<Hello name={firstname} />;
<Hello name={{ firstname: 'John', lastname: 'Doe' }} />;
<Hello name={
firstname
firstname
}
/>;
// END!>

4 changes: 2 additions & 2 deletions test/flow/rules/flow/object-type-delimiter.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ type Foo2Type = {
// GOOD
type FooType = { a: string, b: string };
type Foo2Type = {
a: string,
b: string,
a: string,
b: string,
};
// END!>
Loading