Level up your programming skills by getting bite-sized tips and tricks in your pull requests.
npm install danger-plugin-mentor




> Level up your programming skills by getting bite-sized tips and tricks in your pull requests.
Install:
``sh`
yarn add danger-plugin-mentor --dev
At a glance:
`js
// dangerfile.js
import mentor from 'danger-plugin-mentor'
mentor()
`
You can specify an array of string tags to filter the shown tips:
`js`
mentor(["testing", "agile"])
Should you not like or want to expand upon the default set of tips, you can pass an array of tips that you provide yourself.
`js`
mentor([], myOwnListOfTips)
The items in myOwnListOfTips have to conform to the Tip interface, that,import { Tip } from 'danger-plugin-mentor'
in Typescript, you can import via .
In Javascript, you just need to make sure that every item responds to the methods
of this interface. Of course you can mix your own tips with the included tips:
`js
import { default as mentor, defaultTips } from 'danger-plugin-mentor'
mentor([], [...defaultTips(), ...myOwnListOfTips])
`
In order to make it easy to provide your own list of tips, danger-plugin-mentor ships
with a fromJson that returns an array of lists from a json file.
`js
import { default as mentor, fromJson } from "danger-plugin-mentor"
mentor([], fromJson(
[
{
"text": "My own tip",
"source": "https://mycompany.com",
"tags": ["awesome"]
}
]))
``
See the GitHub release history.
See CONTRIBUTING.md.