Skip to content

Commit

Permalink
Fix eslint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jeppester committed Sep 18, 2024
1 parent 5c60113 commit 057c2e4
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 10 deletions.
5 changes: 1 addition & 4 deletions app/javascript/components/Input/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,10 @@ import classNames from "classnames"
import { Size } from "~/const/size"
import "./index.scss"

const InputVariants = ["default", "error"] as const
export type InputVariant = (typeof InputVariants)[number]

export interface InputProps
extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "size"> {
size?: Size
variant?: InputVariant
variant?: "default" | "error"
}

export default function Input(props: InputProps): JSX.Element {
Expand Down
2 changes: 2 additions & 0 deletions app/javascript/entrypoints/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ require.context("../components", true, /(?<=\.scss)$/) // Only include scss file

// Add application wide CSS, we do this after the components
// because we want tailwind classes to override default component styling
/* eslint-disable @typescript-eslint/no-require-imports */
require("../application.scss")
/* eslint-enable @typescript-eslint/no-require-imports */

// Make components available for react_component helper
const componentsContext = require.context(
Expand Down
4 changes: 2 additions & 2 deletions app/javascript/util/getContrastColor.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// This file uses js and commonjs to be compatible with tailwind config

/* eslint-disable @typescript-eslint/no-var-requires */
/* eslint-disable @typescript-eslint/no-var-requires, @typescript-eslint/no-require-imports */
const getLuminance = require("./getLuminance")
/* eslint-enable @typescript-eslint/no-var-requires */
/* eslint-enable @typescript-eslint/no-var-requires, @typescript-eslint/no-require-imports */

// Based on luminance, pick the best suited contrast color (dark/light) to the target color
module.exports = function getContrastColor(target, dark, light) {
Expand Down
4 changes: 2 additions & 2 deletions app/javascript/util/getLuminance.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// This file uses js and commonjs to be compatible with tailwind config

/* eslint-disable @typescript-eslint/no-var-requires */
/* eslint-disable @typescript-eslint/no-var-requires, @typescript-eslint/no-require-imports */
const colorString = require("color-string")
/* eslint-enable @typescript-eslint/no-var-requires */
/* eslint-enable @typescript-eslint/no-var-requires, @typescript-eslint/no-require-imports */

// The calculation is based on the following algorithm:
// https://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef
Expand Down
4 changes: 2 additions & 2 deletions app/javascript/util/prepareColorVariables.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// This file uses js and commonjs to be compatible with tailwind config

/* eslint-disable @typescript-eslint/no-var-requires */
/* eslint-disable @typescript-eslint/no-var-requires, @typescript-eslint/no-require-imports */
const getContrastColor = require("./getContrastColor")
/* eslint-enable @typescript-eslint/no-var-requires */
/* eslint-enable @typescript-eslint/no-var-requires, @typescript-eslint/no-require-imports */

// Prepare colors for usage in tailwind config and as css variables
module.exports = function prepareColorVariables(jsonColors) {
Expand Down

0 comments on commit 057c2e4

Please sign in to comment.