Skip to content

Commit

Permalink
Merge tag 'v4.0.3' into merge-4.0.3-master
Browse files Browse the repository at this point in the history
v4.0.3
  • Loading branch information
Kaapp committed Nov 15, 2023
2 parents b464e3e + 03c8718 commit 1cfd924
Show file tree
Hide file tree
Showing 1,501 changed files with 42,783 additions and 16,541 deletions.
133 changes: 133 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
const {getESLintConfig} = require('ocular-dev-tools/configuration');

// Make any changes to default config here
const config = getESLintConfig({
overrides: {
// To make import assertions work
parser: '@babel/eslint-parser',
parserOptions: {
project: ['./tsconfig.json'],
requireConfigFile: false,
babelOptions: {
plugins: ['@babel/plugin-syntax-import-assertions']
}
},
env: {
browser: true,
es2020: true,
node: true
},

rules: {
indent: 0,
'import/no-unresolved': 0,
'no-console': 1,
'no-continue': ['warn'],
'callback-return': 0,
'max-depth': ['warn', 4],
complexity: ['warn'],
'max-statements': ['warn'],
'default-case': ['warn'],
'no-eq-null': ['warn'],
eqeqeq: ['warn'],
radix: 0
// 'accessor-pairs': ['error', {getWithoutSet: false, setWithoutGet: false}]
},

overrides: [
{
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,
'@typescript-eslint/no-floating-promises': 0,
// Gradually enable
'@typescript-eslint/ban-ts-comment': 0,
'@typescript-eslint/ban-types': 0,
'@typescript-eslint/no-unsafe-member-access': 0,
'@typescript-eslint/no-unsafe-assignment': 0,
'@typescript-eslint/no-var-requires': 0,
'@typescript-eslint/no-unused-vars': [
'warn',
{vars: 'all', args: 'none', ignoreRestSiblings: false}
],
// We still have some issues with import resolution
'import/named': 0,
'import/no-extraneous-dependencies': 0, // ['warn'], disable for test folder only...
// Warn instead of error
// 'max-params': ['warn'],
// 'no-undef': ['warn'],
// camelcase: ['warn'],
// '@typescript-eslint/no-floating-promises': ['warn'],
// '@typescript-eslint/await-thenable': ['warn'],
// '@typescript-eslint/no-misused-promises': ['warn'],
'@typescript-eslint/no-empty-function': 0,
// We use function hoisting
'@typescript-eslint/no-use-before-define': 0,
// We always want explicit typing, e.g `field: string = ''`
'@typescript-eslint/no-inferrable-types': 0,
'@typescript-eslint/restrict-template-expressions': 0,
'@typescript-eslint/explicit-module-boundary-types': 0,
'@typescript-eslint/require-await': 0,
'@typescript-eslint/no-unsafe-return': 0,
'@typescript-eslint/no-unsafe-call': 0,
'@typescript-eslint/no-empty-interface': 0,
'@typescript-eslint/restrict-plus-operands': 0
}
},
{
// scripts use devDependencies
files: ['*worker*.js', '**/worker-utils/**/*.js'],
env: {
browser: true,
es2020: true,
node: true,
worker: true
}
},
// tests are run with aliases set up in node and webpack.
// This means lint will not find the imported files and generate false warnings
{
// scripts use devDependencies
files: ['**/test/**/*.js', '**/scripts/**/*.js', '*.config.js', '*.config.local.js'],
rules: {
'import/no-unresolved': 0,
'import/no-extraneous-dependencies': 0
}
},
{
files: ['examples/**/*.js'],
rules: {
'import/no-unresolved': 0
}
}
],

settings: {
// Ensure eslint finds typescript files
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.mjs', '.ts', '.tsx']
}
}
}
}
});

// config.overrides[1].parserOptions = {
// project: ['./tsconfig.json']
// };

// Uncomment to log the eslint config
// console.debug(JSON.stringify(config, null, 2));

module.exports = config;
120 changes: 0 additions & 120 deletions .eslintrc.js

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16]
node-version: [16, 18, 20]

steps:
- uses: actions/checkout@v3
Expand All @@ -33,7 +33,7 @@ jobs:
npm run test ci
- name: Coveralls
if: matrix.node-version == 16
if: matrix.node-version == 18
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# tests
test/data/test.png
tmp
!modules/zip/test/data/**/*.zip

# dists
dist/*
Expand Down
35 changes: 0 additions & 35 deletions .ocularrc.cjs

This file was deleted.

37 changes: 37 additions & 0 deletions .ocularrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import {resolve} from 'path';

export default {
aliases: {
test: resolve('./test')
},

typescript: {
project: 'tsconfig.build.json'
},

bundle: {
globalName: 'loader',
externals: ['fs', 'path', 'util', 'events', 'stream', 'crypto', 'http', 'https'],
target: ['supports async-functions', 'not dead'],
format: 'umd',
globals: {
'@loaders.gl/*': 'globalThis.loaders'
}
},

lint: {
// TODO - comment out while getting typescript to work
paths: ['dev-docs', 'docs', 'modules'] // 'examples', test', 'website', 'examples'],
// extensions: ['js', 'jsx', 'mjs', 'ts', 'tsx', 'md']
},

webpack: {},

entry: {
test: 'test/node.ts',
'test-browser': 'test/browser.ts',
bench: 'test/bench/node.js',
'bench-browser': 'test/bench/browser.js',
size: 'test/size/import-nothing.js'
}
};
8 changes: 8 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ node_modules/
.cache
public

modules/core/src/iterators/make-stream/make-node-stream.ts

modules/loader-utils/src/lib/files/node-file-facade.ts
modules/loader-utils/src/lib/filesystems/node-filesystem-facade.ts

modules/3d-tiles/test/lib/classes/tile-3d-batch-table-hierarchy.spec.ts

modules/bson/src/bson-writer.ts
Expand All @@ -15,6 +20,7 @@ modules/bson/src/lib/encoders/encode-bson.ts
modules/bson/src/lib/parsers/parse-bson.ts
modules/bson/test/data/js-bson/corrupt.ts

modules/parquet/src/polyfills/buffer/buffer.ts
modules/parquet/test

examples/experimental/gltf-with-raw-webgl/
Expand All @@ -35,6 +41,8 @@ modules/mvt/src/lib/geojson-tiler/tile.ts

modules/parquet/test

modules/textures/test/basis-loader.spec.ts

modules/xml/test/sax-ts/testcases/attribute-name.spec.ts
modules/xml/test/sax-ts/testcases/opentagstart.spec.ts
modules/xml/test/sax-ts/testcases/script-close-better.spec.ts
Expand Down
5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
printWidth: 100
semi: true
singleQuote: true
trailingComma: none
bracketSpacing: false
Loading

0 comments on commit 1cfd924

Please sign in to comment.