To publish to npm cerate a new release on github. See .github/workflows.release.yml for details.
Use npm version $new_version
to update package.json and package-lock.json.
You shouldn't need to tag locally, creating the github release will create a matching tag.
Debugging eslint rules can be tricky because of circular references. To get around this issue, use the util module (in the standard lib for node, but still require import)
"use strict";
module.exports = {
create(context) {
return {
['CallExpression[callee.name="find"]']: function (node) {
// add inspect to avoid console logging circular reference error
const { inspect } = require('util');
console.log(inspect(node)); // this should work
// console.log(JSON.stringify(node, null, 2)) // this would fail
// ...
},
};
},
};
I found https://astexplorer.net/ very helpful. You can see the ast representation of code, and even the output of fixers you define!
Various eslint docs I found helpful