Skip to content

Commit 615e6a5

Browse files
rickhanloniiespipj
authored andcommitted
Add linting for insensitive and inconsiderate language (facebook#1337)
* Add linting for insensitive and inconsiderate language * Add .alexrc.js * Update alex rules * Minor updates to formatting * Fix deploy_website job name * Update alex rules * Add lintv and .alexignore * Fix lint issues
1 parent 407761a commit 615e6a5

Some content is hidden

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

71 files changed

+1676
-218
lines changed

.alexignore

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# The Code of Conduct calls out language that can't be used so it's not linted.
2+
CODE_OF_CONDUCT.md
3+
4+
# We will handle the blog posts after the main docs are linted.
5+
website/blog/
6+
7+
# The version docs are actively being linted.
8+
# If you want to lint one of these directories, remove it from the list here and then run:
9+
# `yarn lintv website/versioned_docs/version-{version number}/`
10+
# Once you fix all of the errors, commit all of the changes including this file.
11+
#
12+
# To be considerate to the reviewer, please submit each version in different PRs.
13+
website/versioned_docs/version-0.5/
14+
website/versioned_docs/version-0.6/
15+
website/versioned_docs/version-0.7/
16+
website/versioned_docs/version-0.8/
17+
website/versioned_docs/version-0.9/
18+
website/versioned_docs/version-0.10/
19+
website/versioned_docs/version-0.11/
20+
website/versioned_docs/version-0.12/
21+
website/versioned_docs/version-0.13/
22+
website/versioned_docs/version-0.14/
23+
website/versioned_docs/version-0.15/
24+
website/versioned_docs/version-0.16/
25+
website/versioned_docs/version-0.17/
26+
website/versioned_docs/version-0.18/
27+
website/versioned_docs/version-0.19/
28+
website/versioned_docs/version-0.20/
29+
website/versioned_docs/version-0.21/
30+
website/versioned_docs/version-0.22/
31+
website/versioned_docs/version-0.23/
32+
website/versioned_docs/version-0.24/
33+
website/versioned_docs/version-0.25/
34+
website/versioned_docs/version-0.26/
35+
website/versioned_docs/version-0.27/
36+
website/versioned_docs/version-0.28/
37+
website/versioned_docs/version-0.29/
38+
website/versioned_docs/version-0.30/
39+
website/versioned_docs/version-0.31/
40+
website/versioned_docs/version-0.32/
41+
website/versioned_docs/version-0.33/
42+
website/versioned_docs/version-0.34/
43+
website/versioned_docs/version-0.35/
44+
website/versioned_docs/version-0.36/
45+
website/versioned_docs/version-0.37/
46+
website/versioned_docs/version-0.38/
47+
website/versioned_docs/version-0.39/
48+
website/versioned_docs/version-0.40/
49+
website/versioned_docs/version-0.41/
50+
website/versioned_docs/version-0.42/
51+
website/versioned_docs/version-0.43/
52+
website/versioned_docs/version-0.44/
53+
website/versioned_docs/version-0.45/
54+
website/versioned_docs/version-0.46/
55+
website/versioned_docs/version-0.47/
56+
website/versioned_docs/version-0.48/
57+
website/versioned_docs/version-0.49/
58+
website/versioned_docs/version-0.50/
59+
website/versioned_docs/version-0.51/
60+
website/versioned_docs/version-0.52/
61+
website/versioned_docs/version-0.53/
62+
website/versioned_docs/version-0.54/
63+
website/versioned_docs/version-0.55/
64+
website/versioned_docs/version-0.56/
65+
website/versioned_docs/version-0.57/
66+
website/versioned_docs/version-0.58/
67+
website/versioned_docs/version-0.59/
68+
website/versioned_docs/version-0.60/
69+
website/versioned_docs/version-0.61/

.alexrc.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/**
2+
* Copyright (c) Facebook, Inc. and its affiliates.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*/
7+
8+
exports.allow = [
9+
// We frequently refer to form props by their name "disabled".
10+
// Ideally we would alex-ignore only the valid uses (PRs accepted).
11+
"invalid",
12+
13+
// Unfortunately "watchman" is a library name that we depend on.
14+
"watchman-watchwoman"
15+
];
16+
17+
// Use a "maybe" level of profanity instead of the default "unlikely".
18+
exports.profanitySureness = 1;

.circleci/config.yml

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ jobs:
5050
- ~/react-native-website
5151

5252
# --------------------------------------------------
53-
# JOB: test_website
54-
# Test website can be built and has no lint issues.
53+
# JOB: test
54+
# Test that the website can be built.
5555
# --------------------------------------------------
56-
test_website:
56+
test:
5757
executor: node8
5858
working_directory: ~/react-native-website/website
5959
steps:
@@ -67,6 +67,17 @@ jobs:
6767
if [ ! -f build/react-native/index.html ]; then
6868
exit 1;
6969
fi
70+
# --------------------------------------------------
71+
# JOB: lint
72+
# Lint the docs.
73+
# --------------------------------------------------
74+
language_lint:
75+
executor: node8
76+
working_directory: ~/react-native-website/website
77+
steps:
78+
- restore_cache_checkout
79+
- run_yarn
80+
- run: yarn lint
7081

7182
# --------------------------------------------------
7283
# JOB: deploy_website
@@ -101,8 +112,13 @@ workflows:
101112
jobs:
102113
- setup
103114

104-
# Test website
105-
- test_website:
115+
# Run tests
116+
- test:
117+
requires:
118+
- setup
119+
120+
# Run lints
121+
- language_lint:
106122
requires:
107123
- setup
108124

docs/accessibility.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ In the above example, the `accessibilityLabel` on the TouchableOpacity element w
4949

5050
#### accessibilityHint (iOS, Android)
5151

52-
An accessibility hint helps users understand what will happen when they perform an action on the accessibility element when that result is not obvious from the accessibility label.
52+
An accessibility hint helps users understand what will happen when they perform an action on the accessibility element when that result is not clear from the accessibility label.
5353

5454
To use, set the `accessibilityHint` property to a custom string on your View, Text or Touchable:
5555

@@ -185,7 +185,7 @@ In the case of two overlapping UI components with the same parent, default acces
185185
</View>
186186
```
187187

188-
In the above example, the yellow layout and its descendants are completely invisible to TalkBack and all other accessibility services. So we can easily use overlapping views with the same parent without confusing TalkBack.
188+
In the above example, the yellow layout and its descendants are completely invisible to TalkBack and all other accessibility services. So we can use overlapping views with the same parent without confusing TalkBack.
189189

190190
### Accessibility Actions
191191

docs/animated.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ id: animated
33
title: Animated
44
---
55

6-
The `Animated` library is designed to make animations fluid, powerful, and easy to build and maintain. `Animated` focuses on declarative relationships between inputs and outputs, with configurable transforms in between, and simple `start`/`stop` methods to control time-based animation execution.
6+
The `Animated` library is designed to make animations fluid, powerful, and painless to build and maintain. `Animated` focuses on declarative relationships between inputs and outputs, with configurable transforms in between, and `start`/`stop` methods to control time-based animation execution.
77

8-
The simplest workflow for creating an animation is to create an `Animated.Value`, hook it up to one or more style attributes of an animated component, and then drive updates via animations using `Animated.timing()`:
8+
The most basic workflow for creating an animation is to create an `Animated.Value`, hook it up to one or more style attributes of an animated component, and then drive updates via animations using `Animated.timing()`:
99

1010
```jsx
1111
Animated.timing(
@@ -33,7 +33,7 @@ There are two value types you can use with `Animated`:
3333
`Animated` provides three types of animation types. Each animation type provides a particular animation curve that controls how your values animate from their initial value to the final value:
3434

3535
- [`Animated.decay()`](animated.md#decay) starts with an initial velocity and gradually slows to a stop.
36-
- [`Animated.spring()`](animated.md#spring) provides a simple spring physics model.
36+
- [`Animated.spring()`](animated.md#spring) provides a basic spring physics model.
3737
- [`Animated.timing()`](animated.md#timing) animates a value over time using [easing functions](easing.md).
3838

3939
In most cases, you will be using `timing()`. By default, it uses a symmetric easeInOut curve that conveys the gradual acceleration of an object to full speed and concludes by gradually decelerating to a stop.
@@ -50,7 +50,7 @@ You can use the native driver by specifying `useNativeDriver: true` in your anim
5050

5151
### Animatable components
5252

53-
Only animatable components can be animated. These special components do the magic of binding the animated values to the properties, and do targeted native updates to avoid the cost of the react render and reconciliation process on every frame. They also handle cleanup on unmount so they are safe by default.
53+
Only animatable components can be animated. These unique components do the magic of binding the animated values to the properties, and do targeted native updates to avoid the cost of the react render and reconciliation process on every frame. They also handle cleanup on unmount so they are safe by default.
5454

5555
- [`createAnimatedComponent()`](animated.md#createanimatedcomponent) can be used to make a component animatable.
5656

@@ -72,7 +72,7 @@ Animations can also be combined in complex ways using composition functions:
7272
- [`Animated.sequence()`](animated.md#sequence) starts the animations in order, waiting for each to complete before starting the next.
7373
- [`Animated.stagger()`](animated.md#stagger) starts animations in order and in parallel, but with successive delays.
7474

75-
Animations can also be chained together simply by setting the `toValue` of one animation to be another `Animated.Value`. See [Tracking dynamic values](animations.md#tracking-dynamic-values) in the Animations guide.
75+
Animations can also be chained together by setting the `toValue` of one animation to be another `Animated.Value`. See [Tracking dynamic values](animations.md#tracking-dynamic-values) in the Animations guide.
7676

7777
By default, if one animation is stopped or interrupted, then all other animations in the group are also stopped.
7878

@@ -169,14 +169,14 @@ Config is an object that may have the following options.
169169

170170
Note that you can only define one of bounciness/speed, tension/friction, or stiffness/damping/mass, but not more than one:
171171

172-
The friction/tension or bounciness/speed options match the spring model in [Facebook Pop](https://github.com/facebook/pop), [Rebound](http://facebook.github.io/rebound/), and [Origami](http://origami.design/).
172+
The friction/tension or bounciness/speed options match the spring model in [`Facebook Pop`](https://github.com/facebook/pop), [Rebound](http://facebook.github.io/rebound/), and [Origami](http://origami.design/).
173173

174174
- `friction`: Controls "bounciness"/overshoot. Default 7.
175175
- `tension`: Controls speed. Default 40.
176176
- `speed`: Controls speed of the animation. Default 12.
177177
- `bounciness`: Controls bounciness. Default 8.
178178

179-
Specifying stiffness/damping/mass as parameters makes `Animated.spring` use an analytical spring model based on the motion equations of a [damped harmonic oscillator](https://en.wikipedia.org/wiki/Harmonic_oscillator#Damped_harmonic_oscillator). This behavior is slightly more precise and faithful to the physics behind spring dynamics, and closely mimics the implementation in iOS's CASpringAnimation primitive.
179+
Specifying stiffness/damping/mass as parameters makes `Animated.spring` use an analytical spring model based on the motion equations of a [damped harmonic oscillator](https://en.wikipedia.org/wiki/Harmonic_oscillator#Damped_harmonic_oscillator). This behavior is slightly more precise and faithful to the physics behind spring dynamics, and closely mimics the implementation in iOS's CASpringAnimation.
180180

181181
- `stiffness`: The spring stiffness coefficient. Default 100.
182182
- `damping`: Defines how the spring’s motion should be damped due to the forces of friction. Default 10.
@@ -344,7 +344,7 @@ Config is an object that may have the following options:
344344
static forkEvent(event, listener)
345345
```
346346
347-
Advanced imperative API for snooping on animated events that are passed in through props. It permits to add a new javascript listener to an existing `AnimatedEvent`. If `animatedEvent` is a simple javascript listener, it will merge the 2 listeners into a single one, and if `animatedEvent` is null/undefined, it will assign the javascript listener directly. Use values directly where possible.
347+
Advanced imperative API for snooping on animated events that are passed in through props. It permits to add a new javascript listener to an existing `AnimatedEvent`. If `animatedEvent` is a javascript listener, it will merge the 2 listeners into a single one, and if `animatedEvent` is null/undefined, it will assign the javascript listener directly. Use values directly where possible.
348348
349349
---
350350

0 commit comments

Comments
 (0)