Skip to content

Commit

Permalink
Update ESLint plugins
Browse files Browse the repository at this point in the history
- Update to `@typescript-eslint/eslint-plugin@7`.
- Update to `eslint-plugin-jsdoc@48`.
- Update to `eslint-plugin-markdown@4`.
- Update to `eslint-plugin-unicorn@52`.
- Enable rule `@typescript-eslint/class-methods-use-this`.
- Enable rule `unicorn/no-await-in-promise-methods`.
- Enable rule `unicorn/no-single-promise-in-promise-methods`.
- Disble rule `@typescript-eslint/no-throw-literal` for type checking.
- Enable rule `@typescript-eslint/no-array-delete` for type checking.
- Enable rule `@typescript-eslint/no-unsafe-unary-minus` for type checking.
- Enable rule `@typescript-eslint/no-useless-template-literals` for type checking.
- Enable rule `@typescript-eslint/only-throw-error` for type checking.
- Enable rule `@typescript-eslint/prefer-destructuring` for type checking.
- Enable rule `@typescript-eslint/prefer-find` for type checking.
- Enable rule `@typescript-eslint/prefer-promise-reject-errors` for type checking.
- Enable rule `@typescript-eslint/use-unknown-in-catch-callback-variable` for type checking.
  • Loading branch information
remcohaszing committed Apr 6, 2024
1 parent d8e789b commit 14d40ae
Show file tree
Hide file tree
Showing 15 changed files with 731 additions and 424 deletions.
4 changes: 2 additions & 2 deletions examples/babel-react/src/index.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'bulma/css/bulma.css'
import { render } from 'react-dom'
import { createRoot } from 'react-dom/client.js'

import { App } from './components/App/index.js'

render(<App />, document.getElementById('app'))
createRoot(document.getElementById('app')).render(<App />)
2 changes: 1 addition & 1 deletion examples/typescript-preact/src/components/Button/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ interface ButtonProps extends ComponentProps<'button'> {
/**
* An optional class name for the button.
*/
className?: string
readonly className?: string
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ interface ErrorHandlerProps {
/**
* The elements to try to render.
*/
children: ComponentChildren
readonly children: ComponentChildren
}

interface State {
Expand Down
10 changes: 5 additions & 5 deletions examples/typescript-preact/src/components/Input/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,29 @@ interface InputProps {
/**
* The label to render for the input.
*/
label: ComponentChild
readonly label: ComponentChild

/**
* The name of the input field.
*
* This will also be used as the id.
*/
name: string
readonly name: string

/**
* The event handler to call when the input changes.
*/
onChange: JSX.GenericEventHandler<HTMLInputElement>
readonly onChange: JSX.GenericEventHandler<HTMLInputElement>

/**
* The input type.
*/
type?: 'text' | 'url'
readonly type?: 'text' | 'url'

/**
* The current value of the input.
*/
value: string
readonly value: string
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ interface ItemFormProps {
/**
* Called when the form is submitted
*/
onSubmit: (item: Item) => unknown
readonly onSubmit: (item: Item) => unknown
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ interface ErrorHandlerProps {
/**
* The elements to try to render.
*/
children: ReactNode
readonly children: ReactNode
}

interface State {
Expand Down
10 changes: 5 additions & 5 deletions examples/typescript-react/src/components/Input/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,29 @@ interface InputProps {
/**
* The label to render for the input.
*/
label: ReactNode
readonly label: ReactNode

/**
* The name of the input field.
*
* This will also be used as the id.
*/
name: string
readonly name: string

/**
* The event handler to call when the input changes.
*/
onChange: ChangeEventHandler<HTMLInputElement>
readonly onChange: ChangeEventHandler<HTMLInputElement>

/**
* The input type.
*/
type?: 'text' | 'url'
readonly type?: 'text' | 'url'

/**
* The current value of the input.
*/
value: string
readonly value: string
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ interface ItemFormProps {
/**
* Called when the form is submitted
*/
onSubmit: (item: Item) => unknown
readonly onSubmit: (item: Item) => unknown
}

/**
Expand Down
Loading

0 comments on commit 14d40ae

Please sign in to comment.