]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Update TypeScript ESLint configuration (#8288)
authorJosh Kelley <joshkel@gmail.com>
Fri, 8 Jan 2021 21:01:20 +0000 (16:01 -0500)
committerGitHub <noreply@github.com>
Fri, 8 Jan 2021 21:01:20 +0000 (16:01 -0500)
Using TypeScript-specific ESLint rules fixes some spurious ESLint warnings.

types/.eslintrc.yml
types/index.esm.d.ts

index 28cb73163ce74043c470712e931a866700f11fa8..ea2c5e41787b3fe4478fcc0ece6533f7696c8e4e 100644 (file)
@@ -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"
index c2bd5a5ad9609ef9ef9a2c2c4d7ce223660e68c7..28f48da1713f7e1e5cdad5f3d210bcb6d4fb8b1b 100644 (file)
@@ -965,7 +965,7 @@ export interface Plugin<O = {}> 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;