-
Notifications
You must be signed in to change notification settings - Fork 166
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* vite * vitest migration * vite fixes, rollup dts * eanup, vite build fixes * fix build, lint * more fixes and comments * Update examples/vite.config.local.ts Co-authored-by: Alexander CherryTea <[email protected]> * Update modules/layers/test/dependencies.test.ts Co-authored-by: Alexander CherryTea <[email protected]> * Update modules/overlays/test/html-overlay.test.tsx Co-authored-by: Alexander CherryTea <[email protected]> * build order fix, add copy readme * review, build, rollup fixes --------- Co-authored-by: Alexander CherryTea <[email protected]>
- Loading branch information
Showing
85 changed files
with
4,718 additions
and
8,133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,71 +1,68 @@ | ||
|
||
module.exports = { | ||
|
||
"parser": "@typescript-eslint/parser", | ||
plugins: ['prettier', 'babel', 'import', "@typescript-eslint", 'react', "react-hooks"], | ||
parser: '@typescript-eslint/parser', | ||
plugins: ['prettier', 'import', '@typescript-eslint', 'react', 'react-hooks'], | ||
extends: [ | ||
'eslint-config-uber-jsx', | ||
'eslint-config-uber-es2015', | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:react/recommended", | ||
"plugin:react-hooks/recommended", | ||
'prettier' | ||
'plugin:@typescript-eslint/recommended', | ||
'plugin:react/recommended', | ||
'plugin:react-hooks/recommended', | ||
'prettier', | ||
], | ||
rules: { | ||
'callback-return': 'off', | ||
complexity: 'off', | ||
'max-statements': 'off', | ||
'no-return-assign': 'off', | ||
'func-style': 'error', | ||
'prettier/prettier': 'error', | ||
'prettier/prettier': ['error', { usePrettierrc: true }], | ||
'react/no-multi-comp': 'off', | ||
'react/sort-comp': 'error', | ||
'react/jsx-no-duplicate-props': 'error', | ||
'react/no-unescaped-entities': 'warn', | ||
'sort-imports': 'off', | ||
'max-depth': ['warn', 4], | ||
|
||
/* This is needed for class property function declarations */ | ||
'no-invalid-this': 'off', | ||
'babel/no-invalid-this': 'error', | ||
|
||
/* Style guide */ | ||
'spaced-comment': 0, | ||
'import/first': 'error', | ||
'import/no-duplicates': 'error', | ||
'import/extensions': 'error', | ||
'import/order': 'error', | ||
'import/newline-after-import': 'error', | ||
'import/extensions': 'off', | ||
|
||
// Those are rules for typescript migration | ||
"@typescript-eslint/interface-name-prefix": 0, | ||
"@typescript-eslint/no-empty-function": 0, | ||
"@typescript-eslint/explicit-function-return-type": 0, | ||
"no-inline-comments": 0, | ||
'@typescript-eslint/no-empty-function': 0, | ||
'@typescript-eslint/explicit-function-return-type': 0, | ||
'no-inline-comments': 0, | ||
// TODO: Please remove these rules and fix eslint error when possible | ||
"@typescript-eslint/no-use-before-define": 0, | ||
"@typescript-eslint/ban-ts-ignore": 0, | ||
"@typescript-eslint/camelcase": 0, | ||
'@typescript-eslint/no-use-before-define': 'warn', | ||
'@typescript-eslint/ban-ts-comment': 0, | ||
'@typescript-eslint/ban-types': 'warn', | ||
|
||
/* Ignore rules conflicting with prettier */ | ||
'react/jsx-wrap-multilines': 'off', | ||
'react/jsx-indent': 'off', | ||
'func-style': 'off', | ||
'no-unused-vars': 'off', | ||
'@typescript-eslint/no-unused-vars': ['warn', { args: 'none', ignoreRestSiblings: true }], | ||
'no-shadow': 'off', | ||
'@typescript-eslint/no-shadow': ['warn', { hoist: 'never', ignoreOnInitialization: true }], | ||
|
||
/* Use the 'query-string' module instead */ | ||
'no-restricted-imports': ['error', 'querystring'], | ||
|
||
'no-unused-vars': ['error', { args: 'none', 'ignoreRestSiblings': true }] | ||
}, | ||
globals: { | ||
vi: true, | ||
Buffer: true, | ||
window: true | ||
window: true, | ||
}, | ||
env: { | ||
// Support global Jest variables (test, expect, etc.) | ||
jest: true | ||
jest: true, | ||
}, | ||
settings: { | ||
react: { | ||
version: 'detect', | ||
}, | ||
}, | ||
"settings": { | ||
"react": { | ||
"version": "detect" | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<!DOCTYPE html> | ||
<head> | ||
<link href="https://api.mapbox.com/mapbox-gl-js/v1.9.0/mapbox-gl.css" rel="stylesheet" /> | ||
<script type="module" src="./app.tsx"></script> | ||
</head> | ||
<body></body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { builtinModules } from 'module'; | ||
import { defineConfig, UserConfig } from 'vite'; | ||
import { makeLocalDevConfig } from '../vite.config.local'; | ||
|
||
const { alias } = makeLocalDevConfig(__dirname); | ||
|
||
// https://vitejs.dev/config/ | ||
export default defineConfig((env) => { | ||
const viteBuildConfig: UserConfig = { | ||
// use local development overrides in mode == 'localdev' | ||
resolve: env.mode === 'localdev' ? { alias } : {}, | ||
root: 'src', | ||
server: { open: true }, | ||
build: { | ||
emptyOutDir: true, | ||
outDir: '../dist', | ||
sourcemap: true, | ||
// TODO: Rollup warns about builins https://github.com/visgl/loaders.gl/issues/2000 | ||
rollupOptions: { | ||
external: builtinModules, | ||
}, | ||
}, | ||
define: { | ||
'process.env.MapboxAccessToken': JSON.stringify(process.env.MapboxAccessToken), | ||
}, | ||
}; | ||
return viteBuildConfig; | ||
}); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.