Skip to content

Commit

Permalink
[change] update for eslint@4
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Mollweide committed Jul 14, 2017
1 parent 06b5797 commit df400a7
Show file tree
Hide file tree
Showing 10 changed files with 365 additions and 396 deletions.
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
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"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",
Expand Down Expand Up @@ -37,12 +37,12 @@
],
"dependencies": {
"babel-eslint": "7.2.3",
"eslint": "3.19.0",
"eslint-find-rules": "1.14.3",
"eslint-plugin-flowtype": "2.34.0",
"eslint-plugin-import": "2.3.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

0 comments on commit df400a7

Please sign in to comment.