-
Notifications
You must be signed in to change notification settings - Fork 2.2k
target baseline, lightningcss tweaks, eslint updates, eslint.config.ts, remove 3 @ts-expect-error
#4032
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
target baseline, lightningcss tweaks, eslint updates, eslint.config.ts, remove 3 @ts-expect-error
#4032
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -255,10 +255,10 @@ export default defineConfig([ | |
| 'unicode-bom': 1, | ||
|
|
||
| // React Hooks | ||
| // https://www.npmjs.com/package/eslint-plugin-react-hooks | ||
| // https://github.com/facebook/react/tree/main/packages/eslint-plugin-react-hooks | ||
| // 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, | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This rule is deprecated and a no-op |
||
| 'react-hooks/config': 1, | ||
| 'react-hooks/error-boundaries': 1, | ||
| 'react-hooks/gating': 1, | ||
|
|
@@ -365,9 +365,11 @@ copy( | |
| '@eslint-react/jsx-no-children-prop': 1, | ||
| '@eslint-react/jsx-no-children-prop-with-children': 1, | ||
| '@eslint-react/jsx-no-comment-textnodes': 1, | ||
| '@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, | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| '@eslint-react/jsx-no-namespace': 1, | ||
| '@eslint-react/jsx-no-useless-fragment': [1, { allowExpressions: false }], | ||
| '@eslint-react/rsc-function-definition': 1, | ||
| '@eslint-react/dom-no-dangerously-set-innerhtml': 1, | ||
| '@eslint-react/dom-no-dangerously-set-innerhtml-with-children': 1, | ||
|
|
@@ -395,7 +397,7 @@ copy( | |
| '@eslint-react/naming-convention-ref-name': 1, | ||
|
|
||
| // SonarJS rules | ||
| // https://github.com/SonarSource/SonarJS/blob/master/packages/jsts/src/rules/README.md#rules | ||
| // https://github.com/SonarSource/SonarJS/blob/master/packages/analysis/src/jsts/rules/README.md#rules | ||
| /* | ||
| // copy all the rules from the rules table for easy pasting | ||
| copy( | ||
|
|
@@ -442,11 +444,12 @@ copy( | |
| 'sonarjs/aws-sqs-unencrypted-queue': 0, | ||
| 'sonarjs/bitwise-operators': 1, | ||
| 'sonarjs/block-scoped-var': 1, | ||
| 'sonarjs/bool-param-default': 0, | ||
| 'sonarjs/bool-param-default': 1, | ||
| 'sonarjs/call-argument-line': 1, | ||
| 'sonarjs/chai-determinate-assertion': 1, | ||
| 'sonarjs/class-name': 1, | ||
| 'sonarjs/class-prototype': 1, | ||
| 'sonarjs/code-eval': 1, | ||
| 'sonarjs/cognitive-complexity': 0, | ||
| 'sonarjs/comma-or-logical-or-case': 1, | ||
| 'sonarjs/comment-regex': 1, | ||
|
|
@@ -466,6 +469,7 @@ copy( | |
| 'sonarjs/disabled-auto-escaping': 1, | ||
| 'sonarjs/disabled-resource-integrity': 1, | ||
| 'sonarjs/disabled-timeout': 1, | ||
| 'sonarjs/dompurify-unsafe-config': 1, | ||
| 'sonarjs/duplicates-in-character-class': 1, | ||
| 'sonarjs/dynamically-constructed-templates': 1, | ||
| 'sonarjs/elseif-without-else': 0, | ||
|
|
@@ -517,7 +521,7 @@ copy( | |
| 'sonarjs/no-code-after-done': 1, | ||
| 'sonarjs/no-collapsible-if': 1, | ||
| 'sonarjs/no-collection-size-mischeck': 1, | ||
| 'sonarjs/no-commented-code': 0, | ||
| 'sonarjs/no-commented-code': 1, | ||
| 'sonarjs/no-control-regex': 1, | ||
| 'sonarjs/no-dead-store': 1, | ||
| 'sonarjs/no-delete-var': 1, | ||
|
|
@@ -598,7 +602,6 @@ copy( | |
| 'sonarjs/no-undefined-assignment': 0, | ||
| 'sonarjs/no-unenclosed-multiline-block': 1, | ||
| 'sonarjs/no-uniq-key': 1, | ||
| 'sonarjs/no-unsafe-unzip': 1, | ||
| 'sonarjs/no-unthrown-error': 1, | ||
| 'sonarjs/no-unused-collection': 1, | ||
| 'sonarjs/no-unused-function-argument': 1, | ||
|
|
@@ -617,7 +620,6 @@ copy( | |
| 'sonarjs/null-dereference': 1, | ||
| 'sonarjs/object-alt-content': 1, | ||
| 'sonarjs/operation-returning-nan': 1, | ||
| 'sonarjs/os-command': 1, | ||
| 'sonarjs/post-message': 1, | ||
| 'sonarjs/prefer-default-last': 1, | ||
| 'sonarjs/prefer-immediate-return': 1, | ||
|
|
@@ -1028,21 +1030,6 @@ copy( | |
| } | ||
| }, | ||
|
|
||
| { | ||
| name: 'node', | ||
|
|
||
| files: ['**/*.js'], | ||
|
|
||
| rules: { | ||
| // Best Practices | ||
| 'default-param-last': 1, | ||
| // Possible Errors | ||
| 'no-console': 0, | ||
| 'no-undef': 1, | ||
| 'no-use-before-define': [1, { functions: false, classes: false, variables: false }] | ||
| } | ||
| }, | ||
|
|
||
| { | ||
| name: 'markdown', | ||
| files: ['**/*.md'], | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -45,7 +45,7 @@ function Cell<R, SR>({ | |
| ); | ||
| const isEditable = isCellEditableUtil(column, row); | ||
|
|
||
| function setActivePositionWrapper(enableEditor?: boolean) { | ||
| function setActivePositionWrapper(enableEditor = false) { | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Caught by |
||
| setActivePosition({ rowIdx, idx: column.idx }, { enableEditor }); | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -123,8 +123,7 @@ function TestGrid({ | |
| } | ||
|
|
||
| function rowGrouper(rows: readonly Row[], columnKey: string) { | ||
|
amanmahajan7 marked this conversation as resolved.
|
||
| // @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[]>; | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We used an incorrect |
||
| } | ||
|
|
||
| function setup(groupBy: string[], groupIdGetter?: (groupKey: string, parentId?: string) => string) { | ||
|
|
||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| { | ||
| "extends": "./tsconfig.base.json", | ||
| "compilerOptions": { | ||
| "lib": ["ESNext"], | ||
| "module": "NodeNext" | ||
| }, | ||
| "include": ["eslint.config.ts"] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,17 +1,23 @@ | ||
| import { ecij } from 'ecij/plugin'; | ||
| import { Features } from 'lightningcss'; | ||
| import { defineConfig } from 'tsdown'; | ||
|
|
||
| import pkg from './package.json' with { type: 'json' }; | ||
|
|
||
| export default defineConfig({ | ||
| outDir: 'lib', | ||
| target: ['baseline-widely-available', 'node24.0.0'], | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. They've added support for
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| platform: 'neutral', | ||
| sourcemap: true, | ||
| deps: { | ||
| skipNodeModulesBundle: true | ||
| }, | ||
| css: { | ||
| fileName: 'styles.css' | ||
| fileName: 'styles.css', | ||
| lightningcss: { | ||
| // https://github.com/parcel-bundler/lightningcss/issues/873 | ||
| exclude: Features.Nesting | Features.LightDark | ||
| } | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of changing the https://tsdown.dev/options/css#css-target The only before/after difference is this:
Safari only supports the prefixed property, so this is actually a bug fix! |
||
| }, | ||
| dts: { | ||
| build: true, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,7 @@ import { tanstackRouter } from '@tanstack/router-plugin/vite'; | |
| import react from '@vitejs/plugin-react'; | ||
| import { playwright, type PlaywrightProviderOptions } from '@vitest/browser-playwright'; | ||
| import { ecij } from 'ecij/plugin'; | ||
| import { Features } from 'lightningcss'; | ||
| import { defineConfig, type ViteUserConfig } from 'vitest/config'; | ||
| import type { BrowserCommand } from 'vitest/node'; | ||
|
|
||
|
|
@@ -56,9 +57,24 @@ export default defineConfig( | |
| build: { | ||
| modulePreload: { polyfill: false }, | ||
| sourcemap: true, | ||
| reportCompressedSize: false, | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Vite is fast now, so I removed |
||
| // https://github.com/parcel-bundler/lightningcss/issues/873 | ||
| cssTarget: 'esnext' | ||
| rolldownOptions: { | ||
| output: { | ||
| codeSplitting: { | ||
| groups: [ | ||
| { | ||
| name: 'faker', | ||
| test: '@faker-js/faker' | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Faker is the biggest dependency we have, and it doesn't get updates too often, might be worth splitting it into its own chunk. https://rolldown.rs/in-depth/manual-code-splitting#improve-loading-performance Wonder if we should split react/react-dom together too 🤔 |
||
| } | ||
| ] | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| css: { | ||
| lightningcss: { | ||
| // https://github.com/parcel-bundler/lightningcss/issues/873 | ||
| exclude: Features.Nesting | Features.LightDark | ||
| } | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Applied the same lightningcss strategy here to fix the missing |
||
| }, | ||
| plugins: isPreview | ||
| ? [] | ||
|
|
||

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now lints won't span multiple lines anymore, which was inconvenient.
https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint