File tree Expand file tree Collapse file tree 3 files changed +27
-3
lines changed Expand file tree Collapse file tree 3 files changed +27
-3
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,30 @@ This rule accepts an option object with the following properties:
3838- ` allowProperties ` (default: ` [] ` ) - Specify an array of physical properties that are allowed to be used.
3939- ` allowUnits ` (default: ` [] ` ) - Specify an array of physical units that are allowed to be used.
4040
41+ #### ` allowProperties `
42+
43+ Examples of ** correct** code with ` { allowProperties: ["margin-left"] } ` :
44+
45+ ``` css
46+ /* eslint css/prefer-logical-properties: ["error", { allowProperties: ["margin-left"] }] */
47+
48+ a {
49+ margin-left : 10px ;
50+ }
51+ ```
52+
53+ #### ` allowUnits `
54+
55+ Examples of ** correct** code with ` { allowUnits: ["vw"] } ` :
56+
57+ ``` css
58+ /* eslint css/prefer-logical-properties: ["error", { allowUnits: ["vw"] }] */
59+
60+ a {
61+ margin : 10vw ;
62+ }
63+ ```
64+
4165## When Not to Use It
4266
4367If you aren't concerned with the use of logical properties, then you can safely disable this rule.
Original file line number Diff line number Diff line change @@ -152,14 +152,14 @@ export default {
152152 allowProperties : {
153153 type : "array" ,
154154 items : {
155- type : "string" ,
155+ enum : Array . from ( propertiesReplacements . keys ( ) ) ,
156156 } ,
157157 uniqueItems : true ,
158158 } ,
159159 allowUnits : {
160160 type : "array" ,
161161 items : {
162- type : "string" ,
162+ enum : Array . from ( unitReplacements . keys ( ) ) ,
163163 } ,
164164 uniqueItems : true ,
165165 } ,
Original file line number Diff line number Diff line change @@ -69,8 +69,8 @@ export default {
6969 type : "array" ,
7070 items : {
7171 enum : relativeFontUnits ,
72- uniqueItems : true ,
7372 } ,
73+ uniqueItems : true ,
7474 } ,
7575 } ,
7676 additionalProperties : false ,
You can’t perform that action at this time.
0 commit comments