Switch to ESLint flat configs
This commit is contained in:
@@ -1,12 +0,0 @@
|
||||
module.exports = {
|
||||
env: {
|
||||
browser: true,
|
||||
},
|
||||
root: true,
|
||||
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
|
||||
parser: '@typescript-eslint/parser',
|
||||
plugins: ['@typescript-eslint'],
|
||||
rules: {
|
||||
'@typescript-eslint/no-explicit-any': 'warn',
|
||||
},
|
||||
};
|
15
eslint.config.js
Normal file
15
eslint.config.js
Normal file
@@ -0,0 +1,15 @@
|
||||
// @ts-check
|
||||
|
||||
import eslint from '@eslint/js';
|
||||
import tseslint from 'typescript-eslint';
|
||||
import globals from "globals";
|
||||
|
||||
export default tseslint.config(
|
||||
{
|
||||
...eslint.configs.recommended,
|
||||
languageOptions: {
|
||||
globals: globals.browser
|
||||
}
|
||||
},
|
||||
...tseslint.configs.recommended,
|
||||
);
|
15
package.json
15
package.json
@@ -9,16 +9,17 @@
|
||||
"preview": "vite preview"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^8.57.0",
|
||||
"@types/d3": "^7.4.3",
|
||||
"@types/node": "^20.11.16",
|
||||
"@typescript-eslint/eslint-plugin": "^6.20.0",
|
||||
"@typescript-eslint/parser": "^6.20.0",
|
||||
"eslint": "^8.56.0",
|
||||
"typescript": "^5.3.3",
|
||||
"vite": "^5.0.12"
|
||||
"@types/eslint__js": "^8.42.3",
|
||||
"eslint": "^8.57.0",
|
||||
"globals": "^14.0.0",
|
||||
"typescript": "^5.4.2",
|
||||
"typescript-eslint": "^7.3.1",
|
||||
"vite": "^5.2.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"d3": "^7.8.5",
|
||||
"d3": "^7.9.0",
|
||||
"ml-matrix": "^6.11.0"
|
||||
}
|
||||
}
|
||||
|
@@ -26,7 +26,7 @@ export const debounce = <F extends (...args: Parameters<F>) => ReturnType<F>>(
|
||||
func: F,
|
||||
waitFor: number = 150,
|
||||
) => {
|
||||
let timeout: NodeJS.Timeout;
|
||||
let timeout: ReturnType<typeof setTimeout>;
|
||||
|
||||
return (...args: Parameters<F>) => {
|
||||
clearTimeout(timeout);
|
||||
|
@@ -4,7 +4,7 @@
|
||||
"useDefineForClassFields": true,
|
||||
"module": "ESNext",
|
||||
"lib": ["ESNext", "DOM", "DOM.Iterable"],
|
||||
"types": ["@types/node", "vite/client"],
|
||||
"types": ["vite/client"],
|
||||
"skipLibCheck": true,
|
||||
"allowJs": true,
|
||||
"checkJs": true,
|
||||
|
Reference in New Issue
Block a user