Skip to content

Commit

Permalink
chore: home page configuration (#195)
Browse files Browse the repository at this point in the history
* chore: changed home page title and moved navDocumentationLabel to config file

* chore: config eslint and use optional chain in converter

* chore: rebrand config
  • Loading branch information
ariansobczak-rst authored Feb 9, 2022
1 parent 09912a3 commit 5d39022
Show file tree
Hide file tree
Showing 7 changed files with 66 additions and 49 deletions.
94 changes: 56 additions & 38 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,42 +1,60 @@
module.exports = {
'env': {
'es6': true,
'node': true,
'mocha': true
parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint", "mocha"],
env: {
es6: true,
node: true,
mocha: true,
},
extends: [
"airbnb",
"plugin:@typescript-eslint/recommended",
"plugin:vue/essential",
],
parserOptions: {
ecmaVersion: 2015,
sourceType: "module",
},
rules: {
indent: ["error", 2],
"linebreak-style": ["error", "unix"],
quotes: ["error", "single"],
semi: ["error", "never"],
"import/no-unresolved": "off",
"no-underscore-dangle": "off",
"guard-for-in": "off",
"no-restricted-syntax": "off",
"no-await-in-loop": "off",
"object-curly-newline": "off",
},
overrides: [
{
files: [
"*-test.js",
"*.spec.js",
"*-test.ts",
"*.spec.ts",
"*.spec.tsx",
"*.factory.ts",
"*.factory.js",
],
rules: {
"no-unused-expressions": "off",
"func-names": "off",
"prefer-arrow-callback": "off",
},
},
"extends": [
"plugin:vue/essential",
"eslint:recommended",
// 'airbnb'
],
'parserOptions': {
'ecmaVersion': 2015,
'sourceType': 'module'
{
files: ["*.jsx", "*.js"],
rules: { "@typescript-eslint/explicit-function-return-type": "off" },
},
'rules': {
'indent': ['error', 2],
'linebreak-style': ['error', 'unix'],
'quotes': ['error', 'single'],
'semi': ['error', 'never'],
'import/no-unresolved': 'off',
'no-underscore-dangle': 'off',
'guard-for-in': 'off',
'no-restricted-syntax': 'off',
'no-await-in-loop': 'off',
'object-curly-newline': 'off'
{
files: ["*.tsx"],
rules: { "react/prop-types": "off" },
},
overrides: [
{
files: ['*-test.js', '*.spec.js'],
rules: {
'no-unused-expressions': 'off',
'func-names': 'off',
'prefer-arrow-callback': 'off',
"react/jsx-filename-extension": 'off'
}
}
],
globals: {
'expect': true,
}
}
],
globals: {
expect: true,
window: true,
},
};
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ _(To read more about passing options - scroll down to __Customization__ section)
"opts": {...},
"templates": {
"better-docs": {
"name": "AdminBro Documentation",
"name": "Sample Documentation",
"component": {
"wrapper": "./path/to/your/wrapper-component.js",
},
Expand Down Expand Up @@ -533,7 +533,7 @@ So let's say you want to add `babel-polyfill` and 'bulma.css' framework to your
"opts": {...},
"templates": {
"better-docs": {
"name": "AdminBro Documentation",
"name": "Sample Documentation",
"component": {
"entry": [
"import 'babel-polyfill';",
Expand Down Expand Up @@ -592,7 +592,7 @@ Example configuration file with settings for both `default` and `better-docs` te
}
},
"better-docs": {
"name": "AdminBro Documentation",
"name": "Sample Documentation",
"logo": "images/logo.png",
"title": "", // HTML title
"css": "style.css",
Expand Down
6 changes: 3 additions & 3 deletions fixtures/typescript/type3.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const input =
`
/**
* Type representing the AdminBro.Router
* @memberof AdminBro
* Type representing the Sample.Router
* @memberof Sample
* @alias RouterType
*/
export type RouterType = {
Expand All @@ -21,7 +21,7 @@ export type RouterType = {
`

const outputs = [
'* @memberof AdminBro',
'* @memberof Sample',
'* @alias RouterType',
'* @typedef {object} RouterType',
'* @property {Array<object>} assets',
Expand Down
3 changes: 1 addition & 2 deletions jsdoc.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
},
"templates": {
"better-docs": {
"name": "AdminBro Documentation",
"logo": "images/logo.png"
"name": "Sample Documentation"
}
}
}
2 changes: 1 addition & 1 deletion publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@ exports.publish = function(taffyData, opts, tutorials) {
generateSourceFiles(sourceFiles, opts.encoding)
}

if (members.globals.length) { generate('Global', 'Title', [{kind: 'globalobj'}], globalUrl) }
if (members.globals.length) { generate('Global', null, [{kind: 'globalobj'}], globalUrl) }

// index page displays information from package.json and lists files
files = find({kind: 'file'})
Expand Down
2 changes: 1 addition & 1 deletion tmpl/topnav.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
href="<?js= betterDocs.landing ? 'docs.html' : 'index.html' ?>"
class="link"
>
API Documentation
<?js= betterDocs.navDocumentationLabel || 'Documentation' ?>
</a>
<?js if (this.tutorials.length) { ?>
<div class="dropdown is-hoverable is-right">
Expand Down
2 changes: 1 addition & 1 deletion typescript/type-converter.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const getTypeName = (type, src) => {
* Fetches name from a node.
*/
const getName = (node, src) => {
let name = node.name && node.name.escapedText
let name = node.name?.escapedText
|| node.parameters && src.substring(node.parameters.pos, node.parameters.end)

// changing type [key: string] to {...} - otherwise it wont be parsed by @jsdoc
Expand Down

0 comments on commit 5d39022

Please sign in to comment.