Releases: mysticatea/eslint-utils
Releases · mysticatea/eslint-utils
v3.0.0
💥 Breaking Changes
- 9a5c4fb, 5361c33 dropped old Node.js support. The new range is
^10.0.0 || ^12.0.0 || >= 14.0.0
. - 5361c33 added the
exports
field topackage.json
. Now direct accesses to internal files are disallowed. - c5574ce, 46771e1 changed the result of
getFunctionNameWithKind(node)
function in some cases.- Functions at method places prefer the method name than function's id. E.g.,
{ foo: function bar() {} }
ismethod 'foo'
. - Arrow functions at method places are now methods. E.g.,
{ foo: () => {} }
ismethod 'foo'
. - Function expressions at variable initializers or the RHS of assignments are named. E.g.
foo = function() {}
isfunction 'foo'
.
- Functions at method places prefer the method name than function's id. E.g.,
✨ Enhancements
- 05b8390 supports the new class features of ES2022: public class fields, private class members, and static of them.
- 46771e1 added the optional second parameter to
getFunctionNameWithKind(node)
. If you givecontext.getSourceCode()
to that, thegetFunctionNameWithKind(node, sourceCode)
function handles the name of computed properties. E.g.,{ [foo]() {} }
ismethod [foo]
.
🐛 Bug fixes
v2.1.0
v2.0.0
v1.4.3
v1.4.2
v1.4.1
🐛 Bug fixes
- c119e83 fixed
getStaticValue()
function to handlenull
literal correctly even if runtimes don't support BigInt natively. - 587cca2 fixed
getStringIfConstant()
function to handle regular expression literals and BigInt literals even if runtimes don't support those. - 08158db fixed GHSA-3gx7-xhv7-5mx3.
v1.4.0
v1.3.1
v1.3.0
Enhancements
- It added new PatternMatcher class which finds a regular expression pattern in given strings, with handling escape sequences. It will ignore the found pattern if it's escaped by
\
.
v1.2.0
It added new getStaticValue
function 🎉
The getStaticValue
evaluates AST node statically then get the static value.
For a complex example, this function can evaluate the following case on AST:
const eventName = "click"
const aMap = Object.freeze({
click: 777
})
;`on${eventName} : ${aMap[eventName]}` // evaluated to "onclick : 777"