Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eslint: add 'no-tabs' rule #8630

Merged
merged 2 commits into from
Oct 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions configs/base.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
},
"ignorePatterns": [
"node_modules",
"*.d.ts"
"lib"
]
}
}
3 changes: 2 additions & 1 deletion configs/errors.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"hoist": "all"
}
],
"no-tabs": "error",
"no-throw-literal": "error",
"no-trailing-spaces": "error",
"no-underscore-dangle": "off",
Expand Down Expand Up @@ -129,4 +130,4 @@
}
]
}
}
}
1 change: 1 addition & 0 deletions packages/console/src/browser/monaco.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
********************************************************************************/

// eslint-disable-next-line spaced-comment
/// <reference types='@theia/monaco-editor-core/monaco'/>
6 changes: 3 additions & 3 deletions packages/core/src/common/cancellation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ import { Event, Emitter } from './event';
export interface CancellationToken {
readonly isCancellationRequested: boolean;
/*
* An event emitted when cancellation is requested
* @event
*/
* An event emitted when cancellation is requested
* @event
*/
readonly onCancellationRequested: Event<void>;
}

Expand Down
8 changes: 4 additions & 4 deletions packages/core/src/common/encoding-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ import { BinaryBuffer, BinaryBufferReadableStream, BinaryBufferReadable } from '
import { UTF8, UTF8_with_bom, UTF16be, UTF16le, UTF16be_BOM, UTF16le_BOM, UTF8_BOM } from './encodings';
import { newWriteableStream, ReadableStream, Readable } from './stream';

const ZERO_BYTE_DETECTION_BUFFER_MAX_LEN = 512; // number of bytes to look at to decide about a file being binary or not
const NO_ENCODING_GUESS_MIN_BYTES = 512; // when not auto guessing the encoding, small number of bytes are enough
const AUTO_ENCODING_GUESS_MIN_BYTES = 512 * 8; // with auto guessing we want a lot more content to be read for guessing
const AUTO_ENCODING_GUESS_MAX_BYTES = 512 * 128; // set an upper limit for the number of bytes we pass on to jschardet
const ZERO_BYTE_DETECTION_BUFFER_MAX_LEN = 512; // number of bytes to look at to decide about a file being binary or not
const NO_ENCODING_GUESS_MIN_BYTES = 512; // when not auto guessing the encoding, small number of bytes are enough
const AUTO_ENCODING_GUESS_MIN_BYTES = 512 * 8; // with auto guessing we want a lot more content to be read for guessing
const AUTO_ENCODING_GUESS_MAX_BYTES = 512 * 128; // set an upper limit for the number of bytes we pass on to jschardet

// we explicitly ignore a specific set of encodings from auto guessing
// - ASCII: we never want this encoding (most UTF-8 files would happily detect as
Expand Down
126 changes: 63 additions & 63 deletions packages/core/src/common/json-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,76 +28,76 @@
* extended JSON schema
*/
export interface IJSONSchema {
id?: string;
$id?: string;
$schema?: string;
type?: string | string[];
title?: string;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
default?: any;
definitions?: IJSONSchemaMap;
description?: string;
properties?: IJSONSchemaMap;
patternProperties?: IJSONSchemaMap;
additionalProperties?: boolean | IJSONSchema;
minProperties?: number;
maxProperties?: number;
dependencies?: IJSONSchemaMap | { [prop: string]: string[] };
items?: IJSONSchema | IJSONSchema[];
minItems?: number;
maxItems?: number;
uniqueItems?: boolean;
additionalItems?: boolean | IJSONSchema;
pattern?: string;
minLength?: number;
maxLength?: number;
minimum?: number;
maximum?: number;
exclusiveMinimum?: boolean | number;
exclusiveMaximum?: boolean | number;
multipleOf?: number;
required?: string[];
$ref?: string;
anyOf?: IJSONSchema[];
allOf?: IJSONSchema[];
oneOf?: IJSONSchema[];
not?: IJSONSchema;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
enum?: any[];
format?: string;
id?: string;
$id?: string;
$schema?: string;
type?: string | string[];
title?: string;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
default?: any;
definitions?: IJSONSchemaMap;
description?: string;
properties?: IJSONSchemaMap;
patternProperties?: IJSONSchemaMap;
additionalProperties?: boolean | IJSONSchema;
minProperties?: number;
maxProperties?: number;
dependencies?: IJSONSchemaMap | { [prop: string]: string[] };
items?: IJSONSchema | IJSONSchema[];
minItems?: number;
maxItems?: number;
uniqueItems?: boolean;
additionalItems?: boolean | IJSONSchema;
pattern?: string;
minLength?: number;
maxLength?: number;
minimum?: number;
maximum?: number;
exclusiveMinimum?: boolean | number;
exclusiveMaximum?: boolean | number;
multipleOf?: number;
required?: string[];
$ref?: string;
anyOf?: IJSONSchema[];
allOf?: IJSONSchema[];
oneOf?: IJSONSchema[];
not?: IJSONSchema;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
enum?: any[];
format?: string;

// schema draft 06
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const?: any;
contains?: IJSONSchema;
propertyNames?: IJSONSchema;
// schema draft 06
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const?: any;
contains?: IJSONSchema;
propertyNames?: IJSONSchema;

// schema draft 07
$comment?: string;
if?: IJSONSchema;
then?: IJSONSchema;
else?: IJSONSchema;
// schema draft 07
$comment?: string;
if?: IJSONSchema;
then?: IJSONSchema;
else?: IJSONSchema;

// VSCode extensions
defaultSnippets?: IJSONSchemaSnippet[]; // VSCode extension
errorMessage?: string; // VSCode extension
patternErrorMessage?: string; // VSCode extension
deprecationMessage?: string; // VSCode extension
enumDescriptions?: string[]; // VSCode extension
markdownEnumDescriptions?: string[]; // VSCode extension
markdownDescription?: string; // VSCode extension
doNotSuggest?: boolean; // VSCode extension
allowComments?: boolean; // VSCode extension
// VSCode extensions
defaultSnippets?: IJSONSchemaSnippet[]; // VSCode extension
errorMessage?: string; // VSCode extension
patternErrorMessage?: string; // VSCode extension
deprecationMessage?: string; // VSCode extension
enumDescriptions?: string[]; // VSCode extension
markdownEnumDescriptions?: string[]; // VSCode extension
markdownDescription?: string; // VSCode extension
doNotSuggest?: boolean; // VSCode extension
allowComments?: boolean; // VSCode extension
}

export interface IJSONSchemaMap {
[name: string]: IJSONSchema;
[name: string]: IJSONSchema;
}

export interface IJSONSchemaSnippet {
label?: string;
description?: string;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
body?: any; // a object that will be JSON stringified
bodyText?: string; // an already stringified JSON object that can contain new lines (\n) and tabs (\t)
label?: string;
description?: string;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
body?: any; // a object that will be JSON stringified
bodyText?: string; // an already stringified JSON object that can contain new lines (\n) and tabs (\t)
}
134 changes: 67 additions & 67 deletions packages/core/src/common/stream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,22 @@ import { DisposableCollection, Disposable } from './disposable';

export interface ReadableStreamEvents<T> {

/**
* The 'data' event is emitted whenever the stream is
* relinquishing ownership of a chunk of data to a consumer.
*/
/**
* The 'data' event is emitted whenever the stream is
* relinquishing ownership of a chunk of data to a consumer.
*/
on(event: 'data', callback: (data: T) => void): void;

/**
* Emitted when any error occurs.
*/
/**
* Emitted when any error occurs.
*/
on(event: 'error', callback: (err: Error) => void): void;

/**
* The 'end' event is emitted when there is no more data
* to be consumed from the stream. The 'end' event will
* not be emitted unless the data is completely consumed.
*/
/**
* The 'end' event is emitted when there is no more data
* to be consumed from the stream. The 'end' event will
* not be emitted unless the data is completely consumed.
*/
on(event: 'end', callback: () => void): void;
}

Expand All @@ -54,24 +54,24 @@ export interface ReadableStreamEvents<T> {
*/
export interface ReadableStream<T> extends ReadableStreamEvents<T> {

/**
* Stops emitting any events until resume() is called.
*/
/**
* Stops emitting any events until resume() is called.
*/
pause(): void;

/**
* Starts emitting events again after pause() was called.
*/
/**
* Starts emitting events again after pause() was called.
*/
resume(): void;

/**
* Destroys the stream and stops emitting any event.
*/
/**
* Destroys the stream and stops emitting any event.
*/
destroy(): void;

/**
* Allows to remove a listener that was previously added.
*/
/**
* Allows to remove a listener that was previously added.
*/
removeListener(event: string, callback: Function): void;
}

Expand All @@ -81,10 +81,10 @@ export interface ReadableStream<T> extends ReadableStreamEvents<T> {
*/
export interface Readable<T> {

/**
* Read data from the underlying source. Will return
* null to indicate that no more data can be read.
*/
/**
* Read data from the underlying source. Will return
* null to indicate that no more data can be read.
*/
read(): T | null;
}
export namespace Readable {
Expand Down Expand Up @@ -119,34 +119,34 @@ export namespace Readable {
*/
export interface WriteableStream<T> extends ReadableStream<T> {

/**
* Writing data to the stream will trigger the on('data')
* event listener if the stream is flowing and buffer the
* data otherwise until the stream is flowing.
*
* If a `highWaterMark` is configured and writing to the
* stream reaches this mark, a promise will be returned
* that should be awaited on before writing more data.
* Otherwise there is a risk of buffering a large number
* of data chunks without consumer.
*/
/**
* Writing data to the stream will trigger the on('data')
* event listener if the stream is flowing and buffer the
* data otherwise until the stream is flowing.
*
* If a `highWaterMark` is configured and writing to the
* stream reaches this mark, a promise will be returned
* that should be awaited on before writing more data.
* Otherwise there is a risk of buffering a large number
* of data chunks without consumer.
*/
write(data: T): void | Promise<void>;

/**
* Signals an error to the consumer of the stream via the
* on('error') handler if the stream is flowing.
*/
/**
* Signals an error to the consumer of the stream via the
* on('error') handler if the stream is flowing.
*/
error(error: Error): void;

/**
* Signals the end of the stream to the consumer. If the
* result is not an error, will trigger the on('data') event
* listener if the stream is flowing and buffer the data
* otherwise until the stream is flowing.
*
* In case of an error, the on('error') event will be used
* if the stream is flowing.
*/
/**
* Signals the end of the stream to the consumer. If the
* result is not an error, will trigger the on('data') event
* listener if the stream is flowing and buffer the data
* otherwise until the stream is flowing.
*
* In case of an error, the on('error') event will be used
* if the stream is flowing.
*/
end(result?: T | Error): void;
}

Expand All @@ -158,20 +158,20 @@ export interface WriteableStream<T> extends ReadableStream<T> {
*/
export interface ReadableBufferedStream<T> {

/**
* The original stream that is being read.
*/
/**
* The original stream that is being read.
*/
stream: ReadableStream<T>;

/**
* An array of chunks already read from this stream.
*/
/**
* An array of chunks already read from this stream.
*/
buffer: T[];

/**
* Signals if the stream has ended or not. If not, consumers
* should continue to read from the stream until consumed.
*/
/**
* Signals if the stream has ended or not. If not, consumers
* should continue to read from the stream until consumed.
*/
ended: boolean;
}

Expand Down Expand Up @@ -210,11 +210,11 @@ export function newWriteableStream<T>(reducer: Reducer<T>, options?: WriteableSt

export interface WriteableStreamOptions {

/**
* The number of objects to buffer before WriteableStream#write()
* signals back that the buffer is full. Can be used to reduce
* the memory pressure when the stream is not flowing.
*/
/**
* The number of objects to buffer before WriteableStream#write()
* signals back that the buffer is full. Can be used to reduce
* the memory pressure when the stream is not flowing.
*/
highWaterMark?: number;
}

Expand Down
Loading