Skip to content

Commit

Permalink
chore: use Prettier to format source files
Browse files Browse the repository at this point in the history
  • Loading branch information
hegemonic committed Sep 19, 2021
1 parent 3025520 commit 1305499
Show file tree
Hide file tree
Showing 277 changed files with 37,949 additions and 21,049 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ indent_size = 2

[{**/*.js,**/*.css,**/*.json}]
indent_style = space
indent_size = 4
indent_size = 2
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
extends: '@jsdoc'
extends: ['@jsdoc', 'plugin:prettier/recommended'],
};
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ Your debug output here

### Your environment

| Software | Version
| ---------------- | -------
| Software | Version |
| ---------------- | ------- |
| JSDoc |
| Node.js |
| npm |
Expand Down
18 changes: 9 additions & 9 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ https://github.com/jsdoc3/jsdoc/blob/master/CONTRIBUTING.md
https://github.com/jsdoc3/jsdoc/blob/master/CODE_OF_CONDUCT.md
-->

| Q | A
| ---------------- | ---
| Bug fix? | yes/no
| New feature? | yes/no
| Breaking change? | yes/no
| Deprecations? | yes/no
| Tests added? | yes/no
| Fixed issues | comma-separated list of issues fixed by the pull request, if any
| License | Apache-2.0
| Q | A |
| ---------------- | ---------------------------------------------------------------- |
| Bug fix? | yes/no |
| New feature? | yes/no |
| Breaking change? | yes/no |
| Deprecations? | yes/no |
| Tests added? | yes/no |
| Fixed issues | comma-separated list of issues fixed by the pull request, if any |
| License | Apache-2.0 |

<!-- Describe your changes below in as much detail as possible. -->
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Ignore test fixtures.
**/test/fixtures/**

# Ignore code coverage reports.
.nyc_output/
3 changes: 3 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
...require('./packages/jsdoc-prettier-config'),
};
16 changes: 6 additions & 10 deletions .renovaterc.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
{
"extends": [
"config:base"
],
"statusCheckVerify": true,
"ignoreDeps": [
"taffydb"
],
"automerge": true,
"automergeType": "branch",
"rangeStrategy": "bump"
"extends": ["config:base"],
"statusCheckVerify": true,
"ignoreDeps": ["taffydb"],
"automerge": true,
"automergeType": "branch",
"rangeStrategy": "bump"
}
1,184 changes: 577 additions & 607 deletions CHANGES.md

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@ of experience, nationality, personal appearance, race, religion, or sexual ident

Examples of behavior that contributes to creating a positive environment include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit
permission
* Other conduct which could reasonably be considered inappropriate in a professional setting
- The use of sexualized language or imagery and unwelcome sexual attention or advances
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic address, without explicit
permission
- Other conduct which could reasonably be considered inappropriate in a professional setting

## Our Responsibilities

Expand Down
99 changes: 49 additions & 50 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,69 +1,68 @@
Pull Requests
-------------
## Pull Requests

If you're thinking about making some changes, maybe fixing a bug, or adding a
snazzy new feature, first, thank you. Contributions are very welcome. Things
need to be manageable for the maintainers, however. So below you'll find **The
fastest way to get your pull request merged in.** Some things, particularly how
snazzy new feature, first, thank you. Contributions are very welcome. Things
need to be manageable for the maintainers, however. So below you'll find **The
fastest way to get your pull request merged in.** Some things, particularly how
you set up your branches and work with git, are just suggestions, but pretty good
ones.

1. **Create a remote to track the base jsdoc/jsdoc repository**
This is just a convenience to make it easier to update your ```<tracking branch>```
(more on that shortly). You would execute something like:
1. **Create a remote to track the base jsdoc/jsdoc repository**
This is just a convenience to make it easier to update your `<tracking branch>`
(more on that shortly). You would execute something like:

git remote add base git://github.com/jsdoc/jsdoc.git
git remote add base git://github.com/jsdoc/jsdoc.git

Here 'base' is the name of the remote. Feel free to use whatever you want.
Here 'base' is the name of the remote. Feel free to use whatever you want.

2. **Set up a tracking branch for the base repository**
We're gonna call this your ```<tracking branch>```. You will only ever update
this branch by pulling from the 'base' remote. (as opposed to 'origin')
2. **Set up a tracking branch for the base repository**
We're gonna call this your `<tracking branch>`. You will only ever update
this branch by pulling from the 'base' remote. (as opposed to 'origin')

git branch --track pullpost base/master
git checkout pullpost
git branch --track pullpost base/master
git checkout pullpost

Here 'pullpost' is the name of the branch. Fell free to use whatever you want.
Here 'pullpost' is the name of the branch. Fell free to use whatever you want.

3. **Create your change branch**
Once you are in ```<tracking branch>```, make sure it's up to date, then create
a branch for your changes off of that one.
3. **Create your change branch**
Once you are in `<tracking branch>`, make sure it's up to date, then create
a branch for your changes off of that one.

git branch fix-for-issue-395
git checkout fix-for-issue-395
git branch fix-for-issue-395
git checkout fix-for-issue-395

Here 'fix-for-issue-395' is the name of the branch. Feel free to use whatever
you want. We'll call this the ```<change branch>```. This is the branch that
you will eventually issue your pull request from.
Here 'fix-for-issue-395' is the name of the branch. Feel free to use whatever
you want. We'll call this the `<change branch>`. This is the branch that
you will eventually issue your pull request from.

The purpose of these first three steps is to make sure that your merge request
has a nice clean diff that only involves the changes related to your fix/feature.
The purpose of these first three steps is to make sure that your merge request
has a nice clean diff that only involves the changes related to your fix/feature.

4. **Make your changes**
On your ```<change branch>``` make any changes relevant to your fix/feature. Don't
group fixes for multiple unrelated issues or multiple unrelated features together.
Create a separate branch for each unrelated changeset. For instance, if you're
fixing a bug in the parser and adding some new UI to the default template, those
should be separate branches and merge requests.
4. **Make your changes**
On your `<change branch>` make any changes relevant to your fix/feature. Don't
group fixes for multiple unrelated issues or multiple unrelated features together.
Create a separate branch for each unrelated changeset. For instance, if you're
fixing a bug in the parser and adding some new UI to the default template, those
should be separate branches and merge requests.

5. **Add tests**
Add tests for your change. If you are submitting a bugfix, include a test that
verifies the existence of the bug along with your fix. If you are submitting
a new feature, include tests that verify proper feature function, if applicable.
See the readme in the 'test' directory for more information
5. **Add tests**
Add tests for your change. If you are submitting a bugfix, include a test that
verifies the existence of the bug along with your fix. If you are submitting
a new feature, include tests that verify proper feature function, if applicable.
See the readme in the 'test' directory for more information

6. **Commit and publish**
Commit your changes and publish your branch (or push it if it's already published)
6. **Commit and publish**
Commit your changes and publish your branch (or push it if it's already published)

7. **Issue your pull request**
On github.com, switch to your ```<change branch>``` and click the 'Pull Request'
button. Enter some meaningful information about the pull request. If it's a bugfix,
that doesn't already have an issue associated with it, provide some info on what
situations that bug occurs in and a sense of it's severity. If it does already have
an issue, make sure the include the hash and issue number (e.g. '#100') so github
links it.
7. **Issue your pull request**
On github.com, switch to your `<change branch>` and click the 'Pull Request'
button. Enter some meaningful information about the pull request. If it's a bugfix,
that doesn't already have an issue associated with it, provide some info on what
situations that bug occurs in and a sense of it's severity. If it does already have
an issue, make sure the include the hash and issue number (e.g. '#100') so github
links it.

If it's a feature, provide some context about the motivations behind the feature,
why it's important/useful/cool/necessary and what it does/how it works. Don't
worry about being too verbose. Folks will be much more amenable to reading through
your code if they know what its supposed to be about.
If it's a feature, provide some context about the motivations behind the feature,
why it's important/useful/cool/necessary and what it does/how it works. Don't
worry about being too verbose. Folks will be much more amenable to reading through
your code if they know what its supposed to be about.
53 changes: 26 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ An API documentation generator for JavaScript.

Want to contribute to JSDoc? Please read [`CONTRIBUTING.md`](CONTRIBUTING.md).

Installation and Usage
----------------------
## Installation and Usage

JSDoc supports stable versions of Node.js 8.15.0 and later. You can install
JSDoc globally or in your project's `node_modules` folder.
Expand Down Expand Up @@ -51,41 +50,41 @@ and customize your documentation. Here are a few of them:

### Templates

+ [jaguarjs-jsdoc](https://github.com/davidshimjs/jaguarjs-jsdoc)
+ [DocStrap](https://github.com/docstrap/docstrap)
([example](https://docstrap.github.io/docstrap))
+ [jsdoc3Template](https://github.com/DBCDK/jsdoc3Template)
- [jaguarjs-jsdoc](https://github.com/davidshimjs/jaguarjs-jsdoc)
- [DocStrap](https://github.com/docstrap/docstrap)
([example](https://docstrap.github.io/docstrap))
- [jsdoc3Template](https://github.com/DBCDK/jsdoc3Template)
([example](https://github.com/danyg/jsdoc3Template/wiki#wiki-screenshots))
+ [minami](https://github.com/Nijikokun/minami)
+ [docdash](https://github.com/clenemt/docdash)
([example](http://clenemt.github.io/docdash/))
+ [tui-jsdoc-template](https://github.com/nhnent/tui.jsdoc-template)
([example](https://nhnent.github.io/tui.jsdoc-template/latest/))
+ [better-docs](https://github.com/SoftwareBrothers/better-docs)
([example](https://softwarebrothers.github.io/admin-bro-dev/index.html))
- [minami](https://github.com/Nijikokun/minami)
- [docdash](https://github.com/clenemt/docdash)
([example](http://clenemt.github.io/docdash/))
- [tui-jsdoc-template](https://github.com/nhnent/tui.jsdoc-template)
([example](https://nhnent.github.io/tui.jsdoc-template/latest/))
- [better-docs](https://github.com/SoftwareBrothers/better-docs)
([example](https://softwarebrothers.github.io/admin-bro-dev/index.html))

### Build tools

+ [JSDoc Grunt plugin](https://github.com/krampstudio/grunt-jsdoc)
+ [JSDoc Gulp plugin](https://github.com/mlucool/gulp-jsdoc3)
+ [JSDoc GitHub Action](https://github.com/andstor/jsdoc-action)
- [JSDoc Grunt plugin](https://github.com/krampstudio/grunt-jsdoc)
- [JSDoc Gulp plugin](https://github.com/mlucool/gulp-jsdoc3)
- [JSDoc GitHub Action](https://github.com/andstor/jsdoc-action)

### Other tools

+ [jsdoc-to-markdown](https://github.com/jsdoc2md/jsdoc-to-markdown)
+ [Integrating GitBook with
JSDoc](https://medium.com/@kevinast/integrate-gitbook-jsdoc-974be8df6fb3)
- [jsdoc-to-markdown](https://github.com/jsdoc2md/jsdoc-to-markdown)
- [Integrating GitBook with
JSDoc](https://medium.com/@kevinast/integrate-gitbook-jsdoc-974be8df6fb3)

## For more information

+ Documentation is available at [jsdoc.app](https://jsdoc.app/).
+ Contribute to the docs at
[jsdoc/jsdoc.github.io](https://github.com/jsdoc/jsdoc.github.io).
+ [Join JSDoc's Slack channel](https://jsdoc-slack.appspot.com/).
+ Ask for help on the
[JSDoc Users mailing list](http://groups.google.com/group/jsdoc-users).
+ Post questions tagged `jsdoc` to
[Stack Overflow](http://stackoverflow.com/questions/tagged/jsdoc).
- Documentation is available at [jsdoc.app](https://jsdoc.app/).
- Contribute to the docs at
[jsdoc/jsdoc.github.io](https://github.com/jsdoc/jsdoc.github.io).
- [Join JSDoc's Slack channel](https://jsdoc-slack.appspot.com/).
- Ask for help on the
[JSDoc Users mailing list](http://groups.google.com/group/jsdoc-users).
- Post questions tagged `jsdoc` to
[Stack Overflow](http://stackoverflow.com/questions/tagged/jsdoc).

## License

Expand Down
53 changes: 28 additions & 25 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,50 +2,53 @@ const eslint = require('gulp-eslint');
const { exec } = require('child_process');
const gulp = require('gulp');
const path = require('path');
const prettier = require('gulp-prettier');

function execCb(cb, err, stdout, stderr) {
console.log(stdout);
console.error(stderr);
cb(err);
console.log(stdout);
console.error(stderr);
cb(err);
}

const options = {
coveragePaths: [
'*.js',
'packages/**/*.js',
'!packages/**/test/*.js',
'!packages/**/test/**/*.js',
'!packages/**/static/*.js'
],
lintPaths: [
'*.js',
'packages/**/*.js',
'!packages/**/static/*.js'
],
nodeBin: path.resolve(__dirname, './packages/jsdoc/jsdoc.js'),
nodePath: process.execPath
coveragePaths: [
'*.js',
'packages/**/*.js',
'!packages/**/test/*.js',
'!packages/**/test/**/*.js',
'!packages/**/static/*.js',
],
lintPaths: ['*.js', 'packages/**/*.js', '!packages/**/static/*.js'],
nodeBin: path.resolve(__dirname, './packages/jsdoc/jsdoc.js'),
nodePath: process.execPath,
};

function coverage(cb) {
const cmd = `./node_modules/.bin/nyc --reporter=html ${options.nodeBin} -T`;
const cmd = `./node_modules/.bin/nyc --reporter=html ${options.nodeBin} -T`;

return exec(cmd, execCb.bind(null, cb));
return exec(cmd, execCb.bind(null, cb));
}

function format() {
return gulp.src(options.lintPaths).pipe(prettier());
}

function lint() {
return gulp.src(options.lintPaths)
.pipe(eslint())
.pipe(eslint.formatEach())
.pipe(eslint.failAfterError());
return gulp
.src(options.lintPaths)
.pipe(eslint())
.pipe(eslint.formatEach())
.pipe(eslint.failAfterError());
}

function test(cb) {
const cmd = `${options.nodePath} "${options.nodeBin}" -T`;
const cmd = `${options.nodePath} "${options.nodeBin}" -T`;

return exec(cmd, execCb.bind(null, cb));
return exec(cmd, execCb.bind(null, cb));
}

exports.coverage = coverage;
exports.default = gulp.series(lint, test);
exports.format = format;
exports.lint = lint;
exports.test = test;
4 changes: 1 addition & 3 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{
"packages": [
"packages/*"
],
"packages": ["packages/*"],
"version": "independent"
}
Loading

0 comments on commit 1305499

Please sign in to comment.