Skip to content
This repository was archived by the owner on Feb 1, 2022. It is now read-only.

Commit eb465db

Browse files
authored
Check and fix formatting of more files (#120)
I missed JSX files in ESLint and some formatting.
1 parent ab2d3ce commit eb465db

File tree

5 files changed

+102
-14
lines changed

5 files changed

+102
-14
lines changed

.eslintrc.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
module.exports = {
2-
parserOptions: {ecmaVersion: 6},
2+
parser: 'babel-eslint',
3+
parserOptions: {
4+
ecmaVersion: 6,
5+
ecmaFeatures: {
6+
jsx: true,
7+
},
8+
},
39
plugins: ['prettier'],
410
rules: {
511
'prettier/prettier': 'error',

examples/simple/views/index.jsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ var PropTypes = require('prop-types');
33
var Layout = require('./layout');
44

55
// Contrived example to show how one might use Flow type annotations
6-
function countTo(n:number):string {
6+
function countTo(n: number): string {
77
var a = [];
8-
for (var i = 0; i < n; i++ ) {
8+
for (var i = 0; i < n; i++) {
99
a.push(i + 1);
1010
}
1111
return a.join(', ');
@@ -27,7 +27,7 @@ class Index extends React.Component {
2727
}
2828

2929
Index.propTypes = {
30-
title: PropTypes.string
30+
title: PropTypes.string,
3131
};
3232

3333
module.exports = Index;

examples/simple/views/layout.jsx

+8-6
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,25 @@ class Layout extends React.Component {
88
<head>
99
<title>{this.props.title}</title>
1010
<link rel="stylesheet" href="/stylesheets/style.css" />
11-
<script dangerouslySetInnerHTML={{__html:`
11+
<script
12+
dangerouslySetInnerHTML={{
13+
__html: `
1214
// This is making use of ES6 template strings, which allow for
1315
// multiline strings. We specified "{jsx: {harmony: true}}" when
1416
// creating the engine in app.js to get this feature.
1517
console.log("hello world");
16-
`}}/>
18+
`,
19+
}}
20+
/>
1721
</head>
18-
<body>
19-
{this.props.children}
20-
</body>
22+
<body>{this.props.children}</body>
2123
</html>
2224
);
2325
}
2426
}
2527

2628
Layout.propTypes = {
27-
title: PropTypes.string
29+
title: PropTypes.string,
2830
};
2931

3032
module.exports = Layout;

package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
"keywords": ["express", "view engine", "react"],
77
"main": "index.js",
88
"scripts": {
9-
"lint": "eslint .",
9+
"lint": "eslint --ext=js,jsx .",
1010
"format":
11-
"prettier --write *.js package.json .eslintrc.js 'examples/**/*.{js,json}' 'test/*.{js,jsx,json}'",
11+
"prettier --write *.js package.json .eslintrc.js 'examples/**/*.{js,jsx,json}' 'test/*.{js,jsx,json}'",
1212
"test": "node test",
1313
"test-on-travis": "yarn run test && yarn run lint"
1414
},
@@ -32,6 +32,7 @@
3232
},
3333
"devDependencies": {
3434
"async": "^2.4.0",
35+
"babel-eslint": "^8.0.1",
3536
"create-react-class": "^15.5.3",
3637
"eslint": "^4.10.0",
3738
"eslint-plugin-prettier": "^2.3.1",

yarn.lock

+81-2
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,14 @@ async@^2.4.0:
8585
dependencies:
8686
lodash "^4.14.0"
8787

88+
89+
version "7.0.0-beta.0"
90+
resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-7.0.0-beta.0.tgz#418a7b5f3f7dc9a4670e61b1158b4c5661bec98d"
91+
dependencies:
92+
chalk "^2.0.0"
93+
esutils "^2.0.2"
94+
js-tokens "^3.0.0"
95+
8896
babel-code-frame@^6.22.0, babel-code-frame@^6.26.0:
8997
version "6.26.0"
9098
resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b"
@@ -117,6 +125,15 @@ babel-core@^6.26.0:
117125
slash "^1.0.0"
118126
source-map "^0.5.6"
119127

128+
babel-eslint@^8.0.1:
129+
version "8.0.1"
130+
resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-8.0.1.tgz#5d718be7a328625d006022eb293ed3008cbd6346"
131+
dependencies:
132+
babel-code-frame "7.0.0-beta.0"
133+
babel-traverse "7.0.0-beta.0"
134+
babel-types "7.0.0-beta.0"
135+
babylon "7.0.0-beta.22"
136+
120137
babel-generator@^6.26.0:
121138
version "6.26.0"
122139
resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.26.0.tgz#ac1ae20070b79f6e3ca1d3269613053774f20dc5"
@@ -156,6 +173,15 @@ babel-helper-define-map@^6.24.1:
156173
babel-types "^6.26.0"
157174
lodash "^4.17.4"
158175

176+
177+
version "7.0.0-beta.0"
178+
resolved "https://registry.yarnpkg.com/babel-helper-function-name/-/babel-helper-function-name-7.0.0-beta.0.tgz#d1b6779b647e5c5c31ebeb05e13b998e4d352d56"
179+
dependencies:
180+
babel-helper-get-function-arity "7.0.0-beta.0"
181+
babel-template "7.0.0-beta.0"
182+
babel-traverse "7.0.0-beta.0"
183+
babel-types "7.0.0-beta.0"
184+
159185
babel-helper-function-name@^6.24.1:
160186
version "6.24.1"
161187
resolved "https://registry.yarnpkg.com/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz#d3475b8c03ed98242a25b48351ab18399d3580a9"
@@ -166,6 +192,12 @@ babel-helper-function-name@^6.24.1:
166192
babel-traverse "^6.24.1"
167193
babel-types "^6.24.1"
168194

195+
196+
version "7.0.0-beta.0"
197+
resolved "https://registry.yarnpkg.com/babel-helper-get-function-arity/-/babel-helper-get-function-arity-7.0.0-beta.0.tgz#9d1ab7213bb5efe1ef1638a8ea1489969b5a8b6e"
198+
dependencies:
199+
babel-types "7.0.0-beta.0"
200+
169201
babel-helper-get-function-arity@^6.24.1:
170202
version "6.24.1"
171203
resolved "https://registry.yarnpkg.com/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz#8f7782aa93407c41d3aa50908f89b031b1b6853d"
@@ -213,6 +245,10 @@ babel-helpers@^6.24.1:
213245
babel-runtime "^6.22.0"
214246
babel-template "^6.24.1"
215247

248+
249+
version "7.0.0-beta.0"
250+
resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-7.0.0-beta.0.tgz#6df01296e49fc8fbd0637394326a167f36da817b"
251+
216252
babel-messages@^6.23.0:
217253
version "6.23.0"
218254
resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e"
@@ -514,6 +550,15 @@ babel-runtime@^6.18.0, babel-runtime@^6.22.0, babel-runtime@^6.26.0:
514550
core-js "^2.4.0"
515551
regenerator-runtime "^0.11.0"
516552

553+
554+
version "7.0.0-beta.0"
555+
resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-7.0.0-beta.0.tgz#85083cf9e4395d5e48bf5154d7a8d6991cafecfb"
556+
dependencies:
557+
babel-traverse "7.0.0-beta.0"
558+
babel-types "7.0.0-beta.0"
559+
babylon "7.0.0-beta.22"
560+
lodash "^4.2.0"
561+
517562
babel-template@^6.24.1, babel-template@^6.26.0:
518563
version "6.26.0"
519564
resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.26.0.tgz#de03e2d16396b069f46dd9fff8521fb1a0e35e02"
@@ -524,6 +569,20 @@ babel-template@^6.24.1, babel-template@^6.26.0:
524569
babylon "^6.18.0"
525570
lodash "^4.17.4"
526571

572+
573+
version "7.0.0-beta.0"
574+
resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-7.0.0-beta.0.tgz#da14be9b762f62a2f060db464eaafdd8cd072a41"
575+
dependencies:
576+
babel-code-frame "7.0.0-beta.0"
577+
babel-helper-function-name "7.0.0-beta.0"
578+
babel-messages "7.0.0-beta.0"
579+
babel-types "7.0.0-beta.0"
580+
babylon "7.0.0-beta.22"
581+
debug "^3.0.1"
582+
globals "^10.0.0"
583+
invariant "^2.2.0"
584+
lodash "^4.2.0"
585+
527586
babel-traverse@^6.24.1, babel-traverse@^6.26.0:
528587
version "6.26.0"
529588
resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.26.0.tgz#46a9cbd7edcc62c8e5c064e2d2d8d0f4035766ee"
@@ -538,6 +597,14 @@ babel-traverse@^6.24.1, babel-traverse@^6.26.0:
538597
invariant "^2.2.2"
539598
lodash "^4.17.4"
540599

600+
601+
version "7.0.0-beta.0"
602+
resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-7.0.0-beta.0.tgz#eb8b6e556470e6dcc4aef982d79ad229469b5169"
603+
dependencies:
604+
esutils "^2.0.2"
605+
lodash "^4.2.0"
606+
to-fast-properties "^2.0.0"
607+
541608
babel-types@^6.19.0, babel-types@^6.24.1, babel-types@^6.26.0:
542609
version "6.26.0"
543610
resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.26.0.tgz#a3b073f94ab49eb6fa55cd65227a334380632497"
@@ -547,6 +614,10 @@ babel-types@^6.19.0, babel-types@^6.24.1, babel-types@^6.26.0:
547614
lodash "^4.17.4"
548615
to-fast-properties "^1.0.3"
549616

617+
618+
version "7.0.0-beta.22"
619+
resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.22.tgz#74f0ad82ed7c7c3cfeab74cf684f815104161b65"
620+
550621
babylon@^6.18.0:
551622
version "6.18.0"
552623
resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3"
@@ -903,6 +974,10 @@ glob@^7.0.3, glob@^7.0.5, glob@^7.1.2:
903974
once "^1.3.0"
904975
path-is-absolute "^1.0.0"
905976

977+
globals@^10.0.0:
978+
version "10.2.0"
979+
resolved "https://registry.yarnpkg.com/globals/-/globals-10.2.0.tgz#69490789091fcaa7f7d512c668c8eb73894a4ef2"
980+
906981
globals@^9.17.0, globals@^9.18.0:
907982
version "9.18.0"
908983
resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a"
@@ -985,7 +1060,7 @@ inquirer@^3.0.6:
9851060
strip-ansi "^4.0.0"
9861061
through "^2.3.6"
9871062

988-
invariant@^2.2.2:
1063+
invariant@^2.2.0, invariant@^2.2.2:
9891064
version "2.2.2"
9901065
resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.2.tgz#9e1f56ac0acdb6bf303306f338be3b204ae60360"
9911066
dependencies:
@@ -1111,7 +1186,7 @@ lodash.escaperegexp@^4.1.2:
11111186
version "4.1.2"
11121187
resolved "https://registry.yarnpkg.com/lodash.escaperegexp/-/lodash.escaperegexp-4.1.2.tgz#64762c48618082518ac3df4ccf5d5886dae20347"
11131188

1114-
lodash@^4.14.0, lodash@^4.17.4, lodash@^4.3.0:
1189+
lodash@^4.14.0, lodash@^4.17.4, lodash@^4.2.0, lodash@^4.3.0:
11151190
version "4.17.4"
11161191
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae"
11171192

@@ -1518,6 +1593,10 @@ to-fast-properties@^1.0.3:
15181593
version "1.0.3"
15191594
resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47"
15201595

1596+
to-fast-properties@^2.0.0:
1597+
version "2.0.0"
1598+
resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e"
1599+
15211600
trim-right@^1.0.1:
15221601
version "1.0.1"
15231602
resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003"

0 commit comments

Comments
 (0)