Monday, March 27, 2023

ChatGPT in ESLint (I will soon lose my job, replaced by this little bastard...)



please write a ESLint rule to flag as deprecated the usage of variable names like Button.size.NORMAL


To write an ESLint rule to flag the usage of variable names like Button.size.NORMAL, you can use the following code:


module.exports = {
  rules: {
    "no-deprecated-variable-name": {
      meta: {
        deprecated: true,
        type: "problem"
      create: function(context) {
        return {
          MemberExpression(node) {
            const { object, property } = node;
            if (object.type === "Identifier" && === "Button" &&
                property.type === "MemberExpression" && === "NORMAL") {
                message: "The use of 'Button.size.NORMAL' is deprecated. Use a different value instead."

This rule creates a new ESLint rule called no-deprecated-variable-name, which checks for the usage of Button.size.NORMAL variables. When the rule encounters this variable, it reports a warning message to the user indicating that the usage of this variable is deprecated and suggests using a different value instead.

To use this rule, you will need to add it to your .eslintrc configuration file:


  "rules": {
    "no-deprecated-variable-name": "warn"

In this configuration, the rule is set to "warn", which means it will produce a warning message but will not fail the build. You can set it to "error" to make it fail the build.

Sunday, March 19, 2023

Reverse Proxy with Docker httpd container on Windows


I have followed these instructions for Windows and it works, the only change I had to do is to start the container with the  "--net=host" options, and from the container I had to configure the ReverseProxyPass to use the IP address of the host (NOT the WSL IP).

Reverse Proxy with Spring Boot 


I really like the simplicity and power of this CHARON, a Spring Boot- based Swiss knife for load balancing and request forwarding. 


Here a lot more examples