From: Josh Kelley Date: Fri, 8 Jan 2021 21:01:20 +0000 (-0500) Subject: Update TypeScript ESLint configuration (#8288) X-Git-Tag: v3.0.0-beta.8~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fa375ff44894d9f8d11b888957e9a6ef7ab7d529;p=thirdparty%2FChart.js.git Update TypeScript ESLint configuration (#8288) Using TypeScript-specific ESLint rules fixes some spurious ESLint warnings. --- diff --git a/types/.eslintrc.yml b/types/.eslintrc.yml index 28cb73163..ea2c5e417 100644 --- a/types/.eslintrc.yml +++ b/types/.eslintrc.yml @@ -7,11 +7,16 @@ extends: - chartjs - plugin:@typescript-eslint/recommended -# These rules were set to warning to make the linting pass initially, -# without making any major changes to types. rules: - no-use-before-define: "warn" - no-shadow: "warn" + # Replace stock eslint rules with typescript-eslint equivalents for proper + # TypeScript support. + no-use-before-define: "off" + '@typescript-eslint/no-use-before-define': "error" + no-shadow: "off" + '@typescript-eslint/no-shadow': "error" + + # These rules were set to warning to make the linting pass initially, + # without making any major changes to types. object-curly-spacing: ["warn", "always"] '@typescript-eslint/no-empty-interface': "warn" '@typescript-eslint/ban-types': "warn" diff --git a/types/index.esm.d.ts b/types/index.esm.d.ts index c2bd5a5ad..28f48da17 100644 --- a/types/index.esm.d.ts +++ b/types/index.esm.d.ts @@ -965,7 +965,7 @@ export interface Plugin extends ExtendedPlugin { * @param {Chart} chart - The chart instance. * @param {object} args - The call arguments. * @param {ChartEvent} args.event - The event object. - * @param {boolean} replay - True if this event is replayed from `Chart.update` + * @param {boolean} args.replay - True if this event is replayed from `Chart.update` * @param {object} options - The plugin options. */ beforeEvent?(chart: Chart, args: { event: ChartEvent, replay: boolean }, options: O): boolean | void;