From ea9a35f3a9de1a16c514c64098b0d4154587e323 Mon Sep 17 00:00:00 2001 From: otzelpov Date: Fri, 6 Oct 2023 10:18:47 +0200 Subject: [PATCH 1/5] #9 Add word-wrap to obsolete rules --- src/rules/no-obsolete/option.ts | 6 +----- tests/no-obsolete.spec.ts | 2 +- tests/providers/no-obsolete.css | 1 + 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/rules/no-obsolete/option.ts b/src/rules/no-obsolete/option.ts index a071c1b..3f6d77d 100644 --- a/src/rules/no-obsolete/option.ts +++ b/src/rules/no-obsolete/option.ts @@ -224,12 +224,8 @@ export const defaultOptions : Options = { name: { - search: 'word-break', + search: 'word-wrap', replace: 'overflow-wrap' - }, - value: - { - search: 'break-word' } }, { diff --git a/tests/no-obsolete.spec.ts b/tests/no-obsolete.spec.ts index 283c1df..f3c4bdb 100644 --- a/tests/no-obsolete.spec.ts +++ b/tests/no-obsolete.spec.ts @@ -35,7 +35,7 @@ describe('no-obsolete', () => 'Unexpected "scroll-snap-type-y" property', 'Unexpected "text-decoration" value "blink"', 'Unexpected "text-decoration-line" value "blink"', - 'Expected "word-break" property to be "overflow-wrap"', + 'Expected "word-wrap" property to be "overflow-wrap"', 'Unexpected "user-modify" property' ] .map((message, index) => diff --git a/tests/providers/no-obsolete.css b/tests/providers/no-obsolete.css index 5190520..6c482c5 100644 --- a/tests/providers/no-obsolete.css +++ b/tests/providers/no-obsolete.css @@ -57,5 +57,6 @@ text-decoration-line: blink; word-break: break-word; user-modify: unset; + word-wrap: normal; } From 553cf18385bbe65ecd9e8ebb5eb99bd933724f83 Mon Sep 17 00:00:00 2001 From: otzelpov Date: Fri, 6 Oct 2023 10:57:59 +0200 Subject: [PATCH 2/5] #9 fixup --- src/rules/no-obsolete/option.ts | 15 +++++++++++++-- tests/no-obsolete.spec.ts | 5 +++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/rules/no-obsolete/option.ts b/src/rules/no-obsolete/option.ts index 3f6d77d..24c8e92 100644 --- a/src/rules/no-obsolete/option.ts +++ b/src/rules/no-obsolete/option.ts @@ -224,8 +224,12 @@ export const defaultOptions : Options = { name: { - search: 'word-wrap', + search: 'word-break', replace: 'overflow-wrap' + }, + value: + { + search: 'break-word' } }, { @@ -233,6 +237,13 @@ export const defaultOptions : Options = { search: 'user-modify' } - } + }, + { + name: + { + search: 'word-wrap', + replace: 'overflow-wrap' + } + }, ] }; diff --git a/tests/no-obsolete.spec.ts b/tests/no-obsolete.spec.ts index f3c4bdb..386d699 100644 --- a/tests/no-obsolete.spec.ts +++ b/tests/no-obsolete.spec.ts @@ -35,8 +35,9 @@ describe('no-obsolete', () => 'Unexpected "scroll-snap-type-y" property', 'Unexpected "text-decoration" value "blink"', 'Unexpected "text-decoration-line" value "blink"', - 'Expected "word-wrap" property to be "overflow-wrap"', - 'Unexpected "user-modify" property' + 'Expected "word-break" property to be "overflow-wrap"', + 'Unexpected "user-modify" property', + 'Expected "word-wrap" property to be "overflow-wrap"' ] .map((message, index) => { From 5a5b7ca2b4b8f080539f1b1f9d8542fb92a60ff9 Mon Sep 17 00:00:00 2001 From: otzelpov Date: Fri, 6 Oct 2023 16:18:34 +0200 Subject: [PATCH 3/5] #9 fix lint --- src/rules/no-obsolete/option.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rules/no-obsolete/option.ts b/src/rules/no-obsolete/option.ts index 24c8e92..c1b654c 100644 --- a/src/rules/no-obsolete/option.ts +++ b/src/rules/no-obsolete/option.ts @@ -244,6 +244,6 @@ export const defaultOptions : Options = search: 'word-wrap', replace: 'overflow-wrap' } - }, + } ] }; From 6f6eac63c7a09d9d56765da3c3e24ae629007faa Mon Sep 17 00:00:00 2001 From: otzelpov Date: Fri, 6 Oct 2023 16:22:54 +0200 Subject: [PATCH 4/5] #9 refactor to meet code conventions --- src/rules/no-obsolete/option.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/rules/no-obsolete/option.ts b/src/rules/no-obsolete/option.ts index c1b654c..4ccac02 100644 --- a/src/rules/no-obsolete/option.ts +++ b/src/rules/no-obsolete/option.ts @@ -221,6 +221,12 @@ export const defaultOptions : Options = search: 'blink' } }, + { + name: + { + search: 'user-modify' + } + }, { name: { @@ -232,12 +238,6 @@ export const defaultOptions : Options = search: 'break-word' } }, - { - name: - { - search: 'user-modify' - } - }, { name: { From 1f9cfe6b3f25b67d94814535e47cae605dbedd72 Mon Sep 17 00:00:00 2001 From: otzelpov Date: Fri, 6 Oct 2023 16:24:21 +0200 Subject: [PATCH 5/5] #9 refactor to meet code conventions (2) --- tests/no-obsolete.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/no-obsolete.spec.ts b/tests/no-obsolete.spec.ts index 386d699..8e297eb 100644 --- a/tests/no-obsolete.spec.ts +++ b/tests/no-obsolete.spec.ts @@ -35,8 +35,8 @@ describe('no-obsolete', () => 'Unexpected "scroll-snap-type-y" property', 'Unexpected "text-decoration" value "blink"', 'Unexpected "text-decoration-line" value "blink"', - 'Expected "word-break" property to be "overflow-wrap"', 'Unexpected "user-modify" property', + 'Expected "word-break" property to be "overflow-wrap"', 'Expected "word-wrap" property to be "overflow-wrap"' ] .map((message, index) =>