Skip to content

Commit 998ae9c

Browse files
committed
[eslint] switch to @babel/eslint-parser, fix linting
1 parent 18527e8 commit 998ae9c

File tree

47 files changed

+139
-156
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+139
-156
lines changed

.eslintignore

Lines changed: 0 additions & 49 deletions
This file was deleted.

.eslintrc

Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,17 @@
44
"env": {
55
"node": true,
66
},
7-
"parser": "babel-eslint",
7+
"parser": "@babel/eslint-parser",
8+
"ignorePatterns": [
9+
"/build",
10+
"_book",
11+
"packages/*/build/",
12+
// Temporarily copied
13+
"packages/*/LICENSE.md",
14+
"packages/enzyme/README.md",
15+
"packages/enzyme-adapter-react-*/README.md",
16+
"packages/enzyme-adapter-utils*/README.md",
17+
],
818
"rules": {
919
"id-length": 0,
1020
"react/no-find-dom-node": 1,
@@ -23,43 +33,45 @@
2333
"devDependencies": true,
2434
}],
2535
"comma-dangle": [2, {
26-
arrays: "always-multiline",
27-
objects: "always-multiline",
28-
imports: "always-multiline",
29-
exports: "always-multiline",
30-
functions: "ignore",
36+
"arrays": "always-multiline",
37+
"objects": "always-multiline",
38+
"imports": "always-multiline",
39+
"exports": "always-multiline",
40+
"functions": "ignore",
3141
}],
3242
"strict": [2, "safe"],
3343
"prefer-destructuring": 0,
3444
"prefer-template": 0,
3545
},
3646
"parserOptions": {
37-
sourceType: "script",
47+
"sourceType": "script",
3848
},
3949
},
4050
{
4151
"files": [
42-
"*.md",
4352
"**/*.md",
53+
"**/*.md/**"
4454
],
45-
"plugins": [
46-
"markdown"
47-
],
55+
"extends": ["plugin:markdown/recommended"],
4856
"rules": {
4957
"class-methods-use-this": 0,
50-
"import/no-unresolved": 0,
51-
"import/no-extraneous-dependencies": 0,
5258
"import/extensions": 0,
59+
"import/no-extraneous-dependencies": 0,
60+
"import/no-unresolved": 0,
61+
"import/prefer-default-export": 0,
5362
"max-len": 0,
54-
"no-unused-vars": 0,
5563
"no-console": 0,
5664
"no-undef": 0,
57-
"react/react-in-jsx-scope": 0,
65+
"no-unused-vars": 0,
5866
"react/jsx-filename-extension": 0,
67+
"react/jsx-fragments": 0,
5968
"react/jsx-no-undef": 0,
60-
"react/no-multi-comp": 0,
69+
"react/jsx-no-useless-fragment": 0,
6170
"react/jsx-one-expression-per-line": 0,
62-
"react/jsx-fragments": 0,
71+
"react/no-multi-comp": 0,
72+
"react/no-unknown-property": 0,
73+
"react/no-unused-class-component-methods": 0,
74+
"react/react-in-jsx-scope": 0,
6375
},
6476
},
6577
],

docs/api/ReactWrapper/props.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ This method is a reliable way of accessing the props of a node; `wrapper.instanc
77

88
#### Example
99
```jsx
10-
1110
import PropTypes from 'prop-types';
1211

1312
function MyComponent(props) {

docs/api/ReactWrapper/renderProp.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,19 @@ Mouse.propTypes = {
5050
```
5151

5252
```jsx
53-
const App = () => (
54-
<div style={{ height: '100%' }}>
55-
<Mouse
56-
render={(x = 0, y = 0) => (
57-
<h1>
58-
The mouse position is ({x}, {y})
59-
</h1>
60-
)}
61-
/>
62-
</div>
63-
);
53+
function App() {
54+
return (
55+
<div style={{ height: '100%' }}>
56+
<Mouse
57+
render={(x = 0, y = 0) => (
58+
<h1>
59+
The mouse position is ({x}, {y})
60+
</h1>
61+
)}
62+
/>
63+
</div>
64+
);
65+
}
6466
```
6567

6668
##### Testing with no arguments

docs/api/ReactWrapper/simulate.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,14 @@ expect(wrapper.find('.clicks-1').length).to.equal(1);
4848
#### Example `functional component`
4949

5050
```jsx
51-
const Foo = ({ width, height, onChange }) => (
52-
<div>
53-
<input name="width" value={width} onChange={onChange} />
54-
<input name="height" value={height} onChange={onChange} />
55-
</div>
56-
);
51+
function Foo({ width, height, onChange }) {
52+
return (
53+
<div>
54+
<input name="width" value={width} onChange={onChange} />
55+
<input name="height" value={height} onChange={onChange} />
56+
</div>
57+
);
58+
}
5759
Foo.propTypes = {
5860
width: PropTypes.number.isRequired,
5961
height: PropTypes.number.isRequired,

docs/api/ReactWrapper/simulateError.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,5 +74,3 @@ expect(spy.args).to.deep.equal([
7474
},
7575
]);
7676
```
77-
78-

docs/api/ShallowWrapper/props.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ This method is a reliable way of accessing the props of a node; `wrapper.instanc
99

1010
#### Example
1111
```jsx
12-
1312
import PropTypes from 'prop-types';
1413

1514
function MyComponent(props) {

docs/api/ShallowWrapper/renderProp.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,19 @@ Mouse.propTypes = {
5050
```
5151

5252
```jsx
53-
const App = () => (
54-
<div style={{ height: '100%' }}>
55-
<Mouse
56-
render={(x = 0, y = 0) => (
57-
<h1>
58-
The mouse position is ({x}, {y})
59-
</h1>
60-
)}
61-
/>
62-
</div>
63-
);
53+
function App() {
54+
return (
55+
<div style={{ height: '100%' }}>
56+
<Mouse
57+
render={(x = 0, y = 0) => (
58+
<h1>
59+
The mouse position is ({x}, {y})
60+
</h1>
61+
)}
62+
/>
63+
</div>
64+
);
65+
}
6466
```
6567

6668
##### Testing with no arguments

docs/api/ShallowWrapper/simulate.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,14 @@ expect(wrapper.find('.clicks-1').length).to.equal(1);
4848
#### Example `functional component`
4949

5050
```jsx
51-
const Foo = ({ width, height, onChange }) => (
52-
<div>
53-
<input name="width" value={width} onChange={onChange} />
54-
<input name="height" value={height} onChange={onChange} />
55-
</div>
56-
);
51+
function Foo({ width, height, onChange }) {
52+
return (
53+
<div>
54+
<input name="width" value={width} onChange={onChange} />
55+
<input name="height" value={height} onChange={onChange} />
56+
</div>
57+
);
58+
}
5759
Foo.propTypes = {
5860
width: PropTypes.number.isRequired,
5961
height: PropTypes.number.isRequired,

docs/api/ShallowWrapper/simulateError.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,4 @@ expect(spy.args).to.deep.equal([
7373
in WrapperComponent`,
7474
},
7575
]);
76-
```
77-
78-
76+
```

0 commit comments

Comments
 (0)