Skip to content

Commit e721493

Browse files
authored
chore: Use prettier (#274)
* Use prettier * Fix more lint errors * Use const and let
1 parent f7eb575 commit e721493

File tree

117 files changed

+3089
-2396
lines changed

Some content is hidden

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

117 files changed

+3089
-2396
lines changed

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
src/__tests__/fixtures/
2+
dist/
3+
flow-typed/

.eslintrc.js

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
module.exports = {
22
parser: 'babel-eslint',
3-
extends: 'eslint:recommended',
3+
extends: [
4+
'eslint:recommended',
5+
'prettier'
6+
],
7+
plugins:[
8+
'prettier'
9+
],
410
rules: {
5-
'comma-dangle': ['error', 'always-multiline'],
6-
'no-underscore-dangle': 'off',
7-
quotes: ['error', 'single', 'avoid-escape'],
8-
strict: 'off',
9-
'no-unused-vars': 'error',
10-
'no-undef': 'error'
11+
strict: ['error', 'never'],
12+
'no-shadow': 'error',
13+
'no-var': 'error',
14+
'prefer-const': 'error',
15+
'prettier/prettier': 'error',
1116
},
1217
env: {
1318
node: true,

.gitignore

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
/dist
22
node_modules/
3-
4-
## IDE
53
.idea/
6-
7-
## Jest
84
coverage/

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
src/__tests__/fixtures/
2+
dist/

.prettierrc

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"arrowParens": "avoid",
3+
"trailingComma": "all",
4+
"useTabs": false,
5+
"semi": true,
6+
"singleQuote": true,
7+
"bracketSpacing": true,
8+
"jsxBracketSameLine": false,
9+
"tabWidth": 2,
10+
"printWidth": 80,
11+
"overrides": [{
12+
"files": [
13+
"bin/react-docgen.js",
14+
"bin/__tests__/example/**/*.js"
15+
],
16+
"options": {
17+
"trailingComma": "es5"
18+
}
19+
}]
20+
}

bin/__tests__/example/MultipleComponents.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*/
1010

11-
var React = require('react');
11+
const React = require('react');
1212

1313
exports.ComponentA = React.createClass({
1414
displayName: 'ComponentA',

bin/__tests__/example/customResolver.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ const code = `
1919
`;
2020

2121
module.exports = function(ast, recast) {
22-
return (new recast.types.NodePath(recast.parse(code)))
23-
.get('program', 'body', 0, 'expression');
22+
return new recast.types.NodePath(recast.parse(code)).get(
23+
'program',
24+
'body',
25+
0,
26+
'expression'
27+
);
2428
};

0 commit comments

Comments
 (0)