Skip to content

Commit

Permalink
Upgrade to chartjs v4 and fix bugs (#170)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
santam85 and benmccann authored Mar 23, 2024
1 parent d200a1a commit e898295
Show file tree
Hide file tree
Showing 25 changed files with 5,019 additions and 3,610 deletions.
38 changes: 32 additions & 6 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,61 @@
extends:
- chartjs
- plugin:es/no-new-in-es2019
- plugin:es/restrict-to-es2018
- plugin:markdown/recommended

settings:
es:
aggressive: true

env:
es6: true
browser: true
jasmine: true
node: true

parserOptions:
ecmaVersion: 2018
ecmaVersion: 2022
sourceType: module
ecmaFeatures:
impliedStrict: true
modules: true
experimentalObjectRestSpread: true

plugins: ['html', 'es']


rules:
class-methods-use-this: "off"
complexity: ["warn", 10]
indent: ["error", "tab"]
max-statements: ["warn", 30]
no-empty-function: "off"
no-use-before-define: ["error", { "functions": false }]
# disable everything, except Rest/Spread Properties in ES2018
es/no-import-meta: "off"
es/no-async-iteration: "error"
es/no-malformed-template-literals: "error"
es/no-regexp-lookbehind-assertions: "error"
es/no-regexp-named-capture-groups: "error"
es/no-regexp-s-flag: "error"
es/no-regexp-unicode-property-escapes: "error"
es/no-dynamic-import: "off"

overrides:
- files: ['**/*.ts']
parser: '@typescript-eslint/parser'
plugins:
- '@typescript-eslint'
extends:
- chartjs
- plugin:@typescript-eslint/recommended

rules:
complexity: ["warn", 10]
max-statements: ["warn", 30]
# Replace stock eslint rules with typescript-eslint equivalents for proper
# TypeScript support.
indent: "off"
"@typescript-eslint/indent": ["error", 2]
no-use-before-define: "off"
'@typescript-eslint/no-use-before-define': "error"
no-shadow: "off"
'@typescript-eslint/no-shadow': "error"
space-before-function-paren: "off"
'@typescript-eslint/space-before-function-paren': [2, never]
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '14'
node-version: 'lts/*'
cache: npm
- uses: dorny/paths-filter@v3
id: changes
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '14.x'
node-version: 'lts/*'
registry-url: https://registry.npmjs.org/
cache: npm
- name: Setup and build
Expand Down
19 changes: 0 additions & 19 deletions .travis.yml

This file was deleted.

2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ Chart.js 2.9.0 added [improved autoskipping](https://github.com/chartjs/Chart.js

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

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.

## Comparison

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

0 comments on commit e898295

Please sign in to comment.