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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

## [Unreleased](https://github.com/hyparam/hightable/compare/v0.11.0...HEAD)

### Refactored

- Build the library with Vite instead of Rollup ([#63](https://github.com/hyparam/hightable/pull/63)).
- Harmonize the ESLint and Typescript rules with the other hyparam projects ([#63](https://github.com/hyparam/hightable/pull/63)).

## [0.11.0](https://github.com/hyparam/hightable/compare/v0.10.0...v0.11.0) - 2025-02-27

### Added
Expand Down
74 changes: 42 additions & 32 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,48 +1,32 @@
import javascript from '@eslint/js'
import typescriptParser from '@typescript-eslint/parser'
import react from 'eslint-plugin-react'
import reactHooks from 'eslint-plugin-react-hooks'
import globals from 'globals'
import typescript from 'typescript-eslint'

export default [
export default typescript.config(
{ ignores: ['coverage/', 'dist/'] },
{
ignores: ['coverage/', 'dist/'],
},
{
files: ['**/*.ts', '**/*.tsx'],
plugins: {
react,
'react-hooks': reactHooks,
typescript,
},

extends: [javascript.configs.recommended, ...typescript.configs.strictTypeChecked, ...typescript.configs.stylisticTypeChecked],
files: ['**/*.{ts,tsx,js}'],
languageOptions: {
globals: {
...globals.browser,
Babel: 'readonly',
React: 'readonly',
ReactDOM: 'readonly',
},
parser: typescriptParser,
globals: globals.browser,
parserOptions: {
ecmaFeatures: {
jsx: true,
},
project: ['./tsconfig.json', './tsconfig.eslint.json'],
tsconfigRootDir: import.meta.dirname,
},
},
settings: {
react: {
version: 'detect',
},
plugins: {
react,
'react-hooks': reactHooks,
},

rules: {
...javascript.configs.recommended.rules,
...react.configs.recommended.rules,
...react.configs['jsx-runtime'].rules,
...reactHooks.configs.recommended.rules,
...typescript.configs.eslintRecommended.rules,
...javascript.configs.recommended.rules,
...typescript.configs.recommended.rules,
// javascript
'arrow-spacing': 'error',
camelcase: 'off',
'comma-spacing': 'error',
Expand All @@ -60,6 +44,7 @@ export default [
'no-constant-condition': 'off',
'no-extra-parens': 'error',
'no-multi-spaces': 'error',
'no-multiple-empty-lines': ['error', { max: 1, maxEOF: 0 }],
'no-trailing-spaces': 'error',
'no-undef': 'error',
'no-unused-vars': 'off',
Expand All @@ -77,14 +62,39 @@ export default [
quotes: ['error', 'single'],
'require-await': 'warn',
semi: ['error', 'never'],

'sort-imports': ['error', {
ignoreDeclarationSort: true,
ignoreMemberSort: false,
memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],
}],

'space-infix-ops': 'error',
// typescript
'@typescript-eslint/restrict-template-expressions': 'off',
'@typescript-eslint/no-unused-vars': 'warn',
'@typescript-eslint/require-await': 'warn',
// allow using any - see row.ts - it's not easy to replace with unknown for example
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/use-unknown-in-catch-callback-variable': 'off',
'@typescript-eslint/prefer-promise-reject-errors': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
// fix an issue with vi.fn in an object (localStorage mock in our tests): see https://github.com/vitest-dev/eslint-plugin-vitest/issues/591
'@typescript-eslint/unbound-method': 'off',
},
settings: { react: { version: 'detect' } },
},
{
files: ['test/**/*.{ts,tsx}', '*.{js,ts}'],
languageOptions: {
ecmaVersion: 2020,
globals: {
...globals.node,
...globals.browser,
},
},
},
]
{
files: ['**/*.js'],
...typescript.configs.disableTypeChecked,
}
)
26 changes: 15 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,42 +20,46 @@
"type": "git",
"url": "git+https://github.com/hyparam/hightable.git"
},
"main": "dist/HighTable.min.js",
"type": "module",
"exports": {
".": {
"types": "./dist/types/HighTable.d.ts",
"import": "./dist/HighTable.js"
},
"./src/HighTable.css": "./dist/HighTable.css"
},
"files": [
"src",
"dist"
],
"type": "module",
"types": "dist/HighTable.d.ts",
"scripts": {
"build": "rollup -c",
"build:bundle": "vite build",
"build:css": "cp src/HighTable.css dist/HighTable.css",
"build:types": "tsc -b",
"build": "npm run build:bundle && npm run build:types && npm run build:css",
"coverage": "vitest run --coverage --coverage.include=src",
"lint": "eslint",
"prepublishOnly": "npm run build",
"test": "vitest run",
"typecheck": "tsc --noEmit"
},
"devDependencies": {
"@rollup/plugin-commonjs": "28.0.2",
"@rollup/plugin-node-resolve": "16.0.0",
"@rollup/plugin-replace": "6.0.2",
"@rollup/plugin-terser": "0.4.4",
"@rollup/plugin-typescript": "12.1.2",
"@testing-library/react": "16.2.0",
"@testing-library/user-event": "14.6.1",
"@types/node": "22.13.5",
"@types/react": "18.3.18",
"@types/react-dom": "18.3.5",
"@vitejs/plugin-react": "4.3.4",
"@vitest/coverage-v8": "3.0.6",
"eslint": "9.21.0",
"eslint-plugin-react": "7.37.4",
"eslint-plugin-react-hooks": "5.1.0",
"globals": "15.14.0",
"jsdom": "26.0.0",
"react": "18.2.0",
"react-dom": "18.2.0",
"tslib": "2.8.1",
"typescript": "5.7.3",
"typescript-eslint": "8.23.0",
"vite": "6.2.0",
"vitest": "3.0.6"
},
"peerDependencies": {
Expand Down
31 changes: 0 additions & 31 deletions rollup.config.js

This file was deleted.

Loading