Skip to content

Commit 83b9784

Browse files
fix: disable unicorn/prefer-class-fields for old es versions (#84)
1 parent bfafef7 commit 83b9784

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

configs/javascript.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -883,7 +883,6 @@ const unicornRules = {
883883

884884
"unicorn/prefer-blob-reading-methods": "error",
885885

886-
// TODO enable in future
887886
"unicorn/prefer-class-fields": "error",
888887

889888
// No need
@@ -1246,6 +1245,8 @@ function getConfig(esVersion) {
12461245
config.rules["prefer-object-spread"] = "off";
12471246
}
12481247

1248+
// unicorn/prefer-class-fields
1249+
12491250
if (esVersion < 2019) {
12501251
config.rules["unicorn/prefer-object-from-entries"] = "off";
12511252
config.rules["unicorn/prefer-array-flat"] = "off";
@@ -1269,6 +1270,7 @@ function getConfig(esVersion) {
12691270
config.rules["prefer-object-has-own"] = "off";
12701271
config.rules["unicorn/prefer-structured-clone"] = "off";
12711272
config.rules["unicorn/prefer-top-level-await"] = "off";
1273+
config.rules["unicorn/prefer-class-fields"] = "off";
12721274
}
12731275

12741276
return config;

0 commit comments

Comments
 (0)