Skip to content

Commit 5d39022

Browse files
chore: home page configuration (#195)
* chore: changed home page title and moved navDocumentationLabel to config file * chore: config eslint and use optional chain in converter * chore: rebrand config
1 parent 09912a3 commit 5d39022

File tree

7 files changed

+66
-49
lines changed

7 files changed

+66
-49
lines changed

.eslintrc.js

+56-38
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,60 @@
11
module.exports = {
2-
'env': {
3-
'es6': true,
4-
'node': true,
5-
'mocha': true
2+
parser: "@typescript-eslint/parser",
3+
plugins: ["@typescript-eslint", "mocha"],
4+
env: {
5+
es6: true,
6+
node: true,
7+
mocha: true,
8+
},
9+
extends: [
10+
"airbnb",
11+
"plugin:@typescript-eslint/recommended",
12+
"plugin:vue/essential",
13+
],
14+
parserOptions: {
15+
ecmaVersion: 2015,
16+
sourceType: "module",
17+
},
18+
rules: {
19+
indent: ["error", 2],
20+
"linebreak-style": ["error", "unix"],
21+
quotes: ["error", "single"],
22+
semi: ["error", "never"],
23+
"import/no-unresolved": "off",
24+
"no-underscore-dangle": "off",
25+
"guard-for-in": "off",
26+
"no-restricted-syntax": "off",
27+
"no-await-in-loop": "off",
28+
"object-curly-newline": "off",
29+
},
30+
overrides: [
31+
{
32+
files: [
33+
"*-test.js",
34+
"*.spec.js",
35+
"*-test.ts",
36+
"*.spec.ts",
37+
"*.spec.tsx",
38+
"*.factory.ts",
39+
"*.factory.js",
40+
],
41+
rules: {
42+
"no-unused-expressions": "off",
43+
"func-names": "off",
44+
"prefer-arrow-callback": "off",
45+
},
646
},
7-
"extends": [
8-
"plugin:vue/essential",
9-
"eslint:recommended",
10-
// 'airbnb'
11-
],
12-
'parserOptions': {
13-
'ecmaVersion': 2015,
14-
'sourceType': 'module'
47+
{
48+
files: ["*.jsx", "*.js"],
49+
rules: { "@typescript-eslint/explicit-function-return-type": "off" },
1550
},
16-
'rules': {
17-
'indent': ['error', 2],
18-
'linebreak-style': ['error', 'unix'],
19-
'quotes': ['error', 'single'],
20-
'semi': ['error', 'never'],
21-
'import/no-unresolved': 'off',
22-
'no-underscore-dangle': 'off',
23-
'guard-for-in': 'off',
24-
'no-restricted-syntax': 'off',
25-
'no-await-in-loop': 'off',
26-
'object-curly-newline': 'off'
51+
{
52+
files: ["*.tsx"],
53+
rules: { "react/prop-types": "off" },
2754
},
28-
overrides: [
29-
{
30-
files: ['*-test.js', '*.spec.js'],
31-
rules: {
32-
'no-unused-expressions': 'off',
33-
'func-names': 'off',
34-
'prefer-arrow-callback': 'off',
35-
"react/jsx-filename-extension": 'off'
36-
}
37-
}
38-
],
39-
globals: {
40-
'expect': true,
41-
}
42-
}
55+
],
56+
globals: {
57+
expect: true,
58+
window: true,
59+
},
60+
};

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ _(To read more about passing options - scroll down to __Customization__ section)
442442
"opts": {...},
443443
"templates": {
444444
"better-docs": {
445-
"name": "AdminBro Documentation",
445+
"name": "Sample Documentation",
446446
"component": {
447447
"wrapper": "./path/to/your/wrapper-component.js",
448448
},
@@ -533,7 +533,7 @@ So let's say you want to add `babel-polyfill` and 'bulma.css' framework to your
533533
"opts": {...},
534534
"templates": {
535535
"better-docs": {
536-
"name": "AdminBro Documentation",
536+
"name": "Sample Documentation",
537537
"component": {
538538
"entry": [
539539
"import 'babel-polyfill';",
@@ -592,7 +592,7 @@ Example configuration file with settings for both `default` and `better-docs` te
592592
}
593593
},
594594
"better-docs": {
595-
"name": "AdminBro Documentation",
595+
"name": "Sample Documentation",
596596
"logo": "images/logo.png",
597597
"title": "", // HTML title
598598
"css": "style.css",

fixtures/typescript/type3.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
const input =
22
`
33
/**
4-
* Type representing the AdminBro.Router
5-
* @memberof AdminBro
4+
* Type representing the Sample.Router
5+
* @memberof Sample
66
* @alias RouterType
77
*/
88
export type RouterType = {
@@ -21,7 +21,7 @@ export type RouterType = {
2121
`
2222

2323
const outputs = [
24-
'* @memberof AdminBro',
24+
'* @memberof Sample',
2525
'* @alias RouterType',
2626
'* @typedef {object} RouterType',
2727
'* @property {Array<object>} assets',

jsdoc.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@
2222
},
2323
"templates": {
2424
"better-docs": {
25-
"name": "AdminBro Documentation",
26-
"logo": "images/logo.png"
25+
"name": "Sample Documentation"
2726
}
2827
}
2928
}

publish.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,7 @@ exports.publish = function(taffyData, opts, tutorials) {
721721
generateSourceFiles(sourceFiles, opts.encoding)
722722
}
723723

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

726726
// index page displays information from package.json and lists files
727727
files = find({kind: 'file'})

tmpl/topnav.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
href="<?js= betterDocs.landing ? 'docs.html' : 'index.html' ?>"
4040
class="link"
4141
>
42-
API Documentation
42+
<?js= betterDocs.navDocumentationLabel || 'Documentation' ?>
4343
</a>
4444
<?js if (this.tutorials.length) { ?>
4545
<div class="dropdown is-hoverable is-right">

typescript/type-converter.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const getTypeName = (type, src) => {
4242
* Fetches name from a node.
4343
*/
4444
const getName = (node, src) => {
45-
let name = node.name && node.name.escapedText
45+
let name = node.name?.escapedText
4646
|| node.parameters && src.substring(node.parameters.pos, node.parameters.end)
4747

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

0 commit comments

Comments
 (0)