Skip to content

Commit 8b33f5b

Browse files
frenzzyokendoken
authored andcommitted
Add flowtype plugin to eslint with recommended configuration
1 parent d692fc5 commit 8b33f5b

File tree

3 files changed

+69
-50
lines changed

3 files changed

+69
-50
lines changed

.eslintrc.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@ module.exports = {
1414

1515
extends: [
1616
'airbnb',
17+
'plugin:flowtype/recommended',
1718
'plugin:css-modules/recommended',
1819
],
1920

2021
plugins: [
22+
'flowtype',
2123
'css-modules',
2224
],
2325

@@ -56,10 +58,11 @@ module.exports = {
5658
],
5759

5860
// Allow js files to use jsx syntax, too
59-
'react/jsx-filename-extension': 'off',
61+
'react/jsx-filename-extension': ['error', { extensions: ['.js', '.jsx'] }],
6062

63+
// Automatically convert pure class to function by
64+
// babel-plugin-transform-react-pure-class-to-function
6165
// https://github.com/kriasoft/react-starter-kit/pull/961
62-
// You can reopen this if you still want this rule
6366
'react/prefer-stateless-function': 'off',
6467
},
6568

package.json

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"redux": "^3.6.0",
4848
"redux-logger": "^3.0.1",
4949
"redux-thunk": "^2.2.0",
50-
"sequelize": "^4.2.0",
50+
"sequelize": "^4.2.1",
5151
"serialize-javascript": "^1.3.0",
5252
"source-map-support": "^0.4.15",
5353
"sqlite3": "^3.1.8",
@@ -80,7 +80,8 @@
8080
"eslint-import-resolver-node": "^0.3.1",
8181
"eslint-loader": "^1.8.0",
8282
"eslint-plugin-css-modules": "^2.7.1",
83-
"eslint-plugin-import": "^2.6.0",
83+
"eslint-plugin-flowtype": "^2.34.1",
84+
"eslint-plugin-import": "^2.6.1",
8485
"eslint-plugin-jsx-a11y": "^5.0.3",
8586
"eslint-plugin-react": "^7.0.1",
8687
"file-loader": "^0.11.2",
@@ -114,7 +115,7 @@
114115
"postcss-selector-not": "^3.0.1",
115116
"raw-loader": "^0.5.1",
116117
"react-deep-force-update": "^2.0.1",
117-
"react-error-overlay": "^1.0.8",
118+
"react-error-overlay": "^1.0.9",
118119
"react-hot-loader": "^3.0.0-beta.7",
119120
"react-test-renderer": "^15.5.4",
120121
"redux-mock-store": "^1.2.3",
@@ -173,18 +174,21 @@
173174
},
174175
"scripts": {
175176
"precommit": "lint-staged",
176-
"lint:js": "eslint --ignore-path .gitignore --ignore-pattern \"!**/.*\" .",
177-
"lint:css": "stylelint \"src/**/*.{css,less,scss,sss}\"",
178-
"lint": "yarn run lint:js && yarn run lint:css",
177+
"lint-js": "eslint --ignore-path .gitignore --ignore-pattern \"!**/.*\" .",
178+
"lint-css": "stylelint \"src/**/*.{css,less,scss,sss}\"",
179+
"lint": "yarn run lint-js && yarn run lint-css",
180+
"fix-js": "yarn run lint-js -- --fix",
181+
"fix-css": "yarn run lint-css -- --fix",
182+
"fix": "yarn run fix-js && yarn run fix-css",
179183
"test": "mocha",
180-
"test:watch": "yarn run test -- --reporter min --watch",
181-
"test:cover": "cross-env NODE_ENV=test nyc npm run test",
182-
"coverage": "yarn run test:cover && nyc report --reporter=html && opn coverage/index.html",
184+
"test-watch": "yarn run test -- --reporter min --watch",
185+
"test-cover": "cross-env NODE_ENV=test nyc npm run test",
186+
"coverage": "yarn run test-cover && nyc report --reporter=html && opn coverage/index.html",
183187
"clean": "babel-node tools/run clean",
184188
"copy": "babel-node tools/run copy",
185189
"bundle": "babel-node tools/run bundle",
186190
"build": "babel-node tools/run build",
187-
"build:stats": "yarn run build -- --release --analyse",
191+
"build-stats": "yarn run build -- --release --analyse",
188192
"deploy": "babel-node tools/run deploy",
189193
"render": "babel-node tools/run render",
190194
"serve": "babel-node tools/run runServer",

yarn.lock

Lines changed: 50 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,12 @@ ansi-styles@^2.2.1:
132132
version "2.2.1"
133133
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe"
134134

135+
ansi-styles@^3.1.0:
136+
version "3.1.0"
137+
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.1.0.tgz#09c202d5c917ec23188caa5c9cb9179cd9547750"
138+
dependencies:
139+
color-convert "^1.0.0"
140+
135141
anymatch@^1.3.0:
136142
version "1.3.0"
137143
resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-1.3.0.tgz#a3e52fa39168c825ff57b0248126ce5a8ff95507"
@@ -1420,6 +1426,14 @@ [email protected], chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3:
14201426
strip-ansi "^3.0.0"
14211427
supports-color "^2.0.0"
14221428

1429+
chalk@^2.0.1:
1430+
version "2.0.1"
1431+
resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.0.1.tgz#dbec49436d2ae15f536114e76d14656cdbc0f44d"
1432+
dependencies:
1433+
ansi-styles "^3.1.0"
1434+
escape-string-regexp "^1.0.5"
1435+
supports-color "^4.0.0"
1436+
14231437
check-error@^1.0.1:
14241438
version "1.0.2"
14251439
resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.2.tgz#574d312edd88bb5dd8912e9286dd6c0aed4aac82"
@@ -1559,7 +1573,7 @@ code-point-at@^1.0.0:
15591573
version "1.1.0"
15601574
resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77"
15611575

1562-
color-convert@^1.3.0:
1576+
color-convert@^1.0.0, color-convert@^1.3.0:
15631577
version "1.9.0"
15641578
resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.0.tgz#1accf97dd739b983bf994d56fec8f95853641b7a"
15651579
dependencies:
@@ -2511,14 +2525,6 @@ eslint-config-airbnb@^15.0.1:
25112525
dependencies:
25122526
eslint-config-airbnb-base "^11.2.0"
25132527

2514-
eslint-import-resolver-node@^0.2.0:
2515-
version "0.2.3"
2516-
resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.2.3.tgz#5add8106e8c928db2cba232bcd9efa846e3da16c"
2517-
dependencies:
2518-
debug "^2.2.0"
2519-
object-assign "^4.0.1"
2520-
resolve "^1.1.6"
2521-
25222528
eslint-import-resolver-node@^0.3.1:
25232529
version "0.3.1"
25242530
resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.1.tgz#4422574cde66a9a7b099938ee4d508a199e0e3cc"
@@ -2550,15 +2556,21 @@ eslint-plugin-css-modules@^2.7.1:
25502556
gonzales-pe "^4.0.3"
25512557
lodash "^4.17.2"
25522558

2553-
eslint-plugin-import@^2.6.0:
2554-
version "2.6.0"
2555-
resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.6.0.tgz#2a4bbad36a078e052a3c830ce3dfbd6b8a12c6e5"
2559+
eslint-plugin-flowtype@^2.34.1:
2560+
version "2.34.1"
2561+
resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-2.34.1.tgz#ea109175645b05d37baeac53b9b65066d79b9446"
2562+
dependencies:
2563+
lodash "^4.15.0"
2564+
2565+
eslint-plugin-import@^2.6.1:
2566+
version "2.6.1"
2567+
resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.6.1.tgz#f580be62bb809421d46e338372764afcc9f59bf6"
25562568
dependencies:
25572569
builtin-modules "^1.1.1"
25582570
contains-path "^0.1.0"
25592571
debug "^2.6.8"
25602572
doctrine "1.5.0"
2561-
eslint-import-resolver-node "^0.2.0"
2573+
eslint-import-resolver-node "^0.3.1"
25622574
eslint-module-utils "^2.0.0"
25632575
has "^1.0.1"
25642576
lodash.cond "^4.3.0"
@@ -4406,7 +4418,7 @@ lodash@^3.10.1:
44064418
version "3.10.1"
44074419
resolved "https://registry.yarnpkg.com/lodash/-/lodash-3.10.1.tgz#5bf45e8e49ba4189e17d482789dfd15bd140b7b6"
44084420

4409-
lodash@^4.0.0, lodash@^4.1.0, lodash@^4.14.0, lodash@^4.17.1, lodash@^4.17.2, lodash@^4.17.4, lodash@^4.2.0, lodash@^4.3.0, lodash@^4.6.1:
4421+
lodash@^4.0.0, lodash@^4.1.0, lodash@^4.14.0, lodash@^4.15.0, lodash@^4.17.1, lodash@^4.17.2, lodash@^4.17.4, lodash@^4.2.0, lodash@^4.3.0, lodash@^4.6.1:
44104422
version "4.17.4"
44114423
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae"
44124424

@@ -5753,11 +5765,11 @@ postcss@^5.0.0, postcss@^5.0.10, postcss@^5.0.11, postcss@^5.0.12, postcss@^5.0.
57535765
source-map "^0.5.6"
57545766
supports-color "^3.2.3"
57555767

5756-
postcss@^6.0.0, postcss@^6.0.1, postcss@^6.0.2, postcss@^6.0.3:
5757-
version "6.0.3"
5758-
resolved "https://registry.yarnpkg.com/postcss/-/postcss-6.0.3.tgz#b7f565b3d956fbb8565ca7c1e239d0506e427d8b"
5768+
postcss@^6.0.0, postcss@^6.0.1, postcss@^6.0.2, postcss@^6.0.3, postcss@^6.0.4:
5769+
version "6.0.4"
5770+
resolved "https://registry.yarnpkg.com/postcss/-/postcss-6.0.4.tgz#573acddf73f42ecb24aa618d40ee3d5a7c04a654"
57595771
dependencies:
5760-
chalk "^1.1.3"
5772+
chalk "^2.0.1"
57615773
source-map "^0.5.6"
57625774
supports-color "^4.0.0"
57635775

@@ -5935,9 +5947,9 @@ react-deep-force-update@^2.0.1:
59355947
version "2.0.1"
59365948
resolved "https://registry.yarnpkg.com/react-deep-force-update/-/react-deep-force-update-2.0.1.tgz#4f7f6c12c3e7de42f345992a3c518236fa1ecad3"
59375949

5938-
react-dev-utils@^3.0.1:
5939-
version "3.0.1"
5940-
resolved "https://registry.yarnpkg.com/react-dev-utils/-/react-dev-utils-3.0.1.tgz#775cdc660ac7fee9d883fa5c90bd185ce55ae478"
5950+
react-dev-utils@^3.0.2:
5951+
version "3.0.2"
5952+
resolved "https://registry.yarnpkg.com/react-dev-utils/-/react-dev-utils-3.0.2.tgz#1a42263e9b6aa11dcb45d69dfe5eb1b354bd5531"
59415953
dependencies:
59425954
address "1.0.2"
59435955
anser "1.4.1"
@@ -5955,7 +5967,7 @@ react-dev-utils@^3.0.1:
59555967
recursive-readdir "2.2.1"
59565968
shell-quote "1.6.1"
59575969
sockjs-client "1.1.4"
5958-
strip-ansi "4.0.0"
5970+
strip-ansi "3.0.1"
59595971
text-table "0.2.0"
59605972

59615973
react-dom@^15.5.4:
@@ -5967,14 +5979,14 @@ react-dom@^15.5.4:
59675979
object-assign "^4.1.0"
59685980
prop-types "^15.5.10"
59695981

5970-
react-error-overlay@^1.0.8:
5971-
version "1.0.8"
5972-
resolved "https://registry.yarnpkg.com/react-error-overlay/-/react-error-overlay-1.0.8.tgz#331a5683b3b1679a2e289d6e1c6c905f05d660ed"
5982+
react-error-overlay@^1.0.9:
5983+
version "1.0.9"
5984+
resolved "https://registry.yarnpkg.com/react-error-overlay/-/react-error-overlay-1.0.9.tgz#988e48f6f343afa97a719c4ddae51b8fe8ccfee8"
59735985
dependencies:
59745986
anser "1.2.5"
59755987
babel-code-frame "6.22.0"
59765988
babel-runtime "6.23.0"
5977-
react-dev-utils "^3.0.1"
5989+
react-dev-utils "^3.0.2"
59785990
settle-promise "1.0.0"
59795991
source-map "0.5.6"
59805992

@@ -6474,9 +6486,9 @@ [email protected]:
64746486
range-parser "~1.2.0"
64756487
statuses "~1.3.1"
64766488

6477-
sequelize@^4.2.0:
6478-
version "4.2.0"
6479-
resolved "https://registry.yarnpkg.com/sequelize/-/sequelize-4.2.0.tgz#5b58f565d22455808a8a51f443684f851503e32c"
6489+
sequelize@^4.2.1:
6490+
version "4.2.1"
6491+
resolved "https://registry.yarnpkg.com/sequelize/-/sequelize-4.2.1.tgz#17fe1c5b058364effa9ab4624d6bb7014f472241"
64806492
dependencies:
64816493
bluebird "^3.4.6"
64826494
cls-bluebird "^2.0.1"
@@ -6862,18 +6874,18 @@ stringstream@~0.0.4:
68626874
version "0.0.5"
68636875
resolved "https://registry.yarnpkg.com/stringstream/-/stringstream-0.0.5.tgz#4e484cd4de5a0bbbee18e46307710a8a81621878"
68646876

6865-
[email protected], strip-ansi@^4.0.0:
6866-
version "4.0.0"
6867-
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f"
6868-
dependencies:
6869-
ansi-regex "^3.0.0"
6870-
6871-
strip-ansi@^3.0.0, strip-ansi@^3.0.1:
6877+
[email protected], strip-ansi@^3.0.0, strip-ansi@^3.0.1:
68726878
version "3.0.1"
68736879
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf"
68746880
dependencies:
68756881
ansi-regex "^2.0.0"
68766882

6883+
strip-ansi@^4.0.0:
6884+
version "4.0.0"
6885+
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f"
6886+
dependencies:
6887+
ansi-regex "^3.0.0"
6888+
68776889
strip-bom@^2.0.0:
68786890
version "2.0.0"
68796891
resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e"
@@ -6985,7 +6997,7 @@ sugarss@^0.2.0:
69856997
dependencies:
69866998
postcss "^5.2.4"
69876999

6988-
7000+
[email protected], supports-color@^3.1.0:
69897001
version "3.1.2"
69907002
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.1.2.tgz#72a262894d9d408b956ca05ff37b2ed8a6e2a2d5"
69917003
dependencies:
@@ -6995,7 +7007,7 @@ supports-color@^2.0.0:
69957007
version "2.0.0"
69967008
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7"
69977009

6998-
supports-color@^3.1.0, supports-color@^3.1.2, supports-color@^3.2.3:
7010+
supports-color@^3.1.2, supports-color@^3.2.3:
69997011
version "3.2.3"
70007012
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.2.3.tgz#65ac0504b3954171d8a64946b2ae3cbb8a5f54f6"
70017013
dependencies:

0 commit comments

Comments
 (0)