Skip to content

Commit 94573c1

Browse files
author
Erin Doyle
authored
Merge pull request #119 from romeovs/master
Revamp the API and configuration to allow for more modular rules to be added
2 parents d931532 + 518c752 commit 94573c1

77 files changed

Lines changed: 3295 additions & 1445 deletions

Some content is hidden

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

.babelrc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"presets": [
3+
"es2015",
4+
"stage-0",
5+
"react"
6+
],
7+
"plugins": [
8+
"transform-runtime"
9+
]
10+
}

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
lib/
2+
webpack.config.js

.eslintrc

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"node": true,
5+
"es6": true,
6+
"mocha": true
7+
},
8+
"parserOptions": {
9+
"ecmaVersion": 2017,
10+
"sourceType": "module",
11+
"ecmaFeatures": {
12+
"jsx": true,
13+
"modules": true
14+
}
15+
},
16+
"extends": [
17+
"airbnb"
18+
],
19+
"plugins": [
20+
"babel",
21+
"mocha",
22+
"react"
23+
],
24+
"rules": {
25+
"babel/new-cap": 1,
26+
"comma-dangle": ["error", "never"],
27+
"complexity": ["warn", { "max": 7 }],
28+
"generator-star-spacing": 1,
29+
"id-length": ["error", { "exceptions": ["_", "x", "y", "z", "i", "e", "t"] }],
30+
"import/no-named-as-default": 0, // connected/test-only components
31+
"import/no-extraneous-dependencies": ["error", {"devDependencies": true}], // tests
32+
"indent": ["error", 4, {"SwitchCase": 2}],
33+
"max-len": [1, 120, 2, {"ignoreComments": true}],
34+
"no-await-in-loop": 1,
35+
"no-param-reassign": ["error", { "props": false }],
36+
"no-plusplus": ["error", { "allowForLoopAfterthoughts": true }],
37+
"no-underscore-dangle": "off",
38+
"no-use-before-define": [2, "nofunc"],
39+
"no-unused-vars": "warn",
40+
"object-shorthand": 1,
41+
"quotes": [2, "single"],
42+
"react/forbid-prop-types": [1, { "forbid": ["any"] }], // used in conjunction with the transform-react-remove-prop-types babel plugin
43+
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }],
44+
"react/jsx-indent": ["error", 4],
45+
"react/jsx-indent-props": ["error", 4],
46+
"react/jsx-uses-react": 2,
47+
"react/jsx-uses-vars": 2,
48+
"react/no-find-dom-node": "warn", // TODO: change this to error and fix findings
49+
"react/prop-types": 0, // not currently working for stateless components: https://github.com/yannickcr/eslint-plugin-react/issues/803
50+
"react/react-in-jsx-scope": 2,
51+
"strict": [2, "never"],
52+
"vars-on-top": "error"
53+
}
54+
}

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1-
dist
1+
dist/
2+
lib/
23
node_modules/
4+
npm-debug.log

.jshintignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

.jshintrc

Lines changed: 0 additions & 5 deletions
This file was deleted.

.npmignore

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
CONTRIBUTING.md
2-
bower.json
3-
lib
1+
*.log
2+
test
43
karma.conf.js
5-
scripts
64
webpack.config.js

.travis.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
language: node_js
2+
23
node_js:
3-
- "0.10"
4+
- "stable"
5+
- "8"
6+
- "7"
7+
- "6"
8+
- "4"
9+
410
before_script:
511
- export DISPLAY=:99.0
6-
- sh -e /etc/init.d/xvfb start
12+
- sh -e /etc/init.d/xvfb start
13+
14+
cache: yarn
15+
16+
matrix:
17+
fast_finish: true

CHANGELOG.md

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,32 @@
1-
v0.3.3 - Fri, 15 Apr 2016 19:32:24 GMT
1+
0.3.6 - Thu, 12 Oct 2017 12:50:02 GMT
2+
-------------------------------------
3+
4+
- [b8f4e58](../../commit/b8f4e58) Update ReactDOM for react v16 compatibility
5+
6+
7+
v0.3.5 - Tue, 30 May 2017 14:23:58 GMT
8+
-----------------------------------------
9+
10+
- [a7eb16f](../../commit/a7eb16f) Fixed #16 inappropriately referencing this in a context where this is actually undefined.
11+
12+
13+
v0.3.4 - Sun, 30 Apr 2017 20:48:28 GMT
214
--------------------------------------
315

4-
-
16+
- [e41ba68](../../commit/e41ba68) Fixed #11 from being too strict testing for use-onblur-not-onchange. Now it should pass if onChange is used in addition to onBlur.
17+
- [3173a1d](../../commit/3173a1d) Fixed #10 where if a tagName is being checked for reserved in the DOM object but does not exist in the DOM object an exception was being thrown
18+
- [d0401be](../../commit/d0401be) 1. Updated eslint and plugin versions 2. Added the AirBnB eslint config to inherit 3. Fixed all linter findings
19+
20+
21+
v0.3.3 - Mon, 3 Apr 2017 23:01:39 GMT
22+
--------------------------------------
23+
24+
- [d85328e](../../commit/d85328e) Added some more scripts for helping with the version and publish process and added descriptions of the scripts in the CONTRIBUTING.md
25+
- [2ffa8ac](../../commit/2ffa8ac) Added a CONTRIBUTING page and linked to it from the README.
26+
- [c715c45](../../commit/c715c45) Updated urls to point to this repo instead of the forked from repo
27+
- [fa32346](../../commit/fa32346) Added the bundle script to the prepublish script so that the webpack bundle gets included in the npm package. Also disabled the release script and removed the rf-release package as this does not seem to be tagging or publishing to npm properly.
28+
- [8bff3fe](../../commit/8bff3fe) Added/removed dirs and files from npmignore
29+
- [be6f51e](../../commit/be6f51e) Adding some tags! Added <svg> and <path>
530

631

732
v0.3.2 - Tue, 15 Mar 2016 00:16:50 GMT

CONTRIBUTING.md

Lines changed: 102 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,118 @@
1-
### Tests
1+
# Contributing to react-a11y
22

3-
All commits that fix bugs or add features need a test.
3+
## Setting up the workspace
44

5-
`<blink>` Do not merge code without tests.`</blink>`
5+
Before you can submit a Pull Request you'll need to do the following:
66

7-
### Commit Subjects for Public API Changes
7+
1. Fork the repository on GitHub
88

9-
If your patch **changes the API or fixes a bug** please use one of the
10-
following prefixes in your commit subject:
9+
2. Clone your fork
1110

12-
- `[fixed] ...`
13-
- `[changed] ...`
14-
- `[added] ...`
15-
- `[removed] ...`
11+
```bash
12+
git clone https://github.com/<your_username>/react-a11y.git
13+
cd react-a11y
14+
```
1615

17-
That ensures the subject line of your commit makes it into the
18-
auto-generated changelog. Do not use these tags if your change doesn't
19-
fix a bug and doesn't change the public API.
16+
3. Install for development
2017

21-
Commits with changed, added, or removed, should probably be reviewed by
22-
another collaborator.
18+
```bash
19+
npm install
20+
```
2321

24-
#### When using `[changed]` or `[removed]`...
22+
## Workflow
2523

26-
Please include an upgrade path with example code in the commit message.
27-
If it doesn't make sense to do this, then it doesn't make sense to use
28-
`[changed]` or `[removed]` :)
24+
Lint the code:
2925

30-
### Docs
26+
```bash
27+
npm run lint
28+
```
3129

32-
Please update the docs with any API changes, the code and docs should
33-
always be in sync.
30+
Run the tests:
3431

35-
### Development
32+
```bash
33+
npm run mocha // run tests using mocha only
34+
npm run karma // run tests using karma only
35+
npm run test // run tests using both mocha and karma
36+
```
3637

37-
- `npm test` will fire up a karma test runner and watch for changes
38+
Build the code:
3839

39-
### Build
40+
```bash
41+
npm run build
42+
```
4043

41-
Please do not include the output of `scripts/build` in your commits, we
42-
only do this when we release. (Also, you probably don't need to build
43-
anyway unless you are fixing something around our global build.)
44+
## Making changes
4445

46+
1. Checkout a new branch and name it accordingly to what you intend to do
47+
48+
```bash
49+
git checkout -b <branch_name>
50+
```
51+
52+
2. Make your intended changes, being sure to run the tests and lint the code.
53+
54+
## Submitting a Pull Request
55+
56+
1. Commit your changes (please make commits small and commit messages descriptive):
57+
58+
```bash
59+
git commit -m "..."
60+
```
61+
62+
2. Push to _your_ github repo:
63+
```bash
64+
git push origin <branch_name>
65+
```
66+
67+
3. Go to the GitHub page and click "New Pull request".
68+
4. Write a good description of the change.
69+
70+
After sending a pull request, other developers will review and discuss your change. Please address all the comments. Once everything is all right, one of the maintainers will merge your changes in.
71+
72+
## Publishing (for maintainers)
73+
_These steps are for maintainers only and can be disregarded by contributors._
74+
75+
For publishing use the following workflow:
76+
77+
1. Make sure all code changes for this new version have already been committed.
78+
79+
2. Update the CHANGELOG.md by using the following command, double check the content and save (don't commit):
80+
```bash
81+
npm run changelog -- -t <the upcoming version>
82+
```
83+
where `<the upcoming version>` refers to the version number that you are preparing to publish
84+
85+
3. Update the version and publish. This is done by running _one_ of the following scripts:
86+
87+
```bash
88+
npm version:patch # for a patch version update i.e. v1.0.0 -> v1.0.1
89+
npm version:minor # for a minor version update i.e. v1.0.0 -> v1.1.0
90+
npm version:major # for a major version update i.e. v.1.0.0 -> v2.0.0
91+
```
92+
93+
### The publishing scripts
94+
After running one of the above `version:*` scripts the following things will take place in this order:
95+
96+
1. the `preversion` script will run which does the following:
97+
98+
1. The tests will be run and the entire process will halt if they do not all pass
99+
100+
2. A check will be performed to validate that the `CHANGELOG.md` has been updated and it is the only uncommitted change in the repo. If this check fails the process will be halted.
101+
102+
2. the selected `version:*` script will run which does the following:
103+
104+
1. The version in `package.json` will be incremented as requested (patch, minor, major). _Because the `--no-git-tag-version` flag is specified this script will not yet include tagging and committing in the github repo._
105+
106+
3. the `postversion` script will be run which does the following:
107+
108+
1. A `git commit` will be made including only the `package.json` and `CHANGELOG.md` files. It will include a commit comment in the format of: "Version $npm_package_version"
109+
110+
2. Performs a `git tag` in the format of "v$npm_package_version"
111+
112+
3. Performs a `git push` and `git push --tags`
113+
114+
4. Runs `npm publish`
115+
116+
117+
## Additional Resources
118+
* [GitHub pull request help](https://help.github.com/categories/collaborating-with-issues-and-pull-requests/)

0 commit comments

Comments
 (0)