Skip to content

Commit

Permalink
Update js formatter and linter (major) (#237)
Browse files Browse the repository at this point in the history
* Update js formatter and linter

* Migrate to flat config

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Atsushi Watanabe <[email protected]>
  • Loading branch information
renovate[bot] and at-wat authored Nov 20, 2024
1 parent e43b95a commit 2fcbb6b
Show file tree
Hide file tree
Showing 5 changed files with 429 additions and 337 deletions.
26 changes: 0 additions & 26 deletions .eslintrc.js

This file was deleted.

33 changes: 33 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import globals from 'globals'
import js from '@eslint/js'
import react from 'eslint-plugin-react'
import tseslint from 'typescript-eslint'

export default [
{
languageOptions: {
ecmaVersion: 12,
sourceType: 'module',
parserOptions: {
ecmaFeatures: {
jsx: true
},
},
globals: {
...globals.node,
...globals.browser,
},
},
},
js.configs.recommended,
react.configs.flat.recommended,
react.configs.flat['jsx-runtime'],
{
ignores: [
'wasm_exec.js',
'pcdeditor.esm.js',
'node_modules/**',
],
},
...tseslint.configs.recommended,
]
12 changes: 7 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"scripts": {
"build": "make pcdeditor.esm.js ReactPCDEditor/index.js",
"fmt": "prettier --write pcdeditor.js pcdeditor.d.ts ReactPCDEditor/index.tsx",
"lint": "eslint pcdeditor.js pcdeditor.d.ts ReactPCDEditor/index.tsx",
"lint": "eslint",
"typecheck": "tsc --noEmit --allowJs --jsx react --esModuleInterop pcdeditor.js ReactPCDEditor/index.tsx",
"tsc": "tsc --declaration --jsx react --esModuleInterop ReactPCDEditor/index.tsx"
},
Expand All @@ -46,13 +46,15 @@
},
"homepage": "https://github.com/seqsense/pcdeditor#readme",
"devDependencies": {
"@typescript-eslint/eslint-plugin": "7.18.0",
"@typescript-eslint/parser": "7.18.0",
"eslint": "8.57.1",
"@typescript-eslint/eslint-plugin": "8.15.0",
"@typescript-eslint/parser": "8.15.0",
"eslint": "9.14.0",
"eslint-plugin-react": "7.37.2",
"globals": "15.9.0",
"prettier": "3.3.3",
"react": "18.3.1",
"typescript": "5.6.3"
"typescript": "5.6.3",
"typescript-eslint": "8.3.0"
},
"packageManager": "[email protected]"
}
5 changes: 2 additions & 3 deletions pcdeditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,7 @@ class PCDEditor {
.command(e.target.value)
.then((res) => {
let str = ''
// eslint-disable-next-line no-restricted-syntax
for (const vec of res) {
// eslint-disable-next-line no-restricted-syntax
for (const val of vec) {
str += `${val.toFixed(3)} `
}
Expand Down Expand Up @@ -311,7 +309,8 @@ class PCDEditor {
const retryRestore = setInterval(() => {
try {
glex.restoreContext()
} catch (error) {
} catch (e) {
this.logger(e)
return
}
clearInterval(retryRestore)
Expand Down
Loading

0 comments on commit 2fcbb6b

Please sign in to comment.