Skip to content

Commit

Permalink
Code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
cedx committed Apr 15, 2019
1 parent 2a5a1a7 commit 4a357f5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 46 deletions.
37 changes: 9 additions & 28 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,53 +10,38 @@ const _path = 'PATH' in process.env ? process.env.PATH : '';
const _vendor = resolve('node_modules/.bin');
if (!_path.includes(_vendor)) process.env.PATH = `${_vendor}${delimiter}${_path}`;

/**
* The file patterns providing the list of source files.
* @type {string[]}
*/
/** @type {string[]} The file patterns providing the list of source files. */
const sources = ['*.js', 'src/**/*.ts'];

/**
* Builds the project.
*/
/** Builds the project. */
task('build', async () => {
await _exec('tsc', ['--project', 'src/tsconfig.json']);
return _exec('webpack', ['--config=src/webpack.config.js']);
});

/**
* Deletes all generated files and reset any saved state.
*/
/** Deletes all generated files and reset any saved state. */
task('clean', () => del(['build', 'doc/api', 'lib', 'var/**/*', 'web']));

/**
* Builds the documentation.
*/
/** Builds the documentation. */
task('doc', async () => {
for (const path of ['CHANGELOG.md', 'LICENSE.md']) await promises.copyFile(path, `doc/about/${path.toLowerCase()}`);
await _exec('typedoc', ['--options', 'doc/typedoc.js']);
await _exec('mkdocs', ['build', '--config-file=doc/mkdocs.yml']);
return del(['doc/about/changelog.md', 'doc/about/license.md', 'web/mkdocs.yml', 'web/typedoc.js']);
});

/**
* Fixes the coding standards issues.
*/
/** Fixes the coding standards issues. */
task('fix', () => _exec('tslint', ['--fix', ...sources]));

/**
* Performs the static analysis of source code.
*/
/** Performs the static analysis of source code. */
task('lint', () => _exec('tslint', sources));

/**
* Starts the development server.
*/
task('serve', () => _exec('http-server', ['example', '-o']));

/**
* Upgrades the project to the latest revision.
*/
/** Upgrades the project to the latest revision. */
task('upgrade', async () => {
await _exec('git', ['reset', '--hard']);
await _exec('git', ['fetch', '--all', '--prune']);
Expand All @@ -65,14 +50,10 @@ task('upgrade', async () => {
return _exec('npm', ['update', '--dev']);
});

/**
* Watches for file changes.
*/
/** Watches for file changes. */
task('watch', () => watch('src/**/*.ts', {ignoreInitial: false}, task('build')));

/**
* Runs the default tasks.
*/
/** Runs the default tasks. */
task('default', task('build'));

/**
Expand Down
12 changes: 3 additions & 9 deletions src/editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,10 @@ import TableToolbar from '@ckeditor/ckeditor5-table/src/tabletoolbar';

import {JsonMap} from './map';

/**
* An implementation of a rich text editor.
*/
/** An implementation of a rich text editor. */
export class RichTextEditor extends ClassicEditor {

/**
* The set of supported plug-ins.
*/
/** The set of supported plug-ins. */
static readonly builtinPlugins: Plugin[] = [
Alignment,
Autoformat,
Expand All @@ -68,9 +64,7 @@ export class RichTextEditor extends ClassicEditor {
Table, TableToolbar
];

/**
* The default editor settings.
*/
/** The default editor settings. */
static readonly defaultConfig: JsonMap = {
alignment: {
options: ['left', 'center', 'right']
Expand Down
12 changes: 3 additions & 9 deletions src/map.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
/**
* Defines the shape of a map in JSON format.
*/
/** Defines the shape of a map in JSON format. */
export type JsonMap = StringMap<any>;

/**
* Defines the shape of a dictionary whose keys are strings.
*/
/** Defines the shape of a dictionary whose keys are strings. */
export interface StringMap<T = string | undefined> {

/**
* Gets or sets the value for the given key.
*/
/** Gets or sets the value for the given key. */
[key: string]: T;
}

0 comments on commit 4a357f5

Please sign in to comment.