target baseline, lightningcss tweaks, eslint updates, eslint.config.ts, remove 3 @ts-expect-error#4032
target baseline, lightningcss tweaks, eslint updates, eslint.config.ts, remove 3 @ts-expect-error#4032
eslint.config.ts, remove 3 @ts-expect-error#4032Conversation
…ts`, remove 3 `@ts-expect-error`
| "eslint.options": { | ||
| "flags": ["unstable_native_nodejs_ts_config"] | ||
| }, | ||
| "eslint.problems.shortenToSingleLine": true, |
There was a problem hiding this comment.
Now lints won't span multiple lines anymore, which was inconvenient.
https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint
| function rowGrouper(rows: readonly Row[], columnKey: string) { | ||
| // @ts-expect-error | ||
| return Object.groupBy(rows, (r) => r[columnKey]) as Record<string, readonly R[]>; | ||
| return Object.groupBy(rows, (r) => r[columnKey as keyof Row]) as Record<string, readonly Row[]>; |
There was a problem hiding this comment.
We used an incorrect R type, which these 3 @ts-expect-errors hid from us
| // https://react.dev/reference/eslint-plugin-react-hooks | ||
| 'react-hooks/rules-of-hooks': 1, | ||
| 'react-hooks/exhaustive-deps': 1, | ||
| 'react-hooks/component-hook-factories': 1, |
There was a problem hiding this comment.
This rule is deprecated and a no-op
facebook/react@bc24980
| '@eslint-react/jsx-no-useless-fragment': [1, { allowExpressions: false }], | ||
| '@eslint-react/jsx-no-key-after-spread': 1, | ||
| '@eslint-react/jsx-no-leaked-dollar': 1, | ||
| '@eslint-react/jsx-no-leaked-semicolon': 1, |
There was a problem hiding this comment.
| const isEditable = isCellEditableUtil(column, row); | ||
|
|
||
| function setActivePositionWrapper(enableEditor?: boolean) { | ||
| function setActivePositionWrapper(enableEditor = false) { |
There was a problem hiding this comment.
Caught by sonarjs/bool-param-default, decided to keep this rule enabled.
|
|
||
| export default defineConfig({ | ||
| outDir: 'lib', | ||
| target: ['baseline-widely-available', 'node24.0.0'], |
There was a problem hiding this comment.
They've added support for baseline-widely-available so I've added it.
Also added node 24 as it's the current LTS version.
There's 0 difference in the output of index.js/index.js.map/index.d.ts.
https://github.com/rolldown/tsdown/releases
ℹ targets: chrome111, edge111, firefox114, safari16.4, ios16.4, node24.0.0
There was a problem hiding this comment.
| lightningcss: { | ||
| // https://github.com/parcel-bundler/lightningcss/issues/873 | ||
| exclude: Features.Nesting | Features.LightDark | ||
| } |
There was a problem hiding this comment.
Instead of changing the css.target to not break light-dark(), I've set this lightningcss configuration.
https://tsdown.dev/options/css#css-target
https://tsdown.dev/options/css#lightning-css
The only before/after difference is this:
Safari only supports the prefixed property, so this is actually a bug fix!
| build: { | ||
| modulePreload: { polyfill: false }, | ||
| sourcemap: true, | ||
| reportCompressedSize: false, |
There was a problem hiding this comment.
Vite is fast now, so I removed reportCompressedSize: false
| groups: [ | ||
| { | ||
| name: 'faker', | ||
| test: '@faker-js/faker' |
There was a problem hiding this comment.
Faker is the biggest dependency we have, and it doesn't get updates too often, might be worth splitting it into its own chunk.
dist/assets/faker-DefjNDsx.js 410.66 kB │ gzip: 153.89 kB │ map: 696.97 kB
https://rolldown.rs/in-depth/manual-code-splitting#improve-loading-performance
Wonder if we should split react/react-dom together too 🤔
| lightningcss: { | ||
| // https://github.com/parcel-bundler/lightningcss/issues/873 | ||
| exclude: Features.Nesting | Features.LightDark | ||
| } |
There was a problem hiding this comment.
Applied the same lightningcss strategy here to fix the missing -webkit-user-select property.
|
|
||
| export default defineConfig({ | ||
| outDir: 'lib', | ||
| target: ['baseline-widely-available', 'node24.0.0'], |
There was a problem hiding this comment.
eslint.config.js->eslint.config.ts