Skip to content

Commit

Permalink
feat: add reasoning of eslint comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Martí Malek committed Jan 12, 2024
1 parent f5afbcf commit ae26805
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ReadCssColorVariable } from '@freenow/wave';

// eslint-disable-next-line @typescript-eslint/ban-types
// eslint-disable-next-line @typescript-eslint/ban-types you can remove this comment and only use the `ReadCssColorVariable` type after changing the bare colors to `getSemanticValue`
export const STATUS: { [K in string]: ReadCssColorVariable | (string & {}) } = {
APPROACH: 'var(--wave-b-color-white)',
AVAILABLE: 'var(--wave-b-color-white)',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { ReadCssColorVariable } from '@freenow/wave';

export interface LabelVariant {
// eslint-disable-next-line @typescript-eslint/ban-types
// eslint-disable-next-line @typescript-eslint/ban-types you can remove this comment and only use the `ReadCssColorVariable` type after changing the bare colors to `getSemanticValue`
color?: ReadCssColorVariable | (string & {})
// eslint-disable-next-line @typescript-eslint/ban-types
// eslint-disable-next-line @typescript-eslint/ban-types you can remove this comment and only use the `ReadCssColorVariable` type after changing the bare colors to `getSemanticValue`
backgroundColor?: ReadCssColorVariable | (string & {})
// eslint-disable-next-line @typescript-eslint/ban-types
// eslint-disable-next-line @typescript-eslint/ban-types you can remove this comment and only use the `ReadCssColorVariable` type after changing the bare colors to `getSemanticValue`
borderColor?: ReadCssColorVariable | (string & {})
}

// eslint-disable-next-line @typescript-eslint/ban-types
// eslint-disable-next-line @typescript-eslint/ban-types you can remove this comment and only use the `ReadCssColorVariable` type after changing the bare colors to `getSemanticValue`
export interface AnotherInterface { color?: ReadCssColorVariable | (string & {}) }
3 changes: 2 additions & 1 deletion src/codemods/colors-to-css-vars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ const ColorsToCssVariablesMap = {

const CSS_VARS_COLORS_TYPE_NAME = 'ReadCssColorVariable';
const CSS_VARS_COLORS_REPLACEMENT_TYPE = `${CSS_VARS_COLORS_TYPE_NAME} | (string & {})`;
const ESLINT_DISABLE_COMMENT = ' eslint-disable-next-line @typescript-eslint/ban-types';
const ESLINT_DISABLE_COMMENT =
' eslint-disable-next-line @typescript-eslint/ban-types you can remove this comment and only use the `ReadCssColorVariable` type after changing the bare colors to `getSemanticValue`';

const replaceColorsForCssVarsInTemplateLiterals = (
j: JSCodeshift,
Expand Down

0 comments on commit ae26805

Please sign in to comment.