Skip to content
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

fix: eslint #32

Merged
merged 1 commit into from
Nov 11, 2024
Merged

fix: eslint #32

merged 1 commit into from
Nov 11, 2024

Conversation

nabalone
Copy link
Collaborator

@nabalone nabalone commented Nov 7, 2024

This change is Reviewable

@nabalone nabalone force-pushed the eslint branch 2 times, most recently from 8a8374b to c215dda Compare November 7, 2024 23:33
@@ -60,7 +60,7 @@ export function deepStripDemarcation<T>(demarcated: T): T {
return demarcated.map((element) => deepStripDemarcation(element)) as T;
}
if (typeof demarcated === "object") {
const newObject = {} as any;
const newObject: any = {};
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these anys okay? Also on line 65. Would it be better to create a new interface e.g.
`
interface Foo {
[key: string]: T;
} and if so what should it be called? Seems like a lot of code for something so small?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok with me.

@@ -7,10 +7,11 @@
"main": "./index.js",
"types": "./index.d.ts",
"scripts": {
"langtag-processing": "ts-node-esm ./langtagProcessing.ts",
"langtag-processing": "tsx ./langtagProcessing.ts",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even if we're going sticking with node 18 for now, I figure we might as well keep this change so that we can upgrade node in the future

import { PartiallyBoldedTypography } from "./PartiallyBoldedTypography";
import { COLORS } from "./colors";

const COMMA_SEPARATOR = ", ";

export const LanguageCard: React.FunctionComponent<
{ languageCardData: ILanguage } & OptionCardPropsWithoutColors
> = memo(({ languageCardData, ...partialOptionCardProps }) => {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

memo was not making a noticeable difference in speed now that we lazyload

import eslintConfigPrettier from "eslint-config-prettier";
import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended";
// import eslintPluginReactHooks from "eslint-plugin-react-hooks";
// TODO future work: eslint-plugin-react-hooks support for flat-config looks like it's on it's way:
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I put adding eslint-plugin-react-hooks into the kanban

},
},
].map((c) => {
return { ...c, files: ["**/*.{jsx,mjsx,tsx,mtsx}"] };
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can also limit things to folders, i.e. files: ["components/language-chooser/react/**/*/.{jsx,mjsx,tsx,mtsx}"]. Should we talk more about how to setup what eslint rules apply to where?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy to discuss if that's helpful. But applying react rules to react files makes sense.

@@ -0,0 +1,85 @@
// @ts-check
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should live-review this file? Let me know if you think that would be helpful

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it is necessary. But happy to discuss if that helps.

@nabalone
Copy link
Collaborator Author

nabalone commented Nov 7, 2024

Ready for review

Copy link
Contributor

@andrew-polk andrew-polk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 18 of 18 files at r1, all commit messages.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @nabalone)


components/language-chooser/common/find-language/package.json line 29 at r1 (raw file):

  "// We've tested with 18 and have no reason to believe it won't work with higher versions": "",
  "engines": {
    "node": ">=22.11.0"

Is this intentional? I thought we wanted to keep this as low as possible.

Same for the other package.jsons.

If we do want to keep this for some reason, the comments should be updated.

@@ -0,0 +1,85 @@
// @ts-check
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it is necessary. But happy to discuss if that helps.

},
},
].map((c) => {
return { ...c, files: ["**/*.{jsx,mjsx,tsx,mtsx}"] };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy to discuss if that's helpful. But applying react rules to react files makes sense.

@@ -60,7 +60,7 @@ export function deepStripDemarcation<T>(demarcated: T): T {
return demarcated.map((element) => deepStripDemarcation(element)) as T;
}
if (typeof demarcated === "object") {
const newObject = {} as any;
const newObject: any = {};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok with me.

Copy link
Collaborator Author

@nabalone nabalone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 14 of 18 files reviewed, 4 unresolved discussions (waiting on @andrew-polk)


components/language-chooser/common/find-language/package.json line 29 at r1 (raw file):

Previously, andrew-polk wrote…

Is this intentional? I thought we wanted to keep this as low as possible.

Same for the other package.jsons.

If we do want to keep this for some reason, the comments should be updated.

I must have forgotten, why do want to keep it as low as possible again? Our current @typescript-eslint wants at least 18.18 so we can use that

@@ -7,10 +7,11 @@
"main": "./index.js",
"types": "./index.d.ts",
"scripts": {
"langtag-processing": "ts-node-esm ./langtagProcessing.ts",
"langtag-processing": "tsx ./langtagProcessing.ts",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even if we're going sticking with node 18 for now, I figure we might as well keep this change so that we can upgrade node in the future

Copy link
Contributor

@andrew-polk andrew-polk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 4 of 4 files at r2, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions


components/language-chooser/common/find-language/package.json line 29 at r1 (raw file):

Previously, nabalone (Noel) wrote…

I must have forgotten, why do want to keep it as low as possible again? Our current @typescript-eslint wants at least 18.18 so we can use that

Unless I'm mistaken, that is the lowest version of a node a client can use.
We don't want to force libraries to the latest without a reason.

Copy link
Contributor

@andrew-polk andrew-polk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @nabalone)

@andrew-polk andrew-polk merged commit 27a34ca into main Nov 11, 2024
1 check passed
@andrew-polk andrew-polk deleted the eslint branch November 11, 2024 23:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants