Skip to content

Commit 3eb21bc

Browse files
authored
Add React hooks (#31)
* Move to React hooks * Bump dependencies * Add hooks * Update README.md * Typo * Move to HTML table * Update README.md * Set defaults * Sorting * Sorting * Update README.md * Constantize strings * Sorting * Update PR number * Add ESLint * Bump react-scripts * ESLint * Bump to Node.js 12
1 parent 29d7b03 commit 3eb21bc

35 files changed

+7257
-3540
lines changed

.eslintrc.yml

Lines changed: 183 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
1+
env:
2+
browser: true
3+
es6: true
4+
jest: true
5+
extends:
6+
- eslint:recommended
7+
globals:
8+
React: readonly
9+
parser: babel-eslint
10+
parserOptions:
11+
ecmaFeatures:
12+
jsx: true
13+
ecmaVersion: 10
14+
sourceType: module
15+
root: true
16+
rules:
17+
# Only list rules that are not in *:recommended set
18+
# If rules are set to disable the one in *:recommended, please elaborate the reason
19+
20+
# Group - Best Practices
21+
no-async-promise-executor: error
22+
no-await-in-loop: error
23+
no-console:
24+
- error
25+
- allow:
26+
- error
27+
- warn
28+
# no-extra-parens: error # conflicts with prettier
29+
no-misleading-character-class: error
30+
no-template-curly-in-string: error
31+
require-atomic-updates: error
32+
accessor-pairs: error
33+
block-scoped-var: error
34+
class-methods-use-this:
35+
- error
36+
- exceptMethods:
37+
- render
38+
complexity: error
39+
curly: error
40+
default-case: error
41+
dot-notation: error
42+
eqeqeq: error
43+
max-classes-per-file:
44+
- error
45+
- 2
46+
no-alert: error
47+
no-caller: error
48+
no-div-regex: error
49+
no-else-return: error
50+
no-empty-function: error
51+
no-eq-null: error
52+
no-eval: error
53+
no-extend-native: error
54+
no-extra-bind: error
55+
no-extra-label: error
56+
no-implicit-globals: error
57+
no-implied-eval: error
58+
no-invalid-this: error
59+
no-iterator: error
60+
no-labels: error
61+
no-lone-blocks: error
62+
no-magic-numbers:
63+
- error
64+
- ignore:
65+
- 0
66+
- 1
67+
no-multi-spaces:
68+
- error
69+
- ignoreEOLComments: true
70+
no-multi-str: error
71+
no-new: error
72+
no-new-func: error
73+
no-new-wrappers: error
74+
no-octal-escape: error
75+
no-proto: error
76+
no-return-assign: error
77+
no-return-await: error
78+
no-script-url: error
79+
no-self-compare: error
80+
no-sequences: error
81+
no-throw-literal: error
82+
no-unmodified-loop-condition: error
83+
no-unused-expressions:
84+
- error
85+
- allowShortCircuit: true
86+
allowTernary: true
87+
no-useless-call: error
88+
no-useless-catch: error
89+
no-useless-concat: error
90+
no-useless-return: error
91+
no-void: error
92+
no-with: error
93+
prefer-promise-reject-errors: error
94+
radix: error
95+
require-await: error
96+
require-unicode-regexp: error
97+
wrap-iife: error
98+
yoda: error
99+
100+
# Group - Variables
101+
no-label-var: error
102+
103+
# Re-enable later
104+
# no-shadow:
105+
# - error
106+
# - builtinGlobals: true
107+
# hoist: all
108+
109+
no-shadow-restricted-names: error
110+
no-undef-init: error
111+
112+
# "undefined" is commonly used for defaults
113+
# no-undefined: off
114+
115+
no-unused-vars:
116+
- error
117+
- argsIgnorePattern: ^_$
118+
varsIgnorePattern: ^_
119+
no-use-before-define: error
120+
121+
# Group - Node.js and CommonJS
122+
callback-return: error
123+
global-require: error
124+
handle-callback-err: error
125+
no-buffer-constructor: error
126+
no-mixed-requires: error
127+
no-new-require: error
128+
no-path-concat: error
129+
no-sync: error
130+
131+
# Group - ECMAScript 6
132+
arrow-body-style:
133+
- error
134+
- as-needed
135+
arrow-parens:
136+
- error
137+
- as-needed
138+
arrow-spacing:
139+
- error
140+
- after: true
141+
before: true
142+
# generator-star-spacing: # conflicts with prettier
143+
# - error
144+
# - after
145+
146+
# Will produce shorter code if "off"
147+
# no-confusing-arrow:
148+
# - error
149+
# - allowParens: true # This will conflict with no-extra-parens
150+
151+
no-duplicate-imports: error
152+
no-useless-computed-key: error
153+
no-useless-constructor: error
154+
no-useless-rename: error
155+
no-var: error
156+
object-shorthand: error
157+
prefer-arrow-callback: error
158+
prefer-const: error
159+
prefer-destructuring: error
160+
prefer-rest-params: error
161+
prefer-spread: error
162+
163+
# This will force, a + '', into, `${ a }`, which increase code length
164+
# prefer-template: error
165+
166+
rest-spread-spacing:
167+
- error
168+
- never
169+
170+
# Cannot group global or local imports and sort in differently
171+
# sort-imports:
172+
# - error
173+
# - ignoreCase: true
174+
175+
template-curly-spacing:
176+
- error
177+
- never
178+
yield-star-spacing:
179+
- error
180+
- after
181+
settings:
182+
react:
183+
version: detect

.travis.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
language: node_js
22

33
node_js:
4-
- "10"
4+
- "12"
55

66
before_install:
7-
- npm install
7+
- npm ci
88
- sudo apt-get install jq
99
- npx version-from-git --travis --no-git-tag-version
1010
- git checkout -b temp-ci
@@ -14,6 +14,10 @@ install:
1414
- npm run bootstrap
1515
- npm run build
1616

17+
script:
18+
- npm run eslint
19+
- npm test
20+
1721
deploy:
1822
- provider: script
1923
script: bash scripts/lerna_publish

CHANGELOG.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,37 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
66

77
## [Unreleased]
8+
9+
### Breaking changes
10+
- We moved to React Hooks and it requires React 16.8.6 or up
11+
- Hooks will allow us to write simpler and more maintainable code
12+
- Developers can use our React Hooks to perform various operations
13+
814
### Changed
15+
- Moved all code to React functional components, in PR [#31](https://github.com/compulim/react-scroll-to-bottom/pull/31)
16+
- `*`: bump dependencies, in PR [#31](https://github.com/compulim/react-scroll-to-bottom/pull/31)
17+
- [@babel/cli@^7.6.2](https://www.npmjs.com/package/@babel/cli)
18+
- [@babel/core@^7.6.2](https://www.npmjs.com/package/@babel/core)
19+
- [@babel/plugin-proposal-object-rest-spread@^7.6.2](https://www.npmjs.com/package/@babel/plugin-proposal-object-rest-spread)
20+
- [@babel/preset-env@^7.6.2](https://www.npmjs.com/package/@babel/preset-env)
21+
- [babel-jest@^24.9.0](https://www.npmjs.com/package/babel-jest)
22+
- [jest@^24.9.0](https://www.npmjs.com/package/jest)
23+
- [[email protected]](https://www.npmjs.com/package/react-dom)
24+
- [[email protected]](https://www.npmjs.com/package/react)
925
- `*`: bump dependencies, in PR [#27](https://github.com/compulim/react-scroll-to-bottom/pull/27)
1026
- [@babel/cli@^7.5.5](https://www.npmjs.com/package/@babel/cli)
1127
- [@babel/core@^7.5.5](https://www.npmjs.com/package/@babel/core)
1228
- [@babel/plugin-proposal-object-rest-spread@^7.5.5](https://www.npmjs.com/package/@babel/plugin-proposal-object-rest-spread)
1329
- [@babel/preset-env@^7.5.5](https://www.npmjs.com/package/@babel/preset-env)
1430
- [rimraf@^2.6.3](https://www.npmjs.com/package/rimraf)
1531

32+
### Added
33+
- Added React Hooks, in PR [#31](https://github.com/compulim/react-scroll-to-bottom/pull/31)
34+
- Added [ESLint](https://www.npmjs.com/package/eslint) and [Prettier](https://www.npmjs.com/package/prettier), in PR [#31](https://github.com/compulim/react-scroll-to-bottom/pull/31)
35+
36+
### Fixed
37+
- Fix `atStart` was not reporting correctly, in PR [#31](https://github.com/compulim/react-scroll-to-bottom/pull/31)
38+
1639
## [1.3.2] - 2019-06-20
1740
### Changed
1841
- `*`: bumped to `[email protected]`, `[email protected]`, and `[email protected]`, in PR [#22](https://github.com/compulim/react-scroll-to-bottom/pull/22)

0 commit comments

Comments
 (0)