8000 [eslint config] [deps] update `eslint-plugin-react` · odongohcoder2019/javascript@c66cfc3 · GitHub
[go: up one dir, main page]

Skip to content

Commit c66cfc3

Browse files
committed
[eslint config] [deps] update eslint-plugin-react
1 parent 8c94d53 commit c66cfc3

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

packages/eslint-config-airbnb/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
"eslint-find-rules": "^3.4.0",
6868
"eslint-plugin-import": "^2.18.2",
6969
"eslint-plugin-jsx-a11y": "^6.2.3",
70-
"eslint-plugin-react": "^7.14.3",
70+
"eslint-plugin-react": "^7.15.1",
7171
"eslint-plugin-react-hooks": "^1.7.0",
7272
"in-publish": "^2.0.0",
7373
"react": ">= 0.13.0",
@@ -78,7 +78,7 @@
7878
"eslint": "^5.16.0 || ^6.1.0",
7979
"eslint-plugin-import": "^2.18.2",
8080
"eslint-plugin-jsx-a11y": "^6.2.3",
81-
"eslint-plugin-react": "^7.14.3",
81+
"eslint-plugin-react": "^7.15.1",
8282
"eslint-plugin-react-hooks": "^1.7.0"
8383
},
8484
"engines": {

packages/eslint-config-airbnb/test/test-react-order.js

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ import React from 'react';
2929
3030
export default class MyComponent extends React.Component {
3131
/* eslint no-empty-function: 0, class-methods-use-this: 0 */
32-
${body}
33-
}
32+
${body}}
3433
`;
3534
}
3635

@@ -44,25 +43,24 @@ test('validate react prop order', (t) => {
4443
t.test('passes a good component', (t) => {
4544
t.plan(3);
4645
const result = lint(wrapComponent(`
47-
componentWillMount() {}
4846
componentDidMount() {}
4947
setFoo() {}
5048
getFoo() {}
5149
setBar() {}
5250
someMethod() {}
5351
renderDogs() {}
54-
render() { return <div />; }`));
52+
render() { return <div />; }
53+
`));
5554

5655
t.notOk(result.warningCount, 'no warnings');
57-
t.notOk(result.errorCount, 'no errors');
5856
t.deepEquals(result.messages, [], 'no messages in results');
57+
t.notOk(result.errorCount, 'no errors');
5958
});
6059

6160
t.test('order: when random method is first', (t) => {
6261
t.plan(2);
6362
const result = lint(wrapComponent(`
6463
someMethod() {}
65-
componentWillMount() {}
6664
componentDidMount() {}
6765
setFoo() {}
6866
getFoo() {}
@@ -72,13 +70,12 @@ test('validate react prop order', (t) => {
7270
`));
7371

7472
t.ok(result.errorCount, 'fails');
75-
t.equal(result.messages[0].ruleId, 'react/sort-comp', 'fails due to sort');
73+
t.deepEqual(result.messages.map(x => x.ruleId), ['react/sort-comp'], 'fails due to sort');
7674
});
7775

7876
t.test('order: when random method after lifecycle methods', (t) => {
7977
t.plan(2);
8078
const result = lint(wrapComponent(`
81-
componentWillMount() {}
8279
componentDidMount() {}
8380
someMethod() {}
8481
setFoo() {}
@@ -89,6 +86,6 @@ test('validate react prop order', (t) => {
8986
`));
9087

9188
t.ok(result.errorCount, 'fails');
92-
t.equal(result.messages[0].ruleId, 'react/sort-comp', 'fails due to sort');
89+
t.deepEqual(result.messages.map(x => x.ruleId), ['react/sort-comp'], 'fails due to sort');
9390
});
9491
});

0 commit comments

Comments
 (0)
0