Skip to content

Commit

Permalink
Upgrade dev-tools
Browse files Browse the repository at this point in the history
  • Loading branch information
Pessimistress committed Aug 27, 2024
1 parent a435d5d commit 6957d30
Show file tree
Hide file tree
Showing 9 changed files with 325 additions and 1,590 deletions.
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
dist/
node_modules/
examples/
examples/
**/*.md
17 changes: 10 additions & 7 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
const {getESLintConfig} = require('ocular-dev-tools/configuration');
const {getESLintConfig} = require('@vis.gl/dev-tools/configuration');

module.exports = getESLintConfig({
overrides: {
parser: '',
parserOptions: {
project: ['./tsconfig.json'],
ecmaVersion: 2020
},

env: {
es2020: true
// browser: true,
Expand All @@ -28,7 +22,16 @@ module.exports = getESLintConfig({
indent: 0,
'max-statements': 1,
complexity: 1,

// https://github.com/typescript-eslint/typescript-eslint/issues/2483
"no-shadow": 0,
"@typescript-eslint/no-shadow": 2,

"no-use-before-define": 0,
"@typescript-eslint/no-use-before-define": 2,

'@typescript-eslint/ban-ts-comment': 0,
'@typescript-eslint/ban-types': 0,
'@typescript-eslint/explicit-module-boundary-types': 0,
'@typescript-eslint/no-unsafe-assignment': 0,
'@typescript-eslint/no-unsafe-member-access': 0,
Expand Down
7 changes: 3 additions & 4 deletions .ocularrc.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
/** @typedef {import('ocular-dev-tools').OcularConfig} OcularConfig */
/** @typedef {import('@vis.gl/dev-tools').OcularConfig} OcularConfig */
import {resolve} from 'path';

/** @type OcularConfig */
export default {
lint: {
paths: ['src', 'examples', 'test', 'docs']
paths: ['src', 'examples', 'test', 'docs'],
extensions: ['js', 'mjs', 'jsx', 'ts', 'tsx', 'd.ts', 'md']
},

bundle: {
Expand All @@ -17,8 +18,6 @@ export default {
project: 'tsconfig.build.json'
},

babel: false,

alias: {
'mjolnir.js': resolve('./src')
},
Expand Down
6 changes: 0 additions & 6 deletions .prettierrc

This file was deleted.

8 changes: 4 additions & 4 deletions examples/main/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default function App() {
evt.srcEvent.preventDefault();
evt.stopPropagation();

setEventLog(curr => {
setEventLog((curr) => {
curr = curr.slice(0, 30);
curr.unshift(evt);
return curr;
Expand Down Expand Up @@ -72,15 +72,15 @@ export default function App() {
} else {
eventManager.off(name, handleEvent);
}
setOptions(curr => ({...curr, [name]: checked}));
setOptions((curr) => ({...curr, [name]: checked}));
},
[eventManager]
);

return (
<div id="container">
<div id="options">
{EVENTS.map(eventName => (
{EVENTS.map((eventName) => (
<Checkbox
key={eventName}
eventName={eventName}
Expand All @@ -90,7 +90,7 @@ export default function App() {
))}
</div>
<div id="content">
<div id="background" ref={rootRef} onContextMenu={evt => evt.preventDefault()}>
<div id="background" ref={rootRef} onContextMenu={(evt) => evt.preventDefault()}>
<div id="red-box" ref={redBoxRef} />
</div>
<div id="logs">{eventLog.map(renderEventLogEntry)}</div>
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@
"scripts": {
"typecheck": "tsc -p tsconfig.json --noEmit",
"bootstrap": "yarn && ocular-bootstrap",
"start": "(cd examples/main && (path-exists node_modules || npm i) && npm run start-local)",
"build": "ocular-clean && ocular-build",
"build": "ocular-clean && ocular-build && npm run build-bundle",
"build-bundle": "ocular-bundle ./src/index.ts",
"lint": "ocular-lint",
"cover": "ocular-test cover",
Expand All @@ -49,7 +48,8 @@
"dependencies": {},
"devDependencies": {
"jsdom": "^16.0.0",
"ocular-dev-tools": "2.0.0-alpha.33",
"@vis.gl/dev-tools": "1.0.0-alpha.8",
"@vis.gl/ts-plugins": "1.0.0-alpha.8",
"pre-commit": "^1.2.2",
"puppeteer": "^22.0.0"
},
Expand Down
6 changes: 1 addition & 5 deletions tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"target": "es2020",
"moduleResolution": "node",
"strictNullChecks": true,
"allowSyntheticDefaultImports": true,
"module": "ES2020",
"declaration": true,
"sourceMap": true,
"outDir": "./dist"
Expand Down
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
"transpileOnly": true
},
"compilerOptions": {
"target": "es2020",
"target": "ES2020",
"module": "ES2020",
"jsx": "react",
"strictNullChecks": true,
"allowSyntheticDefaultImports": true,
"resolveJsonModule": true,
"moduleResolution": "node",
"module": "ES2020",
"paths": {
"mjolnir.js": ["./src"]
}
Expand Down
Loading

0 comments on commit 6957d30

Please sign in to comment.