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"
|
"preview": "vite preview"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@eslint/js": "^8.57.0",
|
||||||
"@types/d3": "^7.4.3",
|
"@types/d3": "^7.4.3",
|
||||||
"@types/node": "^20.11.16",
|
"@types/eslint__js": "^8.42.3",
|
||||||
"@typescript-eslint/eslint-plugin": "^6.20.0",
|
"eslint": "^8.57.0",
|
||||||
"@typescript-eslint/parser": "^6.20.0",
|
"globals": "^14.0.0",
|
||||||
"eslint": "^8.56.0",
|
"typescript": "^5.4.2",
|
||||||
"typescript": "^5.3.3",
|
"typescript-eslint": "^7.3.1",
|
||||||
"vite": "^5.0.12"
|
"vite": "^5.2.2"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"d3": "^7.8.5",
|
"d3": "^7.9.0",
|
||||||
"ml-matrix": "^6.11.0"
|
"ml-matrix": "^6.11.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -26,7 +26,7 @@ export const debounce = <F extends (...args: Parameters<F>) => ReturnType<F>>(
|
|||||||
func: F,
|
func: F,
|
||||||
waitFor: number = 150,
|
waitFor: number = 150,
|
||||||
) => {
|
) => {
|
||||||
let timeout: NodeJS.Timeout;
|
let timeout: ReturnType<typeof setTimeout>;
|
||||||
|
|
||||||
return (...args: Parameters<F>) => {
|
return (...args: Parameters<F>) => {
|
||||||
clearTimeout(timeout);
|
clearTimeout(timeout);
|
||||||
|
@@ -4,7 +4,7 @@
|
|||||||
"useDefineForClassFields": true,
|
"useDefineForClassFields": true,
|
||||||
"module": "ESNext",
|
"module": "ESNext",
|
||||||
"lib": ["ESNext", "DOM", "DOM.Iterable"],
|
"lib": ["ESNext", "DOM", "DOM.Iterable"],
|
||||||
"types": ["@types/node", "vite/client"],
|
"types": ["vite/client"],
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"allowJs": true,
|
"allowJs": true,
|
||||||
"checkJs": true,
|
"checkJs": true,
|
||||||
|
Reference in New Issue
Block a user