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

Configure typescript build and lint #5

Merged
merged 2 commits into from
Jul 4, 2024
Merged

Configure typescript build and lint #5

merged 2 commits into from
Jul 4, 2024

Conversation

pes10k
Copy link
Collaborator

@pes10k pes10k commented Jul 4, 2024

Also handled Antons : case for CSS rules, and quoted CSS values

Comment on lines 17 to 18
type UnboundOperatorFunc = (OperatorArg, HTMLElement) => OperatorResult
type OperatorFunc = (HTMLElement) => OperatorResult
Copy link
Collaborator

@antonok-edm antonok-edm Jul 4, 2024

Choose a reason for hiding this comment

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

ERROR in brave-browser/src/brave/components/cosmetic_filters/resources/data/content_cosmetic.ts
./components/cosmetic_filters/resources/data/content_cosmetic.ts 806:30-41
[tsl] ERROR in brave-browser/src/brave/components/cosmetic_filters/resources/data/content_cosmetic.ts(806,31)
      TS7051: Parameter has a name but no type. Did you mean 'arg0: OperatorArg'?

ERROR in brave-browser/src/brave/components/cosmetic_filters/resources/data/content_cosmetic.ts
./components/cosmetic_filters/resources/data/content_cosmetic.ts 806:43-54
[tsl] ERROR in brave-browser/src/brave/components/cosmetic_filters/resources/data/content_cosmetic.ts(806,44)
      TS7051: Parameter has a name but no type. Did you mean 'arg1: HTMLElement'?
ERROR in brave-browser/src/brave/components/cosmetic_filters/resources/data/content_cosmetic.ts
./components/cosmetic_filters/resources/data/content_cosmetic.ts 807:23-34
[tsl] ERROR in brave-browser/src/brave/components/cosmetic_filters/resources/data/content_cosmetic.ts(807,24)
      TS7051: Parameter has a name but no type. Did you mean 'arg0: HTMLElement'?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
type UnboundOperatorFunc = (OperatorArg, HTMLElement) => OperatorResult
type OperatorFunc = (HTMLElement) => OperatorResult
type UnboundOperatorFunc = (arg: OperatorArg, element: HTMLElement) => OperatorResult
type OperatorFunc = (element: HTMLElement) => OperatorResult

type Filter = Operator[]

type NeedlePosition = number
type TextMatchRule = (targetText: string, exact: boolean = false) => boolean
Copy link
Collaborator

@antonok-edm antonok-edm Jul 4, 2024

Choose a reason for hiding this comment

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

ERROR in brave-browser/src/brave/components/cosmetic_filters/resources/data/content_cosmetic.ts
./components/cosmetic_filters/resources/data/content_cosmetic.ts 819:44-66
[tsl] ERROR in brave-browser/src/brave/components/cosmetic_filters/resources/data/content_cosmetic.ts(819,45)
      TS2371: A parameter initializer is only allowed in a function or constructor implementation.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
type TextMatchRule = (targetText: string, exact: boolean = false) => boolean
type TextMatchRule = (targetText: string, exact?: boolean) => boolean

@pes10k pes10k force-pushed the improved-typescript branch from 0a3cd30 to baf9aaa Compare July 4, 2024 16:08
@pes10k pes10k merged commit c07c8a2 into main Jul 4, 2024
1 check passed
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