Skip to content
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
3 changes: 2 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ module.exports = {
},
plugins: ["@typescript-eslint", "import"],
rules: {
"@typescript-eslint/ban-ts-comment": "warn",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just satisfying my compulsive need to alphabetize here :)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the idea with warning rules?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these are things that the team isn't fully committed to enforcing (yet). I'd like to upgrade them to errors, but I think we haven't have the time to fix the problems identified by the rule (yet). Perhaps we have a @ts-ignore we don't know how to eliminate (yet)?

"@typescript-eslint/naming-convention": [
"error",
{
Expand All @@ -31,7 +32,7 @@ module.exports = {
],
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-namespace": "off",
"@typescript-eslint/ban-ts-comment": "warn",
"@typescript-eslint/no-unnecessary-type-assertion": "error",
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/quotes": [
"error",
Expand Down
2 changes: 1 addition & 1 deletion packages/base/src/classificationModes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ export namespace GeoTiffClassifications {
if (numValuesInCurrentBin + 1 < valuesPerBin) {
numValuesInCurrentBin++;
} else {
breaks.push(bandSortedValues[i] as number);
breaks.push(bandSortedValues[i]);
numValuesInCurrentBin = 0;
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/base/src/dialogs/symbology/classificationModes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ export namespace GeoTiffClassifications {
if (numValuesInCurrentBin + 1 < valuesPerBin) {
numValuesInCurrentBin++;
} else {
breaks.push(bandSortedValues[i] as number);
breaks.push(bandSortedValues[i]);
numValuesInCurrentBin = 0;
}
}
Expand Down
10 changes: 5 additions & 5 deletions packages/base/src/mainview/mainView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,9 @@ export class MainView extends React.Component<IProps, IStates> {
const options = this._model.getOptions();
const center =
options.longitude !== undefined && options.latitude !== undefined
? fromLonLat([options.longitude!, options.latitude!])
? fromLonLat([options.longitude, options.latitude])
: [0, 0];
const zoom = options.zoom !== undefined ? options.zoom! : 1;
const zoom = options.zoom !== undefined ? options.zoom : 1;

await this.generateMap(center, zoom);
this.addContextMenu();
Expand Down Expand Up @@ -871,7 +871,7 @@ export class MainView extends React.Component<IProps, IStates> {
// create updated source
await this.addSource(id, source);
// change source of target layer
(mapLayer as Layer).setSource(this._sources[id]);
mapLayer.setSource(this._sources[id]);
}

/**
Expand Down Expand Up @@ -1957,7 +1957,7 @@ export class MainView extends React.Component<IProps, IStates> {
return;
}
} else {
jsonData = data as IAnnotation;
jsonData = data;
}

newState[key] = jsonData;
Expand Down Expand Up @@ -2004,7 +2004,7 @@ export class MainView extends React.Component<IProps, IStates> {

// The id is a layer
let extent;
const layer = this.getLayer(id) as Layer;
const layer = this.getLayer(id);
const source = layer?.getSource();

if (source instanceof VectorSource) {
Expand Down
4 changes: 2 additions & 2 deletions packages/base/src/tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ export const loadFile = async (fileInfo: {
if (typeof file.content === 'string') {
const { toGeoJson } = await import('geoparquet');

const arrayBuffer = await stringToArrayBuffer(file.content as string);
const arrayBuffer = await stringToArrayBuffer(file.content);

return await toGeoJson({ file: arrayBuffer, compressors });
} else {
Expand Down Expand Up @@ -959,7 +959,7 @@ export async function getGeoJSONDataFromLayerSource(
): Promise<string | null> {
const vectorSourceTypes: SourceType[] = ['GeoJSONSource', 'ShapefileSource'];

if (!vectorSourceTypes.includes(source.type as SourceType)) {
if (!vectorSourceTypes.includes(source.type)) {
console.error(
`Invalid source type '${source.type}'. Expected one of: ${vectorSourceTypes.join(', ')}`,
);
Expand Down
4 changes: 2 additions & 2 deletions packages/schema/src/doc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ export class JupyterGISDoc
needEmit = true;
}
changes.push({
id: key as string,
id: key,
oldValue: change.oldValue,
newValue: JSONExt.deepCopy(event.target.toJSON()[key]),
});
Expand Down Expand Up @@ -376,7 +376,7 @@ export class JupyterGISDoc
needEmit = true;
}
changes.push({
id: key as string,
id: key,
newValue: JSONExt.deepCopy(event.target.toJSON()[key]),
});
});
Expand Down
2 changes: 1 addition & 1 deletion python/jupytergis_lab/src/notebookrenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ export const notebookRendererPlugin: JupyterFrontEndPlugin<void> = {
);
}

const sharedModel = drive!.sharedModelFactory.createNew({
const sharedModel = drive.sharedModelFactory.createNew({
path: localPath,
format: fileFormat,
contentType,
Expand Down
Loading