Skip to content

Commit e898295

Browse files
santam85benmccann
andauthored
Upgrade to chartjs v4 and fix bugs (#170)
* Upgrade to chartjs v4 and fix bugs * Use node LTS * Fix tests * Fix coverage * Add Firefox tests * Reduce complexity * Replace var * Fixed html indentation as per PR comments * Update docs/index.html Co-authored-by: Ben McCann <[email protected]> * Fixed doc comments indentation * Fixed html indentation as per PR comments * Added info on README --------- Co-authored-by: Ben McCann <[email protected]>
1 parent d200a1a commit e898295

25 files changed

+5019
-3610
lines changed

.eslintrc.yml

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,61 @@
11
extends:
22
- chartjs
3-
- plugin:es/no-new-in-es2019
3+
- plugin:es/restrict-to-es2018
4+
- plugin:markdown/recommended
5+
6+
settings:
7+
es:
8+
aggressive: true
49

510
env:
611
es6: true
712
browser: true
8-
jasmine: true
913
node: true
1014

1115
parserOptions:
12-
ecmaVersion: 2018
16+
ecmaVersion: 2022
1317
sourceType: module
1418
ecmaFeatures:
1519
impliedStrict: true
1620
modules: true
17-
experimentalObjectRestSpread: true
1821

1922
plugins: ['html', 'es']
2023

21-
2224
rules:
2325
class-methods-use-this: "off"
2426
complexity: ["warn", 10]
25-
indent: ["error", "tab"]
2627
max-statements: ["warn", 30]
2728
no-empty-function: "off"
2829
no-use-before-define: ["error", { "functions": false }]
2930
# disable everything, except Rest/Spread Properties in ES2018
31+
es/no-import-meta: "off"
3032
es/no-async-iteration: "error"
3133
es/no-malformed-template-literals: "error"
3234
es/no-regexp-lookbehind-assertions: "error"
3335
es/no-regexp-named-capture-groups: "error"
3436
es/no-regexp-s-flag: "error"
3537
es/no-regexp-unicode-property-escapes: "error"
38+
es/no-dynamic-import: "off"
39+
40+
overrides:
41+
- files: ['**/*.ts']
42+
parser: '@typescript-eslint/parser'
43+
plugins:
44+
- '@typescript-eslint'
45+
extends:
46+
- chartjs
47+
- plugin:@typescript-eslint/recommended
48+
49+
rules:
50+
complexity: ["warn", 10]
51+
max-statements: ["warn", 30]
52+
# Replace stock eslint rules with typescript-eslint equivalents for proper
53+
# TypeScript support.
54+
indent: "off"
55+
"@typescript-eslint/indent": ["error", 2]
56+
no-use-before-define: "off"
57+
'@typescript-eslint/no-use-before-define': "error"
58+
no-shadow: "off"
59+
'@typescript-eslint/no-shadow': "error"
60+
space-before-function-paren: "off"
61+
'@typescript-eslint/space-before-function-paren': [2, never]

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- name: Use Node.js
2626
uses: actions/setup-node@v4
2727
with:
28-
node-version: '14'
28+
node-version: 'lts/*'
2929
cache: npm
3030
- uses: dorny/paths-filter@v3
3131
id: changes

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- uses: actions/checkout@v4
2323
- uses: actions/setup-node@v4
2424
with:
25-
node-version: '14.x'
25+
node-version: 'lts/*'
2626
registry-url: https://registry.npmjs.org/
2727
cache: npm
2828
- name: Setup and build

.travis.yml

Lines changed: 0 additions & 19 deletions
This file was deleted.

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ Chart.js 2.9.0 added [improved autoskipping](https://github.com/chartjs/Chart.js
1818

1919
Chart.js 3.0.0 removed the need for custom scales, which means logarithmic scale is now supported. It also has numerous performance improvements.
2020

21+
Chart.js 4.0.0 has some breaking changes that required modifying this library configuration. Check the updated examples to see which changes are necessary.
22+
2123
## Comparison
2224

2325
We are aiming to make Chart.js the only popular JavaScript library that is both performant and has good timescale handling.

0 commit comments

Comments
 (0)