diff --git a/node.js b/node.js index cbd3f92..c03eb5e 100644 --- a/node.js +++ b/node.js @@ -25,6 +25,9 @@ module.exports = { // don't require .flatMap() over .map().flat() // since .flatMap() only became available in Node 11 - "unicorn/prefer-flat-map": "off" + "unicorn/prefer-flat-map": "off", + + // prefer String#trimStart/trimEnd to trimLeft/trimRight + "unicorn/prefer-trim-start-end": "error" } }; diff --git a/rules/unicorn.js b/rules/unicorn.js index 1d1ad90..d7f286d 100644 --- a/rules/unicorn.js +++ b/rules/unicorn.js @@ -73,8 +73,8 @@ module.exports = { // these have different behavior and uses "unicorn/prefer-text-content": "off", - // trimStart/trimEnd are not always available in supported environments - // TODO [engine:node@>=10]: enable for Node, consider for other environments + // don't prefer trimStart/trimEnd to trimLeft/trimRight + // TODO: enable once supported by Firefox ESR "unicorn/prefer-trim-start-end": "off", // don't prevent common abbreviations