Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 0 additions & 42 deletions .eslintrc.yml

This file was deleted.

6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: 14
node-version: 24
- name: Setup and build
run: |
npm ci
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ jobs:
publish-npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: 14
node-version: 24
registry-url: https://registry.npmjs.org/
- name: Setup and build
run: |
Expand Down
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,17 @@ Chart.js test utils package. For usage examples, take a look at these repositori
- [Chart.js](https://github.com/chartjs/Chart.js)
- [chartjs-plugin-annotation](https://github.com/chartjs/chartjs-plugin-annotation)
- [chartjs-plugin-datalabels](https://github.com/chartjs/chartjs-plugin-datalabels)

## Development

Linting and formatting are done by [Biome](https://biomejs.dev/), configured in
`biome.jsonc`:

```sh
npm run lint # check formatting and lint rules
npm run format # apply the safe fixes
```

The formatter settings mirror the `eslint-config-chartjs` style rules it
replaced, so the formatter agrees with the existing sources rather than
restyling them.
87 changes: 87 additions & 0 deletions biome.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
{
"$schema": "https://biomejs.dev/schemas/2.5.13/schema.json",
// Biome replaces eslint, eslint-config-chartjs and eslint-plugin-es here.
// The formatter settings below are the eslint-config-chartjs style rules
// (2-space indent, single quotes, semicolons, no spacing inside braces),
// so that adopting the formatter is not also a restyling of the sources.
"files": {
"includes": ["**/*.js", "**/*.json", "**/*.jsonc", "!dist", "!package-lock.json"]
},
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 2,
// eslint had `max-len` off; this only wraps what is already very long.
"lineWidth": 120
},
"javascript": {
"formatter": {
"arrowParentheses": "always",
// object-curly-spacing: never
"bracketSpacing": false,
// quotes: single, avoidEscape
"quoteStyle": "single",
// semi: always
"semicolons": "always",
// comma-dangle: only-multiline -- never adding one keeps the diff small
"trailingCommas": "none"
}
},
"json": {
"formatter": {
"trailingCommas": "none"
}
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"complexity": {
// eslint: complexity [2, 10]. Cognitive complexity is a different
// measure, so the threshold is not the same number.
"noExcessiveCognitiveComplexity": {
"level": "warn",
"options": { "maxAllowedComplexity": 15 }
},
// The sources are written in the ES5 style Karma-era Chart.js used:
// `var`, `function () {}` callbacks, `arguments`, string concatenation.
// Modernizing them is a code change, not a tooling change, so these
// stay off until someone makes it deliberately.
"noArguments": "off",
"useArrowFunction": "off",
"useDateNow": "off",
"useOptionalChain": "off"
},
"correctness": {
// Same reason: this reports `var` declared inside a block.
"noInnerDeclarations": "off"
},
"style": {
// eslint: curly [2, all]
"useBlockStatements": "error",
"useTemplate": "off"
},
"suspicious": {
// eslint: no-console [2, {allow: [warn, error]}]
"noConsole": {
"level": "error",
"options": { "allow": ["warn", "error"] }
},
// `isNaN` and `Number.isNaN` do not answer the same question: the
// global coerces, and the matchers rely on that.
"noGlobalIsFinite": "off",
"noGlobalIsNan": "off",
// The code already uses the safe `Object.prototype.hasOwnProperty.call`
// form; the rule only wants the newer `Object.hasOwn`.
"noPrototypeBuiltins": "off"
}
}
},
"assist": {
"actions": {
"source": {
"organizeImports": "on"
}
}
}
}
Loading