From 3973293961a7dd3b8e8ab37d2bb6eedae23300aa Mon Sep 17 00:00:00 2001 From: Safwan Samsudeen Date: Tue, 7 Jan 2025 17:31:38 +0530 Subject: [PATCH] chore: lint --- .eslintrc | 7 ------- .gitignore | 2 +- demo.js | 3 +-- eslint.config.mjs | 19 +++++++++++++++++++ index.html | 5 +---- 5 files changed, 22 insertions(+), 14 deletions(-) delete mode 100644 .eslintrc create mode 100644 eslint.config.mjs diff --git a/.eslintrc b/.eslintrc deleted file mode 100644 index 8d09c5f..0000000 --- a/.eslintrc +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": ["plugin:prettier/recommended"], - "parserOptions": { - "ecmaVersion": 6, - "sourceType": "module" - } -} diff --git a/.gitignore b/.gitignore index faae2ff..691462f 100755 --- a/.gitignore +++ b/.gitignore @@ -31,4 +31,4 @@ node_modules .DS_Store gh-pages -feedback.md +feedback*.md diff --git a/demo.js b/demo.js index 7b31dcf..d2953d1 100644 --- a/demo.js +++ b/demo.js @@ -200,6 +200,7 @@ const HOLIDAYS = [ const mutablity = new Gantt('#mutability', tasks, { holidays: null, scroll_to: daysSince(-7), + popup: () => false, }); const sideheader = new Gantt('#sideheader', tasks, { @@ -326,7 +327,6 @@ for (let [chart, details, after] of UPDATES) { let el = document.getElementById(id); el.onchange = (e) => { - console.log('changed', e.currentTarget.id, e.currentTarget.value); let label = details[id]; let val; if (e.currentTarget.type === 'checkbox') { @@ -353,7 +353,6 @@ for (let [chart, details, after] of UPDATES) { } if (typeof label === 'function') { - console.log('ha', label(val, chart.options)); chart.update_options(label(val, chart.options)); } else { chart.update_options({ diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 0000000..6831439 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,19 @@ +import path from "node:path"; +import { fileURLToPath } from "node:url"; +import js from "@eslint/js"; +import { FlatCompat } from "@eslint/eslintrc"; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); +const compat = new FlatCompat({ + baseDirectory: __dirname, + recommendedConfig: js.configs.recommended, + allConfig: js.configs.all +}); + +export default [...compat.extends("plugin:prettier/recommended"), { + languageOptions: { + ecmaVersion: 6, + sourceType: "module", + }, +}]; \ No newline at end of file diff --git a/index.html b/index.html index f276d72..419d47c 100644 --- a/index.html +++ b/index.html @@ -349,6 +349,7 @@ id: 'Task 1', progress: random(), important: true, + dependencies: 'Task 0', }, { start: daysSince(4), @@ -658,10 +659,6 @@ let store = chart.options.scroll_to; let scroll = chart.$container.scrollLeft; if (typeof label === 'function') { - console.log('k', { - ...label(val), - scroll_to: null, - }); chart.update_options({ ...label(val), scroll_to: null,