enable eslint fix and eslint-plugin-jsdoc

This commit is contained in:
Matthieu MOREL
2021-11-08 22:06:24 +01:00
committed by Matthieu Morel
parent c29c8bd33c
commit 4d103c14f7
53 changed files with 3476 additions and 2715 deletions

View File

@@ -3,13 +3,6 @@ import { log } from './logger'; // eslint-disable-line
import theme from './themes';
import config from './defaultConfig';
// import { unflatten } from 'flat';
// import flatten from 'flat';
// import themeVariables from './theme-default';
// import themeForestVariables from './theme-forest';
// import themeNeutralVariables from './theme-neutral';
const handleThemeVariables = (value) => {
return theme[value] ? theme[value].getThemeVariables() : theme.default.getThemeVariables();
};
@@ -36,8 +29,9 @@ const currentConfig = assignWithDepth({}, defaultConfig);
*the currentConfig to siteConfig. Calls to reset(configApi.defaultConfig) will reset siteConfig and currentConfig
*to the defaultConfig
*Note: currentConfig is set in this function
**Default value: At default, will mirror Global Config**
* @param conf - the base currentConfig to use as siteConfig
*Default value: At default, will mirror Global Config
*
* @param {any} conf - the base currentConfig to use as siteConfig
* @returns {*} - the siteConfig
*/
export const setSiteConfig = (conf) => {
@@ -61,6 +55,7 @@ export const setSiteConfig = (conf) => {
*| setSiteConfig|Returns the current siteConfig base configuration | Get Request | Returns Any Values in siteConfig|
***Notes**:
*Returns **any** values in siteConfig.
*
* @returns {*}
*/
export const getSiteConfig = () => {
@@ -75,7 +70,8 @@ export const getSiteConfig = () => {
*Sets the currentConfig. The parameter conf is sanitized based on the siteConfig.secure keys. Any
*values found in conf with key found in siteConfig.secure will be replaced with the corresponding
*siteConfig value.
* @param conf - the potential currentConfig
*
* @param {any} conf - the potential currentConfig
* @returns {*} - the currentConfig merged with the sanitized conf
*/
export const setConfig = (conf) => {
@@ -96,6 +92,7 @@ export const setConfig = (conf) => {
*| getConfig |Obtains the currentConfig | Get Request | Any Values from currentConfig|
***Notes**:
*Returns **any** the currentConfig
*
* @returns {*} - the currentConfig
*/
export const getConfig = () => {
@@ -107,8 +104,10 @@ export const getConfig = () => {
*| --------- | ------------------- | ------- | ------------------ |
*| sanitize |Sets the siteConfig to desired values. | Put Request |None|
*Ensures options parameter does not attempt to override siteConfig secure keys
*Note: modifies options in-place
* @param options - the potential setConfig parameter
***Notes**:
*modifies options in-place
*
* @param {any} options - the potential setConfig parameter
*/
export const sanitize = (options) => {
Object.keys(siteConfig.secure).forEach((key) => {
@@ -133,9 +132,10 @@ export const sanitize = (options) => {
*| --- | --- | --- | --- | --- |
*| conf| base set of values, which currentConfig coul be **reset** to.| Dictionary | Required | Any Values, with respect to the secure Array|
*
**Notes :
(default: current siteConfig ) (optional, default `getSiteConfig()`)
* @param conf - the base currentConfig to reset to (default: current siteConfig )
***Notes**:
*(default: current siteConfig ) (optional, default `getSiteConfig()`)
*
* @param {any} conf - the base currentConfig to reset to (default: current siteConfig )
*/
export const reset = (conf = getSiteConfig()) => {
console.warn('reset');