react_on_rails 11.3.0 → 12.0.0.pre.beta.4

This diff has not been reviewed by any users.
Sign up to get free protection for your applications and to get access to all the features.
Files changed (97) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +320 -0
  3. data/.eslintignore +2 -1
  4. data/.eslintrc +23 -1
  5. data/.github/FUNDING.yml +1 -0
  6. data/.gitignore +3 -1
  7. data/.prettierignore +10 -1
  8. data/.prettierrc +3 -0
  9. data/.rubocop.yml +37 -11
  10. data/.travis.yml +9 -22
  11. data/CHANGELOG.md +65 -6
  12. data/CONTRIBUTING.md +60 -71
  13. data/Gemfile +3 -4
  14. data/{COMM-LICENSE → REACT-ON-RAILS-PRO-LICENSE} +6 -9
  15. data/README.md +129 -92
  16. data/Rakefile +0 -7
  17. data/SUMMARY.md +7 -11
  18. data/book.json +5 -5
  19. data/docs/additional-reading/asset-pipeline.md +8 -16
  20. data/docs/additional-reading/react-helmet.md +30 -10
  21. data/docs/additional-reading/react-router.md +52 -75
  22. data/docs/additional-reading/server-rendering-tips.md +12 -7
  23. data/docs/api/javascript-api.md +3 -3
  24. data/docs/api/redux-store-api.md +4 -2
  25. data/docs/api/view-helpers-api.md +6 -7
  26. data/docs/basics/configuration.md +83 -69
  27. data/docs/basics/deployment.md +2 -4
  28. data/docs/basics/heroku-deployment.md +24 -0
  29. data/docs/basics/hmr-and-hot-reloading-with-the-webpack-dev-server.md +49 -0
  30. data/docs/basics/i18n.md +45 -23
  31. data/docs/basics/installation-into-an-existing-rails-app.md +4 -9
  32. data/docs/basics/react-server-rendering.md +1 -1
  33. data/docs/basics/recommended-project-structure.md +5 -22
  34. data/docs/basics/{generator-functions-and-railscontext.md → render-functions-and-railscontext.md} +59 -21
  35. data/docs/basics/rspec-configuration.md +27 -16
  36. data/docs/basics/upgrading-react-on-rails.md +58 -2
  37. data/docs/basics/webpack-configuration.md +18 -8
  38. data/docs/contributor-info/errors-with-hooks.md +45 -0
  39. data/docs/contributor-info/pull-requests.md +44 -0
  40. data/docs/misc/doctrine.md +1 -1
  41. data/docs/{misc-pending → outdated}/code-splitting.md +12 -8
  42. data/docs/{basics → outdated}/how-react-on-rails-works.md +8 -4
  43. data/docs/{misc-pending → outdated}/manual-installation-overview.md +5 -5
  44. data/docs/{additional-reading → outdated}/rails-assets-relative-paths.md +3 -3
  45. data/docs/{misc-pending → outdated}/rails-assets.md +2 -12
  46. data/docs/{misc → outdated}/rails3.md +0 -0
  47. data/docs/tutorial.md +94 -68
  48. data/jest.config.js +4 -0
  49. data/lib/generators/react_on_rails/base_generator.rb +2 -2
  50. data/lib/generators/react_on_rails/dev_tests_generator.rb +1 -1
  51. data/lib/generators/react_on_rails/generator_helper.rb +4 -6
  52. data/lib/generators/react_on_rails/templates/base/base/Procfile.dev +3 -1
  53. data/lib/generators/react_on_rails/templates/base/base/Procfile.dev-hmr +26 -0
  54. data/lib/generators/react_on_rails/templates/base/base/app/javascript/bundles/HelloWorld/components/HelloWorld.jsx +20 -40
  55. data/lib/generators/react_on_rails/templates/base/base/config/initializers/react_on_rails.rb +4 -1
  56. data/lib/generators/react_on_rails/templates/redux/base/app/javascript/bundles/HelloWorld/components/HelloWorld.jsx +4 -8
  57. data/lib/generators/react_on_rails/templates/redux/base/app/javascript/bundles/HelloWorld/store/helloWorldStore.js +1 -3
  58. data/lib/react_on_rails.rb +3 -1
  59. data/lib/react_on_rails/configuration.rb +58 -28
  60. data/lib/react_on_rails/error.rb +2 -0
  61. data/lib/react_on_rails/helper.rb +41 -91
  62. data/lib/react_on_rails/json_parse_error.rb +2 -0
  63. data/lib/react_on_rails/locales/base.rb +150 -0
  64. data/lib/react_on_rails/locales/to_js.rb +37 -0
  65. data/lib/react_on_rails/locales/to_json.rb +27 -0
  66. data/lib/react_on_rails/prerender_error.rb +11 -15
  67. data/lib/react_on_rails/server_rendering_pool/ruby_embedded_java_script.rb +41 -46
  68. data/lib/react_on_rails/test_helper/ensure_assets_compiled.rb +7 -8
  69. data/lib/react_on_rails/test_helper/webpack_assets_compiler.rb +17 -0
  70. data/lib/react_on_rails/utils.rb +14 -19
  71. data/lib/react_on_rails/version.rb +1 -1
  72. data/lib/react_on_rails/version_checker.rb +1 -0
  73. data/lib/react_on_rails/webpacker_utils.rb +19 -2
  74. data/lib/tasks/assets.rake +33 -46
  75. data/lib/tasks/locale.rake +4 -2
  76. data/package-scripts.yml +11 -8
  77. data/package.json +29 -28
  78. data/rakelib/dummy_apps.rake +1 -9
  79. data/rakelib/example_type.rb +3 -1
  80. data/rakelib/examples.rake +3 -0
  81. data/rakelib/lint.rake +2 -7
  82. data/rakelib/node_package.rake +2 -2
  83. data/rakelib/release.rake +0 -6
  84. data/rakelib/run_rspec.rake +5 -18
  85. data/react_on_rails.gemspec +4 -5
  86. data/tsconfig.json +14 -0
  87. data/webpackConfigLoader.js +3 -2
  88. data/yarn.lock +4333 -2209
  89. metadata +46 -57
  90. data/Gemfile.rails32 +0 -73
  91. data/docs/additional-reading/babel.md +0 -5
  92. data/docs/additional-reading/heroku-deployment.md +0 -92
  93. data/docs/additional-reading/hot-reloading-rails-development-asset-pipeline.md +0 -47
  94. data/docs/api/ruby-api-hot-reload-view-helpers.md +0 -44
  95. data/lib/generators/react_on_rails/templates/base/base/Procfile.dev-server +0 -12
  96. data/lib/react_on_rails/assets_precompile.rb +0 -153
  97. data/lib/react_on_rails/locales_to_js.rb +0 -138
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0bb16eb9dbe881e26404d0348b398cbf8fe74cc635b070830444b590b603b680
4
- data.tar.gz: ff2fc0cde5a0a74959a6539ffec333f5350c913de8d14fe8650d3b9980a3d8c5
3
+ metadata.gz: 4f6b45ecf176bae7fd87037e00147a35747244f7c6ce113b88e5b556a455b278
4
+ data.tar.gz: 831b05ad059ff57802feaeaa6b0a363765e78eca90b55d9dd9eeab5383e95042
5
5
  SHA512:
6
- metadata.gz: 0c868503c83f7af1b8cf3c2a6a297b045606cb26eaec5580d07ac1567e8d768071720cd5f7c497c576113cd78d0a70bfc677be125d54840b49480766c4662b47
7
- data.tar.gz: 8dcaf2739c09a9689782a7a3e0f58036b86b88ce01092369e58296fc6235ffac4f18df3f8f19ead5db5d21c8ba53860da789d0b59994b220e96935d0fe39c904
6
+ metadata.gz: 37e5dd4e97d970f0bb041da1b6e74e92b137b1ad74a72fe78b3bd885aaeb1712fb710fff4e3fd4230a56e1864506172dd95d2b0c50155b502b54fb101dd9fb2e
7
+ data.tar.gz: 0fbebe0217dde4d72a95fc10f5f88ff7a8535618da757b207519c7e44ca72da5c2763d56e09339d963d445419feffab8336a19a8bb3489589d60ff35f1bae928
@@ -0,0 +1,320 @@
1
+ version: 2
2
+
3
+ aliases:
4
+ - &docker-image
5
+ - image: circleci/ruby:2.6-node-browsers
6
+
7
+ # Print critical data and executables versions.
8
+ - &print-system-info
9
+ name: Print system information
10
+ command: |
11
+ echo "Linux release: "; cat /etc/issue
12
+ echo "Current user: "; whoami
13
+ echo "Current directory: "; pwd
14
+ echo "Ruby version: "; ruby -v
15
+ echo "Node version: "; node -v
16
+ echo "Yarn version: "; yarn --version
17
+ echo "Bundler version: "; bundle --version
18
+ - &lint-js
19
+ name: Linting of JS
20
+ command: yarn start lint
21
+
22
+ - &lint-ruby
23
+ name: Linting of Ruby
24
+ command: bundle exec rubocop
25
+
26
+ - &format
27
+ name: Check formatting
28
+ command: yarn start format.listDifferent
29
+
30
+ # Install/update Node modules for renderer package unless existing set of modules is satisfying Yarn.
31
+ - &install-package-node-modules
32
+ name: Install Node modules with Yarn for renderer package
33
+ command: |
34
+ yarn install --no-progress --no-emoji
35
+ yarn run eslint -v
36
+ sudo yarn global add yalc
37
+
38
+ # Install/update Node modules for dummy app unless existing set of modules is satisfying Yarn.
39
+ - &install-dummy-app-node-modules
40
+ name: Install Node modules with Yarn for dummy app
41
+ command: cd spec/dummy && yarn install --no-progress --no-emoji
42
+
43
+ # Setup yarn links for react-on-rails
44
+ - &install-yalc-publish
45
+ name: yalc publish for react-on-rails
46
+ command: yalc publish
47
+
48
+ - &install-yalc-add-react-on-rails
49
+ name: yalc add react-on-rails
50
+ command: cd spec/dummy && yalc add react-on-rails
51
+
52
+ # Install ruby gems unless existing set of gems is satisfying bundler.
53
+ - &install-dummy-app-ruby-gems
54
+ name: Install Ruby Gems for dummy app
55
+ command: |
56
+ gem install bundler
57
+ echo "Bundler version: "; bundle --version
58
+ cd spec/dummy && bundle check --path=vendor/bundle || bundle install --path=vendor/bundle --jobs=4 --retry=3
59
+
60
+ # Install ruby gems unless existing set of gems is satisfying bundler.
61
+ - &install-package-ruby-gems
62
+ name: Install Ruby Gems for package
63
+ command: |
64
+ gem install bundler
65
+ echo "Bundler version: "; bundle --version
66
+ bundle check --path=vendor/bundle || bundle install --path=vendor/bundle --jobs=4 --retry=3
67
+
68
+ # Restore node_modules dir from cache using yarn.lock checksum as a key.
69
+ - &restore-package-node-modules-cache
70
+ name: Restore cached node_modules directory
71
+ keys:
72
+ - v4-package-node-modules-cache-{{ checksum "yarn.lock" }}
73
+
74
+ # Restore spec/dummy/node_modules dir from cache using yarn.lock checksum as a key.
75
+ - &restore-dummy-app-node-modules-cache
76
+ name: Restore cached spec/dummy/node_modules directory
77
+ keys:
78
+ - v4-dummy-app-node-modules-cache-{{ checksum "spec/dummy/yarn.lock" }}
79
+
80
+ # Restore vendor/bundle dir from cache using Gemfile.lock checksum as a key.
81
+ - &restore-dummy-app-gem-cache
82
+ name: Restore cached Ruby Gems for dummy app
83
+ keys:
84
+ - v4-dummy-app-gem-cache-{{ checksum "spec/dummy/Gemfile.lock" }}
85
+
86
+ # Restore vendor/bundle dir from cache using react_on_rails.gemspec checksum as a key.
87
+ - &restore-package-gem-cache
88
+ name: Restore cached Ruby Gems for package
89
+ keys:
90
+ - v4-package-app-gem-cache-{{ checksum "react_on_rails.gemspec" }}
91
+
92
+ # NOTE: Sometimes CI generated docker images are not updated in time to keep up with the minimum required
93
+ # by chromedriver versions of Chrome. Just bump here Chrome version if chromedriver raises errors
94
+ - &install-latest-chrome
95
+ name: Ensure minimum required Chrome version
96
+ command: |
97
+ echo -e "Installed $(google-chrome --version)\n"
98
+ MINIMUM_REQUIRED_CHROME_VERSION=75
99
+ INSTALLED_CHROME_MAJOR_VERSION="$(google-chrome --version | tr ' .' '\t' | cut -f3)"
100
+ if [[ $INSTALLED_CHROME_MAJOR_VERSION < $MINIMUM_REQUIRED_CHROME_VERSION ]]; then
101
+ wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
102
+ sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
103
+ sudo apt-get update
104
+ sudo apt-get install google-chrome-stable
105
+ echo -e "\nInstalled $(google-chrome --version)"
106
+ fi
107
+
108
+ jobs:
109
+ # Lint all
110
+ lint-js-and-ruby:
111
+ docker: *docker-image
112
+ steps:
113
+ - checkout
114
+ - run: *print-system-info
115
+ - restore_cache: *restore-package-node-modules-cache
116
+ - restore_cache: *restore-package-gem-cache
117
+ - run: *install-package-ruby-gems
118
+ - run: *lint-ruby
119
+ - run: *lint-js
120
+ - run: *format
121
+
122
+ prettier:
123
+ docker: *docker-image
124
+ parallelism: 1
125
+ steps:
126
+ - checkout
127
+ - restore_cache: *restore-package-node-modules-cache
128
+ - run:
129
+ name: prettier
130
+ command: yarn start format.listDifferent
131
+
132
+ # Install Node modules for Renderer package with Yarn and save them to chache.
133
+ install-package-node-packages:
134
+ docker: *docker-image
135
+ steps:
136
+ - checkout
137
+ - run: *print-system-info
138
+ - restore_cache: *restore-package-node-modules-cache
139
+ - run: *install-package-node-modules
140
+ - save_cache:
141
+ name: Save root node_modules to cache
142
+ key: v4-package-node-modules-cache-{{ checksum "yarn.lock" }}
143
+ paths:
144
+ - node_modules
145
+
146
+
147
+ # Install Node modules for dummy app with Yarn and save them to cache.
148
+ install-dummy-app-node-packages:
149
+ docker: *docker-image
150
+ steps:
151
+ - checkout
152
+ - run: *print-system-info
153
+ - restore_cache: *restore-dummy-app-node-modules-cache
154
+ - run: *install-package-node-modules
155
+ - run: *install-yalc-publish
156
+ - run: *install-yalc-add-react-on-rails
157
+ - run: *install-dummy-app-node-modules
158
+ - save_cache:
159
+ name: Save spec/dummy/node_modules to cache
160
+ key: v4-dummy-app-node-modules-cache-{{ checksum "spec/dummy/yarn.lock" }}
161
+ paths:
162
+ - spec/dummy/node_modules
163
+ - spec/dummy/node_modules
164
+
165
+ # Install Ruby gems for package with Bundler and save them to cache.
166
+ install-package-ruby-gems:
167
+ docker: *docker-image
168
+ steps:
169
+ - checkout
170
+ - run: *print-system-info
171
+ - restore_cache: *restore-package-gem-cache
172
+ - run: *install-package-ruby-gems
173
+ - save_cache:
174
+ name: Save dummy app ruby gems to cache
175
+ key: v4-package-app-gem-cache-{{ checksum "react_on_rails.gemspec" }}
176
+ paths:
177
+ - vendor/bundle
178
+
179
+ # Install Ruby gems for dummy app with Bundler and save them to cache.
180
+ install-dummy-app-ruby-gems:
181
+ docker: *docker-image
182
+ steps:
183
+ - checkout
184
+ - run: *print-system-info
185
+ - restore_cache: *restore-dummy-app-gem-cache
186
+ - run: *install-dummy-app-ruby-gems
187
+ - save_cache:
188
+ name: Save dummy app ruby gems to cache
189
+ key: v4-dummy-app-gem-cache-{{ checksum "spec/dummy/Gemfile.lock" }}
190
+ paths:
191
+ - spec/dummy/vendor/bundle
192
+
193
+ # Build client and server bundles for dummy app with Webpack and save them to cache.
194
+ # NOTE: keeping around this cache in case we have multiple rspec suites in the future to tests
195
+ # different node renderers.
196
+ build-dummy-app-webpack-test-bundles:
197
+ docker: *docker-image
198
+ steps:
199
+ - checkout
200
+ - run: *print-system-info
201
+ - run: *install-package-node-modules
202
+ - run: *install-yalc-publish
203
+ - restore_cache: *restore-dummy-app-node-modules-cache
204
+ - run: *install-yalc-add-react-on-rails
205
+ - run: *install-dummy-app-node-modules
206
+ - run: *install-dummy-app-ruby-gems
207
+ - run:
208
+ name: Build test bundles for dummy app
209
+ command: cd spec/dummy && yarn run build:test
210
+ - save_cache:
211
+ name: Save test webpack bundles to cache (for build number checksum used by rspec job)
212
+ key: v4-dummy-app-webpack-bundle-{{ .Revision }}
213
+ paths:
214
+ - spec/dummy/public/webpack
215
+ # Run JS unit tests for Renderer package.
216
+ package-js-tests:
217
+ docker: *docker-image
218
+ steps:
219
+ - checkout
220
+ - run: *print-system-info
221
+ - restore_cache: *restore-package-node-modules-cache
222
+ - run: *install-package-node-modules
223
+ - run:
224
+ name: Run JS unit tests for Renderer package
225
+ command: yarn test
226
+
227
+ rspec-package-specs:
228
+ docker: *docker-image
229
+ steps:
230
+ - checkout
231
+ - run: *print-system-info
232
+ - restore_cache: *restore-package-gem-cache
233
+ - run: *install-package-ruby-gems
234
+ - run:
235
+ name: Run rspec tests
236
+ command: |
237
+ bundle exec rspec spec/react_on_rails
238
+ - store_test_results:
239
+ path: ~/rspec
240
+ - store_artifacts:
241
+ path: log/test.log
242
+
243
+ main:
244
+ docker: *docker-image
245
+ steps:
246
+ - checkout
247
+ - run: *print-system-info
248
+ - restore_cache: *restore-package-gem-cache
249
+ - restore_cache: *restore-dummy-app-gem-cache
250
+ - restore_cache:
251
+ name: Restore cached webpack bundles for dummy app
252
+ key: v4-dummy-app-webpack-bundle-{{ .Revision }}
253
+ - restore_cache: *restore-dummy-app-node-modules-cache
254
+ - restore_cache: *restore-package-node-modules-cache
255
+ - run: *install-package-node-modules
256
+ - run: *install-yalc-publish
257
+ - run: *install-yalc-add-react-on-rails
258
+ - run: *install-package-ruby-gems
259
+ - run: *install-dummy-app-ruby-gems
260
+ - run: *install-latest-chrome
261
+ - run:
262
+ name: Touch webpack bundles
263
+ command: touch spec/dummy/public/webpack/test/*
264
+ - run:
265
+ name: Install yalc globally
266
+ command: sudo yarn global add yalc
267
+ - run:
268
+ name: Prep for CI
269
+ # TODO -- need to leverage Circle CI containers
270
+ command: |
271
+ bundle exec rake prepare_for_ci
272
+ - run:
273
+ name: Main CI
274
+ # TODO -- need to leverage Circle CI containers
275
+ command: |
276
+ bundle exec rake run_rspec:all_dummy
277
+ - store_test_results:
278
+ path: ~/rspec
279
+ - store_artifacts:
280
+ path: spec/dummy/tmp/capybara
281
+ - store_artifacts:
282
+ path: spec/dummy/log/test.log
283
+ - store_artifacts:
284
+ path: spec/dummy/yarn-error.log
285
+
286
+ workflows:
287
+ version: 2
288
+ build-and-test:
289
+ jobs:
290
+ - install-package-node-packages
291
+ - install-package-ruby-gems
292
+ - install-dummy-app-node-packages
293
+ - install-dummy-app-ruby-gems
294
+ - lint-js-and-ruby:
295
+ requires:
296
+ - install-package-node-packages
297
+ - install-package-ruby-gems
298
+ - prettier:
299
+ filters:
300
+ branches:
301
+ ignore: master
302
+ requires:
303
+ - install-package-node-packages
304
+ - build-dummy-app-webpack-test-bundles:
305
+ requires:
306
+ - install-dummy-app-node-packages
307
+ - package-js-tests:
308
+ requires:
309
+ - install-package-node-packages
310
+ - rspec-package-specs:
311
+ requires:
312
+ - install-package-ruby-gems
313
+ - build-dummy-app-webpack-test-bundles
314
+ - install-dummy-app-ruby-gems
315
+ - main:
316
+ requires:
317
+ - install-package-ruby-gems
318
+ - install-dummy-app-ruby-gems
319
+ - install-package-node-packages
320
+ - build-dummy-app-webpack-test-bundles
@@ -2,7 +2,6 @@ node_modules
2
2
  coverage
3
3
  spec/react_on_rails/dummy-for-generators
4
4
  spec/dummy
5
- spec/dummy_no_webpacker
6
5
  node_package/lib/
7
6
  node_package/tests/node_modules
8
7
  node_package/webpack.config.js
@@ -14,3 +13,5 @@ node_package/webpack.config.js
14
13
  **/coverage/**
15
14
  **/cable.js
16
15
  **/public/packs*/*
16
+ gen-examples
17
+ bundle/
data/.eslintrc CHANGED
@@ -15,12 +15,31 @@ env:
15
15
  browser: true
16
16
  node: true
17
17
  mocha: true
18
+ jest: true
19
+
20
+ overrides:
21
+ - files: ["**/*.ts", "**/*.tsx"]
22
+ parser: "@typescript-eslint/parser"
23
+ parserOptions:
24
+ ecmaVersion: 2018
25
+ sourceType: module
26
+ project: "./tsconfig.json"
27
+ extends:
28
+ - eslint:recommended
29
+ - plugin:@typescript-eslint/eslint-recommended
30
+ - plugin:@typescript-eslint/recommended
31
+ plugins:
32
+ - "@typescript-eslint"
33
+ rules:
34
+ "@typescript-eslint/no-namespace": 0
18
35
 
19
36
  rules:
20
37
  no-console: 0
21
38
  function-paren-newline: 0
22
39
  object-curly-newline: 0
23
-
40
+ no-restricted-syntax: ["error", "SequenceExpression"]
41
+ # https://stackoverflow.com/a/59268871/5241481
42
+ import/extensions: ['error', 'ignorePackages', {"js": 'never',"ts": "never"}]
24
43
 
25
44
  # https://github.com/benmosher/eslint-plugin-import/issues/340
26
45
  import/no-extraneous-dependencies: 0
@@ -28,3 +47,6 @@ rules:
28
47
  settings:
29
48
  import/core-modules:
30
49
  - react-redux
50
+ import/resolver:
51
+ node:
52
+ extensions: [".js", ".ts", ".d.ts"]
@@ -0,0 +1 @@
1
+ github: [shakacode]
data/.gitignore CHANGED
@@ -1,7 +1,6 @@
1
1
  /.bundle/
2
2
  /.yardoc
3
3
  /Gemfile.lock
4
- /Gemfile.rails32.lock
5
4
  /_yardoc/
6
5
  /coverage/
7
6
  /doc/
@@ -32,3 +31,6 @@ npm-debug.*
32
31
  /gen-examples
33
32
 
34
33
  .DS_Store
34
+
35
+ .yalc
36
+ yalc.lock
@@ -1 +1,10 @@
1
- node_modules
1
+ node_modules/
2
+ package.json
3
+ tmp/
4
+ coverage/
5
+ **/app/assets/webpack/
6
+ spec/dummy/public
7
+ gen-examples/examples/*
8
+ node_package/lib/*
9
+ spec/react_on_rails/dummy-for-generators/app/javascript/bundles/HelloWorld/*
10
+ bundle/
@@ -8,6 +8,9 @@ bracketSpacing: true
8
8
  jsxBracketSameLine: false
9
9
  parser: flow
10
10
 
11
+ extends:
12
+ - tslint-config-prettier
13
+
11
14
  overrides:
12
15
  - files: "*.@(css|scss)"
13
16
  options:
@@ -3,7 +3,7 @@
3
3
 
4
4
  AllCops:
5
5
  DisplayCopNames: true
6
- TargetRubyVersion: 2.2
6
+ TargetRubyVersion: 2.5
7
7
 
8
8
  Include:
9
9
  - '**/Rakefile'
@@ -27,12 +27,8 @@ AllCops:
27
27
  - 'spec/react_on_rails/dummy-for-generators/**/*'
28
28
  - 'spec/dummy/Procfile.*'
29
29
  - 'spec/dummy/bin/**/*'
30
- - 'spec/dummy/client/node_modules/**/*'
31
- - 'spec/dummy/client/node_modules/**/.*'
32
- - 'spec/dummy_no_webpacker/Procfile.*'
33
- - 'spec/dummy_no_webpacker/bin/**/*'
34
- - 'spec/dummy_no_webpacker/client/node_modules/**/*'
35
- - 'spec/dummy_no_webpacker/client/node_modules/**/.*'
30
+ - 'spec/dummy/node_modules/**/*'
31
+ - 'spec/dummy/node_modules/**/.*'
36
32
  - 'gen-examples/examples/**/.*'
37
33
  - 'gen-examples/examples/**/*'
38
34
 
@@ -40,13 +36,12 @@ Naming/FileName:
40
36
  Exclude:
41
37
  - 'Gemfile'
42
38
  - 'spec/dummy/Gemfile'
43
- - 'spec/dummy_no_webpacker/Gemfile'
44
39
 
45
40
  # Turn off until we require 2.3 ruby
46
41
  Style/SafeNavigation:
47
42
  Enabled: false
48
43
 
49
- Metrics/LineLength:
44
+ Layout/LineLength:
50
45
  Max: 120
51
46
 
52
47
  Style/StringLiterals:
@@ -55,11 +50,20 @@ Style/StringLiterals:
55
50
  Style/Documentation:
56
51
  Enabled: false
57
52
 
53
+ Style/HashEachMethods:
54
+ Enabled: true
55
+
56
+ Style/HashTransformKeys:
57
+ Enabled: true
58
+
59
+ Style/HashTransformValues:
60
+ Enabled: true
61
+
58
62
  Lint/AssignmentInCondition:
59
63
  Exclude:
60
64
  - 'spec/dummy/bin/spring'
61
65
 
62
- Lint/HandleExceptions:
66
+ Lint/SuppressedException:
63
67
  Exclude:
64
68
  - 'spec/dummy/bin/rails'
65
69
  - 'spec/dummy/bin/rake'
@@ -86,9 +90,31 @@ Metrics/MethodLength:
86
90
  Metrics/ModuleLength:
87
91
  Max: 180
88
92
 
93
+ Naming/RescuedExceptionsVariableName:
94
+ Enabled: false
95
+
89
96
  Style/GlobalVars:
90
97
  Exclude:
91
98
  - 'spec/dummy/config/environments/development.rb'
92
99
 
93
100
  Style/FrozenStringLiteralComment:
94
- EnforcedStyle: when_needed
101
+ EnforcedStyle: always
102
+
103
+ Layout/EmptyLinesAroundAttributeAccessor:
104
+ Enabled: true
105
+
106
+ Layout/SpaceAroundMethodCallOperator:
107
+ Enabled: true
108
+
109
+ Lint/RaiseException:
110
+ Enabled: true
111
+
112
+ Lint/StructNewOverride:
113
+ Enabled: true
114
+
115
+ Style/ExponentialNotation:
116
+ Enabled: true
117
+
118
+ Style/SlicingWithRange:
119
+ Enabled: true
120
+