Setup eslint and enforce rules
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2021-06-02 22:36:25 -05:00
parent 82e7a1f299
commit 1d5056b753
149 changed files with 6104 additions and 3114 deletions

View File

@@ -1,21 +1,21 @@
import {Template} from "../../cli"
import {UniversalPath} from "../../util"
import {Container} from "../../di"
import {Config} from "../../service/Config";
import {Template} from '../../cli'
import {Container} from '../../di'
import {Config} from '../../service/Config'
/**
* CLI template that generates a new locale file.
* Automatically adds placeholder entries for phrases that exist in the
* associated common locale file.
*/
const locale_template: Template = {
const templateLocale: Template = {
name: 'locale',
fileSuffix: '.config.ts',
description: 'Create a new config file that specifies translations for a locale.',
baseAppPath: ['configs', 'lang'],
render: (name: string, fullCanonicalName: string, targetFilePath: UniversalPath) => {
render: (name: string, fullCanonicalName: string) => {
const config = <Config> Container.getContainer().make(Config)
const subloc = fullCanonicalName.split(':').slice(1).join(':')
const subloc = fullCanonicalName.split(':').slice(1)
.join(':')
const common: any = config.get(`lang:common${subloc ? ':' + subloc : ''}`, {})
return `import {env} from '@extollo/lib'
@@ -27,4 +27,4 @@ ${Object.keys(common).map(key => ' ' + key + ': \'\',\n')}
},
}
export { locale_template }
export { templateLocale }