Skip to content

Commit

Permalink
lint-upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
ibgreen committed Oct 13, 2023
1 parent d099bdd commit a5b34f6
Show file tree
Hide file tree
Showing 16 changed files with 145 additions and 118 deletions.
8 changes: 8 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ const config = getESLintConfig({
{
files: ['**/*.ts', '**/*.tsx', '**/*.d.ts'],
rules: {
// typescript-eslint 6.0
'@typescript-eslint/no-unsafe-argument': 0,
'@typescript-eslint/no-redundant-type-constituents': 0,
'@typescript-eslint/no-unsafe-enum-comparison': 1,
'@typescript-eslint/no-duplicate-type-constituents': 1,
'@typescript-eslint/no-base-to-string': 1,
'@typescript-eslint/no-loss-of-precision': 1,

// For parquet module
'@typescript-eslint/no-non-null-assertion': 0,
'@typescript-eslint/no-non-null-asserted-optional-chain': 0,
Expand Down
10 changes: 1 addition & 9 deletions modules/arrow/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
type TypedIntArray =
| Int8Array
| Uint8Array
| Int16Array
| Uint16Array
| Int32Array
| Uint32Array
| Int32Array
| Uint32Array;
type TypedIntArray = Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array;

type TypedFloatArray = Float32Array | Float64Array;

Expand Down
2 changes: 1 addition & 1 deletion modules/flatgeobuf/src/flatgeobuf-loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';

export type FlatGeobufLoaderOptions = LoaderOptions & {
flatgeobuf?: {
shape?: 'geojson-table' | 'columnar-table' | 'geojson-table' | 'geojson' | 'binary';
shape?: 'geojson-table' | 'columnar-table' | 'geojson' | 'binary';
};
gis?: {
reproject?: boolean;
Expand Down
2 changes: 0 additions & 2 deletions modules/gltf/src/lib/gltf-utils/gltf-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ type TypedArrayConstructor =
| Uint16ArrayConstructor
| Int32ArrayConstructor
| Uint32ArrayConstructor
| Int32ArrayConstructor
| Uint32ArrayConstructor
| Float32ArrayConstructor
| Float64ArrayConstructor;

Expand Down
2 changes: 1 addition & 1 deletion modules/loader-utils/src/lib/node/buffer.browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ export function toArrayBuffer(buffer) {
/**
* Convert (copy) ArrayBuffer to Buffer
*/
export function toBuffer(binaryData: ArrayBuffer | ArrayBuffer | Buffer): Buffer {
export function toBuffer(binaryData: ArrayBuffer | Buffer): Buffer {
throw new Error('Buffer not supported in browser');
}
2 changes: 1 addition & 1 deletion modules/loader-utils/src/lib/node/buffer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export function toArrayBuffer(buffer) {
/**
* Convert (copy) ArrayBuffer to Buffer
*/
export function toBuffer(binaryData: ArrayBuffer | ArrayBuffer | Buffer): Buffer {
export function toBuffer(binaryData: ArrayBuffer | Buffer): Buffer {
if (Buffer.isBuffer(binaryData)) {
return binaryData;
}
Expand Down
4 changes: 0 additions & 4 deletions modules/loader-utils/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ export type TypedIntArray =
| Int16Array
| Uint16Array
| Int32Array
| Uint32Array
| Int32Array
| Uint32Array;

export type TypedFloatArray = Uint16Array | Float32Array | Float64Array;
Expand All @@ -24,8 +22,6 @@ export type TypedArrayConstructor =
| Uint16ArrayConstructor
| Int32ArrayConstructor
| Uint32ArrayConstructor
| Int32ArrayConstructor
| Uint32ArrayConstructor
| Float32ArrayConstructor
| Float64ArrayConstructor;

Expand Down
2 changes: 0 additions & 2 deletions modules/math/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ export type TypedArrayConstructor =
| Uint16ArrayConstructor
| Int32ArrayConstructor
| Uint32ArrayConstructor
| Int32ArrayConstructor
| Uint32ArrayConstructor
| Float32ArrayConstructor
| Float64ArrayConstructor;

Expand Down
2 changes: 0 additions & 2 deletions modules/schema/src/lib/table/arrow-api/arrow-like-type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ export type TypedIntArray =
| Uint16Array
| Int32Array
| Uint32Array
| Int32Array
| Uint32Array
| Uint8ClampedArray;

export type TypedFloatArray = Float32Array | Float64Array;
Expand Down
2 changes: 0 additions & 2 deletions modules/schema/src/types/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ export type TypedArrayConstructor =
| Uint16ArrayConstructor
| Int32ArrayConstructor
| Uint32ArrayConstructor
| Int32ArrayConstructor
| Uint32ArrayConstructor
| Float32ArrayConstructor
| Float64ArrayConstructor;

Expand Down
2 changes: 0 additions & 2 deletions modules/textures/src/lib/parsers/parse-npy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ type TypedArrayConstructor =
| typeof Uint16Array
| typeof Int32Array
| typeof Uint32Array
| typeof Int32Array
| typeof Uint32Array
| typeof Float32Array
| typeof Float64Array;

Expand Down
1 change: 1 addition & 0 deletions modules/tiles/test/data/tile-header-examples.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {I3STileHeader} from '@loaders.gl/i3s/src';
import {TILE_TYPE} from '../../src';

/* eslint-disable @typescript-eslint/no-loss-of-precision */
export const ROOT_TILE_HEADER: I3STileHeader = {
id: '0',
lodSelection: [
Expand Down
2 changes: 1 addition & 1 deletion modules/wms/src/services/ogc/csw-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export type CSWServiceProps = DataSourceProps & {
* @note Only the URL parameter conversion is supported. XML posts are not supported.
*/
export class CSWService extends DataSource<CSWServiceProps> {
static type: 'csw' = 'csw';
static readonly type = 'csw';
static testURL = (url: string): boolean => url.toLowerCase().includes('csw');

capabilities: CSWCapabilities | null = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ async function loadLibraryFromFile(libraryUrl: string): Promise<any> {
try {
return node && node.requireFromFile && (await node.requireFromFile(libraryUrl));
} catch (error) {
console.error(error);
console.error(error); // eslint-disable-line no-console
return null;
}
}
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@
],
"resolutions": {
"prettier": "3.0.3",
"typescript": "^5.0.4"
"typescript": "^5.0.4",
"@typescript-eslint/eslint-plugin": "^6.0.0",
"@typescript-eslint/parser" : "^6.0.0"
},
"volta": {
"node": "16.20.2",
Expand Down
Loading

0 comments on commit a5b34f6

Please sign in to comment.