Skip to content

Commit ae26805

Browse files
author
Martí Malek
committed
feat: add reasoning of eslint comment
1 parent f5afbcf commit ae26805

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

src/codemods/__testfixtures__/colors-to-css-vars/colors-as-mapped-type.output.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { ReadCssColorVariable } from '@freenow/wave';
22

3-
// eslint-disable-next-line @typescript-eslint/ban-types
3+
// 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`
44
export const STATUS: { [K in string]: ReadCssColorVariable | (string & {}) } = {
55
APPROACH: 'var(--wave-b-color-white)',
66
AVAILABLE: 'var(--wave-b-color-white)',
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import { ReadCssColorVariable } from '@freenow/wave';
22

33
export interface LabelVariant {
4-
// eslint-disable-next-line @typescript-eslint/ban-types
4+
// 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`
55
color?: ReadCssColorVariable | (string & {})
6-
// eslint-disable-next-line @typescript-eslint/ban-types
6+
// 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`
77
backgroundColor?: ReadCssColorVariable | (string & {})
8-
// eslint-disable-next-line @typescript-eslint/ban-types
8+
// 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`
99
borderColor?: ReadCssColorVariable | (string & {})
1010
}
1111

12-
// eslint-disable-next-line @typescript-eslint/ban-types
12+
// 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`
1313
export interface AnotherInterface { color?: ReadCssColorVariable | (string & {}) }

src/codemods/colors-to-css-vars.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ const ColorsToCssVariablesMap = {
4848

4949
const CSS_VARS_COLORS_TYPE_NAME = 'ReadCssColorVariable';
5050
const CSS_VARS_COLORS_REPLACEMENT_TYPE = `${CSS_VARS_COLORS_TYPE_NAME} | (string & {})`;
51-
const ESLINT_DISABLE_COMMENT = ' eslint-disable-next-line @typescript-eslint/ban-types';
51+
const ESLINT_DISABLE_COMMENT =
52+
' 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`';
5253

5354
const replaceColorsForCssVarsInTemplateLiterals = (
5455
j: JSCodeshift,

0 commit comments

Comments
 (0)